diff options
author | Morten Johan Sørvig <morten.sorvig@digia.com> | 2013-12-16 22:43:05 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-11 22:13:19 +0100 |
commit | cd5ae8fb21c2e44083f0b8ba85ef8d620803c934 (patch) | |
tree | b4ec936a4bd6a8a6375bffdcfc4a0931fed04286 /src/widgets | |
parent | 684ebc66481eb095bac1aea4db5ae5a41aabd604 (diff) |
Enable window dragging code in QToolBar on Mac
Allows moving the window by dragging the unified
title and toolbar area.
Task-number: QTBUG-34411
Change-Id: Idd85c0031895b5afd7dfdc8616e4452c47935af2
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/widgets/qtoolbar.cpp | 6 | ||||
-rw-r--r-- | src/widgets/widgets/qtoolbar_p.h | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/widgets/widgets/qtoolbar.cpp b/src/widgets/widgets/qtoolbar.cpp index 5f80bbb1ca..096f53de40 100644 --- a/src/widgets/widgets/qtoolbar.cpp +++ b/src/widgets/widgets/qtoolbar.cpp @@ -272,7 +272,7 @@ bool QToolBarPrivate::mousePressEvent(QMouseEvent *event) QStyleOptionToolBar opt; q->initStyleOption(&opt); if (q->style()->subElementRect(QStyle::SE_ToolBarHandle, &opt, q).contains(event->pos()) == false) { -#ifdef Q_WS_MAC +#ifdef Q_OS_OSX // When using the unified toolbar on Mac OS X, the user can click and // drag between toolbar contents to move the window. Make this work by // implementing the standard mouse-dragging code and then call @@ -306,7 +306,7 @@ bool QToolBarPrivate::mouseReleaseEvent(QMouseEvent*) endDrag(); return true; } else { -#ifdef Q_WS_MAC +#ifdef Q_OS_OSX if (!macWindowDragging) return false; macWindowDragging = false; @@ -322,7 +322,7 @@ bool QToolBarPrivate::mouseMoveEvent(QMouseEvent *event) Q_Q(QToolBar); if (!state) { -#ifdef Q_WS_MAC +#ifdef Q_OS_OSX if (!macWindowDragging) return false; QWidget *w = q->window(); diff --git a/src/widgets/widgets/qtoolbar_p.h b/src/widgets/widgets/qtoolbar_p.h index 9ff0b9d61c..c9dd0490cd 100644 --- a/src/widgets/widgets/qtoolbar_p.h +++ b/src/widgets/widgets/qtoolbar_p.h @@ -75,7 +75,7 @@ public: allowedAreas(Qt::AllToolBarAreas), orientation(Qt::Horizontal), toolButtonStyle(Qt::ToolButtonIconOnly), layout(0), state(0) -#ifdef Q_WS_MAC +#ifdef Q_OS_OSX , macWindowDragging(false) #endif { } @@ -107,7 +107,7 @@ public: }; DragState *state; -#ifdef Q_WS_MAC +#ifdef Q_OS_OSX bool macWindowDragging; QPoint macWindowDragPressPosition; #endif |