Make wxQt build again, with less compiler warnings

This fixes a missing include in qt/nonownedwnd.cpp and a missing method
in qt/glcanvas.cpp, allowing the build to complete again. A number of
missing wxOVERRIDE statements were added to reduce the important number of
compiler warnings about those missing labels.
This commit is contained in:
R.J.V. Bertin 2017-11-05 22:56:57 +01:00 committed by Vadim Zeitlin
parent 1c249a6934
commit 3da6b9c14f
6 changed files with 77 additions and 72 deletions

View File

@ -38,7 +38,7 @@
// resources
// --------------------------------------------------------------------------
#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) || defined(__WXX11__)
#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) || defined(__WXX11__) || defined(__WXQT__)
// application icon
#include "mondrian.xpm"

View File

@ -52,18 +52,18 @@ public:
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
virtual void SetSelection(int n) { wxChoice::SetSelection(n); }
virtual void SetSelection(long from, long to);
virtual void SetSelection(int n) wxOVERRIDE { wxChoice::SetSelection(n); }
virtual void SetSelection(long from, long to) wxOVERRIDE;
virtual int GetSelection() const { return wxChoice::GetSelection(); }
virtual void GetSelection(long *from, long *to) const;
virtual int GetSelection() const wxOVERRIDE { return wxChoice::GetSelection(); }
virtual void GetSelection(long *from, long *to) const wxOVERRIDE;
virtual wxString GetStringSelection() const
virtual wxString GetStringSelection() const wxOVERRIDE
{
return wxItemContainer::GetStringSelection();
}
virtual void Clear()
virtual void Clear() wxOVERRIDE
{
wxTextEntry::Clear();
wxItemContainer::Clear();
@ -79,7 +79,7 @@ public:
protected:
// From wxTextEntry:
virtual wxString DoGetValue() const;
virtual wxString DoGetValue() const wxOVERRIDE;
private:

View File

@ -40,10 +40,10 @@ public:
long style = wxTB_DEFAULT_STYLE | wxNO_BORDER,
const wxString& name = wxToolBarNameStr);
virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const wxOVERRIDE;
virtual QToolBar *GetQToolBar() const { return m_qtToolBar; }
virtual void SetWindowStyleFlag( long style );
virtual void SetWindowStyleFlag( long style ) wxOVERRIDE;
virtual bool Realize() wxOVERRIDE;
virtual wxToolBarToolBase *CreateTool(int toolid,
@ -53,20 +53,20 @@ public:
wxItemKind kind,
wxObject *clientData,
const wxString& shortHelp,
const wxString& longHelp);
const wxString& longHelp) wxOVERRIDE;
virtual wxToolBarToolBase *CreateTool(wxControl *control,
const wxString& label);
QWidget *GetHandle() const;
const wxString& label) wxOVERRIDE;
QWidget *GetHandle() const wxOVERRIDE;
protected:
QActionGroup* GetActionGroup(size_t pos);
virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool);
virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool);
virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable);
virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle);
virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle);
virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool) wxOVERRIDE;
virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool) wxOVERRIDE;
virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable) wxOVERRIDE;
virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle) wxOVERRIDE;
virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle) wxOVERRIDE;
private:
long GetButtonStyle();

View File

