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,
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_MSWindowsUseDirect3DByDefault = 1,
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_mu = 0x0b5,
606 Key_paragraph = 0x0b6,
607 Key_periodcentered = 0x0b7,
608 Key_cedilla = 0x0b8,
609 Key_onesuperior = 0x0b9,
610 Key_masculine = 0x0ba,
611 Key_guillemotright = 0x0bb, // right angle quotation mark
612 Key_onequarter = 0x0bc,
613 Key_onehalf = 0x0bd,
614 Key_threequarters = 0x0be,
615 Key_questiondown = 0x0bf,
616 Key_Agrave = 0x0c0,
617 Key_Aacute = 0x0c1,
618 Key_Acircumflex = 0x0c2,
619 Key_Atilde = 0x0c3,
620 Key_Adiaeresis = 0x0c4,
621 Key_Aring = 0x0c5,
622 Key_AE = 0x0c6,
623 Key_Ccedilla = 0x0c7,
624 Key_Egrave = 0x0c8,
625 Key_Eacute = 0x0c9,
626 Key_Ecircumflex = 0x0ca,
627 Key_Ediaeresis = 0x0cb,
628 Key_Igrave = 0x0cc,
629 Key_Iacute = 0x0cd,
630 Key_Icircumflex = 0x0ce,
631 Key_Idiaeresis = 0x0cf,
632 Key_ETH = 0x0d0,
633 Key_Ntilde = 0x0d1,
634 Key_Ograve = 0x0d2,
635 Key_Oacute = 0x0d3,
636 Key_Ocircumflex = 0x0d4,
637 Key_Otilde = 0x0d5,
638 Key_Odiaeresis = 0x0d6,
639 Key_multiply = 0x0d7,
640 Key_Ooblique = 0x0d8,
641 Key_Ugrave = 0x0d9,
642 Key_Uacute = 0x0da,
643 Key_Ucircumflex = 0x0db,
644 Key_Udiaeresis = 0x0dc,
645 Key_Yacute = 0x0dd,
646 Key_THORN = 0x0de,
647 Key_ssharp = 0x0df,
648 Key_division = 0x0f7,
649 Key_ydiaeresis = 0x0ff,
650
651 // The rest of the Unicode values are skipped here,
652 // so that we can represent them along with Qt::Keys
653 // in the same data type. The maximum Unicode value
654 // is 0x0010ffff, so we start our custom keys at
655 // 0x01000000 to not clash with the Unicode values,
656 // but still give plenty of room to grow.
657
658 Key_Escape = 0x01000000, // misc keys
659 Key_Tab = 0x01000001,
660 Key_Backtab = 0x01000002,
661 Key_Backspace = 0x01000003,
662 Key_Return = 0x01000004,
663 Key_Enter = 0x01000005,
664 Key_Insert = 0x01000006,
665 Key_Delete = 0x01000007,
666 Key_Pause = 0x01000008,
667 Key_Print = 0x01000009, // print screen
668 Key_SysReq = 0x0100000a,
669 Key_Clear = 0x0100000b,
670 Key_Home = 0x01000010, // cursor movement
671 Key_End = 0x01000011,
672 Key_Left = 0x01000012,
673 Key_Up = 0x01000013,
674 Key_Right = 0x01000014,
675 Key_Down = 0x01000015,
676 Key_PageUp = 0x01000016,
677 Key_PageDown = 0x01000017,
678 Key_Shift = 0x01000020, // modifiers
679 Key_Control = 0x01000021,
680 Key_Meta = 0x01000022,
681 Key_Alt = 0x01000023,
682 Key_CapsLock = 0x01000024,
683 Key_NumLock = 0x01000025,
684 Key_ScrollLock = 0x01000026,
685 Key_F1 = 0x01000030, // function keys
686 Key_F2 = 0x01000031,
687 Key_F3 = 0x01000032,
688 Key_F4 = 0x01000033,
689 Key_F5 = 0x01000034,
690 Key_F6 = 0x01000035,
691 Key_F7 = 0x01000036,
692 Key_F8 = 0x01000037,
693 Key_F9 = 0x01000038,
694 Key_F10 = 0x01000039,
695 Key_F11 = 0x0100003a,
696 Key_F12 = 0x0100003b,
697 Key_F13 = 0x0100003c,
698 Key_F14 = 0x0100003d,
699 Key_F15 = 0x0100003e,
700 Key_F16 = 0x0100003f,
701 Key_F17 = 0x01000040,
702 Key_F18 = 0x01000041,
703 Key_F19 = 0x01000042,
704 Key_F20 = 0x01000043,
705 Key_F21 = 0x01000044,
706 Key_F22 = 0x01000045,
707 Key_F23 = 0x01000046,
708 Key_F24 = 0x01000047,
709 Key_F25 = 0x01000048, // F25 .. F35 only on X11
710 Key_F26 = 0x01000049,
711 Key_F27 = 0x0100004a,
712 Key_F28 = 0x0100004b,
713 Key_F29 = 0x0100004c,
714 Key_F30 = 0x0100004d,
715 Key_F31 = 0x0100004e,
716 Key_F32 = 0x0100004f,
717 Key_F33 = 0x01000050,
718 Key_F34 = 0x01000051,
719 Key_F35 = 0x01000052,
720 Key_Super_L = 0x01000053, // extra keys
721 Key_Super_R = 0x01000054,
722 Key_Menu = 0x01000055,
723 Key_Hyper_L = 0x01000056,
724 Key_Hyper_R = 0x01000057,
725 Key_Help = 0x01000058,
726 Key_Direction_L = 0x01000059,
727 Key_Direction_R = 0x01000060,
728
729 // International input method support (X keycode - 0xEE00, the
730 // definition follows Qt/Embedded 2.3.7) Only interesting if
731 // you are writing your own input method
732
733 // International & multi-key character composition
734 Key_AltGr = 0x01001103,
735 Key_Multi_key = 0x01001120, // Multi-key character compose
736 Key_Codeinput = 0x01001137,
737 Key_SingleCandidate = 0x0100113c,
738 Key_MultipleCandidate = 0x0100113d,
739 Key_PreviousCandidate = 0x0100113e,
740
741 // Misc Functions
742 Key_Mode_switch = 0x0100117e, // Character set switch
743 //Key_script_switch = 0x0100117e, // Alias for mode_switch
744
745 // Japanese keyboard support
746 Key_Kanji = 0x01001121, // Kanji, Kanji convert
747 Key_Muhenkan = 0x01001122, // Cancel Conversion
748 //Key_Henkan_Mode = 0x01001123, // Start/Stop Conversion
749 Key_Henkan = 0x01001123, // Alias for Henkan_Mode
750 Key_Romaji = 0x01001124, // to Romaji
751 Key_Hiragana = 0x01001125, // to Hiragana
752 Key_Katakana = 0x01001126, // to Katakana
753 Key_Hiragana_Katakana = 0x01001127, // Hiragana/Katakana toggle
754 Key_Zenkaku = 0x01001128, // to Zenkaku
755 Key_Hankaku = 0x01001129, // to Hankaku
756 Key_Zenkaku_Hankaku = 0x0100112a, // Zenkaku/Hankaku toggle
757 Key_Touroku = 0x0100112b, // Add to Dictionary
758 Key_Massyo = 0x0100112c, // Delete from Dictionary
759 Key_Kana_Lock = 0x0100112d, // Kana Lock
760 Key_Kana_Shift = 0x0100112e, // Kana Shift
761 Key_Eisu_Shift = 0x0100112f, // Alphanumeric Shift
762 Key_Eisu_toggle = 0x01001130, // Alphanumeric toggle
763 //Key_Kanji_Bangou = 0x01001137, // Codeinput
764 //Key_Zen_Koho = 0x0100113d, // Multiple/All Candidate(s)
765 //Key_Mae_Koho = 0x0100113e, // Previous Candidate
766
767 // Korean keyboard support
768 //
769 // In fact, many Korean users need only 2 keys, Key_Hangul and
770 // Key_Hangul_Hanja. But rest of the keys are good for future.
771
772 Key_Hangul = 0x01001131, // Hangul start/stop(toggle)
773 Key_Hangul_Start = 0x01001132, // Hangul start
774 Key_Hangul_End = 0x01001133, // Hangul end, English start
775 Key_Hangul_Hanja = 0x01001134, // Start Hangul->Hanja Conversion
776 Key_Hangul_Jamo = 0x01001135, // Hangul Jamo mode
777 Key_Hangul_Romaja = 0x01001136, // Hangul Romaja mode
778 //Key_Hangul_Codeinput = 0x01001137, // Hangul code input mode
779 Key_Hangul_Jeonja = 0x01001138, // Jeonja mode
780 Key_Hangul_Banja = 0x01001139, // Banja mode
781 Key_Hangul_PreHanja = 0x0100113a, // Pre Hanja conversion
782 Key_Hangul_PostHanja = 0x0100113b, // Post Hanja conversion
783 //Key_Hangul_SingleCandidate = 0x0100113c, // Single candidate
784 //Key_Hangul_MultipleCandidate = 0x0100113d, // Multiple candidate
785 //Key_Hangul_PreviousCandidate = 0x0100113e, // Previous candidate
786 Key_Hangul_Special = 0x0100113f, // Special symbols
787 //Key_Hangul_switch = 0x0100117e, // Alias for mode_switch
788
789 // dead keys (X keycode - 0xED00 to avoid the conflict)
790 Key_Dead_Grave = 0x01001250,
791 Key_Dead_Acute = 0x01001251,
792 Key_Dead_Circumflex = 0x01001252,
793 Key_Dead_Tilde = 0x01001253,
794 Key_Dead_Macron = 0x01001254,
795 Key_Dead_Breve = 0x01001255,
796 Key_Dead_Abovedot = 0x01001256,
797 Key_Dead_Diaeresis = 0x01001257,
798 Key_Dead_Abovering = 0x01001258,
799 Key_Dead_Doubleacute = 0x01001259,
800 Key_Dead_Caron = 0x0100125a,
801 Key_Dead_Cedilla = 0x0100125b,
802 Key_Dead_Ogonek = 0x0100125c,
803 Key_Dead_Iota = 0x0100125d,
804 Key_Dead_Voiced_Sound = 0x0100125e,
805 Key_Dead_Semivoiced_Sound = 0x0100125f,
806 Key_Dead_Belowdot = 0x01001260,
807 Key_Dead_Hook = 0x01001261,
808 Key_Dead_Horn = 0x01001262,
809 Key_Dead_Stroke = 0x01001263,
810 Key_Dead_Abovecomma = 0x01001264,
811 Key_Dead_Abovereversedcomma = 0x01001265,
812 Key_Dead_Doublegrave = 0x01001266,
813 Key_Dead_Belowring = 0x01001267,
814 Key_Dead_Belowmacron = 0x01001268,
815 Key_Dead_Belowcircumflex = 0x01001269,
816 Key_Dead_Belowtilde = 0x0100126a,
817 Key_Dead_Belowbreve = 0x0100126b,
818 Key_Dead_Belowdiaeresis = 0x0100126c,
819 Key_Dead_Invertedbreve = 0x0100126d,
820 Key_Dead_Belowcomma = 0x0100126e,
821 Key_Dead_Currency = 0x0100126f,
822 Key_Dead_a = 0x01001280,
823 Key_Dead_A = 0x01001281,
824 Key_Dead_e = 0x01001282,
825 Key_Dead_E = 0x01001283,
826 Key_Dead_i = 0x01001284,
827 Key_Dead_I = 0x01001285,
828 Key_Dead_o = 0x01001286,
829 Key_Dead_O = 0x01001287,
830 Key_Dead_u = 0x01001288,
831 Key_Dead_U = 0x01001289,
832 Key_Dead_Small_Schwa = 0x0100128a,
833 Key_Dead_Capital_Schwa = 0x0100128b,
834 Key_Dead_Greek = 0x0100128c,
835 Key_Dead_Lowline = 0x01001290,
836 Key_Dead_Aboveverticalline = 0x01001291,
837 Key_Dead_Belowverticalline = 0x01001292,
838 Key_Dead_Longsolidusoverlay = 0x01001293,
839
840 // multimedia/internet keys - ignored by default - see QKeyEvent c'tor
841 Key_Back = 0x01000061,
842 Key_Forward = 0x01000062,
843 Key_Stop = 0x01000063,
844 Key_Refresh = 0x01000064,
845 Key_VolumeDown = 0x01000070,
846 Key_VolumeMute = 0x01000071,
847 Key_VolumeUp = 0x01000072,
848 Key_BassBoost = 0x01000073,
849 Key_BassUp = 0x01000074,
850 Key_BassDown = 0x01000075,
851 Key_TrebleUp = 0x01000076,
852 Key_TrebleDown = 0x01000077,
853 Key_MediaPlay = 0x01000080,
854 Key_MediaStop = 0x01000081,
855 Key_MediaPrevious = 0x01000082,
856 Key_MediaNext = 0x01000083,
857 Key_MediaRecord = 0x01000084,
858 Key_MediaPause = 0x01000085,
859 Key_MediaTogglePlayPause = 0x01000086,
860 Key_HomePage = 0x01000090,
861 Key_Favorites = 0x01000091,
862 Key_Search = 0x01000092,
863 Key_Standby = 0x01000093,
864 Key_OpenUrl = 0x01000094,
865 Key_LaunchMail = 0x010000a0,
866 Key_LaunchMedia = 0x010000a1,
867 Key_Launch0 = 0x010000a2,
868 Key_Launch1 = 0x010000a3,
869 Key_Launch2 = 0x010000a4,
870 Key_Launch3 = 0x010000a5,
871 Key_Launch4 = 0x010000a6,
872 Key_Launch5 = 0x010000a7,
873 Key_Launch6 = 0x010000a8,
874 Key_Launch7 = 0x010000a9,
875 Key_Launch8 = 0x010000aa,
876 Key_Launch9 = 0x010000ab,
877 Key_LaunchA = 0x010000ac,
878 Key_LaunchB = 0x010000ad,
879 Key_LaunchC = 0x010000ae,
880 Key_LaunchD = 0x010000af,
881 Key_LaunchE = 0x010000b0,
882 Key_LaunchF = 0x010000b1,
883 Key_MonBrightnessUp = 0x010000b2,
884 Key_MonBrightnessDown = 0x010000b3,
885 Key_KeyboardLightOnOff = 0x010000b4,
886 Key_KeyboardBrightnessUp = 0x010000b5,
887 Key_KeyboardBrightnessDown = 0x010000b6,
888 Key_PowerOff = 0x010000b7,
889 Key_WakeUp = 0x010000b8,
890 Key_Eject = 0x010000b9,
891 Key_ScreenSaver = 0x010000ba,
892 Key_WWW = 0x010000bb,
893 Key_Memo = 0x010000bc,
894 Key_LightBulb = 0x010000bd,
895 Key_Shop = 0x010000be,
896 Key_History = 0x010000bf,
897 Key_AddFavorite = 0x010000c0,
898 Key_HotLinks = 0x010000c1,
899 Key_BrightnessAdjust = 0x010000c2,
900 Key_Finance = 0x010000c3,
901 Key_Community = 0x010000c4,
902 Key_AudioRewind = 0x010000c5, // Media rewind
903 Key_BackForward = 0x010000c6,
904 Key_ApplicationLeft = 0x010000c7,
905 Key_ApplicationRight = 0x010000c8,
906 Key_Book = 0x010000c9,
907 Key_CD = 0x010000ca,
908 Key_Calculator = 0x010000cb,
909 Key_ToDoList = 0x010000cc,
910 Key_ClearGrab = 0x010000cd,
911 Key_Close = 0x010000ce,
912 Key_Copy = 0x010000cf,
913 Key_Cut = 0x010000d0,
914 Key_Display = 0x010000d1, // Output switch key
915 Key_DOS = 0x010000d2,
916 Key_Documents = 0x010000d3,
917 Key_Excel = 0x010000d4,
918 Key_Explorer = 0x010000d5,
919 Key_Game = 0x010000d6,
920 Key_Go = 0x010000d7,
921 Key_iTouch = 0x010000d8,
922 Key_LogOff = 0x010000d9,
923 Key_Market = 0x010000da,
924 Key_Meeting = 0x010000db,
925 Key_MenuKB = 0x010000dc,
926 Key_MenuPB = 0x010000dd,
927 Key_MySites = 0x010000de,
928 Key_News = 0x010000df,
929 Key_OfficeHome = 0x010000e0,
930 Key_Option = 0x010000e1,
931 Key_Paste = 0x010000e2,
932 Key_Phone = 0x010000e3,
933 Key_Calendar = 0x010000e4,
934 Key_Reply = 0x010000e5,
935 Key_Reload = 0x010000e6,
936 Key_RotateWindows = 0x010000e7,
937 Key_RotationPB = 0x010000e8,
938 Key_RotationKB = 0x010000e9,
939 Key_Save = 0x010000ea,
940 Key_Send = 0x010000eb,
941 Key_Spell = 0x010000ec,
942 Key_SplitScreen = 0x010000ed,
943 Key_Support = 0x010000ee,
944 Key_TaskPane = 0x010000ef,
945 Key_Terminal = 0x010000f0,
946 Key_Tools = 0x010000f1,
947 Key_Travel = 0x010000f2,
948 Key_Video = 0x010000f3,
949 Key_Word = 0x010000f4,
950 Key_Xfer = 0x010000f5,
951 Key_ZoomIn = 0x010000f6,
952 Key_ZoomOut = 0x010000f7,
953 Key_Away = 0x010000f8,
954 Key_Messenger = 0x010000f9,
955 Key_WebCam = 0x010000fa,
956 Key_MailForward = 0x010000fb,
957 Key_Pictures = 0x010000fc,
958 Key_Music = 0x010000fd,
959 Key_Battery = 0x010000fe,
960 Key_Bluetooth = 0x010000ff,
961 Key_WLAN = 0x01000100,
962 Key_UWB = 0x01000101,
963 Key_AudioForward = 0x01000102, // Media fast-forward
964 Key_AudioRepeat = 0x01000103, // Toggle repeat mode
965 Key_AudioRandomPlay = 0x01000104, // Toggle shuffle mode
966 Key_Subtitle = 0x01000105,
967 Key_AudioCycleTrack = 0x01000106,
968 Key_Time = 0x01000107,
969 Key_Hibernate = 0x01000108,
970 Key_View = 0x01000109,
971 Key_TopMenu = 0x0100010a,
972 Key_PowerDown = 0x0100010b,
973 Key_Suspend = 0x0100010c,
974 Key_ContrastAdjust = 0x0100010d,
975
976 // We can remove these two for Qt 7:
977 Key_LaunchG = 0x0100010e,
978 Key_LaunchH = 0x0100010f,
979
980 Key_TouchpadToggle = 0x01000110,
981 Key_TouchpadOn = 0x01000111,
982 Key_TouchpadOff = 0x01000112,
983
984 Key_MicMute = 0x01000113,
985
986 Key_Red = 0x01000114,
987 Key_Green = 0x01000115,
988 Key_Yellow = 0x01000116,
989 Key_Blue = 0x01000117,
990
991 Key_ChannelUp = 0x01000118,
992 Key_ChannelDown = 0x01000119,
993
994 Key_Guide = 0x0100011a,
995 Key_Info = 0x0100011b,
996 Key_Settings = 0x0100011c,
997
998 Key_MicVolumeUp = 0x0100011d,
999 Key_MicVolumeDown = 0x0100011e,
1000
1001 Key_New = 0x01000120,
1002 Key_Open = 0x01000121,
1003 Key_Find = 0x01000122,
1004 Key_Undo = 0x01000123,
1005 Key_Redo = 0x01000124,
1006
1007 Key_MediaLast = 0x0100ffff,
1008
1009 // Keypad navigation keys
1010 Key_Select = 0x01010000,
1011 Key_Yes = 0x01010001,
1012 Key_No = 0x01010002,
1013
1014 // Newer misc keys
1015 Key_Cancel = 0x01020001,
1016 Key_Printer = 0x01020002,
1017 Key_Execute = 0x01020003,
1018 Key_Sleep = 0x01020004,
1019 Key_Play = 0x01020005, // Not the same as Key_MediaPlay
1020 Key_Zoom = 0x01020006,
1021 //Key_Jisho = 0x01020007, // IME: Dictionary key
1022 //Key_Oyayubi_Left = 0x01020008, // IME: Left Oyayubi key
1023 //Key_Oyayubi_Right = 0x01020009, // IME: Right Oyayubi key
1024 Key_Exit = 0x0102000a,
1025
1026 // Device keys
1027 Key_Context1 = 0x01100000,
1028 Key_Context2 = 0x01100001,
1029 Key_Context3 = 0x01100002,
1030 Key_Context4 = 0x01100003,
1031 Key_Call = 0x01100004, // set absolute state to in a call (do not toggle state)
1032 Key_Hangup = 0x01100005, // set absolute state to hang up (do not toggle state)
1033 Key_Flip = 0x01100006,
1034 Key_ToggleCallHangup = 0x01100007, // a toggle key for answering, or hanging up, based on current call state
1035 Key_VoiceDial = 0x01100008,
1036 Key_LastNumberRedial = 0x01100009,
1037
1038 Key_Camera = 0x01100020,
1039 Key_CameraFocus = 0x01100021,
1040
1041 // WARNING: Do not add any keys in the range 0x01200000 to 0xffffffff,
1042 // as those bits are reserved for the Qt::KeyboardModifier enum below.
1043
1044 Key_unknown = 0x01ffffff
1045 };
1046
1047 enum KeyboardModifier {
1048 NoModifier = 0x00000000,
1049 ShiftModifier = 0x02000000,
1050 ControlModifier = 0x04000000,
1051 AltModifier = 0x08000000,
1052 MetaModifier = 0x10000000,
1053 KeypadModifier = 0x20000000,
1054 GroupSwitchModifier = 0x40000000,
1055 // Do not extend the mask to include 0x01000000
1056 KeyboardModifierMask = 0xfe000000
1057 };
1058 Q_DECLARE_FLAGS(KeyboardModifiers, KeyboardModifier)
1059 Q_DECLARE_OPERATORS_FOR_FLAGS(KeyboardModifiers)
1060
1061 //shorter names for shortcuts
1062 // The use of all-caps identifiers has the potential for clashing with
1063 // user-defined or third-party macros. More so when the identifiers are not
1064 // "namespace"-prefixed. This is considered bad practice and is why
1065 // KeypadModifier was not added to the Modifier enum.
1066 // ### Qt 7: consider deprecating in favor of KeyboardModifier.
1067 enum Modifier {
1068 META = Qt::MetaModifier,
1069 SHIFT = Qt::ShiftModifier,
1070 CTRL = Qt::ControlModifier,
1071 ALT = Qt::AltModifier,
1072 MODIFIER_MASK = KeyboardModifierMask,
1073 };
1074 Q_DECLARE_FLAGS(Modifiers, Modifier)
1075 Q_DECLARE_OPERATORS_FOR_FLAGS(Modifiers)
1076
1077 enum ArrowType {
1078 NoArrow,
1079 UpArrow,
1080 DownArrow,
1081 LeftArrow,
1082 RightArrow
1083 };
1084
1085 enum PenStyle { // pen style
1086 NoPen,
1087 SolidLine,
1088 DashLine,
1089 DotLine,
1090 DashDotLine,
1091 DashDotDotLine,
1092 CustomDashLine
1093#ifndef Q_MOC_RUN
1094 , MPenStyle = 0x0f
1095#endif
1096 };
1097
1098 enum PenCapStyle { // line endcap style
1099 FlatCap = 0x00,
1100 SquareCap = 0x10,
1101 RoundCap = 0x20,
1102 MPenCapStyle = 0x30
1103 };
1104
1105 enum PenJoinStyle { // line join style
1106 MiterJoin = 0x00,
1107 BevelJoin = 0x40,
1108 RoundJoin = 0x80,
1109 SvgMiterJoin = 0x100,
1110 MPenJoinStyle = 0x1c0
1111 };
1112
1113 enum BrushStyle { // brush style
1114 NoBrush,
1115 SolidPattern,
1116 Dense1Pattern,
1117 Dense2Pattern,
1118 Dense3Pattern,
1119 Dense4Pattern,
1120 Dense5Pattern,
1121 Dense6Pattern,
1122 Dense7Pattern,
1123 HorPattern,
1124 VerPattern,
1125 CrossPattern,
1126 BDiagPattern,
1127 FDiagPattern,
1128 DiagCrossPattern,
1129 LinearGradientPattern,
1130 RadialGradientPattern,
1131 ConicalGradientPattern,
1132 TexturePattern = 24
1133 };
1134
1135 enum SizeMode {
1136 AbsoluteSize,
1137 RelativeSize
1138 };
1139
1140 enum UIEffect {
1141 UI_General,
1142 UI_AnimateMenu,
1143 UI_FadeMenu,
1144 UI_AnimateCombo,
1145 UI_AnimateTooltip,
1146 UI_FadeTooltip,
1147 UI_AnimateToolBox
1148 };
1149
1150 enum CursorShape {
1151 ArrowCursor,
1152 UpArrowCursor,
1153 CrossCursor,
1154 WaitCursor,
1155 IBeamCursor,
1156 SizeVerCursor,
1157 SizeHorCursor,
1158 SizeBDiagCursor,
1159 SizeFDiagCursor,
1160 SizeAllCursor,
1161 BlankCursor,
1162 SplitVCursor,
1163 SplitHCursor,
1164 PointingHandCursor,
1165 ForbiddenCursor,
1166 WhatsThisCursor,
1167 BusyCursor,
1168 OpenHandCursor,
1169 ClosedHandCursor,
1170 DragCopyCursor,
1171 DragMoveCursor,
1172 DragLinkCursor,
1173 LastCursor = DragLinkCursor,
1174 BitmapCursor = 24,
1175 CustomCursor = 25
1176 };
1177
1178 enum TextFormat {
1179 PlainText,
1180 RichText,
1181 AutoText,
1182 MarkdownText
1183 };
1184
1185 enum AspectRatioMode {
1186 IgnoreAspectRatio,
1187 KeepAspectRatio,
1188 KeepAspectRatioByExpanding
1189 };
1190
1191 enum DockWidgetArea {
1192 LeftDockWidgetArea = 0x1,
1193 RightDockWidgetArea = 0x2,
1194 TopDockWidgetArea = 0x4,
1195 BottomDockWidgetArea = 0x8,
1196
1197 DockWidgetArea_Mask = 0xf,
1198 AllDockWidgetAreas = DockWidgetArea_Mask,
1199 NoDockWidgetArea = 0
1200 };
1201 enum DockWidgetAreaSizes {
1202 NDockWidgetAreas = 4
1203 };
1204
1205 Q_DECLARE_FLAGS(DockWidgetAreas, DockWidgetArea)
1206 Q_DECLARE_OPERATORS_FOR_FLAGS(DockWidgetAreas)
1207
1208 enum ToolBarArea {
1209 LeftToolBarArea = 0x1,
1210 RightToolBarArea = 0x2,
1211 TopToolBarArea = 0x4,
1212 BottomToolBarArea = 0x8,
1213
1214 ToolBarArea_Mask = 0xf,
1215 AllToolBarAreas = ToolBarArea_Mask,
1216 NoToolBarArea = 0
1217 };
1218
1219 enum ToolBarAreaSizes {
1220 NToolBarAreas = 4
1221 };
1222
1223 Q_DECLARE_FLAGS(ToolBarAreas, ToolBarArea)
1224 Q_DECLARE_OPERATORS_FOR_FLAGS(ToolBarAreas)
1225
1226 enum DateFormat {
1227 TextDate, // default Qt
1228 ISODate, // ISO 8601
1229 RFC2822Date = 8, // RFC 2822 (+ 850 and 1036 during parsing)
1230 ISODateWithMs
1231 };
1232
1233 enum TimeSpec {
1234 LocalTime,
1235 UTC,
1236 OffsetFromUTC,
1237 TimeZone
1238 };
1239
1240 enum DayOfWeek {
1241 Monday = 1,
1242 Tuesday = 2,
1243 Wednesday = 3,
1244 Thursday = 4,
1245 Friday = 5,
1246 Saturday = 6,
1247 Sunday = 7
1248 };
1249
1250 enum ScrollBarPolicy {
1251 ScrollBarAsNeeded,
1252 ScrollBarAlwaysOff,
1253 ScrollBarAlwaysOn
1254 };
1255
1256 enum CaseSensitivity {
1257 CaseInsensitive,
1258 CaseSensitive
1259 };
1260
1261 enum Corner {
1262 TopLeftCorner = 0x00000,
1263 TopRightCorner = 0x00001,
1264 BottomLeftCorner = 0x00002,
1265 BottomRightCorner = 0x00003
1266 };
1267
1268 enum Edge {
1269 TopEdge = 0x00001,
1270 LeftEdge = 0x00002,
1271 RightEdge = 0x00004,
1272 BottomEdge = 0x00008
1273 };
1274
1275 Q_DECLARE_FLAGS(Edges, Edge)
1276 Q_DECLARE_OPERATORS_FOR_FLAGS(Edges)
1277
1278 enum ConnectionType {
1279 AutoConnection,
1280 DirectConnection,
1281 QueuedConnection,
1282 BlockingQueuedConnection,
1283 UniqueConnection = 0x80,
1284 SingleShotConnection = 0x100,
1285 };
1286
1287 enum ShortcutContext {
1288 WidgetShortcut,
1289 WindowShortcut,
1290 ApplicationShortcut,
1291 WidgetWithChildrenShortcut
1292 };
1293
1294 enum FillRule {
1295 OddEvenFill,
1296 WindingFill
1297 };
1298
1299 enum MaskMode {
1300 MaskInColor,
1301 MaskOutColor
1302 };
1303
1304 enum ClipOperation {
1305 NoClip,
1306 ReplaceClip,
1307 IntersectClip
1308 };
1309
1310 // Shape = 0x1, BoundingRect = 0x2
1311 enum ItemSelectionMode {
1312 ContainsItemShape = 0x0,
1313 IntersectsItemShape = 0x1,
1314 ContainsItemBoundingRect = 0x2,
1315 IntersectsItemBoundingRect = 0x3
1316 };
1317
1318 enum ItemSelectionOperation {
1319 ReplaceSelection,
1320 AddToSelection
1321 };
1322
1323 enum TransformationMode {
1324 FastTransformation,
1325 SmoothTransformation
1326 };
1327
1328 enum Axis {
1329 XAxis,
1330 YAxis,
1331 ZAxis
1332 };
1333
1334 enum FocusReason {
1335 MouseFocusReason,
1336 TabFocusReason,
1337 BacktabFocusReason,
1338 ActiveWindowFocusReason,
1339 PopupFocusReason,
1340 ShortcutFocusReason,
1341 MenuBarFocusReason,
1342 OtherFocusReason,
1343 NoFocusReason
1344 };
1345
1346 enum ContextMenuPolicy {
1347 NoContextMenu,
1348 DefaultContextMenu,
1349 ActionsContextMenu,
1350 CustomContextMenu,
1351 PreventContextMenu
1352 };
1353
1354 enum InputMethodQuery {
1355 ImEnabled = 0x1,
1356 ImCursorRectangle = 0x2,
1357 ImFont = 0x4,
1358 ImCursorPosition = 0x8,
1359 ImSurroundingText = 0x10,
1360 ImCurrentSelection = 0x20,
1361 ImMaximumTextLength = 0x40,
1362 ImAnchorPosition = 0x80,
1363 ImHints = 0x100,
1364 ImPreferredLanguage = 0x200,
1365
1366 ImAbsolutePosition = 0x400,
1367 ImTextBeforeCursor = 0x800,
1368 ImTextAfterCursor = 0x1000,
1369 ImEnterKeyType = 0x2000,
1370 ImAnchorRectangle = 0x4000,
1371 ImInputItemClipRectangle = 0x8000,
1372
1373 ImReadOnly = 0x10000,
1374 ImPlatformData = 0x80000000,
1375 ImQueryInput = ImCursorRectangle | ImCursorPosition | ImSurroundingText |
1376 ImCurrentSelection | ImAnchorRectangle | ImAnchorPosition,
1377 ImQueryAll = 0xffffffff
1378 };
1379 Q_DECLARE_FLAGS(InputMethodQueries, InputMethodQuery)
1380 Q_DECLARE_OPERATORS_FOR_FLAGS(InputMethodQueries)
1381
1382 enum InputMethodHint {
1383 ImhNone = 0x0,
1384
1385 ImhHiddenText = 0x1,
1386 ImhSensitiveData = 0x2,
1387 ImhNoAutoUppercase = 0x4,
1388 ImhPreferNumbers = 0x8,
1389 ImhPreferUppercase = 0x10,
1390 ImhPreferLowercase = 0x20,
1391 ImhNoPredictiveText = 0x40,
1392
1393 ImhDate = 0x80,
1394 ImhTime = 0x100,
1395
1396 ImhPreferLatin = 0x200,
1397
1398 ImhMultiLine = 0x400,
1399
1400 ImhNoEditMenu = 0x800,
1401 ImhNoTextHandles = 0x1000,
1402
1403 ImhDigitsOnly = 0x10000,
1404 ImhFormattedNumbersOnly = 0x20000,
1405 ImhUppercaseOnly = 0x40000,
1406 ImhLowercaseOnly = 0x80000,
1407 ImhDialableCharactersOnly = 0x100000,
1408 ImhEmailCharactersOnly = 0x200000,
1409 ImhUrlCharactersOnly = 0x400000,
1410 ImhLatinOnly = 0x800000,
1411
1412 ImhExclusiveInputMask = 0xffff0000
1413 };
1414 Q_DECLARE_FLAGS(InputMethodHints, InputMethodHint)
1415 Q_DECLARE_OPERATORS_FOR_FLAGS(InputMethodHints)
1416
1417 enum EnterKeyType {
1418 EnterKeyDefault,
1419 EnterKeyReturn,
1420 EnterKeyDone,
1421 EnterKeyGo,
1422 EnterKeySend,
1423 EnterKeySearch,
1424 EnterKeyNext,
1425 EnterKeyPrevious
1426 };
1427
1428 enum ToolButtonStyle {
1429 ToolButtonIconOnly,
1430 ToolButtonTextOnly,
1431 ToolButtonTextBesideIcon,
1432 ToolButtonTextUnderIcon,
1433 ToolButtonFollowStyle
1434 };
1435
1436 enum LayoutDirection {
1437 LeftToRight,
1438 RightToLeft,
1439 // ### Qt 7: make auto the first one (with value 0)
1440 LayoutDirectionAuto
1441 };
1442
1443 enum AnchorPoint {
1444 AnchorLeft = 0,
1445 AnchorHorizontalCenter,
1446 AnchorRight,
1447 AnchorTop,
1448 AnchorVerticalCenter,
1449 AnchorBottom
1450 };
1451
1452 enum FindChildOption {
1453 FindDirectChildrenOnly = 0x0,
1454 FindChildrenRecursively = 0x1
1455 };
1456 Q_DECLARE_FLAGS(FindChildOptions, FindChildOption)
1457
1458 enum DropAction {
1459 CopyAction = 0x1,
1460 MoveAction = 0x2,
1461 LinkAction = 0x4,
1462 ActionMask = 0xff,
1463 TargetMoveAction = 0x8002,
1464 IgnoreAction = 0x0
1465 };
1466 Q_DECLARE_FLAGS(DropActions, DropAction)
1467 Q_DECLARE_OPERATORS_FOR_FLAGS(DropActions)
1468
1469 enum CheckState {
1470 Unchecked,
1471 PartiallyChecked,
1472 Checked
1473 };
1474
1475 enum ItemDataRole {
1476 DisplayRole = 0,
1477 DecorationRole = 1,
1478 EditRole = 2,
1479 ToolTipRole = 3,
1480 StatusTipRole = 4,
1481 WhatsThisRole = 5,
1482 // Metadata
1483 FontRole = 6,
1484 TextAlignmentRole = 7,
1485 BackgroundRole = 8,
1486 ForegroundRole = 9,
1487 CheckStateRole = 10,
1488 // Accessibility
1489 AccessibleTextRole = 11,
1490 AccessibleDescriptionRole = 12,
1491 // More general purpose
1492 SizeHintRole = 13,
1493 InitialSortOrderRole = 14,
1494 // Internal UiLib roles. Start worrying when public roles go that high.
1495 DisplayPropertyRole = 27,
1496 DecorationPropertyRole = 28,
1497 ToolTipPropertyRole = 29,
1498 StatusTipPropertyRole = 30,
1499 WhatsThisPropertyRole = 31,
1500 // Reserved
1501 UserRole = 0x0100
1502 };
1503
1504 enum ItemFlag {
1505 NoItemFlags = 0,
1506 ItemIsSelectable = 1,
1507 ItemIsEditable = 2,
1508 ItemIsDragEnabled = 4,
1509 ItemIsDropEnabled = 8,
1510 ItemIsUserCheckable = 16,
1511 ItemIsEnabled = 32,
1512 ItemIsAutoTristate = 64,
1513 ItemNeverHasChildren = 128,
1514 ItemIsUserTristate = 256
1515 };
1516 Q_DECLARE_FLAGS(ItemFlags, ItemFlag)
1517 Q_DECLARE_OPERATORS_FOR_FLAGS(ItemFlags)
1518
1519 enum MatchFlag {
1520 MatchExactly = 0,
1521 MatchContains = 1,
1522 MatchStartsWith = 2,
1523 MatchEndsWith = 3,
1524 MatchRegularExpression = 4,
1525 MatchWildcard = 5,
1526 MatchFixedString = 8,
1527 MatchTypeMask = 0x0F,
1528 MatchCaseSensitive = 16,
1529 MatchWrap = 32,
1530 MatchRecursive = 64
1531 };
1532 Q_DECLARE_FLAGS(MatchFlags, MatchFlag)
1533 Q_DECLARE_OPERATORS_FOR_FLAGS(MatchFlags)
1534
1535 typedef void * HANDLE;
1536
1537 enum WindowModality {
1538 NonModal,
1539 WindowModal,
1540 ApplicationModal
1541 };
1542
1543 enum TextInteractionFlag {
1544 NoTextInteraction = 0,
1545 TextSelectableByMouse = 1,
1546 TextSelectableByKeyboard = 2,
1547 LinksAccessibleByMouse = 4,
1548 LinksAccessibleByKeyboard = 8,
1549 TextEditable = 16,
1550
1551 TextEditorInteraction = TextSelectableByMouse | TextSelectableByKeyboard | TextEditable,
1552 TextBrowserInteraction = TextSelectableByMouse | LinksAccessibleByMouse | LinksAccessibleByKeyboard
1553 };
1554 Q_DECLARE_FLAGS(TextInteractionFlags, TextInteractionFlag)
1555 Q_DECLARE_OPERATORS_FOR_FLAGS(TextInteractionFlags)
1556
1557 enum EventPriority {
1558 HighEventPriority = 1,
1559 NormalEventPriority = 0,
1560 LowEventPriority = -1
1561 };
1562
1563 enum SizeHint {
1564 MinimumSize,
1565 PreferredSize,
1566 MaximumSize,
1567 MinimumDescent,
1568 NSizeHints
1569 };
1570
1571 enum WindowFrameSection {
1572 NoSection,
1573 LeftSection, // For resize
1574 TopLeftSection,
1575 TopSection,
1576 TopRightSection,
1577 RightSection,
1578 BottomRightSection,
1579 BottomSection,
1580 BottomLeftSection,
1581 TitleBarArea // For move
1582 };
1583
1584 enum class Initialization {
1585 Uninitialized
1586 };
1587 inline constexpr Initialization Uninitialized = Initialization::Uninitialized;
1588
1589 struct Disambiguated_t {
1590 explicit Disambiguated_t() = default;
1591 };
1592 inline constexpr Disambiguated_t Disambiguated{};
1593
1594 enum CoordinateSystem {
1595 DeviceCoordinates,
1596 LogicalCoordinates
1597 };
1598
1599 enum TouchPointState {
1600 TouchPointUnknownState = 0x00,
1601 TouchPointPressed = 0x01,
1602 TouchPointMoved = 0x02,
1603 TouchPointStationary = 0x04,
1604 TouchPointReleased = 0x08
1605 };
1606 Q_DECLARE_FLAGS(TouchPointStates, TouchPointState)
1607 Q_DECLARE_OPERATORS_FOR_FLAGS(TouchPointStates)
1608
1609#ifndef QT_NO_GESTURES
1610 enum GestureState
1611 {
1612 NoGesture,
1613 GestureStarted = 1,
1614 GestureUpdated = 2,
1615 GestureFinished = 3,
1616 GestureCanceled = 4
1617 };
1618
1619 enum GestureType
1620 {
1621 TapGesture = 1,
1622 TapAndHoldGesture = 2,
1623 PanGesture = 3,
1624 PinchGesture = 4,
1625 SwipeGesture = 5,
1626
1627 CustomGesture = 0x0100,
1628
1629 LastGestureType = ~0u
1630 };
1631
1632 enum GestureFlag
1633 {
1634 DontStartGestureOnChildren = 0x01,
1635 ReceivePartialGestures = 0x02,
1636 IgnoredGesturesPropagateToParent = 0x04
1637 };
1638 Q_DECLARE_FLAGS(GestureFlags, GestureFlag)
1639 Q_DECLARE_OPERATORS_FOR_FLAGS(GestureFlags)
1640
1641 enum NativeGestureType
1642 {
1643 BeginNativeGesture,
1644 EndNativeGesture,
1645 PanNativeGesture,
1646 ZoomNativeGesture,
1647 SmartZoomNativeGesture,
1648 RotateNativeGesture,
1649 SwipeNativeGesture
1650 };
1651
1652#endif // QT_NO_GESTURES
1653
1654 enum NavigationMode
1655 {
1656 NavigationModeNone,
1657 NavigationModeKeypadTabOrder,
1658 NavigationModeKeypadDirectional,
1659 NavigationModeCursorAuto,
1660 NavigationModeCursorForceVisible
1661 };
1662
1663 enum CursorMoveStyle {
1664 LogicalMoveStyle,
1665 VisualMoveStyle
1666 };
1667
1668 enum TimerType {
1669 PreciseTimer,
1670 CoarseTimer,
1671 VeryCoarseTimer
1672 };
1673
1674 enum ScrollPhase {
1675 NoScrollPhase = 0,
1676 ScrollBegin,
1677 ScrollUpdate,
1678 ScrollEnd,
1679 ScrollMomentum
1680 };
1681
1682 enum MouseEventSource {
1683 MouseEventNotSynthesized,
1684 MouseEventSynthesizedBySystem,
1685 MouseEventSynthesizedByQt,
1686 MouseEventSynthesizedByApplication
1687 };
1688
1689 enum MouseEventFlag {
1690 NoMouseEventFlag = 0x00,
1691 MouseEventCreatedDoubleClick = 0x01,
1692 MouseEventFlagMask = 0xFF
1693 };
1694 Q_DECLARE_FLAGS(MouseEventFlags, MouseEventFlag)
1695 Q_DECLARE_OPERATORS_FOR_FLAGS(MouseEventFlags)
1696
1697 enum ChecksumType {
1698 ChecksumIso3309,
1699 ChecksumItuV41
1700 };
1701
1702 enum class HighDpiScaleFactorRoundingPolicy {
1703 Unset,
1704 Round,
1705 Ceil,
1706 Floor,
1707 RoundPreferFloor,
1708 PassThrough
1709 };
1710
1711 enum class PermissionStatus {
1712 Undetermined,
1713 Granted,
1714 Denied,
1715 };
1716
1717 // QTBUG-48701
1718 enum ReturnByValueConstant { ReturnByValue }; // ### Qt 7: Remove me
1719
1720#ifndef Q_QDOC
1721 // NOTE: Generally, do not add Q_ENUM_NS if a corresponding Q_FLAG_NS exists.
1722 Q_ENUM_NS(ScrollBarPolicy)
1723 Q_ENUM_NS(FocusPolicy)
1724 Q_ENUM_NS(ContextMenuPolicy)
1725 Q_ENUM_NS(ArrowType)
1726 Q_ENUM_NS(ToolButtonStyle)
1727 Q_ENUM_NS(PenStyle)
1728 Q_ENUM_NS(PenCapStyle)
1729 Q_ENUM_NS(PenJoinStyle)
1730 Q_ENUM_NS(BrushStyle)
1731 Q_ENUM_NS(FillRule)
1732 Q_ENUM_NS(MaskMode)
1733 Q_ENUM_NS(BGMode)
1734 Q_ENUM_NS(ClipOperation)
1735 Q_ENUM_NS(SizeMode)
1736 Q_ENUM_NS(Axis)
1737 Q_ENUM_NS(Corner)
1738 Q_ENUM_NS(Edge)
1739 Q_ENUM_NS(LayoutDirection)
1740 Q_ENUM_NS(SizeHint)
1741 Q_ENUM_NS(Orientation)
1742 Q_ENUM_NS(DropAction)
1743 Q_FLAG_NS(Alignment)
1744 Q_ENUM_NS(TextFlag)
1745 Q_FLAG_NS(Orientations)
1746 Q_FLAG_NS(SplitBehavior)
1747 Q_FLAG_NS(DropActions)
1748 Q_FLAG_NS(Edges)
1749 Q_FLAG_NS(DockWidgetAreas)
1750 Q_FLAG_NS(ToolBarAreas)
1751 Q_ENUM_NS(DockWidgetArea)
1752 Q_ENUM_NS(ToolBarArea)
1753 Q_ENUM_NS(TextFormat)
1754 Q_ENUM_NS(TextElideMode)
1755 Q_ENUM_NS(DateFormat)
1756 Q_ENUM_NS(TimeSpec)
1757 Q_ENUM_NS(DayOfWeek)
1758 Q_ENUM_NS(CursorShape)
1759 Q_ENUM_NS(GlobalColor)
1760 Q_ENUM_NS(ColorScheme)
1761 Q_ENUM_NS(AspectRatioMode)
1762 Q_ENUM_NS(TransformationMode)
1763 Q_FLAG_NS(ImageConversionFlags)
1764 Q_ENUM_NS(Key)
1765 Q_ENUM_NS(ShortcutContext)
1766 Q_ENUM_NS(TextInteractionFlag)
1767 Q_FLAG_NS(TextInteractionFlags)
1768 Q_ENUM_NS(ItemSelectionMode)
1769 Q_ENUM_NS(ItemSelectionOperation)
1770 Q_FLAG_NS(ItemFlags)
1771 Q_ENUM_NS(CheckState)
1772 Q_ENUM_NS(ItemDataRole)
1773 Q_ENUM_NS(SortOrder)
1774 Q_ENUM_NS(CaseSensitivity)
1775 Q_FLAG_NS(MatchFlags)
1776 Q_ENUM_NS(Modifier)
1777 Q_FLAG_NS(Modifiers)
1778 Q_ENUM_NS(KeyboardModifier)
1779 Q_FLAG_NS(KeyboardModifiers)
1780 Q_FLAG_NS(MouseButtons)
1781 Q_ENUM_NS(WindowType)
1782 Q_ENUM_NS(WindowState)
1783 Q_ENUM_NS(WindowModality)
1784 Q_ENUM_NS(WidgetAttribute)
1785 Q_ENUM_NS(ApplicationAttribute)
1786 Q_FLAG_NS(WindowFlags)
1787 Q_FLAG_NS(WindowStates)
1788 Q_ENUM_NS(FocusReason)
1789 Q_ENUM_NS(InputMethodHint)
1790 Q_ENUM_NS(InputMethodQuery)
1791 Q_FLAG_NS(InputMethodHints)
1792 Q_ENUM_NS(EnterKeyType)
1793 Q_FLAG_NS(InputMethodQueries)
1794 Q_FLAG_NS(TouchPointStates)
1795 Q_ENUM_NS(ScreenOrientation)
1796 Q_FLAG_NS(ScreenOrientations)
1797 Q_ENUM_NS(ConnectionType)
1798 Q_ENUM_NS(ApplicationState)
1799#ifndef QT_NO_GESTURES
1800 Q_ENUM_NS(GestureState)
1801 Q_ENUM_NS(GestureType)
1802 Q_ENUM_NS(NativeGestureType)
1803#endif
1804 Q_ENUM_NS(CursorMoveStyle)
1805 Q_ENUM_NS(TimerType)
1806 Q_ENUM_NS(ScrollPhase)
1807 Q_ENUM_NS(MouseEventSource)
1808 Q_FLAG_NS(MouseEventFlags)
1809 Q_ENUM_NS(ChecksumType)
1810 Q_ENUM_NS(HighDpiScaleFactorRoundingPolicy)
1811 Q_ENUM_NS(TabFocusBehavior)
1812 Q_ENUM_NS(PermissionStatus)
1813#endif // Q_DOC
1814
1815}
1816
1817typedef bool (*qInternalCallback)(void **);
1818
1819class Q_CORE_EXPORT QInternal {
1820public:
1821 enum PaintDeviceFlags {
1822 UnknownDevice = 0x00,
1823 Widget = 0x01,
1824 Pixmap = 0x02,
1825 Image = 0x03,
1826 Printer = 0x04,
1827 Picture = 0x05,
1828 Pbuffer = 0x06, // GL pbuffer
1829 FramebufferObject = 0x07, // GL framebuffer object
1830 CustomRaster = 0x08,
1831 PaintBuffer = 0x0a,
1832 OpenGL = 0x0b
1833 };
1834 enum RelayoutType {
1835 RelayoutNormal,
1836 RelayoutDragging,
1837 RelayoutDropped
1838 };
1839
1840 enum DockPosition {
1841 LeftDock,
1842 RightDock,
1843 TopDock,
1844 BottomDock,
1845 DockCount
1846 };
1847
1848 enum Callback {
1849 EventNotifyCallback,
1850 LastCallback
1851 };
1852 static bool registerCallback(Callback, qInternalCallback);
1853 static bool unregisterCallback(Callback, qInternalCallback);
1854 static bool activateCallbacks(Callback, void **);
1855};
1856
1857class QKeyCombination
1858{
1859 int combination;
1860
1861public:
1862 constexpr Q_IMPLICIT QKeyCombination(Qt::Key key = Qt::Key_unknown) noexcept
1863 : combination(int(key))
1864 {}
1865
1866 constexpr explicit QKeyCombination(Qt::Modifiers modifiers, Qt::Key key = Qt::Key_unknown) noexcept
1867 : combination(modifiers.toInt() | int(key))
1868 {}
1869
1870 constexpr explicit QKeyCombination(Qt::KeyboardModifiers modifiers, Qt::Key key = Qt::Key_unknown) noexcept
1871 : combination(modifiers.toInt() | int(key))
1872 {}
1873
1874 constexpr Qt::KeyboardModifiers keyboardModifiers() const noexcept
1875 {
1876 return Qt::KeyboardModifiers(combination & Qt::KeyboardModifierMask);
1877 }
1878
1879 constexpr Qt::Key key() const noexcept
1880 {
1881 return Qt::Key(combination & ~int(Qt::KeyboardModifierMask));
1882 }
1883
1884 static constexpr QKeyCombination fromCombined(int combined)
1885 {
1886 QKeyCombination result;
1887 result.combination = combined;
1888 return result;
1889 }
1890
1891 constexpr int toCombined() const noexcept
1892 {
1893 return combination;
1894 }
1895
1896#if QT_DEPRECATED_SINCE(6, 0)
1897 QT_DEPRECATED_VERSION_X(6, 0, "Use QKeyCombination instead of int")
1898 constexpr Q_IMPLICIT operator int() const noexcept
1899 {
1900 return combination;
1901 }
1902#endif
1903
1904 friend constexpr bool operator==(QKeyCombination lhs, QKeyCombination rhs) noexcept
1905 {
1906 return lhs.combination == rhs.combination;
1907 }
1908
1909 friend constexpr bool operator!=(QKeyCombination lhs, QKeyCombination rhs) noexcept
1910 {
1911 return lhs.combination != rhs.combination;
1912 }
1913
1914 bool operator<(QKeyCombination) const = delete;
1915};
1916
1917Q_DECLARE_TYPEINFO(QKeyCombination, Q_RELOCATABLE_TYPE);
1918
1919constexpr QKeyCombination operator|(Qt::Modifier modifier, Qt::Key key) noexcept
1920{
1921 return QKeyCombination(modifier, key);
1922}
1923
1924constexpr QKeyCombination operator|(Qt::Modifiers modifiers, Qt::Key key) noexcept
1925{
1926 return QKeyCombination(modifiers, key);
1927}
1928
1929constexpr QKeyCombination operator|(Qt::KeyboardModifier modifier, Qt::Key key) noexcept
1930{
1931 return QKeyCombination(modifier, key);
1932}
1933
1934constexpr QKeyCombination operator|(Qt::KeyboardModifiers modifiers, Qt::Key key) noexcept
1935{
1936 return QKeyCombination(modifiers, key);
1937}
1938
1939constexpr QKeyCombination operator|(Qt::Key key, Qt::Modifier modifier) noexcept
1940{
1941 return QKeyCombination(modifier, key);
1942}
1943
1944constexpr QKeyCombination operator|(Qt::Key key, Qt::Modifiers modifiers) noexcept
1945{
1946 return QKeyCombination(modifiers, key);
1947}
1948
1949constexpr QKeyCombination operator|(Qt::Key key, Qt::KeyboardModifier modifier) noexcept
1950{
1951 return QKeyCombination(modifier, key);
1952}
1953
1954constexpr QKeyCombination operator|(Qt::Key key, Qt::KeyboardModifiers modifiers) noexcept
1955{
1956 return QKeyCombination(modifiers, key);
1957}
1958
1959#if QT_DEPRECATED_SINCE(6, 0)
1960QT_DEPRECATED_VERSION_X(6, 0, "Use operator| instead")
1961constexpr QKeyCombination operator+(Qt::Modifier modifier, Qt::Key key) noexcept
1962{
1963 return QKeyCombination(modifier, key);
1964}
1965
1966QT_DEPRECATED_VERSION_X(6, 0, "Use operator| instead")
1967constexpr QKeyCombination operator+(Qt::Modifiers modifiers, Qt::Key key) noexcept
1968{
1969 return QKeyCombination(modifiers, key);
1970}
1971
1972QT_DEPRECATED_VERSION_X(6, 0, "Use operator| instead")
1973constexpr QKeyCombination operator+(Qt::KeyboardModifier modifier, Qt::Key key) noexcept
1974{
1975 return QKeyCombination(modifier, key);
1976}
1977
1978QT_DEPRECATED_VERSION_X(6, 0, "Use operator| instead")
1979constexpr QKeyCombination operator+(Qt::KeyboardModifiers modifiers, Qt::Key key) noexcept
1980{
1981 return QKeyCombination(modifiers, key);
1982}
1983
1984QT_DEPRECATED_VERSION_X(6, 0, "Use operator| instead")
1985constexpr QKeyCombination operator+(Qt::Key key, Qt::Modifier modifier) noexcept
1986{
1987 return QKeyCombination(modifier, key);
1988}
1989
1990QT_DEPRECATED_VERSION_X(6, 0, "Use operator| instead")
1991constexpr QKeyCombination operator+(Qt::Key key, Qt::Modifiers modifiers) noexcept
1992{
1993 return QKeyCombination(modifiers, key);
1994}
1995
1996QT_DEPRECATED_VERSION_X(6, 0, "Use operator| instead")
1997constexpr QKeyCombination operator+(Qt::Key key, Qt::KeyboardModifier modifier) noexcept
1998{
1999 return QKeyCombination(modifier, key);
2000}
2001
2002QT_DEPRECATED_VERSION_X(6, 0, "Use operator| instead")
2003constexpr QKeyCombination operator+(Qt::Key key, Qt::KeyboardModifiers modifiers) noexcept
2004{
2005 return QKeyCombination(modifiers, key);
2006}
2007#endif
2008
2009QT_END_NAMESPACE
2010
2011#endif // QNAMESPACE_H
2012

source code of qtbase/src/corelib/global/qnamespace.h