summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qnamespace.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/global/qnamespace.h')
-rw-r--r--src/corelib/global/qnamespace.h128
1 files changed, 60 insertions, 68 deletions
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 6edd84534b..2398c0a1a4 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -1,47 +1,16 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Copyright (C) 2020 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// Copyright (C) 2020 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QNAMESPACE_H
#define QNAMESPACE_H
+#if 0
+#pragma qt_class(Qt)
+#endif
+
#include <QtCore/qglobal.h>
+#include <QtCore/qcompare.h>
#include <QtCore/qtmetamacros.h>
#if defined(__OBJC__) && !defined(__cplusplus)
@@ -78,6 +47,12 @@ namespace Qt {
transparent
};
+ enum class ColorScheme {
+ Unknown,
+ Light,
+ Dark,
+ };
+
enum MouseButton {
NoButton = 0x00000000,
LeftButton = 0x00000001,
@@ -208,6 +183,7 @@ namespace Qt {
// size of a multi-variant string.
TextLongestVariant = 0x80000
};
+ Q_DECLARE_MIXED_ENUM_OPERATORS_SYMMETRIC(int, AlignmentFlag, TextFlag)
enum TextElideMode {
ElideLeft,
@@ -215,6 +191,7 @@ namespace Qt {
ElideMiddle,
ElideNone
};
+ Q_DECLARE_MIXED_ENUM_OPERATORS_SYMMETRIC(int, TextElideMode, TextFlag)
enum WhiteSpaceMode {
WhiteSpaceNormal,
@@ -236,7 +213,7 @@ namespace Qt {
ToolTip = Popup | Sheet,
SplashScreen = ToolTip | Dialog,
Desktop = 0x00000010 | Window,
- SubWindow = 0x00000012,
+ SubWindow = 0x00000012, // Note QTBUG-115729 before using
ForeignWindow = 0x00000020 | Window,
CoverWindow = 0x00000040 | Window,
@@ -359,7 +336,6 @@ namespace Qt {
WA_ShowModal = 70, // ## deprecated since since 4.5.1 but still in use :-(
WA_MouseNoMask = 71,
- WA_GroupLeader = 72, // ## deprecated since since 4.5.1 but still in use :-(
WA_NoMousePropagation = 73, // for now, might go away.
WA_Hover = 74,
WA_InputMethodTransparent = 75, // Don't reset IM when user clicks on this (for virtual keyboards on embedded)
@@ -402,7 +378,7 @@ namespace Qt {
WA_NativeWindow = 100,
WA_DontCreateNativeAncestors = 101,
- WA_MacVariableSize = 102, // Mac only
+ // Formerly WA_MacVariableSize = 102, // Mac only
WA_DontShowOnScreen = 103,
@@ -430,7 +406,7 @@ namespace Qt {
WA_TouchPadAcceptSingleTouchEvents = 123,
WA_X11DoNotAcceptFocus = 126,
- WA_MacNoShadow = 127,
+ // Formerly, 127 was WA_MacNoShadow
WA_AlwaysStackOnTop = 128,
@@ -447,7 +423,7 @@ namespace Qt {
enum ApplicationAttribute
{
// AA_ImmediateWidgetCreation = 0,
- // AA_MSWindowsUseDirect3DByDefault = 1,
+ AA_QtQuickUseDefaultSizePolicy = 1 QT_TECH_PREVIEW_API,
AA_DontShowIconsInMenus = 2,
AA_NativeWindows = 3,
AA_DontCreateNativeWidgetSiblings = 4,
@@ -456,7 +432,7 @@ namespace Qt {
AA_MacDontSwapCtrlAndMeta = 7,
AA_Use96Dpi = 8,
AA_DisableNativeVirtualKeyboard = 9,
- // AA_X11InitThreads = 10,
+ AA_DontUseNativeMenuWindows = 10,
AA_SynthesizeTouchForUnhandledMouseEvents = 11,
AA_SynthesizeMouseForUnhandledTouchEvents = 12,
#if QT_DEPRECATED_SINCE(6, 0)
@@ -486,7 +462,7 @@ namespace Qt {
AA_DisableShaderDiskCache = 27,
AA_DontShowShortcutsInContextMenus = 28,
AA_CompressTabletEvents = 29,
- // AA_DisableWindowContextHelpButton = 30,
+ AA_DontUsePopupWindows = 30,
AA_DisableSessionManager = 31,
// Add new attributes before this line
@@ -627,7 +603,11 @@ namespace Qt {
Key_twosuperior = 0x0b2,
Key_threesuperior = 0x0b3,
Key_acute = 0x0b4,
- Key_mu = 0x0b5,
+ Key_micro = 0x0b5,
+#if QT_DEPRECATED_SINCE(6, 11)
+ Key_mu Q_DECL_ENUMERATOR_DEPRECATED_X("This key was misnamed, use Key_micro instead")
+ = Key_micro,
+#endif
Key_paragraph = 0x0b6,
Key_periodcentered = 0x0b7,
Key_cedilla = 0x0b8,
@@ -998,6 +978,7 @@ namespace Qt {
Key_Suspend = 0x0100010c,
Key_ContrastAdjust = 0x0100010d,
+ // We can remove these two for Qt 7:
Key_LaunchG = 0x0100010e,
Key_LaunchH = 0x0100010f,
@@ -1394,6 +1375,7 @@ namespace Qt {
ImAnchorRectangle = 0x4000,
ImInputItemClipRectangle = 0x8000,
+ ImReadOnly = 0x10000,
ImPlatformData = 0x80000000,
ImQueryInput = ImCursorRectangle | ImCursorPosition | ImSurroundingText |
ImCurrentSelection | ImAnchorRectangle | ImAnchorPosition,
@@ -1459,6 +1441,7 @@ namespace Qt {
enum LayoutDirection {
LeftToRight,
RightToLeft,
+ // ### Qt 7: make auto the first one (with value 0)
LayoutDirectionAuto
};
@@ -1546,6 +1529,7 @@ namespace Qt {
MatchRegularExpression = 4,
MatchWildcard = 5,
MatchFixedString = 8,
+ MatchTypeMask = 0x0F,
MatchCaseSensitive = 16,
MatchWrap = 32,
MatchRecursive = 64
@@ -1602,16 +1586,15 @@ namespace Qt {
TitleBarArea // For move
};
-#if defined(Q_COMPILER_CONSTEXPR)
enum class Initialization {
Uninitialized
};
- Q_DECL_UNUSED static constexpr Initialization Uninitialized = Initialization::Uninitialized;
-#else
- enum Initialization {
- Uninitialized
+ inline constexpr Initialization Uninitialized = Initialization::Uninitialized;
+
+ struct Disambiguated_t {
+ explicit Disambiguated_t() = default;
};
-#endif
+ inline constexpr Disambiguated_t Disambiguated{};
enum CoordinateSystem {
DeviceCoordinates,
@@ -1693,6 +1676,10 @@ namespace Qt {
VeryCoarseTimer
};
+ enum class TimerId {
+ Invalid = 0,
+ };
+
enum ScrollPhase {
NoScrollPhase = 0,
ScrollBegin,
@@ -1730,6 +1717,12 @@ namespace Qt {
PassThrough
};
+ enum class PermissionStatus {
+ Undetermined,
+ Granted,
+ Denied,
+ };
+
// QTBUG-48701
enum ReturnByValueConstant { ReturnByValue }; // ### Qt 7: Remove me
@@ -1773,6 +1766,7 @@ namespace Qt {
Q_ENUM_NS(DayOfWeek)
Q_ENUM_NS(CursorShape)
Q_ENUM_NS(GlobalColor)
+ Q_ENUM_NS(ColorScheme)
Q_ENUM_NS(AspectRatioMode)
Q_ENUM_NS(TransformationMode)
Q_FLAG_NS(ImageConversionFlags)
@@ -1820,10 +1814,11 @@ namespace Qt {
Q_ENUM_NS(TimerType)
Q_ENUM_NS(ScrollPhase)
Q_ENUM_NS(MouseEventSource)
- Q_FLAG_NS(MouseEventFlag)
+ Q_FLAG_NS(MouseEventFlags)
Q_ENUM_NS(ChecksumType)
Q_ENUM_NS(HighDpiScaleFactorRoundingPolicy)
Q_ENUM_NS(TabFocusBehavior)
+ Q_ENUM_NS(PermissionStatus)
#endif // Q_DOC
}
@@ -1842,7 +1837,6 @@ public:
Pbuffer = 0x06, // GL pbuffer
FramebufferObject = 0x07, // GL framebuffer object
CustomRaster = 0x08,
- MacQuartz = 0x09,
PaintBuffer = 0x0a,
OpenGL = 0x0b
};
@@ -1874,16 +1868,16 @@ class QKeyCombination
int combination;
public:
- constexpr /* implicit */ QKeyCombination(Qt::Key key = Qt::Key_unknown) noexcept
+ constexpr Q_IMPLICIT QKeyCombination(Qt::Key key = Qt::Key_unknown) noexcept
: combination(int(key))
{}
constexpr explicit QKeyCombination(Qt::Modifiers modifiers, Qt::Key key = Qt::Key_unknown) noexcept
- : combination(int(modifiers) | int(key))
+ : combination(modifiers.toInt() | int(key))
{}
constexpr explicit QKeyCombination(Qt::KeyboardModifiers modifiers, Qt::Key key = Qt::Key_unknown) noexcept
- : combination(int(modifiers) | int(key))
+ : combination(modifiers.toInt() | int(key))
{}
constexpr Qt::KeyboardModifiers keyboardModifiers() const noexcept
@@ -1893,7 +1887,7 @@ public:
constexpr Qt::Key key() const noexcept
{
- return Qt::Key(combination & ~Qt::KeyboardModifierMask);
+ return Qt::Key(combination & ~int(Qt::KeyboardModifierMask));
}
static constexpr QKeyCombination fromCombined(int combined)
@@ -1910,24 +1904,22 @@ public:
#if QT_DEPRECATED_SINCE(6, 0)
QT_DEPRECATED_VERSION_X(6, 0, "Use QKeyCombination instead of int")
- constexpr /* implicit */ operator int() const noexcept
+ constexpr Q_IMPLICIT operator int() const noexcept
{
return combination;
}
#endif
-
- friend constexpr bool operator==(QKeyCombination lhs, QKeyCombination rhs) noexcept
+ bool operator<(QKeyCombination) const = delete;
+private:
+ friend constexpr bool comparesEqual(const QKeyCombination &lhs,
+ const QKeyCombination &rhs) noexcept
{
return lhs.combination == rhs.combination;
}
-
- friend constexpr bool operator!=(QKeyCombination lhs, QKeyCombination rhs) noexcept
- {
- return lhs.combination != rhs.combination;
- }
+ Q_DECLARE_EQUALITY_COMPARABLE_LITERAL_TYPE(QKeyCombination)
};
-Q_DECLARE_TYPEINFO(QKeyCombination, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(QKeyCombination, Q_RELOCATABLE_TYPE);
constexpr QKeyCombination operator|(Qt::Modifier modifier, Qt::Key key) noexcept
{