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

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