From 538cdc0841fb68fa33ed68bff0362b062e127c9e Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Fri, 21 Dec 2018 14:55:33 +0000 Subject: [PATCH 1/3] Add missing RTTI to some wxQT classes --- include/wx/qt/brush.h | 3 +++ include/wx/qt/colordlg.h | 2 ++ include/wx/qt/dc.h | 3 +++ include/wx/qt/dcclient.h | 10 ++++++++++ include/wx/qt/dcmemory.h | 3 +++ include/wx/qt/dcprint.h | 4 ++-- include/wx/qt/mdi.h | 3 +++ include/wx/qt/msgdlg.h | 3 +++ include/wx/qt/palette.h | 3 +++ include/wx/qt/pen.h | 3 +++ include/wx/qt/region.h | 5 +++++ include/wx/qt/textentry.h | 2 -- include/wx/qt/tglbtn.h | 1 + src/qt/brush.cpp | 1 + src/qt/colordlg.cpp | 2 ++ src/qt/dc.cpp | 2 ++ src/qt/dcclient.cpp | 5 +++++ src/qt/dcmemory.cpp | 2 ++ src/qt/dcprint.cpp | 2 ++ src/qt/mdi.cpp | 4 ++++ src/qt/msgdlg.cpp | 2 ++ src/qt/palette.cpp | 2 ++ src/qt/pen.cpp | 2 ++ src/qt/region.cpp | 4 ++++ src/qt/tglbtn.cpp | 2 ++ 25 files changed, 71 insertions(+), 4 deletions(-) diff --git a/include/wx/qt/brush.h b/include/wx/qt/brush.h index 7dfe38ee22..9359ac54ea 100644 --- a/include/wx/qt/brush.h +++ b/include/wx/qt/brush.h @@ -41,6 +41,9 @@ public: protected: virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; + +private: + wxDECLARE_DYNAMIC_CLASS(wxBrush); }; #endif // _WX_QT_BRUSH_H_ diff --git a/include/wx/qt/colordlg.h b/include/wx/qt/colordlg.h index fec19d7d94..48c535fa03 100644 --- a/include/wx/qt/colordlg.h +++ b/include/wx/qt/colordlg.h @@ -27,6 +27,8 @@ private: QColorDialog *GetQColorDialog() const; wxColourData m_data; + + wxDECLARE_DYNAMIC_CLASS(wxColourDialog); }; #endif // _WX_QT_COLORDLG_H_ diff --git a/include/wx/qt/dc.h b/include/wx/qt/dc.h index 56849a2124..43bd13e070 100644 --- a/include/wx/qt/dc.h +++ b/include/wx/qt/dc.h @@ -129,6 +129,9 @@ private: QColor *m_qtPenColor; QColor *m_qtBrushColor; void ApplyRasterColourOp(); + + wxDECLARE_CLASS(wxQtDCImpl); + wxDECLARE_NO_COPY_CLASS(wxQtDCImpl); }; diff --git a/include/wx/qt/dcclient.h b/include/wx/qt/dcclient.h index 23d6d8ce69..fdec1abbed 100644 --- a/include/wx/qt/dcclient.h +++ b/include/wx/qt/dcclient.h @@ -20,6 +20,10 @@ public: protected: wxWindow *m_window; + +private: + wxDECLARE_CLASS(wxWindowDCImpl); + wxDECLARE_NO_COPY_CLASS(wxWindowDCImpl); }; @@ -30,6 +34,9 @@ public: wxClientDCImpl( wxDC *owner, wxWindow *win ); ~wxClientDCImpl(); +private: + wxDECLARE_CLASS(wxClientDCImpl); + wxDECLARE_NO_COPY_CLASS(wxClientDCImpl); }; @@ -38,6 +45,9 @@ class WXDLLIMPEXP_CORE wxPaintDCImpl : public wxWindowDCImpl public: wxPaintDCImpl( wxDC *owner ); wxPaintDCImpl( wxDC *owner, wxWindow *win ); +private: + wxDECLARE_CLASS(wxPaintDCImpl); + wxDECLARE_NO_COPY_CLASS(wxPaintDCImpl); }; #endif // _WX_QT_DCCLIENT_H_ diff --git a/include/wx/qt/dcmemory.h b/include/wx/qt/dcmemory.h index 8ed5773a89..5f1e333cf6 100644 --- a/include/wx/qt/dcmemory.h +++ b/include/wx/qt/dcmemory.h @@ -26,6 +26,9 @@ public: private: wxBitmap m_selected; + + DECLARE_CLASS(wxMemoryDCImpl); + DECLARE_NO_COPY_CLASS(wxMemoryDCImpl); }; #endif // _WX_QT_DCMEMORY_H_ diff --git a/include/wx/qt/dcprint.h b/include/wx/qt/dcprint.h index 3c567eef47..09ea99ea94 100644 --- a/include/wx/qt/dcprint.h +++ b/include/wx/qt/dcprint.h @@ -98,9 +98,9 @@ public: wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle = wxODDEVEN_RULE); -protected: - private: + wxDECLARE_CLASS(wxPrinterDCImpl); + wxDECLARE_NO_COPY_CLASS(wxPrinterDCImpl); }; #endif // _WX_QT_DCPRINT_H_ diff --git a/include/wx/qt/mdi.h b/include/wx/qt/mdi.h index f8ec160355..260857902b 100644 --- a/include/wx/qt/mdi.h +++ b/include/wx/qt/mdi.h @@ -65,6 +65,8 @@ public: const wxString& name = wxFrameNameStr); virtual void Activate(); + + wxDECLARE_DYNAMIC_CLASS(wxMDIChildFrame); }; @@ -75,6 +77,7 @@ public: wxMDIClientWindow(); virtual bool CreateClient(wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL); + wxDECLARE_DYNAMIC_CLASS(wxMDIClientWindow); }; #endif // _WX_QT_MDI_H_ diff --git a/include/wx/qt/msgdlg.h b/include/wx/qt/msgdlg.h index 6f1acdc16a..08b3c6437d 100644 --- a/include/wx/qt/msgdlg.h +++ b/include/wx/qt/msgdlg.h @@ -23,6 +23,9 @@ public: // Reimplemented to translate return codes from Qt to wx virtual int ShowModal(); + +private: + wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxMessageDialog); }; #endif // _WX_QT_MSGDLG_H_ diff --git a/include/wx/qt/palette.h b/include/wx/qt/palette.h index d3aeff38ab..7f01dfdc25 100644 --- a/include/wx/qt/palette.h +++ b/include/wx/qt/palette.h @@ -23,6 +23,9 @@ protected: virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; +private: + wxDECLARE_DYNAMIC_CLASS(wxPalette); + }; #endif // _WX_QT_PALETTE_H_ diff --git a/include/wx/qt/pen.h b/include/wx/qt/pen.h index 42c57a5304..9a6ce1dc8c 100644 --- a/include/wx/qt/pen.h +++ b/include/wx/qt/pen.h @@ -49,6 +49,9 @@ public: protected: virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; + +private: + wxDECLARE_DYNAMIC_CLASS(wxPen); }; #endif // _WX_QT_PEN_H_ diff --git a/include/wx/qt/region.h b/include/wx/qt/region.h index 17840ead77..7bb2a56d68 100644 --- a/include/wx/qt/region.h +++ b/include/wx/qt/region.h @@ -47,6 +47,9 @@ protected: virtual bool DoIntersect(const wxRegion& region); virtual bool DoSubtract(const wxRegion& region); virtual bool DoXor(const wxRegion& region); + +private: + wxDECLARE_DYNAMIC_CLASS(wxRegion); }; @@ -81,6 +84,8 @@ public: private: QVector < QRect > *m_qtRects; int m_pos; + + wxDECLARE_DYNAMIC_CLASS(wxRegionIterator); }; #endif // _WX_QT_REGION_H_ diff --git a/include/wx/qt/textentry.h b/include/wx/qt/textentry.h index 26261c3132..458e6add68 100644 --- a/include/wx/qt/textentry.h +++ b/include/wx/qt/textentry.h @@ -41,8 +41,6 @@ protected: virtual void DoSetValue(const wxString& value, int flags=0); virtual wxWindow *GetEditableWindow(); - -private: }; #endif // _WX_QT_TEXTENTRY_H_ diff --git a/include/wx/qt/tglbtn.h b/include/wx/qt/tglbtn.h index de7f16e926..4b20ac2f75 100644 --- a/include/wx/qt/tglbtn.h +++ b/include/wx/qt/tglbtn.h @@ -72,6 +72,7 @@ public: virtual QWidget *GetHandle() const; private: + wxDECLARE_DYNAMIC_CLASS(wxToggleButton); }; diff --git a/src/qt/brush.cpp b/src/qt/brush.cpp index 9c16a35c9d..6798e438f1 100644 --- a/src/qt/brush.cpp +++ b/src/qt/brush.cpp @@ -15,6 +15,7 @@ #include +wxIMPLEMENT_DYNAMIC_CLASS(wxBrush,wxBrushBase); static Qt::BrushStyle ConvertBrushStyle(wxBrushStyle style) { diff --git a/src/qt/colordlg.cpp b/src/qt/colordlg.cpp index 5781bd61c2..286f8c8831 100644 --- a/src/qt/colordlg.cpp +++ b/src/qt/colordlg.cpp @@ -21,6 +21,8 @@ public: { } }; +wxIMPLEMENT_DYNAMIC_CLASS(wxColourDialog,wxDialog) + bool wxColourDialog::Create(wxWindow *parent, wxColourData *data ) { m_qtWindow = new wxQtColorDialog( parent, this ); diff --git a/src/qt/dc.cpp b/src/qt/dc.cpp index e5405276cd..7715f13037 100644 --- a/src/qt/dc.cpp +++ b/src/qt/dc.cpp @@ -43,6 +43,8 @@ static void SetBrushColour( QPainter *qtPainter, QColor col ) qtPainter->setBrush( b ); } +wxIMPLEMENT_CLASS(wxQtDCImpl,wxDCImpl); + wxQtDCImpl::wxQtDCImpl( wxDC *owner ) : wxDCImpl( owner ) { diff --git a/src/qt/dcclient.cpp b/src/qt/dcclient.cpp index eea8088a42..9c453e7226 100644 --- a/src/qt/dcclient.cpp +++ b/src/qt/dcclient.cpp @@ -27,6 +27,8 @@ //############################################################################## +wxIMPLEMENT_CLASS(wxWindowDCImpl,wxQtDCImpl); + wxWindowDCImpl::wxWindowDCImpl( wxDC *owner ) : wxQtDCImpl( owner ) { @@ -59,6 +61,7 @@ wxWindowDCImpl::~wxWindowDCImpl() //############################################################################## +wxIMPLEMENT_CLASS(wxClientDCImpl,wxQtDCImpl); wxClientDCImpl::wxClientDCImpl( wxDC *owner ) : wxWindowDCImpl( owner ) @@ -118,6 +121,8 @@ wxClientDCImpl::~wxClientDCImpl() //############################################################################## +wxIMPLEMENT_CLASS(wxPaintDCImpl,wxQtDCImpl); + wxPaintDCImpl::wxPaintDCImpl( wxDC *owner ) : wxWindowDCImpl( owner ) { diff --git a/src/qt/dcmemory.cpp b/src/qt/dcmemory.cpp index 563d1cff1f..ab06f32cdd 100644 --- a/src/qt/dcmemory.cpp +++ b/src/qt/dcmemory.cpp @@ -13,6 +13,8 @@ #include +wxIMPLEMENT_CLASS(wxMemoryDCImpl,wxQtDCImpl); + wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner ) : wxQtDCImpl( owner ) { diff --git a/src/qt/dcprint.cpp b/src/qt/dcprint.cpp index 11a3d59d48..74e4dceae0 100644 --- a/src/qt/dcprint.cpp +++ b/src/qt/dcprint.cpp @@ -11,6 +11,8 @@ #include "wx/dcprint.h" #include "wx/qt/dcprint.h" +wxIMPLEMENT_CLASS(wxPrinterDCImpl,wxDCImpl) + wxPrinterDCImpl::wxPrinterDCImpl( wxPrinterDC *owner, const wxPrintData & ) : wxDCImpl( owner ) { diff --git a/src/qt/mdi.cpp b/src/qt/mdi.cpp index 3655a355de..d3e13edff8 100644 --- a/src/qt/mdi.cpp +++ b/src/qt/mdi.cpp @@ -88,6 +88,8 @@ void wxMDIParentFrame::ActivatePrevious() //############################################################################## +wxIMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame,wxMDIChildFrameBase) + wxMDIChildFrame::wxMDIChildFrame() { } @@ -129,6 +131,8 @@ void wxMDIChildFrame::Activate() //############################################################################## +wxIMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow,wxMDIClientWindowBase) + wxMDIClientWindow::wxMDIClientWindow() { } diff --git a/src/qt/msgdlg.cpp b/src/qt/msgdlg.cpp index b80c004564..fd0a446f95 100644 --- a/src/qt/msgdlg.cpp +++ b/src/qt/msgdlg.cpp @@ -111,6 +111,8 @@ wxMessageDialog::wxMessageDialog( wxWindow *parent, const wxString& message, PostCreation(); } +wxIMPLEMENT_CLASS(wxMessageDialog,wxMessageDialogBase); + int wxMessageDialog::ShowModal() { wxCHECK_MSG( m_qtWindow, -1, "Invalid dialog" ); diff --git a/src/qt/palette.cpp b/src/qt/palette.cpp index 933a99943b..9fadc79543 100644 --- a/src/qt/palette.cpp +++ b/src/qt/palette.cpp @@ -10,6 +10,8 @@ #include "wx/palette.h" +wxIMPLEMENT_DYNAMIC_CLASS(wxPalette,wxPaletteBase) + wxPalette::wxPalette() { } diff --git a/src/qt/pen.cpp b/src/qt/pen.cpp index f09d93108c..e7310aaa9b 100644 --- a/src/qt/pen.cpp +++ b/src/qt/pen.cpp @@ -13,6 +13,8 @@ #include "wx/qt/private/utils.h" #include +wxIMPLEMENT_DYNAMIC_CLASS(wxPen,wxPenBase); + static Qt::PenStyle ConvertPenStyle(wxPenStyle style) { switch(style) diff --git a/src/qt/region.cpp b/src/qt/region.cpp index 45936ab577..0fa4a3db60 100644 --- a/src/qt/region.cpp +++ b/src/qt/region.cpp @@ -53,6 +53,8 @@ class wxRegionRefData: public wxGDIRefData #define M_REGIONDATA ((wxRegionRefData *)m_refData)->m_qtRegion +wxIMPLEMENT_DYNAMIC_CLASS(wxRegion,wxRegionBase); + wxRegion::wxRegion() { m_refData = new wxRegionRefData(); @@ -255,6 +257,8 @@ const QRegion &wxRegion::GetHandle() const //############################################################################## +wxIMPLEMENT_DYNAMIC_CLASS(wxRegionIterator,wxObject); + wxRegionIterator::wxRegionIterator() { m_qtRects = NULL; diff --git a/src/qt/tglbtn.cpp b/src/qt/tglbtn.cpp index f27c72490c..77ee85b15e 100644 --- a/src/qt/tglbtn.cpp +++ b/src/qt/tglbtn.cpp @@ -103,6 +103,8 @@ QWidget *wxBitmapToggleButton::GetHandle() const //############################################################################## +wxIMPLEMENT_DYNAMIC_CLASS(wxToggleButton, wxToggleButtonBase); + wxToggleButton::wxToggleButton() { } From 00030b56cbd617ea2b3c6fffd5cd66a70e0113a4 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Mon, 7 Jan 2019 09:18:50 +0000 Subject: [PATCH 2/3] Fix implementation details being used as base class for RTTI in wxQT --- src/qt/app.cpp | 2 +- src/qt/brush.cpp | 2 +- src/qt/dcclient.cpp | 4 ++-- src/qt/dcscreen.cpp | 2 +- src/qt/msgdlg.cpp | 2 +- src/qt/palette.cpp | 2 +- src/qt/pen.cpp | 2 +- src/qt/region.cpp | 2 +- src/qt/tglbtn.cpp | 4 ++-- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/qt/app.cpp b/src/qt/app.cpp index 93f0ccd3d8..57bd0dd049 100644 --- a/src/qt/app.cpp +++ b/src/qt/app.cpp @@ -15,7 +15,7 @@ #include #include -wxIMPLEMENT_DYNAMIC_CLASS(wxApp, wxAppBase); +wxIMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler); wxApp::wxApp() { diff --git a/src/qt/brush.cpp b/src/qt/brush.cpp index 6798e438f1..fc09e71965 100644 --- a/src/qt/brush.cpp +++ b/src/qt/brush.cpp @@ -15,7 +15,7 @@ #include -wxIMPLEMENT_DYNAMIC_CLASS(wxBrush,wxBrushBase); +wxIMPLEMENT_DYNAMIC_CLASS(wxBrush,wxGDIObject); static Qt::BrushStyle ConvertBrushStyle(wxBrushStyle style) { diff --git a/src/qt/dcclient.cpp b/src/qt/dcclient.cpp index 9c453e7226..d062f0455a 100644 --- a/src/qt/dcclient.cpp +++ b/src/qt/dcclient.cpp @@ -61,7 +61,7 @@ wxWindowDCImpl::~wxWindowDCImpl() //############################################################################## -wxIMPLEMENT_CLASS(wxClientDCImpl,wxQtDCImpl); +wxIMPLEMENT_CLASS(wxClientDCImpl,wxWindowDCImpl); wxClientDCImpl::wxClientDCImpl( wxDC *owner ) : wxWindowDCImpl( owner ) @@ -121,7 +121,7 @@ wxClientDCImpl::~wxClientDCImpl() //############################################################################## -wxIMPLEMENT_CLASS(wxPaintDCImpl,wxQtDCImpl); +wxIMPLEMENT_CLASS(wxPaintDCImpl,wxClientDCImpl); wxPaintDCImpl::wxPaintDCImpl( wxDC *owner ) : wxWindowDCImpl( owner ) diff --git a/src/qt/dcscreen.cpp b/src/qt/dcscreen.cpp index 12b02f6715..1f08768ec0 100644 --- a/src/qt/dcscreen.cpp +++ b/src/qt/dcscreen.cpp @@ -16,7 +16,7 @@ #include #include -wxIMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl, wxWindowDCImpl); +wxIMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl, wxQtDCImpl); wxScreenDCImpl::wxScreenDCImpl( wxScreenDC *owner ) : wxWindowDCImpl( owner ) diff --git a/src/qt/msgdlg.cpp b/src/qt/msgdlg.cpp index fd0a446f95..5fe264a242 100644 --- a/src/qt/msgdlg.cpp +++ b/src/qt/msgdlg.cpp @@ -111,7 +111,7 @@ wxMessageDialog::wxMessageDialog( wxWindow *parent, const wxString& message, PostCreation(); } -wxIMPLEMENT_CLASS(wxMessageDialog,wxMessageDialogBase); +wxIMPLEMENT_CLASS(wxMessageDialog,wxDialog); int wxMessageDialog::ShowModal() { diff --git a/src/qt/palette.cpp b/src/qt/palette.cpp index 9fadc79543..8c87a3a9c1 100644 --- a/src/qt/palette.cpp +++ b/src/qt/palette.cpp @@ -10,7 +10,7 @@ #include "wx/palette.h" -wxIMPLEMENT_DYNAMIC_CLASS(wxPalette,wxPaletteBase) +wxIMPLEMENT_DYNAMIC_CLASS(wxPalette,wxGDIObject) wxPalette::wxPalette() { diff --git a/src/qt/pen.cpp b/src/qt/pen.cpp index e7310aaa9b..862443cd14 100644 --- a/src/qt/pen.cpp +++ b/src/qt/pen.cpp @@ -13,7 +13,7 @@ #include "wx/qt/private/utils.h" #include -wxIMPLEMENT_DYNAMIC_CLASS(wxPen,wxPenBase); +wxIMPLEMENT_DYNAMIC_CLASS(wxPen,wxGDIObject); static Qt::PenStyle ConvertPenStyle(wxPenStyle style) { diff --git a/src/qt/region.cpp b/src/qt/region.cpp index 0fa4a3db60..a0c3ea8698 100644 --- a/src/qt/region.cpp +++ b/src/qt/region.cpp @@ -53,7 +53,7 @@ class wxRegionRefData: public wxGDIRefData #define M_REGIONDATA ((wxRegionRefData *)m_refData)->m_qtRegion -wxIMPLEMENT_DYNAMIC_CLASS(wxRegion,wxRegionBase); +wxIMPLEMENT_DYNAMIC_CLASS(wxRegion,wxGDIObject); wxRegion::wxRegion() { diff --git a/src/qt/tglbtn.cpp b/src/qt/tglbtn.cpp index 77ee85b15e..5797157286 100644 --- a/src/qt/tglbtn.cpp +++ b/src/qt/tglbtn.cpp @@ -54,7 +54,7 @@ void wxQtToggleButton::clicked( bool checked ) wxDEFINE_EVENT( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEvent ); -wxIMPLEMENT_DYNAMIC_CLASS(wxBitmapToggleButton, wxToggleButtonBase); +wxIMPLEMENT_DYNAMIC_CLASS(wxBitmapToggleButton, wxToggleButton); wxBitmapToggleButton::wxBitmapToggleButton() { @@ -103,7 +103,7 @@ QWidget *wxBitmapToggleButton::GetHandle() const //############################################################################## -wxIMPLEMENT_DYNAMIC_CLASS(wxToggleButton, wxToggleButtonBase); +wxIMPLEMENT_DYNAMIC_CLASS(wxToggleButton, wxControl); wxToggleButton::wxToggleButton() { From 45fc60b5495ea4130511814ec08daa6a34c75131 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Mon, 7 Jan 2019 11:51:05 +0000 Subject: [PATCH 3/3] wxBitmapToggleButton's reported base class is wxControl --- src/qt/tglbtn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/tglbtn.cpp b/src/qt/tglbtn.cpp index 5797157286..8434179b9e 100644 --- a/src/qt/tglbtn.cpp +++ b/src/qt/tglbtn.cpp @@ -54,7 +54,7 @@ void wxQtToggleButton::clicked( bool checked ) wxDEFINE_EVENT( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEvent ); -wxIMPLEMENT_DYNAMIC_CLASS(wxBitmapToggleButton, wxToggleButton); +wxIMPLEMENT_DYNAMIC_CLASS(wxBitmapToggleButton, wxControl); wxBitmapToggleButton::wxBitmapToggleButton() {