1// Copyright (C) 2020 The Qt Company Ltd.
2// Copyright (C) 2020 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#ifndef QNAMESPACE_H
6#define QNAMESPACE_H
7
8#if 0
9#pragma qt_class(Qt)
10#endif
11
12#include <QtCore/qglobal.h>
13#include <QtCore/qtmetamacros.h>
14
15#if defined(__OBJC__) && !defined(__cplusplus)
16# warning "File built in Objective-C mode (.m), but using Qt requires Objective-C++ (.mm)"
17#endif
18
19QT_BEGIN_NAMESPACE
20
21struct QMetaObject;
22
23namespace Qt {
24 Q_NAMESPACE_EXPORT(Q_CORE_EXPORT)
25
26 enum GlobalColor {
27 color0,
28 color1,
29 black,
30 white,
31 darkGray,
32 gray,
33 lightGray,
34 red,
35 green,
36 blue,
37 cyan,
38 magenta,
39 yellow,
40 darkRed,
41 darkGreen,
42 darkBlue,
43 darkCyan,
44 darkMagenta,
45 darkYellow,
46 transparent
47 };
48
49 enum class ColorScheme {
50 Unknown,
51 Light,
52 Dark,
53 };
54
55 enum MouseButton {
56 NoButton = 0x00000000,
57 LeftButton = 0x00000001,
58 RightButton = 0x00000002,
59 MiddleButton = 0x00000004,
60 BackButton = 0x00000008,
61 XButton1 = BackButton,
62 ExtraButton1 = XButton1,
63 ForwardButton = 0x00000010,
64 XButton2 = ForwardButton,
65 ExtraButton2 = ForwardButton,
66 TaskButton = 0x00000020,
67 ExtraButton3 = TaskButton,
68 ExtraButton4 = 0x00000040,
69 ExtraButton5 = 0x00000080,
70 ExtraButton6 = 0x00000100,
71 ExtraButton7 = 0x00000200,
72 ExtraButton8 = 0x00000400,
73 ExtraButton9 = 0x00000800,
74 ExtraButton10 = 0x00001000,
75 ExtraButton11 = 0x00002000,
76 ExtraButton12 = 0x00004000,
77 ExtraButton13 = 0x00008000,
78 ExtraButton14 = 0x00010000,
79 ExtraButton15 = 0x00020000,
80 ExtraButton16 = 0x00040000,
81 ExtraButton17 = 0x00080000,
82 ExtraButton18 = 0x00100000,
83 ExtraButton19 = 0x00200000,
84 ExtraButton20 = 0x00400000,
85 ExtraButton21 = 0x00800000,
86 ExtraButton22 = 0x01000000,
87 ExtraButton23 = 0x02000000,
88 ExtraButton24 = 0x04000000,
89 AllButtons = 0x07ffffff,
90 MaxMouseButton = ExtraButton24,
91 // 4 high-order bits remain available for future use (0x08000000 through 0x40000000).
92 MouseButtonMask = 0xffffffff
93 };
94 Q_DECLARE_FLAGS(MouseButtons, MouseButton)
95 Q_DECLARE_OPERATORS_FOR_FLAGS(MouseButtons)
96
97 enum Orientation {
98 Horizontal = 0x1,
99 Vertical = 0x2
100 };
101
102 Q_DECLARE_FLAGS(Orientations, Orientation)
103 Q_DECLARE_OPERATORS_FOR_FLAGS(Orientations)
104
105 enum FocusPolicy {
106 NoFocus = 0,
107 TabFocus = 0x1,
108 ClickFocus = 0x2,
109 StrongFocus = TabFocus | ClickFocus | 0x8,
110 WheelFocus = StrongFocus | 0x4
111 };
112
113 enum TabFocusBehavior {
114 NoTabFocus = 0x00,
115 TabFocusTextControls = 0x01,
116 TabFocusListControls = 0x02,
117 TabFocusAllControls = 0xff
118 };
119
120 enum SortOrder {
121 AscendingOrder,
122 DescendingOrder
123 };
124
125 enum SplitBehaviorFlags {
126 KeepEmptyParts = 0,
127 SkipEmptyParts = 0x1,
128 };
129 Q_DECLARE_FLAGS(SplitBehavior, SplitBehaviorFlags)
130 Q_DECLARE_OPERATORS_FOR_FLAGS(SplitBehavior)
131
132 enum TileRule {
133 StretchTile,
134 RepeatTile,
135 RoundTile
136 };
137
138 // Text formatting flags for QPainter::drawText and QLabel.
139 // The following two enums can be combined to one integer which
140 // is passed as 'flags' to QPainter::drawText, QFontMetrics::boundingRect and qt_format_text.
141
142 enum AlignmentFlag {
143 AlignLeft = 0x0001,
144 AlignLeading = AlignLeft,
145 AlignRight = 0x0002,
146 AlignTrailing = AlignRight,
147 AlignHCenter = 0x0004,
148 AlignJustify = 0x0008,
149 AlignAbsolute = 0x0010,
150 AlignHorizontal_Mask = AlignLeft | AlignRight | AlignHCenter | AlignJustify | AlignAbsolute,
151
152 AlignTop = 0x0020,
153 AlignBottom = 0x0040,
154 AlignVCenter = 0x0080,
155 AlignBaseline = 0x0100,
156 // Note that 0x100 will clash with Qt::TextSingleLine = 0x100 due to what the comment above
157 // this enum declaration states. However, since Qt::AlignBaseline is only used by layouts,
158 // it doesn't make sense to pass Qt::AlignBaseline to QPainter::drawText(), so there
159 // shouldn't really be any ambiguity between the two overlapping enum values.
160 AlignVertical_Mask = AlignTop | AlignBottom | AlignVCenter | AlignBaseline,
161
162 AlignCenter = AlignVCenter | AlignHCenter
163 };
164
165 Q_DECLARE_FLAGS(Alignment, AlignmentFlag)
166 Q_DECLARE_OPERATORS_FOR_FLAGS(Alignment)
167
168 enum TextFlag {
169 TextSingleLine = 0x0100,
170 TextDontClip = 0x0200,
171 TextExpandTabs = 0x0400,
172 TextShowMnemonic = 0x0800,
173 TextWordWrap = 0x1000,
174 TextWrapAnywhere = 0x2000,
175 TextDontPrint = 0x4000,
176 TextIncludeTrailingSpaces = 0x08000000,
177 TextHideMnemonic = 0x8000,
178 TextJustificationForced = 0x10000,
179 TextForceLeftToRight = 0x20000,
180 TextForceRightToLeft = 0x40000,
181 // Ensures that the longest variant is always used when computing the
182 // size of a multi-variant string.
183 TextLongestVariant = 0x80000
184 };
185 Q_DECLARE_MIXED_ENUM_OPERATORS_SYMMETRIC(int, AlignmentFlag, TextFlag)
186
187 enum TextElideMode {
188 ElideLeft,
189 ElideRight,
190 ElideMiddle,
191 ElideNone
192 };
193 Q_DECLARE_MIXED_ENUM_OPERATORS_SYMMETRIC(int, TextElideMode, TextFlag)
194
195 enum WhiteSpaceMode {
196 WhiteSpaceNormal,
197 WhiteSpacePre,
198 WhiteSpaceNoWrap,
199 WhiteSpaceModeUndefined = -1
200 };
201
202 enum HitTestAccuracy { ExactHit, FuzzyHit };
203
204 enum WindowType {
205 Widget = 0x00000000,
206 Window = 0x00000001,
207 Dialog = 0x00000002 | Window,
208 Sheet = 0x00000004 | Window,
209 Drawer = Sheet | Dialog,
210 Popup = 0x00000008 | Window,
211 Tool = Popup | Dialog,
212 ToolTip = Popup | Sheet,
213 SplashScreen = ToolTip | Dialog,
214 Desktop = 0x00000010 | Window,
215 SubWindow = 0x00000012, // Note QTBUG-115729 before using
216 ForeignWindow = 0x00000020 | Window,
217 CoverWindow = 0x00000040 | Window,
218
219 WindowType_Mask = 0x000000ff,
220 MSWindowsFixedSizeDialogHint = 0x00000100,
221 MSWindowsOwnDC = 0x00000200,
222 BypassWindowManagerHint = 0x00000400,
223 X11BypassWindowManagerHint = BypassWindowManagerHint,
224 FramelessWindowHint = 0x00000800,
225 WindowTitleHint = 0x00001000,
226 WindowSystemMenuHint = 0x00002000,
227 WindowMinimizeButtonHint = 0x00004000,
228 WindowMaximizeButtonHint = 0x00008000,
229 WindowMinMaxButtonsHint = WindowMinimizeButtonHint | WindowMaximizeButtonHint,
230 WindowContextHelpButtonHint = 0x00010000,
231 WindowShadeButtonHint = 0x00020000,
232 WindowStaysOnTopHint = 0x00040000,
233 WindowTransparentForInput = 0x00080000,
234 WindowOverridesSystemGestures = 0x00100000,
235 WindowDoesNotAcceptFocus = 0x00200000,
236 MaximizeUsingFullscreenGeometryHint = 0x00400000,
237
238 CustomizeWindowHint = 0x02000000,
239 WindowStaysOnBottomHint = 0x04000000,
240 WindowCloseButtonHint = 0x08000000,
241 MacWindowToolBarButtonHint = 0x10000000,
242 BypassGraphicsProxyWidget = 0x20000000,
243 NoDropShadowWindowHint = 0x40000000,
244 WindowFullscreenButtonHint = 0x80000000
245 };
246
247 Q_DECLARE_FLAGS(WindowFlags, WindowType)
248 Q_DECLARE_OPERATORS_FOR_FLAGS(WindowFlags)
249
250 enum WindowState {
251 WindowNoState = 0x00000000,
252 WindowMinimized = 0x00000001,
253 WindowMaximized = 0x00000002,
254 WindowFullScreen = 0x00000004,
255 WindowActive = 0x00000008
256 };
257
258 Q_DECLARE_FLAGS(WindowStates, WindowState)
259 Q_DECLARE_OPERATORS_FOR_FLAGS(WindowStates)
260
261 enum ApplicationState {
262 ApplicationSuspended = 0x00000000,
263 ApplicationHidden = 0x00000001,
264 ApplicationInactive = 0x00000002,
265 ApplicationActive = 0x00000004
266 };
267
268 Q_DECLARE_FLAGS(ApplicationStates, ApplicationState)
269
270 enum ScreenOrientation {
271 PrimaryOrientation = 0x00000000,
272 PortraitOrientation = 0x00000001,
273 LandscapeOrientation = 0x00000002,
274 InvertedPortraitOrientation = 0x00000004,
275 InvertedLandscapeOrientation = 0x00000008
276 };
277
278 Q_DECLARE_FLAGS(ScreenOrientations, ScreenOrientation)
279 Q_DECLARE_OPERATORS_FOR_FLAGS(ScreenOrientations)
280
281 enum WidgetAttribute {
282 WA_Disabled = 0,
283 WA_UnderMouse = 1,
284 WA_MouseTracking = 2,
285 // Formerly, 3 was WA_ContentsPropagated.
286 WA_OpaquePaintEvent = 4,
287 WA_StaticContents = 5,
288 WA_LaidOut = 7,
289 WA_PaintOnScreen = 8,
290 WA_NoSystemBackground = 9,
291 WA_UpdatesDisabled = 10,
292 WA_Mapped = 11,
293 // Formerly, 12 was WA_MacNoClickThrough.
294 WA_InputMethodEnabled = 14,
295 WA_WState_Visible = 15,
296 WA_WState_Hidden = 16,
297
298 WA_ForceDisabled = 32,
299 WA_KeyCompression = 33,
300 WA_PendingMoveEvent = 34,
301 WA_PendingResizeEvent = 35,
302 WA_SetPalette = 36,
303 WA_SetFont = 37,
304 WA_SetCursor = 38,
305 WA_NoChildEventsFromChildren = 39,
306 WA_WindowModified = 41,
307 WA_Resized = 42,
308 WA_Moved = 43,
309 WA_PendingUpdate = 44,
310 WA_InvalidSize = 45,
311 // Formerly 46 was WA_MacBrushedMetal and WA_MacMetalStyle.
312 WA_CustomWhatsThis = 47,
313 WA_LayoutOnEntireRect = 48,
314 WA_OutsideWSRange = 49,
315 WA_GrabbedShortcut = 50,
316 WA_TransparentForMouseEvents = 51,
317 WA_PaintUnclipped = 52,
318 WA_SetWindowIcon = 53,
319 WA_NoMouseReplay = 54,
320 WA_DeleteOnClose = 55,
321 WA_RightToLeft = 56,
322 WA_SetLayoutDirection = 57,
323 WA_NoChildEventsForParent = 58,
324 WA_ForceUpdatesDisabled = 59,
325
326 WA_WState_Created = 60,
327 WA_WState_CompressKeys = 61,
328 WA_WState_InPaintEvent = 62,
329 WA_WState_Reparented = 63,
330 WA_WState_ConfigPending = 64,
331 WA_WState_Polished = 66,
332 // Formerly, 67 was WA_WState_DND.
333 WA_WState_OwnSizePolicy = 68,
334 WA_WState_ExplicitShowHide = 69,
335
336 WA_ShowModal = 70, // ## deprecated since since 4.5.1 but still in use :-(
337 WA_MouseNoMask = 71,
338 WA_NoMousePropagation = 73, // for now, might go away.
339 WA_Hover = 74,
340 WA_InputMethodTransparent = 75, // Don't reset IM when user clicks on this (for virtual keyboards on embedded)
341 WA_QuitOnClose = 76,
342
343 WA_KeyboardFocusChange = 77,
344
345 WA_AcceptDrops = 78,
346 WA_DropSiteRegistered = 79, // internal
347
348 WA_WindowPropagation = 80,
349
350 WA_NoX11EventCompression = 81,
351 WA_TintedBackground = 82,
352 WA_X11OpenGLOverlay = 83,
353 WA_AlwaysShowToolTips = 84,
354 WA_MacOpaqueSizeGrip = 85,
355 WA_SetStyle = 86,
356
357 WA_SetLocale = 87,
358 WA_MacShowFocusRect = 88,
359
360 WA_MacNormalSize = 89, // Mac only
361 WA_MacSmallSize = 90, // Mac only
362 WA_MacMiniSize = 91, // Mac only
363
364 WA_LayoutUsesWidgetRect = 92,
365 WA_StyledBackground = 93, // internal
366 // Formerly, 94 was WA_MSWindowsUseDirect3D.
367 WA_CanHostQMdiSubWindowTitleBar = 95, // Internal
368
369 WA_MacAlwaysShowToolWindow = 96, // Mac only
370
371 WA_StyleSheet = 97, // internal
372
373 WA_ShowWithoutActivating = 98,
374
375 WA_X11BypassTransientForHint = 99,
376
377 WA_NativeWindow = 100,
378 WA_DontCreateNativeAncestors = 101,
379
380 // Formerly WA_MacVariableSize = 102, // Mac only
381
382 WA_DontShowOnScreen = 103,
383
384 // window types from http://standards.freedesktop.org/wm-spec/
385 WA_X11NetWmWindowTypeDesktop = 104,
386 WA_X11NetWmWindowTypeDock = 105,
387 WA_X11NetWmWindowTypeToolBar = 106,
388 WA_X11NetWmWindowTypeMenu = 107,
389 WA_X11NetWmWindowTypeUtility = 108,
390 WA_X11NetWmWindowTypeSplash = 109,
391 WA_X11NetWmWindowTypeDialog = 110,
392 WA_X11NetWmWindowTypeDropDownMenu = 111,
393 WA_X11NetWmWindowTypePopupMenu = 112,
394 WA_X11NetWmWindowTypeToolTip = 113,
395 WA_X11NetWmWindowTypeNotification = 114,
396 WA_X11NetWmWindowTypeCombo = 115,
397 WA_X11NetWmWindowTypeDND = 116,
398 // Formerly, 117 was WA_MacFrameworkScaled.
399 WA_SetWindowModality = 118,
400 WA_WState_WindowOpacitySet = 119, // internal
401 WA_TranslucentBackground = 120,
402
403 WA_AcceptTouchEvents = 121,
404 WA_WState_AcceptedTouchBeginEvent = 122,
405 WA_TouchPadAcceptSingleTouchEvents = 123,
406
407 WA_X11DoNotAcceptFocus = 126,
408 // Formerly, 127 was WA_MacNoShadow
409
410 WA_AlwaysStackOnTop = 128,
411
412 WA_TabletTracking = 129,
413
414 WA_ContentsMarginsRespectsSafeArea = 130,
415
416 WA_StyleSheetTarget = 131,
417
418 // Add new attributes before this line
419 WA_AttributeCount
420 };
421
422 enum ApplicationAttribute
423 {
424 // AA_ImmediateWidgetCreation = 0,
425 AA_QtQuickUseDefaultSizePolicy = 1 QT_TECH_PREVIEW_API,
426 AA_DontShowIconsInMenus = 2,
427 AA_NativeWindows = 3,
428 AA_DontCreateNativeWidgetSiblings = 4,
429 AA_PluginApplication = 5,
430 AA_DontUseNativeMenuBar = 6,
431 AA_MacDontSwapCtrlAndMeta = 7,
432 AA_Use96Dpi = 8,
433 AA_DisableNativeVirtualKeyboard = 9,
434 // AA_X11InitThreads = 10,
435 AA_SynthesizeTouchForUnhandledMouseEvents = 11,
436 AA_SynthesizeMouseForUnhandledTouchEvents = 12,
437#if QT_DEPRECATED_SINCE(6, 0)
438 AA_UseHighDpiPixmaps Q_DECL_ENUMERATOR_DEPRECATED_X(
439 "High-DPI pixmaps are always enabled. " \
440 "This attribute no longer has any effect.") = 13,
441#endif
442 AA_ForceRasterWidgets = 14,
443 AA_UseDesktopOpenGL = 15,
444 AA_UseOpenGLES = 16,
445 AA_UseSoftwareOpenGL = 17,
446 AA_ShareOpenGLContexts = 18,
447 AA_SetPalette = 19,
448#if QT_DEPRECATED_SINCE(6, 0)
449 AA_EnableHighDpiScaling Q_DECL_ENUMERATOR_DEPRECATED_X(
450 "High-DPI scaling is always enabled. " \
451 "This attribute no longer has any effect.") = 20,
452 AA_DisableHighDpiScaling Q_DECL_ENUMERATOR_DEPRECATED_X(
453 "High-DPI scaling is always enabled. " \
454 "This attribute no longer has any effect.") = 21,
455#endif
456 AA_UseStyleSheetPropagationInWidgetStyles = 22,
457 AA_DontUseNativeDialogs = 23,
458 AA_SynthesizeMouseForUnhandledTabletEvents = 24,
459 AA_CompressHighFrequencyEvents = 25,
460 AA_DontCheckOpenGLContextThreadAffinity = 26,
461 AA_DisableShaderDiskCache = 27,
462 AA_DontShowShortcutsInContextMenus = 28,
463 AA_CompressTabletEvents = 29,
464 // AA_DisableWindowContextHelpButton = 30,
465 AA_DisableSessionManager = 31,
466
467 // Add new attributes before this line
468 AA_AttributeCount
469 };
470
471
472 // Image conversion flags. The unusual ordering is caused by
473 // compatibility and default requirements.
474
475 enum ImageConversionFlag {
476 ColorMode_Mask = 0x00000003,
477 AutoColor = 0x00000000,
478 ColorOnly = 0x00000003,
479 MonoOnly = 0x00000002,
480 // Reserved = 0x00000001,
481
482 AlphaDither_Mask = 0x0000000c,
483 ThresholdAlphaDither = 0x00000000,
484 OrderedAlphaDither = 0x00000004,
485 DiffuseAlphaDither = 0x00000008,
486 NoAlpha = 0x0000000c, // Not supported
487
488 Dither_Mask = 0x00000030,
489 DiffuseDither = 0x00000000,
490 OrderedDither = 0x00000010,
491 ThresholdDither = 0x00000020,
492 // ReservedDither = 0x00000030,
493
494 DitherMode_Mask = 0x000000c0,
495 AutoDither = 0x00000000,
496 PreferDither = 0x00000040,
497 AvoidDither = 0x00000080,
498
499 NoOpaqueDetection = 0x00000100,
500 NoFormatConversion = 0x00000200
501 };
502 Q_DECLARE_FLAGS(ImageConversionFlags, ImageConversionFlag)
503 Q_DECLARE_OPERATORS_FOR_FLAGS(ImageConversionFlags)
504
505 enum BGMode {
506 TransparentMode,
507 OpaqueMode
508 };
509
510 enum Key {
511 // Unicode Basic Latin block (0x00-0x7f)
512 Key_Space = 0x20,
513 Key_Any = Key_Space,
514 Key_Exclam = 0x21,
515 Key_QuoteDbl = 0x22,
516 Key_NumberSign = 0x23,
517 Key_Dollar = 0x24,
518 Key_Percent = 0x25,
519 Key_Ampersand = 0x26,
520 Key_Apostrophe = 0x27,
521 Key_ParenLeft = 0x28,
522 Key_ParenRight = 0x29,
523 Key_Asterisk = 0x2a,
524 Key_Plus = 0x2b,
525 Key_Comma = 0x2c,
526 Key_Minus = 0x2d,
527 Key_Period = 0x2e,
528 Key_Slash = 0x2f,
529 Key_0 = 0x30,
530 Key_1 = 0x31,
531 Key_2 = 0x32,
532 Key_3 = 0x33,
533 Key_4 = 0x34,
534 Key_5 = 0x35,
535 Key_6 = 0x36,
536 Key_7 = 0x37,
537 Key_8 = 0x38,
538 Key_9 = 0x39,
539 Key_Colon = 0x3a,
540 Key_Semicolon = 0x3b,
541 Key_Less = 0x3c,
542 Key_Equal = 0x3d,
543 Key_Greater = 0x3e,
544 Key_Question = 0x3f,
545 Key_At = 0x40,
546 Key_A = 0x41,
547 Key_B = 0x42,
548 Key_C = 0x43,
549 Key_D = 0x44,
550 Key_E = 0x45,
551 Key_F = 0x46,
552 Key_G = 0x47,
553 Key_H = 0x48,
554 Key_I = 0x49,
555 Key_J = 0x4a,
556 Key_K = 0x4b,
557 Key_L = 0x4c,
558 Key_M = 0x4d,
559 Key_N = 0x4e,
560 Key_O = 0x4f,
561 Key_P = 0x50,
562 Key_Q = 0x51,
563 Key_R = 0x52,
564 Key_S = 0x53,
565 Key_T = 0x54,
566 Key_U = 0x55,
567 Key_V = 0x56,
568 Key_W = 0x57,
569 Key_X = 0x58,
570 Key_Y = 0x59,
571 Key_Z = 0x5a,
572 Key_BracketLeft = 0x5b,
573 Key_Backslash = 0x5c,
574 Key_BracketRight = 0x5d,
575 Key_AsciiCircum = 0x5e,
576 Key_Underscore = 0x5f,
577 Key_QuoteLeft = 0x60,
578 Key_BraceLeft = 0x7b,
579 Key_Bar = 0x7c,
580 Key_BraceRight = 0x7d,
581 Key_AsciiTilde = 0x7e,
582
583 // Unicode Latin-1 Supplement block (0x80-0xff)
584 Key_nobreakspace = 0x0a0,
585 Key_exclamdown = 0x0a1,
586 Key_cent = 0x0a2,
587 Key_sterling = 0x0a3,
588 Key_currency = 0x0a4,
589 Key_yen = 0x0a5,
590 Key_brokenbar = 0x0a6,
591 Key_section = 0x0a7,
592 Key_diaeresis = 0x0a8,
593 Key_copyright = 0x0a9,
594 Key_ordfeminine = 0x0aa,
595 Key_guillemotleft = 0x0ab, // left angle quotation mark
596 Key_notsign = 0x0ac,
597 Key_hyphen = 0x0ad,
598 Key_registered = 0x0ae,
599 Key_macron = 0x0af,
600 Key_degree = 0x0b0,
601 Key_plusminus = 0x0b1,
602 Key_twosuperior = 0x0b2,
603 Key_threesuperior = 0x0b3,
604 Key_acute = 0x0b4,
605 Key_micro = 0x0b5,
606#if QT_DEPRECATED_SINCE(6, 11)
607 Key_mu Q_DECL_ENUMERATOR_DEPRECATED_X("This key was misnamed, use Key_micro instead")
608 = Key_micro,
609#endif
610 Key_paragraph = 0x0b6,
611 Key_periodcentered = 0x0b7,
612 Key_cedilla = 0x0b8,
613 Key_onesuperior = 0x0b9,
614 Key_masculine = 0x0ba,
615 Key_guillemotright = 0x0bb, // right angle quotation mark
616 Key_onequarter = 0x0bc,
617 Key_onehalf = 0x0bd,
618 Key_threequarters = 0x0be,
619 Key_questiondown = 0x0bf,
620 Key_Agrave = 0x0c0,
621 Key_Aacute = 0x0c1,
622 Key_Acircumflex = 0x0c2,
623 Key_Atilde = 0x0c3,
624 Key_Adiaeresis = 0x0c4,
625 Key_Aring = 0x0c5,
626 Key_AE = 0x0c6,
627 Key_Ccedilla = 0x0c7,
628 Key_Egrave = 0x0c8,
629 Key_Eacute = 0x0c9,
630 Key_Ecircumflex = 0x0ca,
631 Key_Ediaeresis = 0x0cb,
632 Key_Igrave = 0x0cc,
633 Key_Iacute = 0x0cd,
634 Key_Icircumflex = 0x0ce,
635 Key_Idiaeresis = 0x0cf,
636 Key_ETH = 0x0d0,
637 Key_Ntilde = 0x0d1,
638 Key_Ograve = 0x0d2,
639 Key_Oacute = 0x0d3,
640 Key_Ocircumflex = 0x0d4,
641 Key_Otilde = 0x0d5,
642 Key_Odiaeresis = 0x0d6,
643 Key_multiply = 0x0d7,
644 Key_Ooblique = 0x0d8,
645 Key_Ugrave = 0x0d9,
646 Key_Uacute = 0x0da,
647 Key_Ucircumflex = 0x0db,
648 Key_Udiaeresis = 0x0dc,
649 Key_Yacute = 0x0dd,
650 Key_THORN = 0x0de,
651 Key_ssharp = 0x0df,
652 Key_division = 0x0f7,
653 Key_ydiaeresis = 0x0ff,
654
655 // The rest of the Unicode values are skipped here,
656 // so that we can represent them along with Qt::Keys
657 // in the same data type. The maximum Unicode value
658 // is 0x0010ffff, so we start our custom keys at
659 // 0x01000000 to not clash with the Unicode values,
660 // but still give plenty of room to grow.
661
662 Key_Escape = 0x01000000, // misc keys
663 Key_Tab = 0x01000001,
664 Key_Backtab = 0x01000002,
665 Key_Backspace = 0x01000003,
666 Key_Return = 0x01000004,
667 Key_Enter = 0x01000005,
668 Key_Insert = 0x01000006,
669 Key_Delete = 0x01000007,
670 Key_Pause = 0x01000008,
671 Key_Print = 0x01000009, // print screen
672 Key_SysReq = 0x0100000a,
673 Key_Clear = 0x0100000b,
674 Key_Home = 0x01000010, // cursor movement
675 Key_End = 0x01000011,
676 Key_Left = 0x01000012,
677 Key_Up = 0x01000013,
678 Key_Right = 0x01000014,
679 Key_Down = 0x01000015,
680 Key_PageUp = 0x01000016,
681 Key_PageDown = 0x01000017,
682 Key_Shift = 0x01000020, // modifiers
683 Key_Control = 0x01000021,
684 Key_Meta = 0x01000022,
685 Key_Alt = 0x01000023,
686 Key_CapsLock = 0x01000024,
687 Key_NumLock = 0x01000025,
688 Key_ScrollLock = 0x01000026,
689 Key_F1 = 0x01000030, // function keys
690 Key_F2 = 0x01000031,
691 Key_F3 = 0x01000032,
692 Key_F4 = 0x01000033,
693 Key_F5 = 0x01000034,
694 Key_F6 = 0x01000035,
695 Key_F7 = 0x01000036,
696 Key_F8 = 0x01000037,
697 Key_F9 = 0x01000038,
698 Key_F10 = 0x01000039,
699 Key_F11 = 0x0100003a,
700 Key_F12 = 0x0100003b,
701 Key_F13 = 0x0100003c,
702 Key_F14 = 0x0100003d,
703 Key_F15 = 0x0100003e,
704 Key_F16 = 0x0100003f,
705 Key_F17 = 0x01000040,
706 Key_F18 = 0x01000041,
707 Key_F19 = 0x01000042,
708 Key_F20 = 0x01000043,
709 Key_F21 = 0x01000044,
710 Key_F22 = 0x01000045,
711 Key_F23 = 0x01000046,
712 Key_F24 = 0x01000047,
713 Key_F25 = 0x01000048, // F25 .. F35 only on X11
714 Key_F26 = 0x01000049,
715 Key_F27 = 0x0100004a,
716 Key_F28 = 0x0100004b,
717 Key_F29 = 0x0100004c,
718 Key_F30 = 0x0100004d,
719 Key_F31 = 0x0100004e,
720 Key_F32 = 0x0100004f,
721 Key_F33 = 0x01000050,
722 Key_F34 = 0x01000051,
723 Key_F35 = 0x01000052,
724 Key_Super_L = 0x01000053, // extra keys
725 Key_Super_R = 0x01000054,
726 Key_Menu = 0x01000055,
727 Key_Hyper_L = 0x01000056,
728 Key_Hyper_R = 0x01000057,
729 Key_Help = 0x01000058,
730 Key_Direction_L = 0x01000059,
731 Key_Direction_R = 0x01000060,
732
733 // International input method support (X keycode - 0xEE00, the
734 // definition follows Qt/Embedded 2.3.7) Only interesting if
735 // you are writing your own input method
736
737 // International & multi-key character composition
738 Key_AltGr = 0x01001103,
739 Key_Multi_key = 0x01001120, // Multi-key character compose
740 Key_Codeinput = 0x01001137,
741 Key_SingleCandidate = 0x0100113c,
742 Key_MultipleCandidate = 0x0100113d,
743 Key_PreviousCandidate = 0x0100113e,
744
745 // Misc Functions
746 Key_Mode_switch = 0x0100117e, // Character set switch
747 //Key_script_switch = 0x0100117e, // Alias for mode_switch
748
749 // Japanese keyboard support
750 Key_Kanji = 0x01001121, // Kanji, Kanji convert
751 Key_Muhenkan = 0x01001122, // Cancel Conversion
752 //Key_Henkan_Mode = 0x01001123, // Start/Stop Conversion
753 Key_Henkan = 0x01001123, // Alias for Henkan_Mode
754 Key_Romaji = 0x01001124, // to Romaji
755 Key_Hiragana = 0x01001125, // to Hiragana
756 Key_Katakana = 0x01001126, // to Katakana
757 Key_Hiragana_Katakana = 0x01001127, // Hiragana/Katakana toggle
758 Key_Zenkaku = 0x01001128, // to Zenkaku
759 Key_Hankaku = 0x01001129, // to Hankaku
760 Key_Zenkaku_Hankaku = 0x0100112a, // Zenkaku/Hankaku toggle
761 Key_Touroku = 0x0100112b, // Add to Dictionary
762 Key_Massyo = 0x0100112c, // Delete from Dictionary
763 Key_Kana_Lock = 0x0100112d, // Kana Lock
764 Key_Kana_Shift = 0x0100112e, // Kana Shift
765 Key_Eisu_Shift = 0x0100112f, // Alphanumeric Shift
766 Key_Eisu_toggle = 0x01001130, // Alphanumeric toggle
767 //Key_Kanji_Bangou = 0x01001137, // Codeinput
768 //Key_Zen_Koho = 0x0100113d, // Multiple/All Candidate(s)
769 //Key_Mae_Koho = 0x0100113e, // Previous Candidate
770
771 // Korean keyboard support
772 //
773 // In fact, many Korean users need only 2 keys, Key_Hangul and
774 // Key_Hangul_Hanja. But rest of the keys are good for future.
775
776 Key_Hangul = 0x01001131, // Hangul start/stop(toggle)
777 Key_Hangul_Start = 0x01001132, // Hangul start
778 Key_Hangul_End = 0x01001133, // Hangul end, English start
779 Key_Hangul_Hanja = 0x01001134, // Start Hangul->Hanja Conversion
780 Key_Hangul_Jamo = 0x01001135, // Hangul Jamo mode
781 Key_Hangul_Romaja = 0x01001136, // Hangul Romaja mode
782 //Key_Hangul_Codeinput = 0x01001137, // Hangul code input mode
783 Key_Hangul_Jeonja = 0x01001138, // Jeonja mode
784 Key_Hangul_Banja = 0x01001139, // Banja mode
785 Key_Hangul_PreHanja = 0x0100113a, // Pre Hanja conversion
786 Key_Hangul_PostHanja = 0x0100113b, // Post Hanja conversion
787 //Key_Hangul_SingleCandidate = 0x0100113c, // Single candidate
788 //Key_Hangul_MultipleCandidate = 0x0100113d, // Multiple candidate
789 //Key_Hangul_PreviousCandidate = 0x0100113e, // Previous candidate
790 Key_Hangul_Special = 0x0100113f, // Special symbols
791 //Key_Hangul_switch = 0x0100117e, // Alias for mode_switch
792
793 // dead keys (X keycode - 0xED00 to avoid the conflict)
794 Key_Dead_Grave = 0x01001250,
795 Key_Dead_Acute = 0x01001251,
796 Key_Dead_Circumflex = 0x01001252,
797 Key_Dead_Tilde = 0x01001253,
798 Key_Dead_Macron = 0x01001254,
799 Key_Dead_Breve = 0x01001255,
800 Key_Dead_Abovedot = 0x01001256,
801 Key_Dead_Diaeresis = 0x01001257,
802 Key_Dead_Abovering = 0x01001258,
803 Key_Dead_Doubleacute = 0x01001259,
804 Key_Dead_Caron = 0x0100125a,
805 Key_Dead_Cedilla = 0x0100125b,
806 Key_Dead_Ogonek = 0x0100125c,
807 Key_Dead_Iota = 0x0100125d,
808 Key_Dead_Voiced_Sound = 0x0100125e,
809 Key_Dead_Semivoiced_Sound = 0x0100125f,
810 Key_Dead_Belowdot = 0x01001260,
811 Key_Dead_Hook = 0x01001261,
812 Key_Dead_Horn = 0x01001262,
813 Key_Dead_Stroke = 0x01001263,
814 Key_Dead_Abovecomma = 0x01001264,
815 Key_Dead_Abovereversedcomma = 0x01001265,
816 Key_Dead_Doublegrave = 0x01001266,
817 Key_Dead_Belowring = 0x01001267,
818 Key_Dead_Belowmacron = 0x01001268,
819 Key_Dead_Belowcircumflex = 0x01001269,
820 Key_Dead_Belowtilde = 0x0100126a,
821 Key_Dead_Belowbreve = 0x0100126b,
822 Key_Dead_Belowdiaeresis = 0x0100126c,
823 Key_Dead_Invertedbreve = 0x0100126d,
824 Key_Dead_Belowcomma = 0x0100126e,
825 Key_Dead_Currency = 0x0100126f,
826 Key_Dead_a = 0x01001280,
827 Key_Dead_A = 0x01001281,
828 Key_Dead_e = 0x01001282,
829 Key_Dead_E = 0x01001283,
830 Key_Dead_i = 0x01001284,
831 Key_Dead_I = 0x01001285,
832 Key_Dead_o = 0x01001286,
833 Key_Dead_O = 0x01001287,
834 Key_Dead_u = 0x01001288,
835 Key_Dead_U = 0x01001289,
836 Key_Dead_Small_Schwa = 0x0100128a,
837 Key_Dead_Capital_Schwa = 0x0100128b,
838 Key_Dead_Greek = 0x0100128c,
839 Key_Dead_Lowline = 0x01001290,
840 Key_Dead_Aboveverticalline = 0x01001291,
841 Key_Dead_Belowverticalline = 0x01001292,
842 Key_Dead_Longsolidusoverlay = 0x01001293,
843
844 // multimedia/internet keys - ignored by default - see QKeyEvent c'tor
845 Key_Back = 0x01000061,
846 Key_Forward = 0x01000062,
847 Key_Stop = 0x01000063,
848 Key_Refresh = 0x01000064,
849 Key_VolumeDown = 0x01000070,
850 Key_VolumeMute = 0x01000071,
851 Key_VolumeUp = 0x01000072,
852 Key_BassBoost = 0x01000073,
853 Key_BassUp = 0x01000074,
854 Key_BassDown = 0x01000075,
855 Key_TrebleUp = 0x01000076,
856 Key_TrebleDown = 0x01000077,
857 Key_MediaPlay = 0x01000080,
858 Key_MediaStop = 0x01000081,
859 Key_MediaPrevious = 0x01000082,
860 Key_MediaNext = 0x01000083,
861 Key_MediaRecord = 0x01000084,
862 Key_MediaPause = 0x01000085,
863 Key_MediaTogglePlayPause = 0x01000086,
864 Key_HomePage = 0x01000090,
865 Key_Favorites = 0x01000091,
866 Key_Search = 0x01000092,
867 Key_Standby = 0x01000093,
868 Key_OpenUrl = 0x01000094,
869 Key_LaunchMail = 0x010000a0,
870 Key_LaunchMedia = 0x010000a1,
871 Key_Launch0 = 0x010000a2,
872 Key_Launch1 = 0x010000a3,
873 Key_Launch2 = 0x010000a4,
874 Key_Launch3 = 0x010000a5,
875 Key_Launch4 = 0x010000a6,
876 Key_Launch5 = 0x010000a7,
877 Key_Launch6 = 0x010000a8,
878 Key_Launch7 = 0x010000a9,
879 Key_Launch8 = 0x010000aa,
880 Key_Launch9 = 0x010000ab,
881 Key_LaunchA = 0x010000ac,
882 Key_LaunchB = 0x010000ad,
883 Key_LaunchC = 0x010000ae,
884 Key_LaunchD = 0x010000af,
885 Key_LaunchE = 0x010000b0,
886 Key_LaunchF = 0x010000b1,
887 Key_MonBrightnessUp = 0x010000b2,
888 Key_MonBrightnessDown = 0x010000b3,
889 Key_KeyboardLightOnOff = 0x010000b4,
890 Key_KeyboardBrightnessUp = 0x010000b5,
891 Key_KeyboardBrightnessDown = 0x010000b6,
892 Key_PowerOff = 0x010000b7,
893 Key_WakeUp = 0x010000b8,
894 Key_Eject = 0x010000b9,
895 Key_ScreenSaver = 0x010000ba,
896 Key_WWW = 0x010000bb,
897 Key_Memo = 0x010000bc,
898 Key_LightBulb = 0x010000bd,
899 Key_Shop = 0x010000be,
900 Key_History = 0x010000bf,
901 Key_AddFavorite = 0x010000c0,
902 Key_HotLinks = 0x010000c1,
903 Key_BrightnessAdjust = 0x010000c2,
904 Key_Finance = 0x010000c3,
905 Key_Community = 0x010000c4,
906 Key_AudioRewind = 0x010000c5, // Media rewind
907 Key_BackForward = 0x010000c6,
908 Key_ApplicationLeft = 0x010000c7,
909 Key_ApplicationRight = 0x010000c8,
910 Key_Book = 0x010000c9,
911 Key_CD = 0x010000ca,
912 Key_Calculator = 0x010000cb,
913 Key_ToDoList = 0x010000cc,
914 Key_ClearGrab = 0x010000cd,
915 Key_Close = 0x010000ce,
916 Key_Copy = 0x010000cf,
917 Key_Cut = 0x010000d0,
918 Key_Display = 0x010000d1, // Output switch key
919 Key_DOS = 0x010000d2,
920 Key_Documents = 0x010000d3,
921 Key_Excel = 0x010000d4,
922 Key_Explorer = 0x010000d5,
923 Key_Game = 0x010000d6,
924 Key_Go = 0x010000d7,
925 Key_iTouch = 0x010000d8,
926 Key_LogOff = 0x010000d9,
927 Key_Market = 0x010000da,
928 Key_Meeting = 0x010000db,
929 Key_MenuKB = 0x010000dc,
930 Key_MenuPB = 0x010000dd,
931 Key_MySites = 0x010000de,
932 Key_News = 0x010000df,
933 Key_OfficeHome = 0x010000e0,
934 Key_Option = 0x010000e1,
935 Key_Paste = 0x010000e2,
936 Key_Phone = 0x010000e3,
937 Key_Calendar = 0x010000e4,
938 Key_Reply = 0x010000e5,
939 Key_Reload = 0x010000e6,
940 Key_RotateWindows = 0x010000e7,
941 Key_RotationPB = 0x010000e8,
942 Key_RotationKB = 0x010000e9,
943 Key_Save = 0x010000ea,
944 Key_Send = 0x010000eb,
945 Key_Spell = 0x010000ec,
946 Key_SplitScreen = 0x010000ed,
947 Key_Support = 0x010000ee,
948 Key_TaskPane = 0x010000ef,
949 Key_Terminal = 0x010000f0,
950 Key_Tools = 0x010000f1,
951 Key_Travel = 0x010000f2,
952 Key_Video = 0x010000f3,
953 Key_Word = 0x010000f4,
954 Key_Xfer = 0x010000f5,
955 Key_ZoomIn = 0x010000f6,
956 Key_ZoomOut = 0x010000f7,
957 Key_Away = 0x010000f8,
958 Key_Messenger = 0x010000f9,
959 Key_WebCam = 0x010000fa,
960 Key_MailForward = 0x010000fb,
961 Key_Pictures = 0x010000fc,
962 Key_Music = 0x010000fd,
963 Key_Battery = 0x010000fe,
964 Key_Bluetooth = 0x010000ff,
965 Key_WLAN = 0x01000100,
966 Key_UWB = 0x01000101,
967 Key_AudioForward = 0x01000102, // Media fast-forward
968 Key_AudioRepeat = 0x01000103, // Toggle repeat mode
969 Key_AudioRandomPlay = 0x01000104, // Toggle shuffle mode
970 Key_Subtitle = 0x01000105,
971 Key_AudioCycleTrack = 0x01000106,
972 Key_Time = 0x01000107,
973 Key_Hibernate = 0x01000108,
974 Key_View = 0x01000109,
975 Key_TopMenu = 0x0100010a,
976 Key_PowerDown = 0x0100010b,
977 Key_Suspend = 0x0100010c,
978 Key_ContrastAdjust = 0x0100010d,
979
980 // We can remove these two for Qt 7:
981 Key_LaunchG = 0x0100010e,
982 Key_LaunchH = 0x0100010f,
983
984 Key_TouchpadToggle = 0x01000110,
985 Key_TouchpadOn = 0x01000111,
986 Key_TouchpadOff = 0x01000112,
987
988 Key_MicMute = 0x01000113,
989
990 Key_Red = 0x01000114,
991 Key_Green = 0x01000115,
992 Key_Yellow = 0x01000116,
993 Key_Blue = 0x01000117,
994
995 Key_ChannelUp = 0x01000118,
996 Key_ChannelDown = 0x01000119,
997
998 Key_Guide = 0x0100011a,
999 Key_Info = 0x0100011b,
1000 Key_Settings = 0x0100011c,
1001
1002 Key_MicVolumeUp = 0x0100011d,
1003 Key_MicVolumeDown = 0x0100011e,
1004
1005 Key_New = 0x01000120,
1006 Key_Open = 0x01000121,
1007 Key_Find = 0x01000122,
1008 Key_Undo = 0x01000123,
1009 Key_Redo = 0x01000124,
1010
1011 Key_MediaLast = 0x0100ffff,
1012
1013 // Keypad navigation keys
1014 Key_Select = 0x01010000,
1015 Key_Yes = 0x01010001,
1016 Key_No = 0x01010002,
1017
1018 // Newer misc keys
1019 Key_Cancel = 0x01020001,
1020 Key_Printer = 0x01020002,
1021 Key_Execute = 0x01020003,
1022 Key_Sleep = 0x01020004,
1023 Key_Play = 0x01020005, // Not the same as Key_MediaPlay
1024 Key_Zoom = 0x01020006,
1025 //Key_Jisho = 0x01020007, // IME: Dictionary key
1026 //Key_Oyayubi_Left = 0x01020008, // IME: Left Oyayubi key
1027 //Key_Oyayubi_Right = 0x01020009, // IME: Right Oyayubi key
1028 Key_Exit = 0x0102000a,
1029
1030 // Device keys
1031 Key_Context1 = 0x01100000,
1032 Key_Context2 = 0x01100001,
1033 Key_Context3 = 0x01100002,
1034 Key_Context4 = 0x01100003,
1035 Key_Call = 0x01100004, // set absolute state to in a call (do not toggle state)
1036 Key_Hangup = 0x01100005, // set absolute state to hang up (do not toggle state)
1037 Key_Flip = 0x01100006,
1038 Key_ToggleCallHangup = 0x01100007, // a toggle key for answering, or hanging up, based on current call state
1039 Key_VoiceDial = 0x01100008,
1040 Key_LastNumberRedial = 0x01100009,
1041
1042 Key_Camera = 0x01100020,
1043 Key_CameraFocus = 0x01100021,
1044
1045 // WARNING: Do not add any keys in the range 0x01200000 to 0xffffffff,
1046 // as those bits are reserved for the Qt::KeyboardModifier enum below.
1047
1048 Key_unknown = 0x01ffffff
1049 };
1050
1051 enum KeyboardModifier {
1052 NoModifier = 0x00000000,
1053 ShiftModifier = 0x02000000,
1054 ControlModifier = 0x04000000,
1055 AltModifier = 0x08000000,
1056 MetaModifier = 0x10000000,
1057 KeypadModifier = 0x20000000,
1058 GroupSwitchModifier = 0x40000000,
1059 // Do not extend the mask to include 0x01000000
1060 KeyboardModifierMask = 0xfe000000
1061 };
1062 Q_DECLARE_FLAGS(KeyboardModifiers, KeyboardModifier)
1063 Q_DECLARE_OPERATORS_FOR_FLAGS(KeyboardModifiers)
1064
1065 //shorter names for shortcuts
1066 // The use of all-caps identifiers has the potential for clashing with
1067 // user-defined or third-party macros. More so when the identifiers are not
1068 // "namespace"-prefixed. This is considered bad practice and is why
1069 // KeypadModifier was not added to the Modifier enum.
1070 // ### Qt 7: consider deprecating in favor of KeyboardModifier.
1071 enum Modifier {
1072 META = Qt::MetaModifier,
1073 SHIFT = Qt::ShiftModifier,
1074 CTRL = Qt::ControlModifier,
1075 ALT = Qt::AltModifier,
1076 MODIFIER_MASK = KeyboardModifierMask,
1077 };
1078 Q_DECLARE_FLAGS(Modifiers, Modifier)
1079 Q_DECLARE_OPERATORS_FOR_FLAGS(Modifiers)
1080
1081 enum ArrowType {
1082 NoArrow,
1083 UpArrow,
1084 DownArrow,
1085 LeftArrow,
1086 RightArrow
1087 };
1088
1089 enum PenStyle { // pen style
1090 NoPen,
1091 SolidLine,
1092 DashLine,
1093 DotLine,
1094 DashDotLine,
1095 DashDotDotLine,
1096 CustomDashLine
1097#ifndef Q_MOC_RUN
1098 , MPenStyle = 0x0f
1099#endif
1100 };
1101
1102 enum PenCapStyle { // line endcap style
1103 FlatCap = 0x00,
1104 SquareCap = 0x10,
1105 RoundCap = 0x20,
1106 MPenCapStyle = 0x30
1107 };
1108
1109 enum PenJoinStyle { // line join style
1110 MiterJoin = 0x00,
1111 BevelJoin = 0x40,
1112 RoundJoin = 0x80,
1113 SvgMiterJoin = 0x100,
1114 MPenJoinStyle = 0x1c0
1115 };
1116
1117 enum BrushStyle { // brush style
1118 NoBrush,
1119 SolidPattern,
1120 Dense1Pattern,
1121 Dense2Pattern,
1122 Dense3Pattern,
1123 Dense4Pattern,
1124 Dense5Pattern,
1125 Dense6Pattern,
1126 Dense7Pattern,
1127 HorPattern,
1128 VerPattern,
1129 CrossPattern,
1130 BDiagPattern,
1131 FDiagPattern,
1132 DiagCrossPattern,
1133 LinearGradientPattern,
1134 RadialGradientPattern,
1135 ConicalGradientPattern,
1136 TexturePattern = 24
1137 };
1138
1139 enum SizeMode {
1140 AbsoluteSize,
1141 RelativeSize
1142 };
1143
1144 enum UIEffect {
1145 UI_General,
1146 UI_AnimateMenu,
1147 UI_FadeMenu,
1148 UI_AnimateCombo,
1149 UI_AnimateTooltip,
1150 UI_FadeTooltip,
1151 UI_AnimateToolBox
1152 };
1153
1154 enum CursorShape {
1155 ArrowCursor,
1156 UpArrowCursor,
1157 CrossCursor,
1158 WaitCursor,
1159 IBeamCursor,
1160 SizeVerCursor,
1161 SizeHorCursor,
1162 SizeBDiagCursor,
1163 SizeFDiagCursor,
1164 SizeAllCursor,
1165 BlankCursor,
1166 SplitVCursor,
1167 SplitHCursor,
1168 PointingHandCursor,
1169 ForbiddenCursor,
1170 WhatsThisCursor,
1171 BusyCursor,
1172 OpenHandCursor,
1173 ClosedHandCursor,
1174 DragCopyCursor,
1175 DragMoveCursor,
1176 DragLinkCursor,
1177 LastCursor = DragLinkCursor,
1178 BitmapCursor = 24,
1179 CustomCursor = 25
1180 };
1181
1182 enum TextFormat {
1183 PlainText,
1184 RichText,
1185 AutoText,
1186 MarkdownText
1187 };
1188
1189 enum AspectRatioMode {
1190 IgnoreAspectRatio,
1191 KeepAspectRatio,
1192 KeepAspectRatioByExpanding
1193 };
1194
1195 enum DockWidgetArea {
1196 LeftDockWidgetArea = 0x1,
1197 RightDockWidgetArea = 0x2,
1198 TopDockWidgetArea = 0x4,
1199 BottomDockWidgetArea = 0x8,
1200
1201 DockWidgetArea_Mask = 0xf,
1202 AllDockWidgetAreas = DockWidgetArea_Mask,
1203 NoDockWidgetArea = 0
1204 };
1205 enum DockWidgetAreaSizes {
1206 NDockWidgetAreas = 4
1207 };
1208
1209 Q_DECLARE_FLAGS(DockWidgetAreas, DockWidgetArea)
1210 Q_DECLARE_OPERATORS_FOR_FLAGS(DockWidgetAreas)
1211
1212 enum ToolBarArea {
1213 LeftToolBarArea = 0x1,
1214 RightToolBarArea = 0x2,
1215 TopToolBarArea = 0x4,
1216 BottomToolBarArea = 0x8,
1217
1218 ToolBarArea_Mask = 0xf,
1219 AllToolBarAreas = ToolBarArea_Mask,
1220 NoToolBarArea = 0
1221 };
1222
1223 enum ToolBarAreaSizes {
1224 NToolBarAreas = 4
1225 };
1226
1227 Q_DECLARE_FLAGS(ToolBarAreas, ToolBarArea)
1228 Q_DECLARE_OPERATORS_FOR_FLAGS(ToolBarAreas)
1229
1230 enum DateFormat {
1231 TextDate, // default Qt
1232 ISODate, // ISO 8601
1233 RFC2822Date = 8, // RFC 2822 (+ 850 and 1036 during parsing)
1234 ISODateWithMs
1235 };
1236
1237 enum TimeSpec {
1238 LocalTime,
1239 UTC,
1240 OffsetFromUTC,
1241 TimeZone
1242 };
1243
1244 enum DayOfWeek {
1245 Monday = 1,
1246 Tuesday = 2,
1247 Wednesday = 3,
1248 Thursday = 4,
1249 Friday = 5,
1250 Saturday = 6,
1251 Sunday = 7
1252 };
1253
1254 enum ScrollBarPolicy {
1255 ScrollBarAsNeeded,
1256 ScrollBarAlwaysOff,
1257 ScrollBarAlwaysOn
1258 };
1259
1260 enum CaseSensitivity {
1261 CaseInsensitive,
1262 CaseSensitive
1263 };
1264
1265 enum Corner {
1266 TopLeftCorner = 0x00000,
1267 TopRightCorner = 0x00001,
1268 BottomLeftCorner = 0x00002,
1269 BottomRightCorner = 0x00003
1270 };
1271
1272 enum Edge {
1273 TopEdge = 0x00001,
1274 LeftEdge = 0x00002,
1275 RightEdge = 0x00004,
1276 BottomEdge = 0x00008
1277 };
1278
1279 Q_DECLARE_FLAGS(Edges, Edge)
1280 Q_DECLARE_OPERATORS_FOR_FLAGS(Edges)
1281
1282 enum ConnectionType {
1283 AutoConnection,
1284 DirectConnection,
1285 QueuedConnection,
1286 BlockingQueuedConnection,
1287 UniqueConnection = 0x80,
1288 SingleShotConnection = 0x100,
1289 };
1290
1291 enum ShortcutContext {
1292 WidgetShortcut,
1293 WindowShortcut,
1294 ApplicationShortcut,
1295 WidgetWithChildrenShortcut
1296 };
1297
1298 enum FillRule {
1299 OddEvenFill,
1300 WindingFill
1301 };
1302
1303 enum MaskMode {
1304 MaskInColor,
1305 MaskOutColor
1306 };
1307
1308 enum ClipOperation {
1309 NoClip,
1310 ReplaceClip,
1311 IntersectClip
1312 };
1313
1314 // Shape = 0x1, BoundingRect = 0x2
1315 enum ItemSelectionMode {
1316 ContainsItemShape = 0x0,
1317 IntersectsItemShape = 0x1,
1318 ContainsItemBoundingRect = 0x2,
1319 IntersectsItemBoundingRect = 0x3
1320 };
1321
1322 enum ItemSelectionOperation {
1323 ReplaceSelection,
1324 AddToSelection
1325 };
1326
1327 enum TransformationMode {
1328 FastTransformation,
1329 SmoothTransformation
1330 };
1331
1332 enum Axis {
1333 XAxis,
1334 YAxis,
1335 ZAxis
1336 };
1337
1338 enum FocusReason {
1339 MouseFocusReason,
1340 TabFocusReason,
1341 BacktabFocusReason,
1342 ActiveWindowFocusReason,
1343 PopupFocusReason,
1344 ShortcutFocusReason,
1345 MenuBarFocusReason,
1346 OtherFocusReason,
1347 NoFocusReason
1348 };
1349
1350 enum ContextMenuPolicy {
1351 NoContextMenu,
1352 DefaultContextMenu,
1353 ActionsContextMenu,
1354 CustomContextMenu,
1355 PreventContextMenu
1356 };
1357
1358 enum InputMethodQuery {
1359 ImEnabled = 0x1,
1360 ImCursorRectangle = 0x2,
1361 ImFont = 0x4,
1362 ImCursorPosition = 0x8,
1363 ImSurroundingText = 0x10,
1364 ImCurrentSelection = 0x20,
1365 ImMaximumTextLength = 0x40,
1366 ImAnchorPosition = 0x80,
1367 ImHints = 0x100,
1368 ImPreferredLanguage = 0x200,
1369
1370 ImAbsolutePosition = 0x400,
1371 ImTextBeforeCursor = 0x800,
1372 ImTextAfterCursor = 0x1000,
1373 ImEnterKeyType = 0x2000,
1374 ImAnchorRectangle = 0x4000,
1375 ImInputItemClipRectangle = 0x8000,
1376
1377 ImReadOnly = 0x10000,
1378 ImPlatformData = 0x80000000,
1379 ImQueryInput = ImCursorRectangle | ImCursorPosition | ImSurroundingText |
1380 ImCurrentSelection | ImAnchorRectangle | ImAnchorPosition,
1381 ImQueryAll = 0xffffffff
1382 };
1383 Q_DECLARE_FLAGS(InputMethodQueries, InputMethodQuery)
1384 Q_DECLARE_OPERATORS_FOR_FLAGS(InputMethodQueries)
1385
1386 enum InputMethodHint {
1387 ImhNone = 0x0,
1388
1389 ImhHiddenText = 0x1,
1390 ImhSensitiveData = 0x2,
1391 ImhNoAutoUppercase = 0x4,
1392 ImhPreferNumbers = 0x8,
1393 ImhPreferUppercase = 0x10,
1394 ImhPreferLowercase = 0x20,
1395 ImhNoPredictiveText = 0x40,
1396
1397 ImhDate = 0x80,
1398 ImhTime = 0x100,
1399
1400 ImhPreferLatin = 0x200,
1401
1402 ImhMultiLine = 0x400,
1403
1404 ImhNoEditMenu = 0x800,
1405 ImhNoTextHandles = 0x1000,
1406
1407 ImhDigitsOnly = 0x10000,
1408 ImhFormattedNumbersOnly = 0x20000,
1409 ImhUppercaseOnly = 0x40000,
1410 ImhLowercaseOnly = 0x80000,
1411 ImhDialableCharactersOnly = 0x100000,
1412 ImhEmailCharactersOnly = 0x200000,
1413 ImhUrlCharactersOnly = 0x400000,
1414 ImhLatinOnly = 0x800000,
1415
1416 ImhExclusiveInputMask = 0xffff0000
1417 };
1418 Q_DECLARE_FLAGS(InputMethodHints, InputMethodHint)
1419 Q_DECLARE_OPERATORS_FOR_FLAGS(InputMethodHints)
1420
1421 enum EnterKeyType {
1422 EnterKeyDefault,
1423 EnterKeyReturn,
1424 EnterKeyDone,
1425 EnterKeyGo,
1426 EnterKeySend,
1427 EnterKeySearch,
1428 EnterKeyNext,
1429 EnterKeyPrevious
1430 };
1431
1432 enum ToolButtonStyle {
1433 ToolButtonIconOnly,
1434 ToolButtonTextOnly,
1435 ToolButtonTextBesideIcon,
1436 ToolButtonTextUnderIcon,
1437 ToolButtonFollowStyle
1438 };
1439
1440 enum LayoutDirection {
1441 LeftToRight,
1442 RightToLeft,
1443 // ### Qt 7: make auto the first one (with value 0)
1444 LayoutDirectionAuto
1445 };
1446
1447 enum AnchorPoint {
1448 AnchorLeft = 0,
1449 AnchorHorizontalCenter,
1450 AnchorRight,
1451 AnchorTop,
1452 AnchorVerticalCenter,
1453 AnchorBottom
1454 };
1455
1456 enum FindChildOption {
1457 FindDirectChildrenOnly = 0x0,
1458 FindChildrenRecursively = 0x1
1459 };
1460 Q_DECLARE_FLAGS(FindChildOptions, FindChildOption)
1461
1462 enum DropAction {
1463 CopyAction = 0x1,
1464 MoveAction = 0x2,
1465 LinkAction = 0x4,
1466 ActionMask = 0xff,
1467 TargetMoveAction = 0x8002,
1468 IgnoreAction = 0x0
1469 };
1470 Q_DECLARE_FLAGS(DropActions, DropAction)
1471 Q_DECLARE_OPERATORS_FOR_FLAGS(DropActions)
1472
1473 enum CheckState {
1474 Unchecked,
1475 PartiallyChecked,
1476 Checked
1477 };
1478
1479 enum ItemDataRole {
1480 DisplayRole = 0,
1481 DecorationRole = 1,
1482 EditRole = 2,
1483 ToolTipRole = 3,
1484 StatusTipRole = 4,
1485 WhatsThisRole = 5,
1486 // Metadata
1487 FontRole = 6,
1488 TextAlignmentRole = 7,
1489 BackgroundRole = 8,
1490 ForegroundRole = 9,
1491 CheckStateRole = 10,
1492 // Accessibility
1493 AccessibleTextRole = 11,
1494 AccessibleDescriptionRole = 12,
1495 // More general purpose
1496 SizeHintRole = 13,
1497 InitialSortOrderRole = 14,
1498 // Internal UiLib roles. Start worrying when public roles go that high.
1499 DisplayPropertyRole = 27,
1500 DecorationPropertyRole = 28,
1501 ToolTipPropertyRole = 29,
1502 StatusTipPropertyRole = 30,
1503 WhatsThisPropertyRole = 31,
1504 // Reserved
1505 UserRole = 0x0100
1506 };
1507
1508 enum ItemFlag {
1509 NoItemFlags = 0,
1510 ItemIsSelectable = 1,
1511 ItemIsEditable = 2,
1512 ItemIsDragEnabled = 4,
1513 ItemIsDropEnabled = 8,
1514 ItemIsUserCheckable = 16,
1515 ItemIsEnabled = 32,
1516 ItemIsAutoTristate = 64,
1517 ItemNeverHasChildren = 128,
1518 ItemIsUserTristate = 256
1519 };
1520 Q_DECLARE_FLAGS(ItemFlags, ItemFlag)
1521 Q_DECLARE_OPERATORS_FOR_FLAGS(ItemFlags)
1522
1523 enum MatchFlag {
1524 MatchExactly = 0,
1525 MatchContains = 1,
1526 MatchStartsWith = 2,
1527 MatchEndsWith = 3,
1528 MatchRegularExpression = 4,
1529 MatchWildcard = 5,
1530 MatchFixedString = 8,
1531 MatchTypeMask = 0x0F,
1532 MatchCaseSensitive = 16,
1533 MatchWrap = 32,
1534 MatchRecursive = 64
1535 };
1536 Q_DECLARE_FLAGS(MatchFlags, MatchFlag)
1537 Q_DECLARE_OPERATORS_FOR_FLAGS(MatchFlags)
1538
1539 typedef void * HANDLE;
1540
1541 enum WindowModality {
1542 NonModal,
1543 WindowModal,
1544 ApplicationModal
1545 };
1546
1547 enum TextInteractionFlag {
1548 NoTextInteraction = 0,
1549 TextSelectableByMouse = 1,
1550 TextSelectableByKeyboard = 2,
1551 LinksAccessibleByMouse = 4,
1552 LinksAccessibleByKeyboard = 8,
1553 TextEditable = 16,
1554
1555 TextEditorInteraction = TextSelectableByMouse | TextSelectableByKeyboard | TextEditable,
1556 TextBrowserInteraction = TextSelectableByMouse | LinksAccessibleByMouse | LinksAccessibleByKeyboard
1557 };
1558 Q_DECLARE_FLAGS(TextInteractionFlags, TextInteractionFlag)
1559 Q_DECLARE_OPERATORS_FOR_FLAGS(TextInteractionFlags)
1560
1561 enum EventPriority {
1562 HighEventPriority = 1,
1563 NormalEventPriority = 0,
1564 LowEventPriority = -1
1565 };
1566
1567 enum SizeHint {
1568 MinimumSize,
1569 PreferredSize,
1570 MaximumSize,
1571 MinimumDescent,
1572 NSizeHints
1573 };
1574
1575 enum WindowFrameSection {
1576 NoSection,
1577 LeftSection, // For resize
1578 TopLeftSection,
1579 TopSection,
1580 TopRightSection,
1581 RightSection,
1582 BottomRightSection,
1583 BottomSection,
1584 BottomLeftSection,
1585 TitleBarArea // For move
1586 };
1587
1588 enum class Initialization {
1589 Uninitialized
1590 };
1591 inline constexpr Initialization Uninitialized = Initialization::Uninitialized;
1592
1593 struct Disambiguated_t {
1594 explicit Disambiguated_t() = default;
1595 };
1596 inline constexpr Disambiguated_t Disambiguated{};
1597
1598 enum CoordinateSystem {
1599 DeviceCoordinates,
1600 LogicalCoordinates
1601 };
1602
1603 enum TouchPointState {
1604 TouchPointUnknownState = 0x00,
1605 TouchPointPressed = 0x01,
1606 TouchPointMoved = 0x02,
1607 TouchPointStationary = 0x04,
1608 TouchPointReleased = 0x08
1609 };
1610 Q_DECLARE_FLAGS(TouchPointStates, TouchPointState)
1611 Q_DECLARE_OPERATORS_FOR_FLAGS(TouchPointStates)
1612
1613#ifndef QT_NO_GESTURES
1614 enum GestureState
1615 {
1616 NoGesture,
1617 GestureStarted = 1,
1618 GestureUpdated = 2,
1619 GestureFinished = 3,
1620 GestureCanceled = 4
1621 };
1622
1623 enum GestureType
1624 {
1625 TapGesture = 1,
1626 TapAndHoldGesture = 2,
1627 PanGesture = 3,
1628 PinchGesture = 4,
1629 SwipeGesture = 5,
1630
1631 CustomGesture = 0x0100,
1632
1633 LastGestureType = ~0u
1634 };
1635
1636 enum GestureFlag
1637 {
1638 DontStartGestureOnChildren = 0x01,
1639 ReceivePartialGestures = 0x02,
1640 IgnoredGesturesPropagateToParent = 0x04
1641 };
1642 Q_DECLARE_FLAGS(GestureFlags, GestureFlag)
1643 Q_DECLARE_OPERATORS_FOR_FLAGS(GestureFlags)
1644
1645 enum NativeGestureType
1646 {
1647 BeginNativeGesture,
1648 EndNativeGesture,
1649 PanNativeGesture,
1650 ZoomNativeGesture,
1651 SmartZoomNativeGesture,
1652 RotateNativeGesture,
1653 SwipeNativeGesture
1654 };
1655
1656#endif // QT_NO_GESTURES
1657
1658 enum NavigationMode
1659 {
1660 NavigationModeNone,
1661 NavigationModeKeypadTabOrder,
1662 NavigationModeKeypadDirectional,
1663 NavigationModeCursorAuto,
1664 NavigationModeCursorForceVisible
1665 };
1666
1667 enum CursorMoveStyle {
1668 LogicalMoveStyle,
1669 VisualMoveStyle
1670 };
1671
1672 enum TimerType {
1673 PreciseTimer,
1674 CoarseTimer,
1675 VeryCoarseTimer
1676 };
1677
1678 enum ScrollPhase {
1679 NoScrollPhase = 0,
1680 ScrollBegin,
1681 ScrollUpdate,
1682 ScrollEnd,
1683 ScrollMomentum
1684 };
1685
1686 enum MouseEventSource {
1687 MouseEventNotSynthesized,
1688 MouseEventSynthesizedBySystem,
1689 MouseEventSynthesizedByQt,
1690 MouseEventSynthesizedByApplication
1691 };
1692
1693 enum MouseEventFlag {
1694 NoMouseEventFlag = 0x00,
1695 MouseEventCreatedDoubleClick = 0x01,
1696 MouseEventFlagMask = 0xFF
1697 };
1698 Q_DECLARE_FLAGS(MouseEventFlags, MouseEventFlag)
1699 Q_DECLARE_OPERATORS_FOR_FLAGS(MouseEventFlags)
1700
1701 enum ChecksumType {
1702 ChecksumIso3309,
1703 ChecksumItuV41
1704 };
1705
1706 enum class HighDpiScaleFactorRoundingPolicy {
1707 Unset,
1708 Round,
1709 Ceil,
1710 Floor,
1711 RoundPreferFloor,
1712 PassThrough
1713 };
1714
1715 enum class PermissionStatus {
1716 Undetermined,
1717 Granted,
1718 Denied,
1719 };
1720
1721 // QTBUG-48701
1722 enum ReturnByValueConstant { ReturnByValue }; // ### Qt 7: Remove me
1723
1724#ifndef Q_QDOC
1725 // NOTE: Generally, do not add Q_ENUM_NS if a corresponding Q_FLAG_NS exists.
1726 Q_ENUM_NS(ScrollBarPolicy)
1727 Q_ENUM_NS(FocusPolicy)
1728 Q_ENUM_NS(ContextMenuPolicy)
1729 Q_ENUM_NS(ArrowType)
1730 Q_ENUM_NS(ToolButtonStyle)
1731 Q_ENUM_NS(PenStyle)
1732 Q_ENUM_NS(PenCapStyle)
1733 Q_ENUM_NS(PenJoinStyle)
1734 Q_ENUM_NS(BrushStyle)
1735 Q_ENUM_NS(FillRule)
1736 Q_ENUM_NS(MaskMode)
1737 Q_ENUM_NS(BGMode)
1738 Q_ENUM_NS(ClipOperation)
1739 Q_ENUM_NS(SizeMode)
1740 Q_ENUM_NS(Axis)
1741 Q_ENUM_NS(Corner)
1742 Q_ENUM_NS(Edge)
1743 Q_ENUM_NS(LayoutDirection)
1744 Q_ENUM_NS(SizeHint)
1745 Q_ENUM_NS(Orientation)
1746 Q_ENUM_NS(DropAction)
1747 Q_FLAG_NS(Alignment)
1748 Q_ENUM_NS(TextFlag)
1749 Q_FLAG_NS(Orientations)
1750 Q_FLAG_NS(SplitBehavior)
1751 Q_FLAG_NS(DropActions)
1752 Q_FLAG_NS(Edges)
1753 Q_FLAG_NS(DockWidgetAreas)
1754 Q_FLAG_NS(ToolBarAreas)
1755 Q_ENUM_NS(DockWidgetArea)
1756 Q_ENUM_NS(ToolBarArea)
1757 Q_ENUM_NS(TextFormat)
1758 Q_ENUM_NS(TextElideMode)
1759 Q_ENUM_NS(DateFormat)
1760 Q_ENUM_NS(TimeSpec)
1761 Q_ENUM_NS(DayOfWeek)
1762 Q_ENUM_NS(CursorShape)
1763 Q_ENUM_NS(GlobalColor)
1764 Q_ENUM_NS(ColorScheme)
1765 Q_ENUM_NS(AspectRatioMode)
1766 Q_ENUM_NS(TransformationMode)
1767 Q_FLAG_NS(ImageConversionFlags)
1768 Q_ENUM_NS(Key)
1769 Q_ENUM_NS(ShortcutContext)
1770 Q_ENUM_NS(TextInteractionFlag)
1771 Q_FLAG_NS(TextInteractionFlags)
1772 Q_ENUM_NS(ItemSelectionMode)
1773 Q_ENUM_NS(ItemSelectionOperation)
1774 Q_FLAG_NS(ItemFlags)
1775 Q_ENUM_NS(CheckState)
1776 Q_ENUM_NS(ItemDataRole)
1777 Q_ENUM_NS(SortOrder)
1778 Q_ENUM_NS(CaseSensitivity)
1779 Q_FLAG_NS(MatchFlags)
1780 Q_ENUM_NS(Modifier)
1781 Q_FLAG_NS(Modifiers)
1782 Q_ENUM_NS(KeyboardModifier)
1783 Q_FLAG_NS(KeyboardModifiers)
1784 Q_FLAG_NS(MouseButtons)
1785 Q_ENUM_NS(WindowType)
1786 Q_ENUM_NS(WindowState)
1787 Q_ENUM_NS(WindowModality)
1788 Q_ENUM_NS(WidgetAttribute)
1789 Q_ENUM_NS(ApplicationAttribute)
1790 Q_FLAG_NS(WindowFlags)
1791 Q_FLAG_NS(WindowStates)
1792 Q_ENUM_NS(FocusReason)
1793 Q_ENUM_NS(InputMethodHint)
1794 Q_ENUM_NS(InputMethodQuery)
1795 Q_FLAG_NS(InputMethodHints)
1796 Q_ENUM_NS(EnterKeyType)
1797 Q_FLAG_NS(InputMethodQueries)
1798 Q_FLAG_NS(TouchPointStates)
1799 Q_ENUM_NS(ScreenOrientation)
1800 Q_FLAG_NS(ScreenOrientations)
1801 Q_ENUM_NS(ConnectionType)
1802 Q_ENUM_NS(ApplicationState)
1803#ifndef QT_NO_GESTURES
1804 Q_ENUM_NS(GestureState)
1805 Q_ENUM_NS(GestureType)
1806 Q_ENUM_NS(NativeGestureType)
1807#endif
1808 Q_ENUM_NS(CursorMoveStyle)
1809 Q_ENUM_NS(TimerType)
1810 Q_ENUM_NS(ScrollPhase)
1811 Q_ENUM_NS(MouseEventSource)
1812 Q_FLAG_NS(MouseEventFlags)
1813 Q_ENUM_NS(ChecksumType)
1814 Q_ENUM_NS(HighDpiScaleFactorRoundingPolicy)
1815 Q_ENUM_NS(TabFocusBehavior)
1816 Q_ENUM_NS(PermissionStatus)
1817#endif // Q_DOC
1818
1819}
1820
1821typedef bool (*qInternalCallback)(void **);
1822
1823class Q_CORE_EXPORT QInternal {
1824public:
1825 enum PaintDeviceFlags {
1826 UnknownDevice = 0x00,
1827 Widget = 0x01,
1828 Pixmap = 0x02,
1829 Image = 0x03,
1830 Printer = 0x04,
1831 Picture = 0x05,
1832 Pbuffer = 0x06, // GL pbuffer
1833 FramebufferObject = 0x07, // GL framebuffer object
1834 CustomRaster = 0x08,
1835 PaintBuffer = 0x0a,
1836 OpenGL = 0x0b
1837 };
1838 enum RelayoutType {
1839 RelayoutNormal,
1840 RelayoutDragging,
1841 RelayoutDropped
1842 };
1843
1844 enum DockPosition {
1845 LeftDock,
1846 RightDock,
1847 TopDock,
1848 BottomDock,
1849 DockCount
1850 };
1851
1852 enum Callback {
1853 EventNotifyCallback,
1854 LastCallback
1855 };
1856 static bool registerCallback(Callback, qInternalCallback);
1857 static bool unregisterCallback(Callback, qInternalCallback);
1858 static bool activateCallbacks(Callback, void **);
1859};
1860
1861class QKeyCombination
1862{
1863 int combination;
1864
1865public:
1866 constexpr Q_IMPLICIT QKeyCombination(Qt::Key key = Qt::Key_unknown) noexcept
1867 : combination(int(key))
1868 {}
1869
1870 constexpr explicit QKeyCombination(Qt::Modifiers modifiers, Qt::Key key = Qt::Key_unknown) noexcept
1871 : combination(modifiers.toInt() | int(key))
1872 {}
1873
1874 constexpr explicit QKeyCombination(Qt::KeyboardModifiers modifiers, Qt::Key key = Qt::Key_unknown) noexcept
1875 : combination(modifiers.toInt() | int(key))
1876 {}
1877
1878 constexpr Qt::KeyboardModifiers keyboardModifiers() const noexcept
1879 {
1880 return Qt::KeyboardModifiers(combination & Qt::KeyboardModifierMask);
1881 }
1882
1883 constexpr Qt::Key key() const noexcept
1884 {
1885 return Qt::Key(combination & ~int(Qt::KeyboardModifierMask));
1886 }
1887
1888 static constexpr QKeyCombination fromCombined(int combined)
1889 {
1890 QKeyCombination result;
1891 result.combination = combined;
1892 return result;
1893 }
1894
1895 constexpr int toCombined() const noexcept
1896 {
1897 return combination;
1898 }
1899
1900#if QT_DEPRECATED_SINCE(6, 0)
1901 QT_DEPRECATED_VERSION_X(6, 0, "Use QKeyCombination instead of int")
1902 constexpr Q_IMPLICIT operator int() const noexcept
1903 {
1904 return combination;
1905 }
1906#endif
1907
1908 friend constexpr bool operator==(QKeyCombination lhs, QKeyCombination rhs) noexcept
1909 {
1910 return lhs.combination == rhs.combination;
1911 }
1912
1913 friend constexpr bool operator!=(QKeyCombination lhs, QKeyCombination rhs) noexcept
1914 {
1915 return lhs.combination != rhs.combination;
1916 }
1917
1918 bool operator<(QKeyCombination) const = delete;
1919};
1920
1921Q_DECLARE_TYPEINFO(QKeyCombination, Q_RELOCATABLE_TYPE);
1922
1923constexpr QKeyCombination operator|(Qt::Modifier modifier, Qt::Key key) noexcept
1924{
1925 return QKeyCombination(modifier, key);
1926}
1927
1928constexpr QKeyCombination operator|(Qt::Modifiers modifiers, Qt::Key key) noexcept
1929{
1930 return QKeyCombination(modifiers, key);
1931}
1932
1933constexpr QKeyCombination operator|(Qt::KeyboardModifier modifier, Qt::Key key) noexcept
1934{
1935 return QKeyCombination(modifier, key);
1936}
1937
1938constexpr QKeyCombination operator|(Qt::KeyboardModifiers modifiers, Qt::Key key) noexcept
1939{
1940 return QKeyCombination(modifiers, key);
1941}
1942
1943constexpr QKeyCombination operator|(Qt::Key key, Qt::Modifier modifier) noexcept
1944{
1945 return QKeyCombination(modifier, key);
1946}
1947
1948constexpr QKeyCombination operator|(Qt::Key key, Qt::Modifiers modifiers) noexcept
1949{
1950 return QKeyCombination(modifiers, key);
1951}
1952
1953constexpr QKeyCombination operator|(Qt::Key key, Qt::KeyboardModifier modifier) noexcept
1954{
1955 return QKeyCombination(modifier, key);
1956}
1957
1958constexpr QKeyCombination operator|(Qt::Key key, Qt::KeyboardModifiers modifiers) noexcept
1959{
1960 return QKeyCombination(modifiers, key);
1961}
1962
1963#if QT_DEPRECATED_SINCE(6, 0)
1964QT_DEPRECATED_VERSION_X(6, 0, "Use operator| instead")
1965constexpr QKeyCombination operator+(Qt::Modifier modifier, Qt::Key key) noexcept
1966{
1967 return QKeyCombination(modifier, key);
1968}
1969
1970QT_DEPRECATED_VERSION_X(6, 0, "Use operator| instead")
1971constexpr QKeyCombination operator+(Qt::Modifiers modifiers, Qt::Key key) noexcept
1972{
1973 return QKeyCombination(modifiers, key);
1974}
1975
1976QT_DEPRECATED_VERSION_X(6, 0, "Use operator| instead")
1977constexpr QKeyCombination operator+(Qt::KeyboardModifier modifier, Qt::Key key) noexcept
1978{
1979 return QKeyCombination(modifier, key);
1980}
1981
1982QT_DEPRECATED_VERSION_X(6, 0, "Use operator| instead")
1983constexpr QKeyCombination operator+(Qt::KeyboardModifiers modifiers, Qt::Key key) noexcept
1984{
1985 return QKeyCombination(modifiers, key);
1986}
1987
1988QT_DEPRECATED_VERSION_X(6, 0, "Use operator| instead")
1989constexpr QKeyCombination operator+(Qt::Key key, Qt::Modifier modifier) noexcept
1990{
1991 return QKeyCombination(modifier, key);
1992}
1993
1994QT_DEPRECATED_VERSION_X(6, 0, "Use operator| instead")
1995constexpr QKeyCombination operator+(Qt::Key key, Qt::Modifiers modifiers) noexcept
1996{
1997 return QKeyCombination(modifiers, key);
1998}
1999
2000QT_DEPRECATED_VERSION_X(6, 0, "Use operator| instead")
2001constexpr QKeyCombination operator+(Qt::Key key, Qt::KeyboardModifier modifier) noexcept
2002{
2003 return QKeyCombination(modifier, key);
2004}
2005
2006QT_DEPRECATED_VERSION_X(6, 0, "Use operator| instead")
2007constexpr QKeyCombination operator+(Qt::Key key, Qt::KeyboardModifiers modifiers) noexcept
2008{
2009 return QKeyCombination(modifiers, key);
2010}
2011#endif
2012
2013QT_END_NAMESPACE
2014
2015#endif // QNAMESPACE_H
2016