@ -65,82 +65,82 @@ public:
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxPanelNameStr);
bool Create(wxWindowQt *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxPanelNameStr);
// Used by all window classes in the widget creation process.
void PostCreation( bool generic = true );
void AddChild( wxWindowBase *child );
void AddChild( wxWindowBase *child ) wxOVERRIDE;
virtual bool Show( bool show = true );
virtual bool Show( bool show = true ) wxOVERRIDE;
virtual void SetLabel(const wxString& label);
virtual wxString GetLabel() const;
virtual void SetLabel(const wxString& label) wxOVERRIDE;
virtual wxString GetLabel() const wxOVERRIDE;
virtual void DoEnable( bool enable );
virtual void SetFocus();
virtual void DoEnable( bool enable ) wxOVERRIDE;
virtual void SetFocus() wxOVERRIDE;
// Parent/Child:
static void QtReparent( QWidget *child, QWidget *parent );
virtual bool Reparent( wxWindowBase *newParent );
// Z-order
virtual void Raise();
virtual void Lower();
// move the mouse to the specified position
virtual void WarpPointer(int x, int y);
virtual bool Reparent( wxWindowBase *newParent ) wxOVERRIDE;
virtual void Update();
// Z-order
virtual void Raise() wxOVERRIDE;
virtual void Lower() wxOVERRIDE;
// move the mouse to the specified position
virtual void WarpPointer(int x, int y) wxOVERRIDE;
virtual void Update() wxOVERRIDE;
virtual void Refresh( bool eraseBackground = true,
const wxRect *rect = (const wxRect *) NULL );
const wxRect *rect = (const wxRect *) NULL ) wxOVERRIDE;
virtual bool SetCursor( const wxCursor &cursor ) wxOVERRIDE;
virtual bool SetFont(const wxFont& font);
virtual bool SetFont(const wxFont& font) wxOVERRIDE;
// get the (average) character size for the current font
virtual int GetCharHeight() const;
virtual int GetCharWidth() const;
virtual int GetCharHeight() const wxOVERRIDE;
virtual int GetCharWidth() const wxOVERRIDE;
virtual void SetScrollbar( int orient,
int pos,
int thumbvisible,
int range,
bool refresh = true );
virtual void SetScrollPos( int orient, int pos, bool refresh = true );
virtual int GetScrollPos( int orient ) const;
virtual int GetScrollThumb( int orient ) const;
virtual int GetScrollRange( int orient ) const;
bool refresh = true ) wxOVERRIDE;
virtual void SetScrollPos( int orient, int pos, bool refresh = true ) wxOVERRIDE;
virtual int GetScrollPos( int orient ) const wxOVERRIDE;
virtual int GetScrollThumb( int orient ) const wxOVERRIDE;
virtual int GetScrollRange( int orient ) const wxOVERRIDE;
// scroll window to the specified position
virtual void ScrollWindow( int dx, int dy,
const wxRect* rect = NULL );
const wxRect* rect = NULL ) wxOVERRIDE;
// Styles
virtual void SetWindowStyleFlag( long style );
virtual void SetExtraStyle( long exStyle );
virtual void SetWindowStyleFlag( long style ) wxOVERRIDE;
virtual void SetExtraStyle( long exStyle ) wxOVERRIDE;
virtual bool SetBackgroundStyle(wxBackgroundStyle style);
virtual bool IsTransparentBackgroundSupported(wxString* reason = NULL) const;
virtual bool SetTransparent(wxByte alpha);
virtual bool CanSetTransparent() { return true; }
virtual bool SetBackgroundStyle(wxBackgroundStyle style) wxOVERRIDE;
virtual bool IsTransparentBackgroundSupported(wxString* reason = NULL) const wxOVERRIDE;
virtual bool SetTransparent(wxByte alpha) wxOVERRIDE;
virtual bool CanSetTransparent() wxOVERRIDE { return true; }
QWidget *GetHandle() const;
QWidget *GetHandle() const wxOVERRIDE;
virtual void SetDropTarget( wxDropTarget *dropTarget ) wxOVERRIDE;
virtual void SetDropTarget( wxDropTarget *dropTarget );
#if wxUSE_ACCEL
// accelerators
// ------------
virtual void SetAcceleratorTable( const wxAcceleratorTable& accel );
virtual void SetAcceleratorTable( const wxAcceleratorTable& accel ) wxOVERRIDE;
#endif // wxUSE_ACCEL
// wxQt implementation internals:
virtual QPicture *QtGetPicture() const;
@ -174,34 +174,34 @@ protected:
int *x, int *y,
int *descent = NULL,
int *externalLeading = NULL,
const wxFont *font = NULL) const;
const wxFont *font = NULL) const wxOVERRIDE;
// coordinates translation
virtual void DoClientToScreen( int *x, int *y ) const;
virtual void DoScreenToClient( int *x, int *y ) const;
virtual void DoClientToScreen( int *x, int *y ) const wxOVERRIDE;
virtual void DoScreenToClient( int *x, int *y ) const wxOVERRIDE;
// capture/release the mouse, used by Capture/ReleaseMouse()
virtual void DoCaptureMouse();
virtual void DoReleaseMouse();
virtual void DoCaptureMouse() wxOVERRIDE;
virtual void DoReleaseMouse() wxOVERRIDE;
// retrieve the position/size of the window
virtual void DoGetPosition(int *x, int *y) const;
virtual void DoGetPosition(int *x, int *y) const wxOVERRIDE;
virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
virtual void DoGetSize(int *width, int *height) const;
virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO) wxOVERRIDE;
virtual void DoGetSize(int *width, int *height) const wxOVERRIDE;
// same as DoSetSize() for the client size
virtual void DoSetClientSize(int width, int height);
virtual void DoGetClientSize(int *width, int *height) const;
virtual void DoSetClientSize(int width, int height) wxOVERRIDE;
virtual void DoGetClientSize(int *width, int *height) const wxOVERRIDE;
virtual void DoMoveWindow(int x, int y, int width, int height);
virtual void DoMoveWindow(int x, int y, int width, int height) wxOVERRIDE;
#if wxUSE_TOOLTIPS
virtual void DoSetToolTip( wxToolTip *tip );
virtual void DoSetToolTip( wxToolTip *tip ) wxOVERRIDE;
#endif // wxUSE_TOOLTIPS
#if wxUSE_MENUS
virtual bool DoPopupMenu(wxMenu *menu, int x, int y);
virtual bool DoPopupMenu(wxMenu *menu, int x, int y) wxOVERRIDE;
#endif // wxUSE_MENUS
QWidget *m_qtWindow;

View File

@ -318,6 +318,10 @@ wxGLAttributes& wxGLAttributes::Defaults()
return *this;
}
void wxGLAttributes::AddDefaultsForWXBefore31()
{
Defaults();
}
//---------------------------------------------------------------------------
// wxGlContext

View File

@ -28,6 +28,7 @@
#include "wx/nonownedwnd.h"
#include "wx/qt/private/converter.h"
#include "wx/qt/private/utils.h"
#include <QtGui/QBitmap>
#include <QtGui/QPainter>