diff --git a/src/qt/app.cpp b/src/qt/app.cpp index 57bd0dd049..bc6276806f 100644 --- a/src/qt/app.cpp +++ b/src/qt/app.cpp @@ -20,6 +20,8 @@ wxIMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler); wxApp::wxApp() { m_qtApplication = NULL; + m_qtArgc = 0; + m_qtArgv = NULL; } diff --git a/src/qt/checkbox.cpp b/src/qt/checkbox.cpp index c248531f72..0554e1c6d1 100644 --- a/src/qt/checkbox.cpp +++ b/src/qt/checkbox.cpp @@ -46,7 +46,8 @@ void wxQtCheckBox::clicked( bool checked ) } -wxCheckBox::wxCheckBox() +wxCheckBox::wxCheckBox() : + m_qtCheckBox(NULL) { } diff --git a/src/qt/choice.cpp b/src/qt/choice.cpp index 2716a9c004..1bd6511202 100644 --- a/src/qt/choice.cpp +++ b/src/qt/choice.cpp @@ -37,7 +37,8 @@ void wxQtChoice::activated(int WXUNUSED(index)) } -wxChoice::wxChoice() +wxChoice::wxChoice() : + m_qtComboBox(NULL) { } diff --git a/src/qt/combobox.cpp b/src/qt/combobox.cpp index 1080721625..4ca376f23d 100644 --- a/src/qt/combobox.cpp +++ b/src/qt/combobox.cpp @@ -112,8 +112,9 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, const wxValidator& validator, const wxString& name ) { - return Create( parent, id, value, pos, size, choices.size(), &choices[ 0 ], - style, validator, name ); + const wxString *pChoices = choices.size() ? &choices[ 0 ] : NULL; + return Create(parent, id, value, pos, size, choices.size(), pChoices, + style, validator, name ); } diff --git a/src/qt/dc.cpp b/src/qt/dc.cpp index 7715f13037..073a10d755 100644 --- a/src/qt/dc.cpp +++ b/src/qt/dc.cpp @@ -117,14 +117,50 @@ bool wxQtDCImpl::CanGetTextExtent() const void wxQtDCImpl::DoGetSize(int *width, int *height) const { - if (width) *width = m_qtPainter->device()->width(); - if (height) *height = m_qtPainter->device()->height(); + QPaintDevice *pDevice = m_qtPainter->device(); + + int deviceWidth; + int deviceHeight; + + if ( pDevice ) + { + deviceWidth = pDevice->width(); + deviceHeight = pDevice->height(); + } + else + { + deviceWidth = 0; + deviceHeight = 0; + + } + if ( width ) + *width = deviceWidth; + if ( height ) + *height = deviceHeight; } void wxQtDCImpl::DoGetSizeMM(int* width, int* height) const { - if (width) *width = m_qtPainter->device()->widthMM(); - if (height) *height = m_qtPainter->device()->heightMM(); + QPaintDevice *pDevice = m_qtPainter->device(); + + int deviceWidthMM; + int deviceHeightMM; + + if ( pDevice ) + { + deviceWidthMM = pDevice->widthMM(); + deviceHeightMM = pDevice->heightMM(); + } + else + { + deviceWidthMM = 0; + deviceHeightMM = 0; + } + + if ( width ) + *width = deviceWidthMM; + if ( height ) + *height = deviceHeightMM; } int wxQtDCImpl::GetDepth() const diff --git a/src/qt/gauge.cpp b/src/qt/gauge.cpp index 8952043db8..38df21aa35 100644 --- a/src/qt/gauge.cpp +++ b/src/qt/gauge.cpp @@ -29,7 +29,8 @@ wxQtProgressBar::wxQtProgressBar( wxWindow *parent, wxGauge *handler ) } -wxGauge::wxGauge() +wxGauge::wxGauge() : + m_qtProgressBar(NULL) { } diff --git a/src/qt/listbox.cpp b/src/qt/listbox.cpp index acae97e7d8..ffd6f84aa8 100644 --- a/src/qt/listbox.cpp +++ b/src/qt/listbox.cpp @@ -45,7 +45,8 @@ void wxQtListWidget::doubleClicked( const QModelIndex &index ) } -wxListBox::wxListBox() +wxListBox::wxListBox() : + m_qtListWidget(NULL) { Init(); } diff --git a/src/qt/listctrl.cpp b/src/qt/listctrl.cpp index 8a087ef07d..556021c003 100644 --- a/src/qt/listctrl.cpp +++ b/src/qt/listctrl.cpp @@ -154,6 +154,7 @@ void wxListCtrl::Init() m_ownsImageListSmall = false; m_imageListState = NULL; m_ownsImageListState = false; + m_qtTreeWidget = NULL; } wxListCtrl::~wxListCtrl() diff --git a/src/qt/notebook.cpp b/src/qt/notebook.cpp index 3730c67782..4f00fa31f1 100644 --- a/src/qt/notebook.cpp +++ b/src/qt/notebook.cpp @@ -50,7 +50,8 @@ void wxQtTabWidget::currentChanged(int index) } -wxNotebook::wxNotebook() +wxNotebook::wxNotebook() : + m_qtTabWidget(NULL) { } diff --git a/src/qt/radiobox.cpp b/src/qt/radiobox.cpp index b8c82a8a37..be0dada8eb 100644 --- a/src/qt/radiobox.cpp +++ b/src/qt/radiobox.cpp @@ -56,7 +56,10 @@ void wxQtButtonGroup::buttonClicked(int index) { wxIMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl); -wxRadioBox::wxRadioBox() +wxRadioBox::wxRadioBox() : + m_qtGroupBox(NULL), + m_qtButtonGroup(NULL), + m_qtBoxLayout(NULL) { } diff --git a/src/qt/radiobut.cpp b/src/qt/radiobut.cpp index 64e2100cd4..1a389997da 100644 --- a/src/qt/radiobut.cpp +++ b/src/qt/radiobut.cpp @@ -13,7 +13,8 @@ #include -wxRadioButton::wxRadioButton() +wxRadioButton::wxRadioButton() : + m_qtRadioButton(NULL) { } diff --git a/src/qt/scrolbar.cpp b/src/qt/scrolbar.cpp index e848bf2c0c..77939a2765 100644 --- a/src/qt/scrolbar.cpp +++ b/src/qt/scrolbar.cpp @@ -27,7 +27,8 @@ class wxQtScrollBar : public wxQtEventSignalHandler< QScrollBar, wxScrollBar > }; -wxScrollBar::wxScrollBar() +wxScrollBar::wxScrollBar() : + m_qtScrollBar(NULL) { } diff --git a/src/qt/slider.cpp b/src/qt/slider.cpp index 9efc54d529..1b8e1f96a7 100644 --- a/src/qt/slider.cpp +++ b/src/qt/slider.cpp @@ -46,7 +46,8 @@ void wxQtSlider::valueChanged(int position) } -wxSlider::wxSlider() +wxSlider::wxSlider() : + m_qtSlider(NULL) { } diff --git a/src/qt/spinbutt.cpp b/src/qt/spinbutt.cpp index 0fca8ba9e4..688649461c 100644 --- a/src/qt/spinbutt.cpp +++ b/src/qt/spinbutt.cpp @@ -41,7 +41,8 @@ void wxQtSpinButton::valueChanged(int value) } -wxSpinButton::wxSpinButton() +wxSpinButton::wxSpinButton() : + m_qtSpinBox(NULL) { } diff --git a/src/qt/spinctrl.cpp b/src/qt/spinctrl.cpp index 60df847a50..a782d30906 100644 --- a/src/qt/spinctrl.cpp +++ b/src/qt/spinctrl.cpp @@ -18,7 +18,8 @@ #include template< typename T, typename Widget > -wxSpinCtrlQt< T, Widget >::wxSpinCtrlQt() +wxSpinCtrlQt< T, Widget >::wxSpinCtrlQt() : + m_qtSpinBox(NULL) { } diff --git a/src/qt/statbmp.cpp b/src/qt/statbmp.cpp index b4dbde30f0..d27a57672f 100644 --- a/src/qt/statbmp.cpp +++ b/src/qt/statbmp.cpp @@ -21,7 +21,8 @@ public: }; -wxStaticBitmap::wxStaticBitmap() +wxStaticBitmap::wxStaticBitmap() : + m_qtLabel(NULL) { } diff --git a/src/qt/statbox.cpp b/src/qt/statbox.cpp index 6af3e2ddb6..cfa585caa0 100644 --- a/src/qt/statbox.cpp +++ b/src/qt/statbox.cpp @@ -23,7 +23,8 @@ public: }; -wxStaticBox::wxStaticBox() +wxStaticBox::wxStaticBox() : + m_qtGroupBox(NULL) { } diff --git a/src/qt/statline.cpp b/src/qt/statline.cpp index 444f59c6e7..82e52f01a8 100644 --- a/src/qt/statline.cpp +++ b/src/qt/statline.cpp @@ -12,7 +12,8 @@ #include -wxStaticLine::wxStaticLine() +wxStaticLine::wxStaticLine() : + m_qtFrame(NULL) { } diff --git a/src/qt/stattext.cpp b/src/qt/stattext.cpp index 8e410bfa10..2eb50b5f18 100644 --- a/src/qt/stattext.cpp +++ b/src/qt/stattext.cpp @@ -22,7 +22,8 @@ public: }; -wxStaticText::wxStaticText() +wxStaticText::wxStaticText() : + m_qtLabel(NULL) { } diff --git a/src/qt/statusbar.cpp b/src/qt/statusbar.cpp index 57881f8a6e..8224c80928 100644 --- a/src/qt/statusbar.cpp +++ b/src/qt/statusbar.cpp @@ -105,6 +105,7 @@ void wxStatusBar::Refresh( bool eraseBackground, const wxRect *rect ) void wxStatusBar::Init() { + m_qtStatusBar = NULL; m_qtPanes = NULL; } diff --git a/src/qt/window.cpp b/src/qt/window.cpp index 8342db8c74..f112f3a545 100644 --- a/src/qt/window.cpp +++ b/src/qt/window.cpp @@ -1074,6 +1074,7 @@ bool wxWindowQt::QtHandlePaintEvent ( QWidget *handler, QPaintEvent *event ) dc.SetDeviceClippingRegion( m_updateRegion ); wxEraseEvent erase( GetId(), &dc ); + erase.SetEventObject(this); if ( ProcessWindowEvent(erase) ) { // background erased, don't do it again