diff options
Diffstat (limited to 'src/corelib/global/qnamespace.h')
-rw-r--r-- | src/corelib/global/qnamespace.h | 176 |
1 files changed, 121 insertions, 55 deletions
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index e239a11cda..745fb442f2 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -42,6 +42,17 @@ QT_BEGIN_NAMESPACE +#if !defined(Q_QDOC) && !defined(Q_MOC_RUN) +struct QMetaObject; +const QMetaObject *qt_getQtMetaObject() Q_DECL_NOEXCEPT; // defined in qobject.h (which can't be included here) +#define QT_Q_ENUM(ENUM) \ + inline const QMetaObject *qt_getEnumMetaObject(ENUM) Q_DECL_NOEXCEPT { return qt_getQtMetaObject(); } \ + inline Q_DECL_CONSTEXPR const char *qt_getEnumName(ENUM) Q_DECL_NOEXCEPT { return #ENUM; } +#define QT_Q_FLAG(ENUM) QT_Q_ENUM(ENUM) +#else +#define QT_Q_ENUM Q_ENUM +#define QT_Q_FLAG Q_FLAG +#endif #ifndef Q_MOC_RUN namespace @@ -52,53 +63,6 @@ Qt { #if defined(Q_MOC_RUN) Q_OBJECT -#endif - -#if defined(Q_MOC_RUN) - // NOTE: Generally, do not add Q_ENUMS if a corresponding Q_FLAGS exists. - Q_ENUMS(ScrollBarPolicy FocusPolicy ContextMenuPolicy) - Q_ENUMS(ArrowType ToolButtonStyle PenStyle PenCapStyle PenJoinStyle BrushStyle) - Q_ENUMS(FillRule MaskMode BGMode ClipOperation SizeMode) - Q_ENUMS(Axis Corner Edge LayoutDirection SizeHint Orientation DropAction) - Q_FLAGS(Alignment Orientations DropActions Edges) - Q_FLAGS(DockWidgetAreas ToolBarAreas) - Q_ENUMS(DockWidgetArea ToolBarArea) - Q_ENUMS(TextFormat) - Q_ENUMS(TextElideMode) - Q_ENUMS(DateFormat TimeSpec DayOfWeek) - Q_ENUMS(CursorShape GlobalColor) - Q_ENUMS(AspectRatioMode TransformationMode) - Q_FLAGS(ImageConversionFlags) - Q_ENUMS(Key ShortcutContext) - Q_ENUMS(TextInteractionFlag) - Q_FLAGS(TextInteractionFlags) - Q_ENUMS(ItemSelectionMode) - Q_FLAGS(ItemFlags) - Q_ENUMS(CheckState) - Q_ENUMS(SortOrder CaseSensitivity) - Q_FLAGS(MatchFlags) - Q_FLAGS(KeyboardModifiers MouseButtons) - Q_ENUMS(WindowType WindowState WindowModality WidgetAttribute ApplicationAttribute) - Q_FLAGS(WindowFlags WindowStates) - Q_ENUMS(FocusReason) - Q_ENUMS(InputMethodHint InputMethodQuery) - Q_FLAGS(InputMethodHints InputMethodQueries) - Q_ENUMS(ScreenOrientation) - Q_FLAGS(ScreenOrientations) - Q_ENUMS(ConnectionType) - Q_ENUMS(ApplicationState) -#ifndef QT_NO_GESTURES - Q_ENUMS(GestureState) - Q_ENUMS(GestureType) - Q_ENUMS(NativeGestureType) -#endif - Q_ENUMS(CursorMoveStyle) - Q_ENUMS(TimerType) - Q_ENUMS(ScrollPhase) - Q_ENUMS(MouseEventSource) -#endif // defined(Q_MOC_RUN) - -#if defined(Q_MOC_RUN) public: #endif @@ -209,6 +173,13 @@ public: WheelFocus = StrongFocus | 0x4 }; + enum TabFocusBehavior { + NoTabFocus = 0x00, + TabFocusTextControls = 0x01, + TabFocusListControls = 0x02, + TabFocusAllControls = 0xff + }; + enum SortOrder { AscendingOrder, DescendingOrder @@ -316,6 +287,7 @@ public: WindowTransparentForInput = 0x00080000, WindowOverridesSystemGestures = 0x00100000, WindowDoesNotAcceptFocus = 0x00200000, + MaximizeUsingFullscreenGeometryHint = 0x00400000, CustomizeWindowHint = 0x02000000, WindowStaysOnBottomHint = 0x04000000, @@ -1298,6 +1270,11 @@ public: IntersectsItemBoundingRect = 0x3 }; + enum ItemSelectionOperation { + ReplaceSelection, + AddToSelection + }; + enum TransformationMode { FastTransformation, SmoothTransformation @@ -1469,7 +1446,8 @@ public: ItemIsUserCheckable = 16, ItemIsEnabled = 32, ItemIsTristate = 64, - ItemNeverHasChildren = 128 + ItemNeverHasChildren = 128, + ItemIsUserTristate = 256 }; Q_DECLARE_FLAGS(ItemFlags, ItemFlag) @@ -1637,11 +1615,99 @@ public: }; Q_DECLARE_FLAGS(MouseEventFlags, MouseEventFlag) +#ifndef Q_QDOC + // NOTE: Generally, do not add QT_Q_ENUM if a corresponding Q_Q_FLAG exists. + QT_Q_ENUM(ScrollBarPolicy) + QT_Q_ENUM(FocusPolicy) + QT_Q_ENUM(ContextMenuPolicy) + QT_Q_ENUM(ArrowType) + QT_Q_ENUM(ToolButtonStyle) + QT_Q_ENUM(PenStyle) + QT_Q_ENUM(PenCapStyle) + QT_Q_ENUM(PenJoinStyle) + QT_Q_ENUM(BrushStyle) + QT_Q_ENUM(FillRule) + QT_Q_ENUM(MaskMode) + QT_Q_ENUM(BGMode) + QT_Q_ENUM(ClipOperation) + QT_Q_ENUM(SizeMode) + QT_Q_ENUM(Axis) + QT_Q_ENUM(Corner) + QT_Q_ENUM(Edge) + QT_Q_ENUM(LayoutDirection) + QT_Q_ENUM(SizeHint) + QT_Q_ENUM(Orientation) + QT_Q_ENUM(DropAction) + QT_Q_FLAG(Alignment) + QT_Q_FLAG(Orientations) + QT_Q_FLAG(DropActions) + QT_Q_FLAG(Edges) + QT_Q_FLAG(DockWidgetAreas) + QT_Q_FLAG(ToolBarAreas) + QT_Q_ENUM(DockWidgetArea) + QT_Q_ENUM(ToolBarArea) + QT_Q_ENUM(TextFormat) + QT_Q_ENUM(TextElideMode) + QT_Q_ENUM(DateFormat) + QT_Q_ENUM(TimeSpec) + QT_Q_ENUM(DayOfWeek) + QT_Q_ENUM(CursorShape) + QT_Q_ENUM(GlobalColor) + QT_Q_ENUM(AspectRatioMode) + QT_Q_ENUM(TransformationMode) + QT_Q_FLAG(ImageConversionFlags) + QT_Q_ENUM(Key) + QT_Q_ENUM(ShortcutContext) + QT_Q_ENUM(TextInteractionFlag) + QT_Q_FLAG(TextInteractionFlags) + QT_Q_ENUM(ItemSelectionMode) + QT_Q_ENUM(ItemSelectionOperation) + QT_Q_FLAG(ItemFlags) + QT_Q_ENUM(CheckState) + QT_Q_ENUM(ItemDataRole) + QT_Q_ENUM(SortOrder) + QT_Q_ENUM(CaseSensitivity) + QT_Q_FLAG(MatchFlags) + QT_Q_FLAG(KeyboardModifiers) + QT_Q_FLAG(MouseButtons) + QT_Q_ENUM(WindowType) + QT_Q_ENUM(WindowState) + QT_Q_ENUM(WindowModality) + QT_Q_ENUM(WidgetAttribute) + QT_Q_ENUM(ApplicationAttribute) + QT_Q_FLAG(WindowFlags) + QT_Q_FLAG(WindowStates) + QT_Q_ENUM(FocusReason) + QT_Q_ENUM(InputMethodHint) + QT_Q_ENUM(InputMethodQuery) + QT_Q_FLAG(InputMethodHints) + QT_Q_FLAG(InputMethodQueries) + QT_Q_FLAG(TouchPointStates) + QT_Q_ENUM(ScreenOrientation) + QT_Q_FLAG(ScreenOrientations) + QT_Q_ENUM(ConnectionType) + QT_Q_ENUM(ApplicationState) +#ifndef QT_NO_GESTURES + QT_Q_ENUM(GestureState) + QT_Q_ENUM(GestureType) + QT_Q_ENUM(NativeGestureType) +#endif + QT_Q_ENUM(CursorMoveStyle) + QT_Q_ENUM(TimerType) + QT_Q_ENUM(ScrollPhase) + QT_Q_ENUM(MouseEventSource) + QT_Q_FLAG(MouseEventFlag) + QT_Q_ENUM(TabFocusBehavior) +#endif // Q_DOC + } #ifdef Q_MOC_RUN ; #endif +#undef QT_Q_ENUM +#undef QT_Q_FLAG + Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::MouseButtons) Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::Orientations) Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::KeyboardModifiers) |