Implement wxFrame::DoSetClientSize()
Resize the central widget to fit the new size. See https://github.com/wxWidgets/wxWidgets/pull/1340
This commit is contained in:
parent
b8d5c85ecb
commit
4bfb3a5f01
@ -56,6 +56,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void DoGetClientSize(int *width, int *height) const wxOVERRIDE;
|
||||
virtual void DoSetClientSize(int width, int height) wxOVERRIDE;
|
||||
|
||||
virtual QWidget* QtGetParentWidget() const wxOVERRIDE;
|
||||
|
||||
|
@ -231,6 +231,19 @@ void wxFrame::DoGetClientSize(int *width, int *height) const
|
||||
}
|
||||
}
|
||||
|
||||
void wxFrame::DoSetClientSize(int width, int height)
|
||||
{
|
||||
wxWindow::DoSetClientSize(width, height);
|
||||
|
||||
int adjustedWidth, adjustedHeight;
|
||||
DoGetClientSize(&adjustedWidth, &adjustedHeight);
|
||||
|
||||
QWidget *centralWidget = GetQMainWindow()->centralWidget();
|
||||
QRect geometry = centralWidget->geometry();
|
||||
geometry.setSize(QSize(adjustedWidth, adjustedHeight));
|
||||
centralWidget->setGeometry(geometry);
|
||||
}
|
||||
|
||||
QMainWindow *wxFrame::GetQMainWindow() const
|
||||
{
|
||||
return static_cast<QMainWindow*>(m_qtWindow);
|
||||
|
Loading…
Reference in New Issue
Block a user