summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2012-01-26 11:01:13 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-27 21:18:54 +0100
commit12b88cc7bbb1378f0e7420aaf35294e8dca01086 (patch)
tree8b49d0464c1a61989181109b31ef6f92ec0e4ed3 /src/widgets/widgets
parent692a1babe53c342e9f5435517a1265765f77f676 (diff)
QSizeGrip: Fix Windows.
Reactivate the old Windows code. Change-Id: Ied467cf83d89c76a0fa8edf3c76bb207cc2a70e0 Reviewed-by: Oliver Wolff <oliver.wolff@nokia.com>
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r--src/widgets/widgets/qsizegrip.cpp47
-rw-r--r--src/widgets/widgets/qsizegrip.h3
2 files changed, 23 insertions, 27 deletions
diff --git a/src/widgets/widgets/qsizegrip.cpp b/src/widgets/widgets/qsizegrip.cpp
index 4db06779ee..557481179f 100644
--- a/src/widgets/widgets/qsizegrip.cpp
+++ b/src/widgets/widgets/qsizegrip.cpp
@@ -54,8 +54,9 @@
#if defined(Q_WS_X11)
#include <private/qt_x11_p.h>
-#elif defined (Q_WS_WIN)
-#include "qt_windows.h"
+#elif defined (Q_OS_WIN)
+# include <QtCore/qt_windows.h>
+# include "private/qapplication_p.h"
#endif
#ifdef Q_WS_MAC
#include <private/qt_mac_p.h>
@@ -64,13 +65,18 @@
#include <private/qwidget_p.h>
#include <QtWidgets/qabstractscrollarea.h>
-#define SZ_SIZEBOTTOMRIGHT 0xf008
-#define SZ_SIZEBOTTOMLEFT 0xf007
-#define SZ_SIZETOPLEFT 0xf004
-#define SZ_SIZETOPRIGHT 0xf005
-
QT_BEGIN_NAMESPACE
+#if defined (Q_OS_WIN)
+# define SZ_SIZEBOTTOMRIGHT 0xf008
+# define SZ_SIZEBOTTOMLEFT 0xf007
+# define SZ_SIZETOPLEFT 0xf004
+# define SZ_SIZETOPRIGHT 0xf005
+
+HMENU qt_getWindowsSystemMenu(const QWidget *w);
+
+#endif
+
static QWidget *qt_sizegrip_topLevelWidget(QWidget* w)
{
while (w && !w->isWindow() && w->windowType() != Qt::SubWindow)
@@ -317,7 +323,7 @@ void QSizeGrip::mousePressEvent(QMouseEvent * e)
return;
}
#endif // Q_WS_X11
-#ifdef Q_WS_WIN
+#ifdef Q_OS_WIN
if (tlw->isWindow() && !tlw->testAttribute(Qt::WA_DontShowOnScreen) && !qt_widget_private(tlw)->hasHeightForWidth()) {
uint orientation = 0;
if (d->atBottom())
@@ -326,10 +332,10 @@ void QSizeGrip::mousePressEvent(QMouseEvent * e)
orientation = d->atLeft() ? SZ_SIZETOPLEFT : SZ_SIZETOPRIGHT;
ReleaseCapture();
- PostMessage(tlw->winId(), WM_SYSCOMMAND, orientation, 0);
+ PostMessage(QApplicationPrivate::getHWNDForWidget(tlw), WM_SYSCOMMAND, orientation, 0);
return;
}
-#endif // Q_WS_WIN
+#endif // Q_OS_WIN
// Find available desktop/workspace geometry.
QRect availableGeometry;
@@ -411,12 +417,13 @@ void QSizeGrip::mouseMoveEvent(QMouseEvent * e)
&& !tlw->testAttribute(Qt::WA_DontShowOnScreen) && !qt_widget_private(tlw)->hasHeightForWidth())
return;
#endif
-#ifdef Q_WS_WIN
- if (tlw->isWindow() && GetSystemMenu(tlw->winId(), FALSE) != 0 && internalWinId()
- && !tlw->testAttribute(Qt::WA_DontShowOnScreen) && !qt_widget_private(tlw)->hasHeightForWidth()) {
- MSG msg;
- while(PeekMessage(&msg, winId(), WM_MOUSEMOVE, WM_MOUSEMOVE, PM_REMOVE));
- return;
+#ifdef Q_OS_WIN
+ if (tlw->isWindow() && qt_getWindowsSystemMenu(tlw) && !tlw->testAttribute(Qt::WA_DontShowOnScreen) && !qt_widget_private(tlw)->hasHeightForWidth()) {
+ if (const HWND hwnd = QApplicationPrivate::getHWNDForWidget(tlw)) {
+ MSG msg;
+ while (PeekMessage(&msg, hwnd, WM_MOUSEMOVE, WM_MOUSEMOVE, PM_REMOVE)) ;
+ return;
+ }
}
#endif
@@ -541,14 +548,6 @@ bool QSizeGrip::event(QEvent *event)
return QWidget::event(event);
}
-#ifdef Q_WS_WIN
-/*! \reimp */
-bool QSizeGrip::winEvent( MSG *m, long *result )
-{
- return QWidget::winEvent(m, result);
-}
-#endif
-
QT_END_NAMESPACE
#include "moc_qsizegrip.cpp"
diff --git a/src/widgets/widgets/qsizegrip.h b/src/widgets/widgets/qsizegrip.h
index 44b27b2976..8dccebb973 100644
--- a/src/widgets/widgets/qsizegrip.h
+++ b/src/widgets/widgets/qsizegrip.h
@@ -71,9 +71,6 @@ protected:
void hideEvent(QHideEvent *hideEvent);
bool eventFilter(QObject *, QEvent *);
bool event(QEvent *);
-#ifdef Q_WS_WIN
- bool winEvent(MSG *m, long *result);
-#endif
public: