From a134b57152964e1279f62606cce0a7e7f521c32a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 3 Dec 2013 12:45:29 +0100 Subject: Windows: Show context menu on mouse release. Introduce a hint to QPlatformTheme to control the behavior. Task-number: QTBUG-35231 Change-Id: Ia28e153a8dd3f1931321a222d8906ca87166ed62 Reviewed-by: Shawn Rutledge Reviewed-by: Joerg Bornemann --- src/gui/kernel/qplatformtheme.cpp | 3 +++ src/gui/kernel/qplatformtheme.h | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src/gui/kernel') diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp index 1844232efe..3548ec0199 100644 --- a/src/gui/kernel/qplatformtheme.cpp +++ b/src/gui/kernel/qplatformtheme.cpp @@ -142,6 +142,8 @@ QT_BEGIN_NAMESPACE \value DialogSnapToDefaultButton (bool) Whether the mouse should snap to the default button when a dialog becomes visible. + \value ContextMenuOnMouseRelease (bool) Whether the context menu should be shown on mouse release. + \sa themeHint(), QStyle::pixelMetric() */ @@ -487,6 +489,7 @@ QVariant QPlatformTheme::defaultThemeHint(ThemeHint hint) case IconPixmapSizes: return QVariant::fromValue(QList()); case DialogSnapToDefaultButton: + case ContextMenuOnMouseRelease: return QVariant(false); } return QVariant(); diff --git a/src/gui/kernel/qplatformtheme.h b/src/gui/kernel/qplatformtheme.h index 4bddac5b1b..5cdec48ca3 100644 --- a/src/gui/kernel/qplatformtheme.h +++ b/src/gui/kernel/qplatformtheme.h @@ -106,7 +106,8 @@ public: TabAllWidgets, IconPixmapSizes, PasswordMaskCharacter, - DialogSnapToDefaultButton + DialogSnapToDefaultButton, + ContextMenuOnMouseRelease }; enum DialogType { -- cgit v1.2.3 From 2f284d3632cb786446b0b95bf30afdaaf2c1a7ff Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Thu, 5 Dec 2013 02:43:53 +0100 Subject: Move notification of layout change up from QApplication to QGuiApplication. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QGuiApplication-using things (like QtQuick) need to know about this, too -- this makes QGuiApplication::setLayoutDirection actually work. Task-number: QTBUG-21573 Change-Id: I2d2ac7dc07f11be5c7e501a3575b1d0978d8ac31 Reviewed-by: Friedemann Kleint Reviewed-by: Jan Arve Sæther --- src/gui/kernel/qguiapplication.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/gui/kernel') diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index bc4a135e03..1db252ca61 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -2548,6 +2548,11 @@ void QGuiApplication::setFont(const QFont &font) void QGuiApplicationPrivate::notifyLayoutDirectionChange() { + const QWindowList list = QGuiApplication::topLevelWindows(); + for (int i = 0; i < list.size(); ++i) { + QEvent ev(QEvent::ApplicationLayoutDirectionChange); + QCoreApplication::sendEvent(list.at(i), &ev); + } } void QGuiApplicationPrivate::notifyActiveWindowChange(QWindow *) -- cgit v1.2.3