From 25f70314e0e2aa5cb913aba108d2e9c16117004a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 16 May 2011 16:39:50 +0200 Subject: Implement QWindow minimum/maximum/base size hints and size increments. --- src/widgets/kernel/qwidget_qpa.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/widgets') diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp index b7b502a35f..533cc0a47c 100644 --- a/src/widgets/kernel/qwidget_qpa.cpp +++ b/src/widgets/kernel/qwidget_qpa.cpp @@ -49,6 +49,7 @@ #include "QtWidgets/qdesktopwidget.h" #include "QtGui/qplatformwindow_qpa.h" #include "QtGui/qplatformglcontext_qpa.h" +#include "QtGui/private/qwindow_p.h" #include @@ -628,6 +629,22 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) void QWidgetPrivate::setConstraints_sys() { + Q_Q(QWidget); + if (extra && q->windowHandle()) { + QWindow *win = q->windowHandle(); + QWindowPrivate *winp = qt_window_private(win); + + winp->minimumSize = QSize(extra->minw, extra->minh); + winp->maximumSize = QSize(extra->maxw, extra->maxh); + + if (extra->topextra) { + winp->baseSize = QSize(extra->topextra->basew, extra->topextra->baseh); + winp->sizeIncrement = QSize(extra->topextra->incw, extra->topextra->inch); + } + + if (winp->platformWindow) + winp->platformWindow->propagateSizeHints(); + } } void QWidgetPrivate::scroll_sys(int dx, int dy) -- cgit v1.2.3