From 38e4fa0a043fbb2e85b33bfdfe458f8d77c073a9 Mon Sep 17 00:00:00 2001 From: Jani Uusi-Rantala Date: Sat, 8 Oct 2011 19:45:22 +0300 Subject: [PATCH] Enable using the new Qt::ScreenOrientation enum as flags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Going to be useful later on in multiple places... - Respecified Qt::ScreenOrientation as bit values - Added Qt::ScreenOrientations QFlags definitions Change-Id: Ib7648d23de79ea5f88d617015bc98efcf903a8f3 Signed-off-by: Jani Uusi-Rantala Reviewed-on: http://codereview.qt-project.org/6268 Sanity-Review: Qt Sanity Bot Reviewed-by: Samuel Rødal --- src/corelib/global/qnamespace.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 4c1cff8eee..01de6807ed 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -86,8 +86,10 @@ Qt { Q_FLAGS(MatchFlags) Q_FLAGS(KeyboardModifiers MouseButtons) Q_ENUMS(WindowType WindowState WindowModality WidgetAttribute ApplicationAttribute) + Q_ENUMS(ScreenOrientation) Q_ENUMS(InputMethodHint) Q_FLAGS(WindowFlags WindowStates InputMethodHints) + Q_FLAGS(ScreenOrientations) Q_ENUMS(ConnectionType) #ifndef QT_NO_GESTURES Q_ENUMS(GestureState) @@ -284,13 +286,15 @@ public: Q_DECLARE_FLAGS(WindowStates, WindowState) enum ScreenOrientation { - UnknownOrientation, - LandscapeOrientation, - PortraitOrientation, - InvertedLandscapeOrientation, - InvertedPortraitOrientation + UnknownOrientation = 0x00000000, + PortraitOrientation = 0x00000001, + LandscapeOrientation = 0x00000002, + InvertedPortraitOrientation = 0x00000004, + InvertedLandscapeOrientation = 0x00000008 }; + Q_DECLARE_FLAGS(ScreenOrientations, ScreenOrientation) + enum WidgetAttribute { WA_Disabled = 0, WA_UnderMouse = 1, @@ -1529,6 +1533,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::ImageConversionFlags) Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::DockWidgetAreas) Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::ToolBarAreas) Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::WindowStates) +Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::ScreenOrientations) Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::DropActions) Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::ItemFlags) Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::MatchFlags)