Qt Namespace

The Qt namespace contains miscellaneous identifiers used throughout the Qt library. More...

Header: #include <Qt>
CMake: find_package(Qt6 COMPONENTS Core REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core

Types

flags Alignment
enum AlignmentFlag { AlignLeft, AlignRight, AlignHCenter, AlignJustify, AlignTop, …, AlignVertical_Mask }
enum AnchorPoint { AnchorLeft, AnchorHorizontalCenter, AnchorRight, AnchorTop, AnchorVerticalCenter, AnchorBottom }
enum ApplicationAttribute { AA_DontShowIconsInMenus, AA_DontShowShortcutsInContextMenus, AA_NativeWindows, AA_DontCreateNativeWidgetSiblings, AA_PluginApplication, …, AA_DisableNativeVirtualKeyboard }
enum ApplicationState { ApplicationSuspended, ApplicationHidden, ApplicationInactive, ApplicationActive }
flags ApplicationStates
enum ArrowType { NoArrow, UpArrow, DownArrow, LeftArrow, RightArrow }
enum AspectRatioMode { IgnoreAspectRatio, KeepAspectRatio, KeepAspectRatioByExpanding }
enum Axis { XAxis, YAxis, ZAxis }
enum BGMode { TransparentMode, OpaqueMode }
enum BrushStyle { NoBrush, SolidPattern, Dense1Pattern, Dense2Pattern, Dense3Pattern, …, TexturePattern }
enum CaseSensitivity { CaseInsensitive, CaseSensitive }
enum CheckState { Unchecked, PartiallyChecked, Checked }
enum ChecksumType { ChecksumIso3309, ChecksumItuV41 }
enum ClipOperation { NoClip, ReplaceClip, IntersectClip }
enum ConnectionType { AutoConnection, DirectConnection, QueuedConnection, BlockingQueuedConnection, UniqueConnection, SingleShotConnection }
enum ContextMenuPolicy { NoContextMenu, PreventContextMenu, DefaultContextMenu, ActionsContextMenu, CustomContextMenu }
enum CoordinateSystem { DeviceCoordinates, LogicalCoordinates }
enum Corner { TopLeftCorner, TopRightCorner, BottomLeftCorner, BottomRightCorner }
enum CursorMoveStyle { LogicalMoveStyle, VisualMoveStyle }
enum CursorShape { ArrowCursor, UpArrowCursor, CrossCursor, WaitCursor, IBeamCursor, …, BitmapCursor }
enum DateFormat { TextDate, ISODateWithMs, ISODate, RFC2822Date }
enum DayOfWeek { Monday, Tuesday, Wednesday, Thursday, Friday, …, Sunday }
enum DockWidgetArea { LeftDockWidgetArea, RightDockWidgetArea, TopDockWidgetArea, BottomDockWidgetArea, AllDockWidgetAreas, NoDockWidgetArea }
flags DockWidgetAreas
enum DropAction { CopyAction, MoveAction, LinkAction, ActionMask, IgnoreAction, TargetMoveAction }
flags DropActions
enum Edge { TopEdge, LeftEdge, RightEdge, BottomEdge }
flags Edges
enum EnterKeyType { EnterKeyDefault, EnterKeyReturn, EnterKeyDone, EnterKeyGo, EnterKeySend, …, EnterKeyPrevious }
enum EventPriority { HighEventPriority, NormalEventPriority, LowEventPriority }
enum FillRule { OddEvenFill, WindingFill }
enum FindChildOption { FindDirectChildrenOnly, FindChildrenRecursively }
flags FindChildOptions
enum FocusPolicy { TabFocus, ClickFocus, StrongFocus, WheelFocus, NoFocus }
enum FocusReason { MouseFocusReason, TabFocusReason, BacktabFocusReason, ActiveWindowFocusReason, PopupFocusReason, …, OtherFocusReason }
enum GestureFlag { DontStartGestureOnChildren, ReceivePartialGestures, IgnoredGesturesPropagateToParent }
flags GestureFlags
enum GestureState { NoGesture, GestureStarted, GestureUpdated, GestureFinished, GestureCanceled }
enum GestureType { TapGesture, TapAndHoldGesture, PanGesture, PinchGesture, SwipeGesture, CustomGesture }
enum GlobalColor { white, black, red, darkRed, green, …, color1 }
HANDLE
enum class HighDpiScaleFactorRoundingPolicy { Round, Ceil, Floor, RoundPreferFloor, PassThrough }
enum HitTestAccuracy { ExactHit, FuzzyHit }
enum ImageConversionFlag { AutoColor, ColorOnly, MonoOnly, DiffuseDither, OrderedDither, …, NoFormatConversion }
flags ImageConversionFlags
enum InputMethodHint { ImhNone, ImhHiddenText, ImhSensitiveData, ImhNoAutoUppercase, ImhPreferNumbers, …, ImhExclusiveInputMask }
flags InputMethodHints
flags InputMethodQueries
enum InputMethodQuery { ImEnabled, ImCursorRectangle, ImFont, ImCursorPosition, ImSurroundingText, …, ImQueryAll }
enum ItemDataRole { DisplayRole, DecorationRole, EditRole, ToolTipRole, StatusTipRole, …, UserRole }
enum ItemFlag { NoItemFlags, ItemIsSelectable, ItemIsEditable, ItemIsDragEnabled, ItemIsDropEnabled, …, ItemIsUserTristate }
flags ItemFlags
enum ItemSelectionMode { ContainsItemShape, IntersectsItemShape, ContainsItemBoundingRect, IntersectsItemBoundingRect }
enum ItemSelectionOperation { ReplaceSelection, AddToSelection }
enum Key { Key_Escape, Key_Tab, Key_Backtab, Key_Backspace, Key_Return, …, Key_Cancel }
enum KeyboardModifier { NoModifier, ShiftModifier, ControlModifier, AltModifier, MetaModifier, …, GroupSwitchModifier }
flags KeyboardModifiers
enum LayoutDirection { LeftToRight, RightToLeft, LayoutDirectionAuto }
enum MaskMode { MaskInColor, MaskOutColor }
enum MatchFlag { MatchExactly, MatchFixedString, MatchContains, MatchStartsWith, MatchEndsWith, …, MatchRecursive }
flags MatchFlags
enum Modifier { SHIFT, META, CTRL, ALT }
flags Modifiers
enum MouseButton { NoButton, AllButtons, LeftButton, RightButton, MiddleButton, …, ExtraButton24 }
flags MouseButtons
enum MouseEventFlag { MouseEventCreatedDoubleClick }
flags MouseEventFlags
enum MouseEventSource { MouseEventNotSynthesized, MouseEventSynthesizedBySystem, MouseEventSynthesizedByQt, MouseEventSynthesizedByApplication }
enum NativeGestureType { BeginNativeGesture, EndNativeGesture, PanNativeGesture, ZoomNativeGesture, SmartZoomNativeGesture, …, SwipeNativeGesture }
enum NavigationMode { NavigationModeNone, NavigationModeKeypadTabOrder, NavigationModeKeypadDirectional, NavigationModeCursorAuto, NavigationModeCursorForceVisible }
enum Orientation { Horizontal, Vertical }
flags Orientations
enum PenCapStyle { FlatCap, SquareCap, RoundCap }
enum PenJoinStyle { MiterJoin, BevelJoin, RoundJoin, SvgMiterJoin }
enum PenStyle { NoPen, SolidLine, DashLine, DotLine, DashDotLine, …, CustomDashLine }
enum ReturnByValueConstant { }
enum ScreenOrientation { PrimaryOrientation, LandscapeOrientation, PortraitOrientation, InvertedLandscapeOrientation, InvertedPortraitOrientation }
flags ScreenOrientations
enum ScrollBarPolicy { ScrollBarAsNeeded, ScrollBarAlwaysOff, ScrollBarAlwaysOn }
enum ScrollPhase { NoScrollPhase, ScrollBegin, ScrollUpdate, ScrollEnd, ScrollMomentum }
enum ShortcutContext { WidgetShortcut, WidgetWithChildrenShortcut, WindowShortcut, ApplicationShortcut }
enum SizeHint { MinimumSize, PreferredSize, MaximumSize, MinimumDescent }
enum SizeMode { AbsoluteSize, RelativeSize }
enum SortOrder { AscendingOrder, DescendingOrder }
flags SplitBehavior
enum SplitBehaviorFlags { KeepEmptyParts, SkipEmptyParts }
enum TabFocusBehavior { NoTabFocus, TabFocusTextControls, TabFocusListControls, TabFocusAllControls }
enum TextElideMode { ElideLeft, ElideRight, ElideMiddle, ElideNone }
enum TextFlag { TextSingleLine, TextDontClip, TextExpandTabs, TextShowMnemonic, TextWordWrap, …, TextJustificationForced }
enum TextFormat { PlainText, RichText, AutoText, MarkdownText }
enum TextInteractionFlag { NoTextInteraction, TextSelectableByMouse, TextSelectableByKeyboard, LinksAccessibleByMouse, LinksAccessibleByKeyboard, …, TextBrowserInteraction }
flags TextInteractionFlags
enum TileRule { StretchTile, RepeatTile, RoundTile }
enum TimeSpec { LocalTime, UTC, OffsetFromUTC, TimeZone }
enum TimerType { PreciseTimer, CoarseTimer, VeryCoarseTimer }
enum ToolBarArea { LeftToolBarArea, RightToolBarArea, TopToolBarArea, BottomToolBarArea, AllToolBarAreas, NoToolBarArea }
flags ToolBarAreas
enum ToolButtonStyle { ToolButtonIconOnly, ToolButtonTextOnly, ToolButtonTextBesideIcon, ToolButtonTextUnderIcon, ToolButtonFollowStyle }
enum TouchPointState { TouchPointUnknownState, TouchPointPressed, TouchPointMoved, TouchPointStationary, TouchPointReleased }
flags TouchPointStates
enum TransformationMode { FastTransformation, SmoothTransformation }
enum UIEffect { UI_AnimateMenu, UI_FadeMenu, UI_AnimateCombo, UI_AnimateTooltip, UI_FadeTooltip, UI_AnimateToolBox }
enum WhiteSpaceMode { WhiteSpaceNormal, WhiteSpacePre, WhiteSpaceNoWrap }
enum WidgetAttribute { WA_AcceptDrops, WA_AlwaysShowToolTips, WA_CustomWhatsThis, WA_DeleteOnClose, WA_Disabled, …, WA_ContentsMarginsRespectsSafeArea }
flags WindowFlags
enum WindowFrameSection { NoSection, LeftSection, TopLeftSection, TopSection, TopRightSection, …, TitleBarArea }
enum WindowModality { NonModal, WindowModal, ApplicationModal }
enum WindowState { WindowNoState, WindowMinimized, WindowMaximized, WindowFullScreen, WindowActive }
flags WindowStates
enum WindowType { Widget, Window, Dialog, Sheet, Drawer, …, WindowType_Mask }

Functions

void beginPropertyUpdateGroup()
QTextStream &bin(QTextStream &stream)
QTextStream &bom(QTextStream &stream)
QTextStream &center(QTextStream &stream)
QString convertFromPlainText(const QString &plain, Qt::WhiteSpaceMode mode)
QTextStream &dec(QTextStream &stream)
void endPropertyUpdateGroup()
QTextStream &endl(QTextStream &stream)
QTextStream &fixed(QTextStream &stream)
QTextStream &flush(QTextStream &stream)
QTextStream &forcepoint(QTextStream &stream)
QTextStream &forcesign(QTextStream &stream)
QTextStream &hex(QTextStream &stream)
QTextStream &left(QTextStream &stream)
QTextStream &lowercasebase(QTextStream &stream)
QTextStream &lowercasedigits(QTextStream &stream)
bool mightBeRichText(const QString &text)
QTextStream &noforcepoint(QTextStream &stream)
QTextStream &noforcesign(QTextStream &stream)
QTextStream &noshowbase(QTextStream &stream)
QTextStream &oct(QTextStream &stream)
QTextStream &reset(QTextStream &stream)
QTextStream &right(QTextStream &stream)
QTextStream &scientific(QTextStream &stream)
QTextStream &showbase(QTextStream &stream)
QTextStream &uppercasebase(QTextStream &stream)
QTextStream &uppercasedigits(QTextStream &stream)
QTextStream &ws(QTextStream &stream)
QKeyCombination operator|(Qt::Modifier modifier, Qt::Key key)
QKeyCombination operator|(Qt::KeyboardModifier modifier, Qt::Key key)
QKeyCombination operator|(Qt::Key key, Qt::Modifier modifier)
QKeyCombination operator|(Qt::Key key, Qt::KeyboardModifier modifier)
QKeyCombination operator|(Qt::Modifiers modifiers, Qt::Key key)
QKeyCombination operator|(Qt::KeyboardModifiers modifiers, Qt::Key key)
QKeyCombination operator|(Qt::Key key, Qt::Modifiers modifiers)
QKeyCombination operator|(Qt::Key key, Qt::KeyboardModifiers modifiers)

Detailed Description

Type Documentation

enum Qt::AlignmentFlag
flags Qt::Alignment

This enum type is used to describe alignment. It contains horizontal and vertical flags that can be combined to produce the required effect.

The TextElideMode enum can also be used in many situations to fine-tune the appearance of aligned text.

The horizontal flags are:

ConstantValueDescription
Qt::AlignLeft0x0001Aligns with the left edge.
Qt::AlignRight0x0002Aligns with the right edge.
Qt::AlignHCenter0x0004Centers horizontally in the available space.
Qt::AlignJustify0x0008Justifies the text in the available space.

The vertical flags are:

ConstantValueDescription
Qt::AlignTop0x0020Aligns with the top.
Qt::AlignBottom0x0040Aligns with the bottom.
Qt::AlignVCenter0x0080Centers vertically in the available space.
Qt::AlignBaseline0x0100Aligns with the baseline.

You can use only one of the horizontal flags at a time. There is one two-dimensional flag:

ConstantValueDescription
Qt::AlignCenterAlignVCenter | AlignHCenterCenters in both dimensions.

You can use at most one horizontal and one vertical flag at a time. Qt::AlignCenter counts as both horizontal and vertical.

Three enum values are useful in applications that can be run in right-to-left mode:

ConstantValueDescription
Qt::AlignAbsolute0x0010If the widget's layout direction is Qt::RightToLeft (instead of Qt::LeftToRight, the default), Qt::AlignLeft refers to the right edge and Qt::AlignRight to the left edge. This is normally the desired behavior. If you want Qt::AlignLeft to always mean "left" and Qt::AlignRight to always mean "right", combine the flag with Qt::AlignAbsolute.
Qt::AlignLeadingAlignLeftSynonym for Qt::AlignLeft.
Qt::AlignTrailingAlignRightSynonym for Qt::AlignRight.

Masks:

ConstantValue
Qt::AlignHorizontal_MaskAlignLeft | AlignRight | AlignHCenter | AlignJustify | AlignAbsolute
Qt::AlignVertical_MaskAlignTop | AlignBottom | AlignVCenter | AlignBaseline

Conflicting combinations of flags have undefined meanings.

The Alignment type is a typedef for QFlags<AlignmentFlag>. It stores an OR combination of AlignmentFlag values.

enum Qt::AnchorPoint

Specifies a side of a layout item that can be anchored. This is used by QGraphicsAnchorLayout.

ConstantValueDescription
Qt::AnchorLeft0The left side of a layout item.
Qt::AnchorHorizontalCenter1A "virtual" side that is centered between the left and the right side of a layout item.
Qt::AnchorRight2The right side of a layout item.
Qt::AnchorTop3The top side of a layout item.
Qt::AnchorVerticalCenter4A "virtual" side that is centered between the top and the bottom side of a layout item.
Qt::AnchorBottom5The bottom side of a layout item.

See also QGraphicsAnchorLayout.

enum Qt::ApplicationAttribute

This enum describes attributes that change the behavior of application-wide features. These are enabled and disabled using QCoreApplication::setAttribute(), and can be tested for with QCoreApplication::testAttribute().

ConstantValueDescription
Qt::AA_DontShowIconsInMenus2Actions with the Icon property won't be shown in any menus unless specifically set by the QAction::iconVisibleInMenu property. Menus that are currently open or menus already created in the native macOS menubar may not pick up a change in this attribute. Changes in the QAction::iconVisibleInMenu property will always be picked up.
Qt::AA_DontShowShortcutsInContextMenus28Actions with the Shortcut property won't be shown in any shortcut menus unless specifically set by the QAction::shortcutVisibleInContextMenu property. This value was added in Qt 5.10, and defaults to the preference reported by the implementation of QPlatformIntegration::styleHint. To override the platform integration, set this attribute after QCoreApplication has been instantiated.
Qt::AA_NativeWindows3Ensures that widgets have native windows.
Qt::AA_DontCreateNativeWidgetSiblings4Ensures that siblings of native widgets stay non-native unless specifically set by the Qt::WA_NativeWindow attribute.
Qt::AA_PluginApplication5Indicates that Qt is used to author a plugin. Depending on the operating system, it suppresses specific initializations that do not necessarily make sense in the plugin case. For example on macOS, this includes avoiding loading our nib for the main menu and not taking possession of the native menu bar. Setting this attribute to true will also set the AA_DontUseNativeMenuBar attribute to true. It also disables native event filters. This attribute must be set before QGuiApplication constructed. This value was added in Qt 5.7.
Qt::AA_DontUseNativeMenuBar6All menubars created while this attribute is set to true won't be used as a native menubar (e.g, the menubar at the top of the main screen on macOS).
Qt::AA_MacDontSwapCtrlAndMeta7Keyboard shortcuts on macOS are typically based on the Command (or Cmd) keyboard modifier, represented by the ⌘ symbol. For example, the 'Copy' action is Command+C (⌘+C). To ease cross platform development Qt will by default remap Command to the Qt::ControlModifier, to align with other platforms. This allows creating keyboard shortcuts such as "Ctrl+J", which on macOS will then map to Command+J, as expected by macOS users. The actual Control (or Ctrl) modifier on macOS, represented by ⌃, is mapped to Qt::MetaModifier.

When this attribute is true Qt will not do the remapping, and pressing the Command modifier will result in Qt::MetaModifier, while pressing the Control modifier will result in Qt::ControlModifier.

Note that the QKeySequence::StandardKey sequences will always be based on the same modifier (i.e., QKeySequence::Copy will be Command+C regardless of the value set), but what is output for QKeySequence::toString() will be different.

ConstantValueDescription
Qt::AA_Use96Dpi8Assume the screen has a resolution of 96 DPI rather than using the OS-provided resolution. This will cause font rendering to be consistent in pixels-per-point across devices rather than defining 1 point as 1/72 inch.
Qt::AA_SynthesizeTouchForUnhandledMouseEvents11All mouse events that are not accepted by the application will be translated to touch events instead.
Qt::AA_SynthesizeMouseForUnhandledTouchEvents12All touch events that are not accepted by the application will be translated to left button mouse events instead. This attribute is enabled by default.
Qt::AA_ForceRasterWidgets14Make top-level widgets use pure raster surfaces, and do not support non-native GL-based child widgets.
Qt::AA_UseDesktopOpenGL15Forces the usage of desktop OpenGL (for example, opengl32.dll or libGL.so) on platforms that use dynamic loading of the OpenGL implementation. This attribute must be set before QGuiApplication is constructed. This value was added in Qt 5.3.
Qt::AA_UseOpenGLES16Forces the usage of OpenGL ES 2.0 or higher on platforms that use dynamic loading of the OpenGL implementation. This attribute must be set before QGuiApplication is constructed. This value was added in Qt 5.3.
Qt::AA_UseSoftwareOpenGL17Forces the usage of a software based OpenGL implementation on platforms that use dynamic loading of the OpenGL implementation. This will typically be a patched build of Mesa llvmpipe, providing OpenGL 2.1. The value may have no effect if no such OpenGL implementation is available. The default name of this library is opengl32sw.dll and can be overridden by setting the environment variable QT_OPENGL_DLL. See the platform-specific pages, for instance Qt for Windows, for more information. This attribute must be set before QGuiApplication is constructed. This value was added in Qt 5.4.
Qt::AA_ShareOpenGLContexts18Enables resource sharing between the OpenGL contexts used by classes like QOpenGLWidget and QQuickWidget. This allows sharing OpenGL resources, like textures, between QOpenGLWidget instances that belong to different top-level windows. This attribute must be set before QGuiApplication is constructed. This value was added in Qt 5.4.
Qt::AA_SetPalette19Indicates whether a palette was explicitly set on the QGuiApplication. This value was added in Qt 5.5.
Qt::AA_UseStyleSheetPropagationInWidgetStyles22By default, Qt Style Sheets disable regular QWidget palette and font propagation. When this flag is enabled, font and palette changes propagate as though the user had manually called the corresponding QWidget methods. See The Style Sheet Syntax - Inheritance for more details. This value was added in Qt 5.7.
Qt::AA_DontUseNativeDialogs23All dialogs created while this attribute is set to true won't use the native dialogs provided by the platform. This value was added in Qt 5.7.
Qt::AA_SynthesizeMouseForUnhandledTabletEvents24All tablet events that are not accepted by the application will be translated to mouse events instead. This attribute is enabled by default. This value was added in Qt 5.7.
Qt::AA_CompressHighFrequencyEvents25Enables compression of certain frequent events. On the X11 windowing system, the default value is true, which means that QEvent::MouseMove, QEvent::TouchUpdate, and changes in window size and position will be combined whenever they occur more frequently than the application handles them, so that they don't accumulate and overwhelm the application later. On Windows 8 and above the default value is also true, but it only applies to touch events. Mouse and window events remain unaffected by this flag. On other platforms, the default is false. (In the future, the compression feature may be implemented across platforms.) You can test the attribute to see whether compression is enabled. If your application needs to handle all events with no compression, you can unset this attribute. Notice that input events from tablet devices will not be compressed. See AA_CompressTabletEvents if you want these to be compressed as well. This value was added in Qt 5.7.
Qt::AA_CompressTabletEvents29Enables compression of input events from tablet devices. Notice that AA_CompressHighFrequencyEvents must be true for events compression to be enabled, and that this flag extends the former to tablet events. Currently supported on the X11 windowing system, Windows 8 and above. The default value is false. This value was added in Qt 5.10.
Qt::AA_DontCheckOpenGLContextThreadAffinity26When making a context current using QOpenGLContext, do not check that the QObject thread affinity of the QOpenGLContext object is the same thread calling makeCurrent(). This value was added in Qt 5.8.
Qt::AA_DisableShaderDiskCache27Disables caching of shader program binaries on disk. By default Qt Quick, QPainter's OpenGL backend, and any application using QOpenGLShaderProgram with one of its addCacheableShaderFromSource overloads will employ a disk-based program binary cache in either the shared or per-process cache storage location, on systems that support glProgramBinary(). In the unlikely event of this being problematic, set this attribute to disable all disk-based caching of shaders.
Qt::AA_DisableSessionManager31Disables the QSessionManager. By default Qt will connect to a running session manager for a GUI application on supported platforms, use of a session manager may be redundant for system services. This attribute must be set before QGuiApplication is constructed. This value was added in 5.14
Qt::AA_DisableNativeVirtualKeyboard9When this attribute is set, the native on-screen virtual keyboard will not be shown automatically when a text input widget gains focus on a system without a physical keyboard. Currently supported on the Windows platform only. This value was added in 5.15

[since 5.1] enum Qt::ApplicationState
flags Qt::ApplicationStates

This enum type is used to specify the current state of the application.

The states are

ConstantValueDescription
Qt::ApplicationSuspended0x00000000The application is about to suspend. When entering this state, the application should save its state, cease all activities, and be prepared for code execution to stop. While suspended, the application can be killed at any time without further warnings (e.g. when low memory forces the OS to purge suspended applications).
Qt::ApplicationHidden0x00000001The application is hidden and runs in the background. This is the normal state for applications that need to do background processing, like playing music, while the user interacts with other applications. The application should free up all graphical resources when entering this state.
Qt::ApplicationInactive0x00000002The application is visible, but not selected to be in front. On desktop platforms, this typically means that the user activated another application. On mobile platforms, it is more common to enter this state when the OS is interrupting the user with e.g. incoming calls or SMS-messages. While in this state, consider reducing CPU-intensive tasks.
Qt::ApplicationActive0x00000004The application is visible and selected to be in front.

This enum was introduced or modified in Qt 5.1.

The ApplicationStates type is a typedef for QFlags<ApplicationState>. It stores an OR combination of ApplicationState values.

enum Qt::ArrowType

ConstantValue
Qt::NoArrow0
Qt::UpArrow1
Qt::DownArrow2
Qt::LeftArrow3
Qt::RightArrow4

enum Qt::AspectRatioMode

This enum type defines what happens to the aspect ratio when scaling an rectangle.

ConstantValueDescription
Qt::IgnoreAspectRatio0The size is scaled freely. The aspect ratio is not preserved.
Qt::KeepAspectRatio1The size is scaled to a rectangle as large as possible inside a given rectangle, preserving the aspect ratio.
Qt::KeepAspectRatioByExpanding2The size is scaled to a rectangle as small as possible outside a given rectangle, preserving the aspect ratio.

See also QSize::scale() and QImage::scaled().

enum Qt::Axis

This enum type defines three values to represent the three axes in the cartesian coordinate system.

ConstantValueDescription
Qt::XAxis0The X axis.
Qt::YAxis1The Y axis.
Qt::ZAxis2The Z axis.

See also QTransform::rotate() and QTransform::rotateRadians().

enum Qt::BGMode

Background mode:

ConstantValue
Qt::TransparentMode0
Qt::OpaqueMode1

enum Qt::BrushStyle

This enum type defines the brush styles supported by Qt, i.e. the fill pattern of shapes drawn using QPainter.

Brush Styles

ConstantValueDescription
Qt::NoBrush0No brush pattern.
Qt::SolidPattern1Uniform color.
Qt::Dense1Pattern2Extremely dense brush pattern.
Qt::Dense2Pattern3Very dense brush pattern.
Qt::Dense3Pattern4Somewhat dense brush pattern.
Qt::Dense4Pattern5Half dense brush pattern.
Qt::Dense5Pattern6Somewhat sparse brush pattern.
Qt::Dense6Pattern7Very sparse brush pattern.
Qt::Dense7Pattern8Extremely sparse brush pattern.
Qt::HorPattern9Horizontal lines.
Qt::VerPattern10Vertical lines.
Qt::CrossPattern11Crossing horizontal and vertical lines.
Qt::BDiagPattern12Backward diagonal lines.
Qt::FDiagPattern13Forward diagonal lines.
Qt::DiagCrossPattern14Crossing diagonal lines.
Qt::LinearGradientPattern15Linear gradient (set using a dedicated QBrush constructor).
Qt::ConicalGradientPattern17Conical gradient (set using a dedicated QBrush constructor).
Qt::RadialGradientPattern16Radial gradient (set using a dedicated QBrush constructor).
Qt::TexturePattern24Custom pattern (see QBrush::setTexture()).

See also QBrush.

enum Qt::CaseSensitivity

ConstantValue
Qt::CaseInsensitive0
Qt::CaseSensitive1

enum Qt::CheckState

This enum describes the state of checkable items, controls, and widgets.

ConstantValueDescription
Qt::Unchecked0The item is unchecked.
Qt::PartiallyChecked1The item is partially checked. Items in hierarchical models may be partially checked if some, but not all, of their children are checked.
Qt::Checked2The item is checked.

See also QCheckBox, Qt::ItemFlags, and Qt::ItemDataRole.

[since 5.9] enum Qt::ChecksumType

This enum describes the possible standards used by qChecksum().

ConstantValueDescription
Qt::ChecksumIso33090Checksum calculation based on ISO 3309.
Qt::ChecksumItuV411Checksum calculation based on ITU-V.41.

This enum was introduced or modified in Qt 5.9.

enum Qt::ClipOperation

ConstantValueDescription
Qt::NoClip0This operation turns clipping off.
Qt::ReplaceClip1Replaces the current clip path/rect/region with the one supplied in the function call.
Qt::IntersectClip2Intersects the current clip path/rect/region with the one supplied in the function call.

enum Qt::ConnectionType

This enum describes the types of connection that can be used between signals and slots. In particular, it determines whether a particular signal is delivered to a slot immediately or queued for delivery at a later time.

ConstantValueDescription
Qt::AutoConnection0(Default) If the receiver lives in the thread that emits the signal, Qt::DirectConnection is used. Otherwise, Qt::QueuedConnection is used. The connection type is determined when the signal is emitted.
Qt::DirectConnection1The slot is invoked immediately when the signal is emitted. The slot is executed in the signalling thread.
Qt::QueuedConnection2The slot is invoked when control returns to the event loop of the receiver's thread. The slot is executed in the receiver's thread.
Qt::BlockingQueuedConnection3Same as Qt::QueuedConnection, except that the signalling thread blocks until the slot returns. This connection must not be used if the receiver lives in the signalling thread, or else the application will deadlock.
Qt::UniqueConnection0x80This is a flag that can be combined with any one of the above connection types, using a bitwise OR. When Qt::UniqueConnection is set, QObject::connect() will fail if the connection already exists (i.e. if the same signal is already connected to the same slot for the same pair of objects). This flag was introduced in Qt 4.6.
Qt::SingleShotConnection0x100This is a flag that can be combined with any one of the above connection types, using a bitwise OR. When Qt::SingleShotConnection is set, the slot is going to be called only once; the connection will be automatically broken when the signal is emitted. This flag was introduced in Qt 6.0.

With queued connections, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message:

QObject::connect: Cannot queue arguments of type 'MyType'

Call qRegisterMetaType() to register the data type before you establish the connection.

When using signals and slots with multiple threads, see Signals and Slots Across Threads.

See also Thread Support in Qt, QObject::connect(), qRegisterMetaType(), and Q_DECLARE_METATYPE().

enum Qt::ContextMenuPolicy

This enum type defines the various policies a widget can have with respect to showing a context menu.

ConstantValueDescription
Qt::NoContextMenu0the widget does not feature a context menu, context menu handling is deferred to the widget's parent.
Qt::PreventContextMenu4the widget does not feature a context menu, and in contrast to NoContextMenu, the handling is not deferred to the widget's parent. This means that all right mouse button events are guaranteed to be delivered to the widget itself through QWidget::mousePressEvent(), and QWidget::mouseReleaseEvent().
Qt::DefaultContextMenu1the widget's QWidget::contextMenuEvent() handler is called.
Qt::ActionsContextMenu2the widget displays its QWidget::actions() as context menu.
Qt::CustomContextMenu3the widget emits the QWidget::customContextMenuRequested() signal.

enum Qt::CoordinateSystem

This enum specifies the coordinate system.

ConstantValueDescription
Qt::DeviceCoordinates0Coordinates are relative to the top-left corner of the object's paint device.
Qt::LogicalCoordinates1Coordinates are relative to the top-left corner of the object.

enum Qt::Corner

This enum type specifies a corner in a rectangle:

ConstantValueDescription
Qt::TopLeftCorner0x00000The top-left corner of the rectangle.
Qt::TopRightCorner0x00001The top-right corner of the rectangle.
Qt::BottomLeftCorner0x00002The bottom-left corner of the rectangle.
Qt::BottomRightCorner0x00003The bottom-right corner of the rectangle.

enum Qt::CursorMoveStyle

This enum describes the movement style available to text cursors. The options are:

ConstantValueDescription
Qt::LogicalMoveStyle0Within a left-to-right text block, decrease cursor position when pressing left arrow key, increase cursor position when pressing the right arrow key. If the text block is right-to-left, the opposite behavior applies.
Qt::VisualMoveStyle1Pressing the left arrow key will always cause the cursor to move left, regardless of the text's writing direction. Pressing the right arrow key will always cause the cursor to move right.

enum Qt::CursorShape

This enum type defines the various cursors that can be used.

The standard arrow cursor is the default for widgets in a normal state.

ConstantValueDescription
Qt::ArrowCursor0 The standard arrow cursor.
Qt::UpArrowCursor1 An arrow pointing upwards toward the top of the screen.
Qt::CrossCursor2 A crosshair cursor, typically used to help the user accurately select a point on the screen.
Qt::WaitCursor3 An hourglass or watch cursor, usually shown during operations that prevent the user from interacting with the application.
Qt::IBeamCursor4 A caret or ibeam cursor, indicating that a widget can accept and display text input.
Qt::SizeVerCursor5 A cursor used for elements that are used to vertically resize top-level windows.
Qt::SizeHorCursor6 A cursor used for elements that are used to horizontally resize top-level windows.
Qt::SizeBDiagCursor7 A cursor used for elements that are used to diagonally resize top-level windows at their top-right and bottom-left corners.
Qt::SizeFDiagCursor8 A cursor used for elements that are used to diagonally resize top-level windows at their top-left and bottom-right corners.
Qt::SizeAllCursor9 A cursor used for elements that are used to resize top-level windows in any direction.
Qt::BlankCursor10A blank/invisible cursor, typically used when the cursor shape needs to be hidden.
Qt::SplitVCursor11 A cursor used for vertical splitters, indicating that a handle can be dragged horizontally to adjust the use of available space.
Qt::SplitHCursor12 A cursor used for horizontal splitters, indicating that a handle can be dragged vertically to adjust the use of available space.
Qt::PointingHandCursor13 A pointing hand cursor that is typically used for clickable elements such as hyperlinks.
Qt::ForbiddenCursor14 A slashed circle cursor, typically used during drag and drop operations to indicate that dragged content cannot be dropped on particular widgets or inside certain regions.
Qt::OpenHandCursor17 A cursor representing an open hand, typically used to indicate that the area under the cursor is the visible part of a canvas that the user can click and drag in order to scroll around.
Qt::ClosedHandCursor18 A cursor representing a closed hand, typically used to indicate that a dragging operation is in progress that involves scrolling.
Qt::WhatsThisCursor15 An arrow with a question mark, typically used to indicate the presence of What's This? help for a widget.
Qt::BusyCursor16 An hourglass or watch cursor, usually shown during operations that allow the user to interact with the application while they are performed in the background.
Qt::DragMoveCursor20A cursor that is usually used when dragging an item.
Qt::DragCopyCursor19A cursor that is usually used when dragging an item to copy it.
Qt::DragLinkCursor21A cursor that is usually used when dragging an item to make a link to it.
Qt::BitmapCursor24 

enum Qt::DateFormat

ConstantValueDescription
Qt::TextDate0The default Qt format, which includes the day and month name, the day number in the month, and the year in full. The day and month names will be short names in English (C locale). This effectively uses, for a date, format ddd MMM d yyyy, for a time HH:mm:ss and combines these as ddd MMM d HH:mm:ss yyyy for a date-time, with an optional zone-offset suffix, where relevant. When reading from a string, a fractional part is also recognized on the seconds of a time part, as HH:mm:ss.zzz, and some minor variants on the format may be recognized, for compatibility with earlier versions of Qt and with changes to the format planned for the future. In particular, the zone-offset suffix presently uses GMT[±tzoff] with a tzoff in HH[[:]mm] format (two-digit hour and optional two-digit minutes, with optional colon separator); this shall change to use UTC in place of GMT in a future release of Qt, so the planned UTC format is recognized.
Qt::ISODateWithMs9ISO 8601 extended format: uses yyyy-MM-dd for dates, HH:mm:ss.zzz for times or yyyy-MM-ddTHH:mm:ss.zzz (e.g. 2017-07-24T15:46:29.739) for combined dates and times, optionally with a time-zone suffix (Z for UTC otherwise an offset as ±HH:mm) where appropriate. When parsed, a single space, ' ', may be used in place of the 'T' separator between date and time; no other spacing characters are permitted. This format also accepts HH:mm and plain HH formats for the time part, either of which may include a fractional part, HH:mm.zzz or HH.zzz, applied to the last field present (hour or minute).
Qt::ISODate1ISO 8601 extended format, as for ISODateWithMs, but omitting the milliseconds (.zzz) part when converting to a string. There is no difference when reading from a string: if a fractional part is present on the last time field, either format will accept it.
Qt::RFC2822Date8RFC 2822, RFC 850 and RFC 1036 format: when converting dates to string form, format dd MMM yyyy is used, for times the format is HH:mm:ss. For combined date and time, these are combined as dd MMM yyyy HH:mm:ss ±tzoff (omitting the optional leading day of the week from the first format recognized). When reading from a string either [ddd,] dd MMM yyyy [HH:mm[:ss]][ ±tzoff] or ddd MMM dd[ HH:mm:ss] yyyy[ ±tzoff] will be recognized for combined dates and times, where tzoff is a timezone offset in HHmm format. Arbitrary spacing may appear before or after the text and any non-empty spacing may replace the spaces in this format. For dates and times separately, the same formats are matched and the unwanted parts are ignored. In particular, note that a time is not recognized without an accompanying date.

Note: For ISODate formats, each y, M and d represents a single digit of the year, month, and day used to specify the date. Each H, m, and s represents a single digit of the hour (up to 24), minute and second used to specify the time. An hour of 24, with zero for all other time fields, is understood as the start of the next day. A .zzz stands for a fractional part suffix on the preceding field, which may be separated from that field either by a comma ',' or the dot '.' shown. Precision beyond milliseconds is accepted but discarded, rounding to the nearest representable millisecond. The presence of a literal T character is used to separate the date and time when both are specified. For the TextDate and RFC2822Date formats, ddd stands for the first three letters of the name of the day of the week and MMM stands for the first three letters of the month name. The names of days and months are always in English (C locale) regardless of user preferences or system settings. The other format characters have the same meaning as for the ISODate format, except that 24 is not accepted as an hour. Parts of a format enclosed in square brackets [...] are optional; the square brackets do not form part of the format. The plus-or-minus character '±' here stands for either sign character, '-' for minus or '+' for plus.

Note: Zone offsets are measured positive to the east of Greenwich, negative to the west, as is usual for UTC-based offset notations (conflicting with some GMT-based zones-names, such as Etc/GMT+3, which use the opposite convention).

See also QDate::toString(), QTime::toString(), QDateTime::toString(), QDate::fromString(), QTime::fromString(), and QDateTime::fromString().

enum Qt::DayOfWeek

ConstantValue
Qt::Monday1
Qt::Tuesday2
Qt::Wednesday3
Qt::Thursday4
Qt::Friday5
Qt::Saturday6
Qt::Sunday7

enum Qt::DockWidgetArea
flags Qt::DockWidgetAreas

ConstantValue
Qt::LeftDockWidgetArea0x1
Qt::RightDockWidgetArea0x2
Qt::TopDockWidgetArea0x4
Qt::BottomDockWidgetArea0x8
Qt::AllDockWidgetAreasDockWidgetArea_Mask
Qt::NoDockWidgetArea0

The DockWidgetAreas type is a typedef for QFlags<DockWidgetArea>. It stores an OR combination of DockWidgetArea values.

enum Qt::DropAction
flags Qt::DropActions

ConstantValueDescription
Qt::CopyAction0x1Copy the data to the target.
Qt::MoveAction0x2Move the data from the source to the target.
Qt::LinkAction0x4Create a link from the source to the target.
Qt::ActionMask0xff 
Qt::IgnoreAction0x0Ignore the action (do nothing with the data).
Qt::TargetMoveAction0x8002On Windows, this value is used when the ownership of the D&D data should be taken over by the target application, i.e., the source application should not delete the data. On X11 this value is used to do a move. TargetMoveAction is not used on the Mac.

The DropActions type is a typedef for QFlags<DropAction>. It stores an OR combination of DropAction values.

[since 5.1] enum Qt::Edge
flags Qt::Edges

This enum type specifies an edge in a rectangle:

ConstantValueDescription
Qt::TopEdge0x00001The top edge of the rectangle.
Qt::LeftEdge0x00002The left edge of the rectangle.
Qt::RightEdge0x00004The right edge of the rectangle.
Qt::BottomEdge0x00008The bottom edge of the rectangle.

This enum was introduced or modified in Qt 5.1.

The Edges type is a typedef for QFlags<Edge>. It stores an OR combination of Edge values.

[since 5.6] enum Qt::EnterKeyType

This can be used to alter the appearance of the Return key on an on-screen keyboard.

Note: Not all of these values are supported on all platforms. For unsupported values the default key will be used instead.

ConstantValueDescription
Qt::EnterKeyDefault0The default Enter key. This can either be a button closing the keyboard, or a Return button causing a new line in case of a multi-line input field.
Qt::EnterKeyReturn1Show a Return button that inserts a new line. The keyboard will not close when this button is pressed.
Qt::EnterKeyDone2Show a "Done" button. The keyboard will close when this button is pressed.
Qt::EnterKeyGo3Show a "Go" button. Typically used in an address bar when entering a URL; the keyboard will close when this button is pressed.
Qt::EnterKeySend4Show a "Send" button. The keyboard will close when this button is pressed.
Qt::EnterKeySearch5Show a "Search" button. The keyboard will close when this button is pressed.
Qt::EnterKeyNext6Show a "Next" button. Typically used in a form to allow navigating to the next input field; the keyboard will not close when this button is pressed.
Qt::EnterKeyPrevious7Show a "Previous" button. The keyboard will not close when this button is pressed.

This enum was introduced or modified in Qt 5.6.

enum Qt::EventPriority

This enum can be used to specify event priorities.

ConstantValueDescription
Qt::HighEventPriority1Events with this priority are sent before events with NormalEventPriority or LowEventPriority.
Qt::NormalEventPriority0Events with this priority are sent after events with HighEventPriority, but before events with LowEventPriority.
Qt::LowEventPriority-1Events with this priority are sent after events with HighEventPriority or NormalEventPriority.

Note that these values are provided purely for convenience, since event priorities can be any value between INT_MAX and INT_MIN, inclusive. For example, you can define custom priorities as being relative to each other:

enum CustomEventPriority
{
    // An important event
    ImportantEventPriority = Qt::HighEventPriority,

    // A more important event
    MoreImportantEventPriority = ImportantEventPriority + 1,

    // A critical event
    CriticalEventPriority = 100 * MoreImportantEventPriority,

    // Not that important
    StatusEventPriority = Qt::LowEventPriority,

    // These are less important than Status events
    IdleProcessingDoneEventPriority = StatusEventPriority - 1
};

See also QCoreApplication::postEvent().

enum Qt::FillRule

Specifies which method should be used to fill the paths and polygons.

ConstantValueDescription
Qt::OddEvenFill0Specifies that the region is filled using the odd even fill rule. With this rule, we determine whether a point is inside the shape by using the following method. Draw a horizontal line from the point to a location outside the shape, and count the number of intersections. If the number of intersections is an odd number, the point is inside the shape. This mode is the default.
Qt::WindingFill1Specifies that the region is filled using the non zero winding rule. With this rule, we determine whether a point is inside the shape by using the following method. Draw a horizontal line from the point to a location outside the shape. Determine whether the direction of the line at each intersection point is up or down. The winding number is determined by summing the direction of each intersection. If the number is non zero, the point is inside the shape. This fill mode can also in most cases be considered as the intersection of closed shapes.

enum Qt::FindChildOption
flags Qt::FindChildOptions

ConstantValueDescription
Qt::FindDirectChildrenOnly0x0Looks only at the direct children of the object.
Qt::FindChildrenRecursively0x1Looks at all children of the object (recursive search).

The FindChildOptions type is a typedef for QFlags<FindChildOption>. It stores an OR combination of FindChildOption values.

enum Qt::FocusPolicy

This enum type defines the various policies a widget can have with respect to acquiring keyboard focus.

ConstantValueDescription
Qt::TabFocus0x1the widget accepts focus by tabbing.
Qt::ClickFocus0x2the widget accepts focus by clicking.
Qt::StrongFocusTabFocus | ClickFocus | 0x8the widget accepts focus by both tabbing and clicking. On macOS this will also be indicate that the widget accepts tab focus when in 'Text/List focus mode'.
Qt::WheelFocusStrongFocus | 0x4like Qt::StrongFocus plus the widget accepts focus by using the mouse wheel.
Qt::NoFocus0the widget does not accept focus.

enum Qt::FocusReason

This enum specifies why the focus changed. It will be passed through QWidget::setFocus and can be retrieved in the QFocusEvent sent to the widget upon focus change.

ConstantValueDescription
Qt::MouseFocusReason0A mouse action occurred.
Qt::TabFocusReason1The Tab key was pressed.
Qt::BacktabFocusReason2A Backtab occurred. The input for this may include the Shift or Control keys; e.g. Shift+Tab.
Qt::ActiveWindowFocusReason3The window system made this window either active or inactive.
Qt::PopupFocusReason4The application opened/closed a pop-up that grabbed/released the keyboard focus.
Qt::ShortcutFocusReason5The user typed a label's buddy shortcut
Qt::MenuBarFocusReason6The menu bar took focus.
Qt::OtherFocusReason7Another reason, usually application-specific.

See also Keyboard Focus in Widgets.

enum Qt::GestureFlag
flags Qt::GestureFlags

This enum type describes additional flags that can be used when subscribing to a gesture.

ConstantValueDescription
Qt::DontStartGestureOnChildren0x01By default gestures can start on the widget or over any of its children. Use this flag to disable this and allow a gesture to start on the widget only.
Qt::ReceivePartialGestures0x02Allows any ignored gesture events to be propagated to parent widgets which have specified this hint. By default only gestures that are in the Qt::GestureStarted state are propagated and the widget always gets the full gesture sequence starting with a gesture in the Qt::GestureStarted state and ending with a gesture in the Qt::GestureFinished or Qt::GestureCanceled states.
Qt::IgnoredGesturesPropagateToParent0x04Since Qt 4.7, this flag allows you to fine-tune gesture event propagation. By setting the flag when grabbing a gesture all ignored partial gestures will propagate to their parent items.

The GestureFlags type is a typedef for QFlags<GestureFlag>. It stores an OR combination of GestureFlag values.

See also QWidget::grabGesture() and QGraphicsObject::grabGesture().

enum Qt::GestureState

This enum type describes the state of a gesture.

ConstantValueDescription
Qt::NoGesture0No gesture has been detected.
Qt::GestureStarted1A continuous gesture has started.
Qt::GestureUpdated2A gesture continues.
Qt::GestureFinished3A gesture has finished.
Qt::GestureCanceled4A gesture was canceled.

See also QGesture.

enum Qt::GestureType

This enum type describes the standard gestures.

ConstantValueDescription
Qt::TapGesture1A Tap gesture.
Qt::TapAndHoldGesture2A Tap-And-Hold (Long-Tap) gesture.
Qt::PanGesture3A Pan gesture.
Qt::PinchGesture4A Pinch gesture.
Qt::SwipeGesture5A Swipe gesture.
Qt::CustomGesture0x0100A flag that can be used to test if the gesture is a user-defined gesture ID.

User-defined gestures are registered with the QGestureRecognizer::registerRecognizer() function which generates a custom gesture ID with the Qt::CustomGesture flag set.

See also QGesture, QWidget::grabGesture(), and QGraphicsObject::grabGesture().

enum Qt::GlobalColor

Qt's predefined QColor objects:

ConstantValueDescription
Qt::white3White (#ffffff)
Qt::black2Black (#000000)
Qt::red7Red (#ff0000)
Qt::darkRed13Dark red (#800000)
Qt::green8Green (#00ff00)
Qt::darkGreen14Dark green (#008000)
Qt::blue9Blue (#0000ff)
Qt::darkBlue15Dark blue (#000080)
Qt::cyan10Cyan (#00ffff)
Qt::darkCyan16Dark cyan (#008080)
Qt::magenta11Magenta (#ff00ff)
Qt::darkMagenta17Dark magenta (#800080)
Qt::yellow12Yellow (#ffff00)
Qt::darkYellow18Dark yellow (#808000)
Qt::gray5Gray (#a0a0a4)
Qt::darkGray4Dark gray (#808080)
Qt::lightGray6Light gray (#c0c0c0)
Qt::transparent19a transparent black value (i.e., QColor(0, 0, 0, 0))
Qt::color000 pixel value (for bitmaps)
Qt::color111 pixel value (for bitmaps)

See also QColor.

Qt::HANDLE

A handle type for system objects, defined as void * on all platforms.

[since 5.14] enum class Qt::HighDpiScaleFactorRoundingPolicy

This enum describes the possible High-DPI scale factor rounding policies, which decide how non-integer scale factors (such as Windows 150%) are handled.

The active policy is set by calling QGuiApplication::setHighDdpiScaleFactorRoundingPolicy() before the application object is created.

ConstantValueDescription
Qt::HighDpiScaleFactorRoundingPolicy::Round1Round up for .5 and above.
Qt::HighDpiScaleFactorRoundingPolicy::Ceil2Always round up.
Qt::HighDpiScaleFactorRoundingPolicy::Floor3Always round down.
Qt::HighDpiScaleFactorRoundingPolicy::RoundPreferFloor4Round up for .75 and above.
Qt::HighDpiScaleFactorRoundingPolicy::PassThrough5Don't round.

This enum was introduced or modified in Qt 5.14.

See also QGuiApplication::setHighDpiScaleFactorRoundingPolicy().

enum Qt::HitTestAccuracy

This enum contains the types of accuracy that can be used by the QTextDocument class when testing for mouse clicks on text documents.

ConstantValueDescription
Qt::ExactHit0The point at which input occurred must coincide exactly with input-sensitive parts of the document.
Qt::FuzzyHit1The point at which input occurred can lie close to input-sensitive parts of the document.

enum Qt::ImageConversionFlag
flags Qt::ImageConversionFlags

The options marked "(default)" are set if no other values from the list are included (since the defaults are zero):

Color/Mono preference (ignored for QBitmap):

ConstantValueDescription
Qt::AutoColor0x00000000(default) - If the image has depth 1 and contains only black and white pixels, the pixmap becomes monochrome.
Qt::ColorOnly0x00000003The pixmap is dithered/converted to the native display depth.
Qt::MonoOnly0x00000002The pixmap becomes monochrome. If necessary, it is dithered using the chosen dithering algorithm.

Dithering mode preference:

ConstantValueDescription
Qt::DiffuseDither0x00000000(default) - A high-quality dither using error diffusion.
Qt::OrderedDither0x00000010A faster, ordered dither.
Qt::ThresholdDither0x00000020No dithering; closest color is used.

Dithering mode preference for 1-bit alpha masks:

ConstantValueDescription
Qt::ThresholdAlphaDither0x00000000(default) - No dithering.
Qt::OrderedAlphaDither0x00000004A faster, ordered dither.
Qt::DiffuseAlphaDither0x00000008A high-quality dither using error diffusion.

Color matching versus dithering preference:

ConstantValueDescription
Qt::PreferDither0x00000040Always dither images when converting to smaller color-spaces.
Qt::AvoidDither0x00000080Only dither to indexed formats if the source image uses more different colors than the size of the color table of the destination format.
Qt::AutoDither0x00000000(default) - Only dither when down-converting to 1 or 8-bit indexed formats.
Qt::NoOpaqueDetection0x00000100Do not check whether the image contains non-opaque pixels. Use this if you know that the image is semi-transparent and you want to avoid the overhead of checking the pixels in the image until a non-opaque pixel is found, or if you want the pixmap to retain an alpha channel for some other reason. If the image has no alpha channel this flag has no effect.
Qt::NoFormatConversion0x00000200Don't do any format conversions on the image. Can be useful when converting a QImage to a QPixmap for a one-time rendering operation for example. Note that a QPixmap not in the preferred format will be much slower as a paint device.

The ImageConversionFlags type is a typedef for QFlags<ImageConversionFlag>. It stores an OR combination of ImageConversionFlag values.

enum Qt::InputMethodHint
flags Qt::InputMethodHints

ConstantValueDescription
Qt::ImhNone0x0No hints.

Flags that alter the behavior:

ConstantValueDescription
Qt::ImhHiddenText0x1The input method should not show the characters while typing. This is automatically set when setting QLineEdit::echoMode to Password. Note that setting ImhHiddenText does not change the echo mode.
Qt::ImhSensitiveData0x2Typed text should not be stored by the active input method in any persistent storage like predictive user dictionary.
Qt::ImhNoAutoUppercase0x4The input method should not try to automatically switch to upper case when a sentence ends.
Qt::ImhPreferNumbers0x8Numbers are preferred (but not required).
Qt::ImhPreferUppercase0x10Upper case letters are preferred (but not required).
Qt::ImhPreferLowercase0x20Lower case letters are preferred (but not required).
Qt::ImhNoPredictiveText0x40Do not use predictive text (i.e. dictionary lookup) while typing.
Qt::ImhDate0x80The text editor functions as a date field.
Qt::ImhTime0x100The text editor functions as a time field.
Qt::ImhPreferLatin0x200Latin characters are preferred (but not required).
Qt::ImhMultiLine0x400Multiple lines can be entered into the text field.
Qt::ImhNoEditMenu0x800Do not use built-in edit menu. This flag was introduced in Qt 5.11.
Qt::ImhNoTextHandles0x1000Do not use built-in text cursor and selection handles. This flag was introduced in Qt 5.11.

Flags that restrict input (exclusive flags):

ConstantValueDescription
Qt::ImhDigitsOnly0x10000Only digits are allowed.
Qt::ImhFormattedNumbersOnly0x20000Only number input is allowed. This includes decimal point and minus sign.
Qt::ImhUppercaseOnly0x40000Only upper case letter input is allowed.
Qt::ImhLowercaseOnly0x80000Only lower case letter input is allowed.
Qt::ImhDialableCharactersOnly0x100000Only characters suitable for phone dialing are allowed.
Qt::ImhEmailCharactersOnly0x200000Only characters suitable for email addresses are allowed.
Qt::ImhUrlCharactersOnly0x400000Only characters suitable for URLs are allowed.
Qt::ImhLatinOnly0x800000Only latin based input is allowed.

Masks:

ConstantValueDescription
Qt::ImhExclusiveInputMask0xffff0000This mask yields nonzero if any of the exclusive flags are used.

Note: If several exclusive flags are OR-ed together, the resulting character set will consist of the union of the specified sets. For instance specifying ImhNumbersOnly and ImhUppercaseOnly would yield a set consisting of numbers and uppercase letters.

The InputMethodHints type is a typedef for QFlags<InputMethodHint>. It stores an OR combination of InputMethodHint values.

See also QGraphicsItem::inputMethodHints().

enum Qt::InputMethodQuery
flags Qt::InputMethodQueries

ConstantValueDescription
Qt::ImEnabled0x1The widget accepts input method input.
Qt::ImCursorRectangle0x2The rectangle covering the area of the input cursor in widget coordinates.
Qt::ImFont0x4The currently used font for text input.
Qt::ImCursorPosition0x8The logical position of the cursor within the text surrounding the input area (see ImSurroundingText). The position does not incorporate the offset of the cursor within the preedit area, as controlled by QInputMethodEvent::Cursor.
Qt::ImSurroundingText0x10The plain text around the input area, for example the current paragraph.
Qt::ImCurrentSelection0x20The currently selected text.
Qt::ImMaximumTextLength0x40The maximum number of characters that the widget can hold. If there is no limit, QVariant::QVariant() is returned.
Qt::ImAnchorPosition0x80The position of the selection anchor. This may be less or greater than ImCursorPosition, depending on which side of selection the cursor is. If there is no selection, it returns the same as ImCursorPosition.
Qt::ImHints0x100The hints for input method on expected input. (See Qt::InputMethodHints)
Qt::ImPreferredLanguage0x200The preferred input language.
Qt::ImPlatformData0x80000000Platform specific data for input method.
Qt::ImAbsolutePosition0x400The logical position of the cursor within the entire document. The position does not incorporate the offset of the cursor within the preedit area, as controlled by QInputMethodEvent::Cursor.
Qt::ImTextBeforeCursor0x800The plain text before the cursor. The widget can decide how much text to return, but must not return an empty string unless the cursor is at the start of the document.
Qt::ImTextAfterCursor0x1000The plain text after the cursor. The widget can decide how much text to return, but must not return an empty string unless the cursor is at the end of the document.
Qt::ImEnterKeyType0x2000The Enter key type.
Qt::ImAnchorRectangle0x4000The bounding rectangle of the selection anchor. This value was added in Qt 5.7.
Qt::ImInputItemClipRectangle0x8000The actual exposed input item rectangle. Parts of the input item might be clipped. This value will take clipping into consideration and return the actual painted item rectangle. The rectangle is in widget coordinates.
Qt::ImReadOnly0x10000The widget is read only. This value was added in Qt 6.2.

Masks:

ConstantValueDescription
Qt::ImQueryInputImCursorRectangle | ImCursorPosition | ImSurroundingText | ImCurrentSelection | ImAnchorRectangle | ImAnchorPositionCommonly changed properties on input.
Qt::ImQueryAll0xffffffffQuery for all input method properties.

The InputMethodQueries type is a typedef for QFlags<InputMethodQuery>. It stores an OR combination of InputMethodQuery values.

See also QInputMethodQueryEvent.

enum Qt::ItemDataRole

Each item in the model has a set of data elements associated with it, each with its own role. The roles are used by the view to indicate to the model which type of data it needs. Custom models should return data in these types.

The general purpose roles (and the associated types) are:

ConstantValueDescription
Qt::DisplayRole0The key data to be rendered in the form of text. (QString)
Qt::DecorationRole1The data to be rendered as a decoration in the form of an icon. (QColor, QIcon or QPixmap)
Qt::EditRole2The data in a form suitable for editing in an editor. (QString)
Qt::ToolTipRole3The data displayed in the item's tooltip. (QString)
Qt::StatusTipRole4The data displayed in the status bar. (QString)
Qt::WhatsThisRole5The data displayed for the item in "What's This?" mode. (QString)
Qt::SizeHintRole13The size hint for the item that will be supplied to views. (QSize)

Roles describing appearance and meta data (with associated types):

ConstantValueDescription
Qt::FontRole6The font used for items rendered with the default delegate. (QFont)
Qt::TextAlignmentRole7The alignment of the text for items rendered with the default delegate. (Qt::Alignment)
Qt::BackgroundRole8The background brush used for items rendered with the default delegate. (QBrush)
Qt::ForegroundRole9The foreground brush (text color, typically) used for items rendered with the default delegate. (QBrush)
Qt::CheckStateRole10This role is used to obtain the checked state of an item. (Qt::CheckState)
Qt::InitialSortOrderRole14This role is used to obtain the initial sort order of a header view section. (Qt::SortOrder). This role was introduced in Qt 4.8.

Accessibility roles (with associated types):

ConstantValueDescription
Qt::AccessibleTextRole11The text to be used by accessibility extensions and plugins, such as screen readers. (QString)
Qt::AccessibleDescriptionRole12A description of the item for accessibility purposes. (QString)

User roles:

ConstantValueDescription
Qt::UserRole0x0100The first role that can be used for application-specific purposes.

For user roles, it is up to the developer to decide which types to use and ensure that components use the correct types when accessing and setting data.

enum Qt::ItemFlag
flags Qt::ItemFlags

This enum describes the properties of an item:

ConstantValueDescription
Qt::NoItemFlags0It does not have any properties set.
Qt::ItemIsSelectable1It can be selected.
Qt::ItemIsEditable2It can be edited.
Qt::ItemIsDragEnabled4It can be dragged.
Qt::ItemIsDropEnabled8It can be used as a drop target.
Qt::ItemIsUserCheckable16It can be checked or unchecked by the user.
Qt::ItemIsEnabled32The user can interact with the item.
Qt::ItemIsAutoTristate64The item's state depends on the state of its children. This enables automatic management of the state of parent items in QTreeWidget (checked if all children are checked, unchecked if all children are unchecked, or partially checked if only some children are checked).
Qt::ItemNeverHasChildren128The item never has child items. This is used for optimization purposes only.
Qt::ItemIsUserTristate256The user can cycle through three separate states. This value was added in Qt 5.5.

Note that checkable items need to be given both a suitable set of flags and an initial state, indicating whether the item is checked or not. This is handled automatically for model/view components, but needs to be explicitly set for instances of QListWidgetItem, QTableWidgetItem, and QTreeWidgetItem.

Note that it is undefined behavior to reimplement QAbstractItemModel::hasChildren to return true for an index if that index has the Qt::ItemNeverHasChildren flag set.

The ItemFlags type is a typedef for QFlags<ItemFlag>. It stores an OR combination of ItemFlag values.

See also QAbstractItemModel.

enum Qt::ItemSelectionMode

This enum is used in QGraphicsItem, QGraphicsScene and QGraphicsView to specify how items are selected, or how to determine if shapes and items collide.

ConstantValueDescription
Qt::ContainsItemShape0x0The output list contains only items whose shape is fully contained inside the selection area. Items that intersect with the area's outline are not included.
Qt::IntersectsItemShape0x1The output list contains both items whose shape is fully contained inside the selection area, and items that intersect with the area's outline. This is a common mode for rubber band selection.
Qt::ContainsItemBoundingRect0x2The output list contains only items whose bounding rectangle is fully contained inside the selection area. Items that intersect with the area's outline are not included.
Qt::IntersectsItemBoundingRect0x3The output list contains both items whose bounding rectangle is fully contained inside the selection area, and items that intersect with the area's outline. This method is commonly used for determining areas that need redrawing.

See also QGraphicsScene::items(), QGraphicsScene::collidingItems(), QGraphicsView::items(), QGraphicsItem::collidesWithItem(), and QGraphicsItem::collidesWithPath().

enum Qt::ItemSelectionOperation

This enum is used in QGraphicsScene to specify what to do with currently selected items when setting a selection area.

ConstantValueDescription
Qt::ReplaceSelection0The currently selected items are replaced by items in the selection area.
Qt::AddToSelection1The items in the selection area are added to the currently selected items.

See also QGraphicsScene::setSelectionArea().

enum Qt::Key

The key names used by Qt.

ConstantValueDescription
Qt::Key_Escape0x01000000 
Qt::Key_Tab0x01000001 
Qt::Key_Backtab0x01000002 
Qt::Key_Backspace0x01000003 
Qt::Key_Return0x01000004 
Qt::Key_Enter0x01000005Typically located on the keypad.
Qt::Key_Insert0x01000006 
Qt::Key_Delete0x01000007 
Qt::Key_Pause0x01000008The Pause/Break key (Note: Not related to pausing media)
Qt::Key_Print0x01000009 
Qt::Key_SysReq0x0100000a 
Qt::Key_Clear0x0100000bCorresponds to the Clear key on selected Apple keyboard models. On other systems it is commonly mapped to the numeric keypad key 5, when Num Lock is off.
Qt::Key_Home0x01000010 
Qt::Key_End0x01000011 
Qt::Key_Left0x01000012 
Qt::Key_Up0x01000013 
Qt::Key_Right0x01000014 
Qt::Key_Down0x01000015 
Qt::Key_PageUp0x01000016 
Qt::Key_PageDown0x01000017 
Qt::Key_Shift0x01000020 
Qt::Key_Control0x01000021On macOS, this corresponds to the Command keys.
Qt::Key_Meta0x01000022On macOS, this corresponds to the Control keys. On Windows keyboards, this key is mapped to the Windows key.
Qt::Key_Alt0x01000023 
Qt::Key_AltGr0x01001103On Windows, when the KeyDown event for this key is sent, the Ctrl+Alt modifiers are also set.
Qt::Key_CapsLock0x01000024 
Qt::Key_NumLock0x01000025 
Qt::Key_ScrollLock0x01000026 
Qt::Key_F10x01000030 
Qt::Key_F20x01000031 
Qt::Key_F30x01000032 
Qt::Key_F40x01000033 
Qt::Key_F50x01000034 
Qt::Key_F60x01000035 
Qt::Key_F70x01000036 
Qt::Key_F80x01000037 
Qt::Key_F90x01000038 
Qt::Key_F100x01000039 
Qt::Key_F110x0100003a 
Qt::Key_F120x0100003b 
Qt::Key_F130x0100003c 
Qt::Key_F140x0100003d 
Qt::Key_F150x0100003e 
Qt::Key_F160x0100003f 
Qt::Key_F170x01000040 
Qt::Key_F180x01000041 
Qt::Key_F190x01000042 
Qt::Key_F200x01000043 
Qt::Key_F210x01000044 
Qt::Key_F220x01000045 
Qt::Key_F230x01000046 
Qt::Key_F240x01000047 
Qt::Key_F250x01000048 
Qt::Key_F260x01000049 
Qt::Key_F270x0100004a 
Qt::Key_F280x0100004b 
Qt::Key_F290x0100004c 
Qt::Key_F300x0100004d 
Qt::Key_F310x0100004e 
Qt::Key_F320x0100004f 
Qt::Key_F330x01000050 
Qt::Key_F340x01000051 
Qt::Key_F350x01000052 
Qt::Key_Super_L0x01000053 
Qt::Key_Super_R0x01000054 
Qt::Key_Menu0x01000055 
Qt::Key_Hyper_L0x01000056 
Qt::Key_Hyper_R0x01000057 
Qt::Key_Help0x01000058 
Qt::Key_Direction_L0x01000059 
Qt::Key_Direction_R0x01000060 
Qt::Key_Space0x20 
Qt::Key_AnyKey_Space 
Qt::Key_Exclam0x21 
Qt::Key_QuoteDbl0x22 
Qt::Key_NumberSign0x23 
Qt::Key_Dollar0x24 
Qt::Key_Percent0x25 
Qt::Key_Ampersand0x26 
Qt::Key_Apostrophe0x27 
Qt::Key_ParenLeft0x28 
Qt::Key_ParenRight0x29 
Qt::Key_Asterisk0x2a 
Qt::Key_Plus0x2b 
Qt::Key_Comma0x2c 
Qt::Key_Minus0x2d 
Qt::Key_Period0x2e 
Qt::Key_Slash0x2f 
Qt::Key_00x30 
Qt::Key_10x31 
Qt::Key_20x32 
Qt::Key_30x33 
Qt::Key_40x34 
Qt::Key_50x35 
Qt::Key_60x36 
Qt::Key_70x37 
Qt::Key_80x38 
Qt::Key_90x39 
Qt::Key_Colon0x3a 
Qt::Key_Semicolon0x3b 
Qt::Key_Less0x3c 
Qt::Key_Equal0x3d 
Qt::Key_Greater0x3e 
Qt::Key_Question0x3f 
Qt::Key_At0x40 
Qt::Key_A0x41 
Qt::Key_B0x42 
Qt::Key_C0x43 
Qt::Key_D0x44 
Qt::Key_E0x45 
Qt::Key_F0x46 
Qt::Key_G0x47 
Qt::Key_H0x48 
Qt::Key_I0x49 
Qt::Key_J0x4a 
Qt::Key_K0x4b 
Qt::Key_L0x4c 
Qt::Key_M0x4d 
Qt::Key_N0x4e 
Qt::Key_O0x4f 
Qt::Key_P0x50 
Qt::Key_Q0x51 
Qt::Key_R0x52 
Qt::Key_S0x53 
Qt::Key_T0x54 
Qt::Key_U0x55 
Qt::Key_V0x56 
Qt::Key_W0x57 
Qt::Key_X0x58 
Qt::Key_Y0x59 
Qt::Key_Z0x5a 
Qt::Key_BracketLeft0x5b 
Qt::Key_Backslash0x5c 
Qt::Key_BracketRight0x5d 
Qt::Key_AsciiCircum0x5e 
Qt::Key_Underscore0x5f 
Qt::Key_QuoteLeft0x60 
Qt::Key_BraceLeft0x7b 
Qt::Key_Bar0x7c 
Qt::Key_BraceRight0x7d 
Qt::Key_AsciiTilde0x7e 
Qt::Key_nobreakspace0x0a0 
Qt::Key_exclamdown0x0a1 
Qt::Key_cent0x0a2 
Qt::Key_sterling0x0a3 
Qt::Key_currency0x0a4 
Qt::Key_yen0x0a5 
Qt::Key_brokenbar0x0a6 
Qt::Key_section0x0a7 
Qt::Key_diaeresis0x0a8 
Qt::Key_copyright0x0a9 
Qt::Key_ordfeminine0x0aa 
Qt::Key_guillemotleft0x0ab 
Qt::Key_notsign0x0ac 
Qt::Key_hyphen0x0ad 
Qt::Key_registered0x0ae 
Qt::Key_macron0x0af 
Qt::Key_degree0x0b0 
Qt::Key_plusminus0x0b1 
Qt::Key_twosuperior0x0b2 
Qt::Key_threesuperior0x0b3 
Qt::Key_acute0x0b4 
Qt::Key_mu0x0b5 
Qt::Key_paragraph0x0b6 
Qt::Key_periodcentered0x0b7 
Qt::Key_cedilla0x0b8 
Qt::Key_onesuperior0x0b9 
Qt::Key_masculine0x0ba 
Qt::Key_guillemotright0x0bb 
Qt::Key_onequarter0x0bc 
Qt::Key_onehalf0x0bd 
Qt::Key_threequarters0x0be 
Qt::Key_questiondown0x0bf 
Qt::Key_Agrave0x0c0 
Qt::Key_Aacute0x0c1 
Qt::Key_Acircumflex0x0c2 
Qt::Key_Atilde0x0c3 
Qt::Key_Adiaeresis0x0c4 
Qt::Key_Aring0x0c5 
Qt::Key_AE0x0c6 
Qt::Key_Ccedilla0x0c7 
Qt::Key_Egrave0x0c8 
Qt::Key_Eacute0x0c9 
Qt::Key_Ecircumflex0x0ca 
Qt::Key_Ediaeresis0x0cb 
Qt::Key_Igrave0x0cc 
Qt::Key_Iacute0x0cd 
Qt::Key_Icircumflex0x0ce 
Qt::Key_Idiaeresis0x0cf 
Qt::Key_ETH0x0d0 
Qt::Key_Ntilde0x0d1 
Qt::Key_Ograve0x0d2 
Qt::Key_Oacute0x0d3 
Qt::Key_Ocircumflex0x0d4 
Qt::Key_Otilde0x0d5 
Qt::Key_Odiaeresis0x0d6 
Qt::Key_multiply0x0d7 
Qt::Key_Ooblique0x0d8 
Qt::Key_Ugrave0x0d9 
Qt::Key_Uacute0x0da 
Qt::Key_Ucircumflex0x0db 
Qt::Key_Udiaeresis0x0dc 
Qt::Key_Yacute0x0dd 
Qt::Key_THORN0x0de 
Qt::Key_ssharp0x0df 
Qt::Key_division0x0f7 
Qt::Key_ydiaeresis0x0ff 
Qt::Key_Multi_key0x01001120 
Qt::Key_Codeinput0x01001137 
Qt::Key_SingleCandidate0x0100113c 
Qt::Key_MultipleCandidate0x0100113d 
Qt::Key_PreviousCandidate0x0100113e 
Qt::Key_Mode_switch0x0100117e 
Qt::Key_Kanji0x01001121 
Qt::Key_Muhenkan0x01001122 
Qt::Key_Henkan0x01001123 
Qt::Key_Romaji0x01001124 
Qt::Key_Hiragana0x01001125 
Qt::Key_Katakana0x01001126 
Qt::Key_Hiragana_Katakana0x01001127 
Qt::Key_Zenkaku0x01001128 
Qt::Key_Hankaku0x01001129 
Qt::Key_Zenkaku_Hankaku0x0100112a 
Qt::Key_Touroku0x0100112b 
Qt::Key_Massyo0x0100112c 
Qt::Key_Kana_Lock0x0100112d 
Qt::Key_Kana_Shift0x0100112e 
Qt::Key_Eisu_Shift0x0100112f 
Qt::Key_Eisu_toggle0x01001130 
Qt::Key_Hangul0x01001131 
Qt::Key_Hangul_Start0x01001132 
Qt::Key_Hangul_End0x01001133 
Qt::Key_Hangul_Hanja0x01001134 
Qt::Key_Hangul_Jamo0x01001135 
Qt::Key_Hangul_Romaja0x01001136 
Qt::Key_Hangul_Jeonja0x01001138 
Qt::Key_Hangul_Banja0x01001139 
Qt::Key_Hangul_PreHanja0x0100113a 
Qt::Key_Hangul_PostHanja0x0100113b 
Qt::Key_Hangul_Special0x0100113f 
Qt::Key_Dead_Grave0x01001250 
Qt::Key_Dead_Acute0x01001251 
Qt::Key_Dead_Circumflex0x01001252 
Qt::Key_Dead_Tilde0x01001253 
Qt::Key_Dead_Macron0x01001254 
Qt::Key_Dead_Breve0x01001255 
Qt::Key_Dead_Abovedot0x01001256 
Qt::Key_Dead_Diaeresis0x01001257 
Qt::Key_Dead_Abovering0x01001258 
Qt::Key_Dead_Doubleacute0x01001259 
Qt::Key_Dead_Caron0x0100125a 
Qt::Key_Dead_Cedilla0x0100125b 
Qt::Key_Dead_Ogonek0x0100125c 
Qt::Key_Dead_Iota0x0100125d 
Qt::Key_Dead_Voiced_Sound0x0100125e 
Qt::Key_Dead_Semivoiced_Sound0x0100125f 
Qt::Key_Dead_Belowdot0x01001260 
Qt::Key_Dead_Hook0x01001261 
Qt::Key_Dead_Horn0x01001262 
Qt::Key_Dead_Stroke0x01001263 
Qt::Key_Dead_Abovecomma0x01001264 
Qt::Key_Dead_Abovereversedcomma0x01001265 
Qt::Key_Dead_Doublegrave0x01001266 
Qt::Key_Dead_Belowring0x01001267 
Qt::Key_Dead_Belowmacron0x01001268 
Qt::Key_Dead_Belowcircumflex0x01001269 
Qt::Key_Dead_Belowtilde0x0100126a 
Qt::Key_Dead_Belowbreve0x0100126b 
Qt::Key_Dead_Belowdiaeresis0x0100126c 
Qt::Key_Dead_Invertedbreve0x0100126d 
Qt::Key_Dead_Belowcomma0x0100126e 
Qt::Key_Dead_Currency0x0100126f 
Qt::Key_Dead_a0x01001280 
Qt::Key_Dead_A0x01001281 
Qt::Key_Dead_e0x01001282 
Qt::Key_Dead_E0x01001283 
Qt::Key_Dead_i0x01001284 
Qt::Key_Dead_I0x01001285 
Qt::Key_Dead_o0x01001286 
Qt::Key_Dead_O0x01001287 
Qt::Key_Dead_u0x01001288 
Qt::Key_Dead_U0x01001289 
Qt::Key_Dead_Small_Schwa0x0100128a 
Qt::Key_Dead_Capital_Schwa0x0100128b 
Qt::Key_Dead_Greek0x0100128c 
Qt::Key_Dead_Lowline0x01001290 
Qt::Key_Dead_Aboveverticalline0x01001291 
Qt::Key_Dead_Belowverticalline0x01001292 
Qt::Key_Dead_Longsolidusoverlay0x01001293 
Qt::Key_Back0x01000061 
Qt::Key_Forward0x01000062 
Qt::Key_Stop0x01000063 
Qt::Key_Refresh0x01000064 
Qt::Key_VolumeDown0x01000070 
Qt::Key_VolumeMute0x01000071 
Qt::Key_VolumeUp0x01000072 
Qt::Key_BassBoost0x01000073 
Qt::Key_BassUp0x01000074 
Qt::Key_BassDown0x01000075 
Qt::Key_TrebleUp0x01000076 
Qt::Key_TrebleDown0x01000077 
Qt::Key_MediaPlay0x01000080A key setting the state of the media player to play
Qt::Key_MediaStop0x01000081A key setting the state of the media player to stop
Qt::Key_MediaPrevious0x01000082 
Qt::Key_MediaNext0x01000083 
Qt::Key_MediaRecord0x01000084 
Qt::Key_MediaPause0x01000085A key setting the state of the media player to pause (Note: not the pause/break key)
Qt::Key_MediaTogglePlayPause0x01000086A key to toggle the play/pause state in the media player (rather than setting an absolute state)
Qt::Key_HomePage0x01000090 
Qt::Key_Favorites0x01000091 
Qt::Key_Search0x01000092 
Qt::Key_Standby0x01000093 
Qt::Key_OpenUrl0x01000094 
Qt::Key_LaunchMail0x010000a0 
Qt::Key_LaunchMedia0x010000a1 
Qt::Key_Launch00x010000a2 
Qt::Key_Launch10x010000a3 
Qt::Key_Launch20x010000a4 
Qt::Key_Launch30x010000a5 
Qt::Key_Launch40x010000a6 
Qt::Key_Launch50x010000a7 
Qt::Key_Launch60x010000a8 
Qt::Key_Launch70x010000a9 
Qt::Key_Launch80x010000aa 
Qt::Key_Launch90x010000ab 
Qt::Key_LaunchA0x010000ac 
Qt::Key_LaunchB0x010000ad 
Qt::Key_LaunchC0x010000ae 
Qt::Key_LaunchD0x010000af 
Qt::Key_LaunchE0x010000b0 
Qt::Key_LaunchF0x010000b1 
Qt::Key_LaunchG0x0100010e 
Qt::Key_LaunchH0x0100010f 
Qt::Key_MonBrightnessUp0x010000b2 
Qt::Key_MonBrightnessDown0x010000b3 
Qt::Key_KeyboardLightOnOff0x010000b4 
Qt::Key_KeyboardBrightnessUp0x010000b5 
Qt::Key_KeyboardBrightnessDown0x010000b6 
Qt::Key_PowerOff0x010000b7 
Qt::Key_WakeUp0x010000b8 
Qt::Key_Eject0x010000b9 
Qt::Key_ScreenSaver0x010000ba 
Qt::Key_WWW0x010000bb 
Qt::Key_Memo0x010000bc 
Qt::Key_LightBulb0x010000bd 
Qt::Key_Shop0x010000be 
Qt::Key_History0x010000bf 
Qt::Key_AddFavorite0x010000c0 
Qt::Key_HotLinks0x010000c1 
Qt::Key_BrightnessAdjust0x010000c2 
Qt::Key_Finance0x010000c3 
Qt::Key_Community0x010000c4 
Qt::Key_AudioRewind0x010000c5 
Qt::Key_BackForward0x010000c6 
Qt::Key_ApplicationLeft0x010000c7 
Qt::Key_ApplicationRight0x010000c8 
Qt::Key_Book0x010000c9 
Qt::Key_CD0x010000ca 
Qt::Key_Calculator0x010000cb 
Qt::Key_ToDoList0x010000cc 
Qt::Key_ClearGrab0x010000cd 
Qt::Key_Close0x010000ce 
Qt::Key_Copy0x010000cf 
Qt::Key_Cut0x010000d0 
Qt::Key_Display0x010000d1 
Qt::Key_DOS0x010000d2 
Qt::Key_Documents0x010000d3 
Qt::Key_Excel0x010000d4 
Qt::Key_Explorer0x010000d5 
Qt::Key_Game0x010000d6 
Qt::Key_Go0x010000d7 
Qt::Key_iTouch0x010000d8 
Qt::Key_LogOff0x010000d9 
Qt::Key_Market0x010000da 
Qt::Key_Meeting0x010000db 
Qt::Key_MenuKB0x010000dc 
Qt::Key_MenuPB0x010000dd 
Qt::Key_MySites0x010000de 
Qt::Key_News0x010000df 
Qt::Key_OfficeHome0x010000e0 
Qt::Key_Option0x010000e1 
Qt::Key_Paste0x010000e2 
Qt::Key_Phone0x010000e3 
Qt::Key_Calendar0x010000e4 
Qt::Key_Reply0x010000e5 
Qt::Key_Reload0x010000e6 
Qt::Key_RotateWindows0x010000e7 
Qt::Key_RotationPB0x010000e8 
Qt::Key_RotationKB0x010000e9 
Qt::Key_Save0x010000ea 
Qt::Key_Send0x010000eb 
Qt::Key_Spell0x010000ec 
Qt::Key_SplitScreen0x010000ed 
Qt::Key_Support0x010000ee 
Qt::Key_TaskPane0x010000ef 
Qt::Key_Terminal0x010000f0 
Qt::Key_Tools0x010000f1 
Qt::Key_Travel0x010000f2 
Qt::Key_Video0x010000f3 
Qt::Key_Word0x010000f4 
Qt::Key_Xfer0x010000f5 
Qt::Key_ZoomIn0x010000f6 
Qt::Key_ZoomOut0x010000f7 
Qt::Key_Away0x010000f8 
Qt::Key_Messenger0x010000f9 
Qt::Key_WebCam0x010000fa 
Qt::Key_MailForward0x010000fb 
Qt::Key_Pictures0x010000fc 
Qt::Key_Music0x010000fd 
Qt::Key_Battery0x010000fe 
Qt::Key_Bluetooth0x010000ff 
Qt::Key_WLAN0x01000100 
Qt::Key_UWB0x01000101 
Qt::Key_AudioForward0x01000102 
Qt::Key_AudioRepeat0x01000103 
Qt::Key_AudioRandomPlay0x01000104 
Qt::Key_Subtitle0x01000105 
Qt::Key_AudioCycleTrack0x01000106 
Qt::Key_Time0x01000107 
Qt::Key_Hibernate0x01000108 
Qt::Key_View0x01000109 
Qt::Key_TopMenu0x0100010a 
Qt::Key_PowerDown0x0100010b 
Qt::Key_Suspend0x0100010c 
Qt::Key_ContrastAdjust0x0100010d 
Qt::Key_TouchpadToggle0x01000110 
Qt::Key_TouchpadOn0x01000111 
Qt::Key_TouchpadOff0x01000112 
Qt::Key_MicMute0x01000113 
Qt::Key_Red0x01000114 
Qt::Key_Green0x01000115 
Qt::Key_Yellow0x01000116 
Qt::Key_Blue0x01000117 
Qt::Key_ChannelUp0x01000118 
Qt::Key_ChannelDown0x01000119 
Qt::Key_Guide0x0100011a 
Qt::Key_Info0x0100011b 
Qt::Key_Settings0x0100011c 
Qt::Key_MicVolumeUp0x0100011d 
Qt::Key_MicVolumeDown0x0100011e 
Qt::Key_New0x01000120 
Qt::Key_Open0x01000121 
Qt::Key_Find0x01000122 
Qt::Key_Undo0x01000123 
Qt::Key_Redo0x01000124 
Qt::Key_MediaLast0x0100ffff 
Qt::Key_unknown0x01ffffff 
Qt::Key_Call0x01100004A key to answer or initiate a call (see Qt::Key_ToggleCallHangup for a key to toggle current call state)
Qt::Key_Camera0x01100020A key to activate the camera shutter. On Windows Runtime, the environment variable QT_QPA_ENABLE_CAMERA_KEYS must be set to receive the event.
Qt::Key_CameraFocus0x01100021A key to focus the camera. On Windows Runtime, the environment variable QT_QPA_ENABLE_CAMERA_KEYS must be set to receive the event.
Qt::Key_Context10x01100000 
Qt::Key_Context20x01100001 
Qt::Key_Context30x01100002 
Qt::Key_Context40x01100003 
Qt::Key_Flip0x01100006 
Qt::Key_Hangup0x01100005A key to end an ongoing call (see Qt::Key_ToggleCallHangup for a key to toggle current call state)
Qt::Key_No0x01010002 
Qt::Key_Select0x01010000 
Qt::Key_Yes0x01010001 
Qt::Key_ToggleCallHangup0x01100007A key to toggle the current call state (ie. either answer, or hangup) depending on current call state
Qt::Key_VoiceDial0x01100008 
Qt::Key_LastNumberRedial0x01100009 
Qt::Key_Execute0x01020003 
Qt::Key_Printer0x01020002 
Qt::Key_Play0x01020005 
Qt::Key_Sleep0x01020004 
Qt::Key_Zoom0x01020006 
Qt::Key_Exit0x0102000a 
Qt::Key_Cancel0x01020001 

See also QKeyEvent::key().

enum Qt::KeyboardModifier
flags Qt::KeyboardModifiers

This enum describes the modifier keys.

ConstantValueDescription
Qt::NoModifier0x00000000No modifier key is pressed.
Qt::ShiftModifier0x02000000A Shift key on the keyboard is pressed.
Qt::ControlModifier0x04000000A Ctrl key on the keyboard is pressed.
Qt::AltModifier0x08000000An Alt key on the keyboard is pressed.
Qt::MetaModifier0x10000000A Meta key on the keyboard is pressed.
Qt::KeypadModifier0x20000000A keypad button is pressed.
Qt::GroupSwitchModifier0x40000000X11 only (unless activated on Windows by a command line argument). A Mode_switch key on the keyboard is pressed.

Note: On macOS, the ControlModifier value corresponds to the Command keys on the keyboard, and the MetaModifier value corresponds to the Control keys. The KeypadModifier value will also be set when an arrow key is pressed as the arrow keys are considered part of the keypad.

Note: On Windows Keyboards, Qt::MetaModifier and Qt::Key_Meta are mapped to the Windows key.

The KeyboardModifiers type is a typedef for QFlags<KeyboardModifier>. It stores an OR combination of KeyboardModifier values.

See also MouseButton and Modifier.

enum Qt::LayoutDirection

Specifies the direction of Qt's layouts and text handling.

ConstantValueDescription
Qt::LeftToRight0Left-to-right layout.
Qt::RightToLeft1Right-to-left layout.
Qt::LayoutDirectionAuto2Automatic layout.

Right-to-left layouts are necessary for certain languages, notably Arabic and Hebrew.

LayoutDirectionAuto serves two purposes. When used in conjunction with widgets and layouts, it will imply to use the layout direction set on the parent widget or QApplication. This has the same effect as QWidget::unsetLayoutDirection().

When LayoutDirectionAuto is used in conjunction with text layouting, it will imply that the text directionality is determined from the content of the string to be layouted.

See also QGuiApplication::setLayoutDirection(), QWidget::setLayoutDirection(), QTextOption::setTextDirection(), and QString::isRightToLeft().

enum Qt::MaskMode

This enum specifies the behavior of the QPixmap::createMaskFromColor() and QImage::createMaskFromColor() functions.

ConstantValueDescription
Qt::MaskInColor0Creates a mask where all pixels matching the given color are opaque.
Qt::MaskOutColor1Creates a mask where all pixels matching the given color are transparent.

enum Qt::MatchFlag
flags Qt::MatchFlags

This enum describes the type of matches that can be used when searching for items in a model.

ConstantValueDescription
Qt::MatchExactly0Performs QVariant-based matching.
Qt::MatchFixedString8Performs string-based matching. String-based comparisons are case-insensitive unless the MatchCaseSensitive flag is also specified.
Qt::MatchContains1The search term is contained in the item.
Qt::MatchStartsWith2The search term matches the start of the item.
Qt::MatchEndsWith3The search term matches the end of the item.
Qt::MatchCaseSensitive16The search is case sensitive.
Qt::MatchRegularExpression4Performs string-based matching using a regular expression as the search term. Uses QRegularExpression. When using this flag, a QRegularExpression object can be passed as parameter and will directly be used to perform the search. The case sensitivity flag will be ignored as the QRegularExpression object is expected to be fully configured. This enum value was added in Qt 5.15.
Qt::MatchWildcard5Performs string-based matching using a string with wildcards as the search term.
Qt::MatchWrap32Perform a search that wraps around, so that when the search reaches the last item in the model, it begins again at the first item and continues until all items have been examined.
Qt::MatchRecursive64Searches the entire hierarchy.

Note: Qt::MatchExactly, Qt::MatchContains, Qt::MatchStartsWith, Qt::MatchEndsWith, Qt::MatchRegularExpression, Qt::MatchWildcard, and Qt::MatchFixedString are mutually exclusive. The behavior achieved by setting several of them in a Qt::MatchFlags argument is undefined.

The MatchFlags type is a typedef for QFlags<MatchFlag>. It stores an OR combination of MatchFlag values.

See also QString::compare() and QRegularExpression.

enum Qt::Modifier
flags Qt::Modifiers

This enum provides shorter names for the keyboard modifier keys supported by Qt.

Note: On macOS, the CTRL value corresponds to the Command keys on the keyboard, and the META value corresponds to the Control keys.

ConstantValueDescription
Qt::SHIFTQt::ShiftModifierThe Shift keys provided on all standard keyboards.
Qt::METAQt::MetaModifierThe Meta keys.
Qt::CTRLQt::ControlModifierThe Ctrl keys.
Qt::ALTQt::AltModifierThe normal Alt keys, but not keys like AltGr.

The Modifiers type is a typedef for QFlags<Modifier>. It stores an OR combination of Modifier values.

See also KeyboardModifier and MouseButton.

enum Qt::MouseButton
flags Qt::MouseButtons

This enum type describes the different mouse buttons.

ConstantValueDescription
Qt::NoButton0x00000000The button state does not refer to any button (see QMouseEvent::button()).
Qt::AllButtons0x07ffffffThis value corresponds to a mask of all possible mouse buttons. Use to set the 'acceptedButtons' property of a MouseArea to accept ALL mouse buttons.
Qt::LeftButton0x00000001The left button is pressed, or an event refers to the left button. (The left button may be the right button on left-handed mice.)
Qt::RightButton0x00000002The right button.
Qt::MiddleButton0x00000004The middle button.
Qt::BackButton0x00000008The 'Back' button. (Typically present on the 'thumb' side of a mouse with extra buttons. This is NOT the tilt wheel.)
Qt::XButton1BackButtonThe 'Back' Button.
Qt::ExtraButton1XButton1The 'Back' Button.
Qt::ForwardButton0x00000010The 'Forward' Button. (Typically present beside the 'Back' button, and also pressed by the thumb.)
Qt::XButton2ForwardButtonThe 'Forward Button.
Qt::ExtraButton2ForwardButtonThe 'Forward' Button.
Qt::TaskButton0x00000020The 'Task' Button.
Qt::ExtraButton3TaskButtonThe 'Task' Button.
Qt::ExtraButton40x00000040The 7th non-wheel Mouse Button.
Qt::ExtraButton50x00000080The 8th non-wheel Mouse Button.
Qt::ExtraButton60x00000100The 9th non-wheel Mouse Button.
Qt::ExtraButton70x00000200The 10th non-wheel Mouse Button.
Qt::ExtraButton80x00000400The 11th non-wheel Mouse Button.
Qt::ExtraButton90x00000800The 12th non-wheel Mouse Button.
Qt::ExtraButton100x00001000The 13th non-wheel Mouse Button.
Qt::ExtraButton110x00002000The 14th non-wheel Mouse Button.
Qt::ExtraButton120x00004000The 15th non-wheel Mouse Button.
Qt::ExtraButton130x00008000The 16th non-wheel Mouse Button.
Qt::ExtraButton140x00010000The 17th non-wheel Mouse Button.
Qt::ExtraButton150x00020000The 18th non-wheel Mouse Button.
Qt::ExtraButton160x00040000The 19th non-wheel Mouse Button.
Qt::ExtraButton170x00080000The 20th non-wheel Mouse Button.
Qt::ExtraButton180x00100000The 21st non-wheel Mouse Button.
Qt::ExtraButton190x00200000The 22nd non-wheel Mouse Button.
Qt::ExtraButton200x00400000The 23rd non-wheel Mouse Button.
Qt::ExtraButton210x00800000The 24th non-wheel Mouse Button.
Qt::ExtraButton220x01000000The 25th non-wheel Mouse Button.
Qt::ExtraButton230x02000000The 26th non-wheel Mouse Button.
Qt::ExtraButton240x04000000The 27th non-wheel Mouse Button.

Note: Some models of multi-button mice are pre-configured with high-numbered Buttons emulating keyboard sequences, for use in specific games. In order for these Buttons to be seen as actual 'Mouse Buttons', the device must be re-configured (using the vendor's configuration tool).

The MouseButtons type is a typedef for QFlags<MouseButton>. It stores an OR combination of MouseButton values.

See also KeyboardModifier and Modifier.

[since 5.3] enum Qt::MouseEventFlag
flags Qt::MouseEventFlags

This enum provides additional information concerning a QMouseEvent.

ConstantValueDescription
Qt::MouseEventCreatedDoubleClick0x01Indicates that Qt has created a MouseButtonDblClick event from this event. The flag is set in the causing MouseButtonPress, and not in the resulting MouseButtonDblClick.

This enum was introduced or modified in Qt 5.3.

The MouseEventFlags type is a typedef for QFlags<MouseEventFlag>. It stores an OR combination of MouseEventFlag values.

[since 5.3] enum Qt::MouseEventSource

This enum describes the source of a mouse event and can be useful to determine if the event is an artificial mouse event originating from another device such as a touchscreen.

ConstantValueDescription
Qt::MouseEventNotSynthesized0The most common value. On platforms where such information is available this value indicates that the event was generated in response to a genuine mouse event in the system.
Qt::MouseEventSynthesizedBySystem1Indicates that the mouse event was synthesized from a touch event by the platform.
Qt::MouseEventSynthesizedByQt2Indicates that the mouse event was synthesized from an unhandled touch event by Qt.
Qt::MouseEventSynthesizedByApplication3Indicates that the mouse event was synthesized by the application. This allows distinguishing application-generated mouse events from the ones that are coming from the system or are synthesized by Qt. This value was introduced in Qt 5.6

This enum was introduced or modified in Qt 5.3.

See also Qt::AA_SynthesizeMouseForUnhandledTouchEvents.

[since 5.2] enum Qt::NativeGestureType

This enum returns the gesture type.

ConstantValueDescription
Qt::BeginNativeGesture0Sent before gesture event stream.
Qt::EndNativeGesture1Sent after gesture event stream.
Qt::PanNativeGesture2Specifies the displacement delta in pixels.
Qt::ZoomNativeGesture3Specifies the magnification delta in percent.
Qt::SmartZoomNativeGesture4Boolean magnification state.
Qt::RotateNativeGesture5Specifies the rotation delta in degrees.
Qt::SwipeNativeGesture6Sent after a swipe movement.

This enum was introduced or modified in Qt 5.2.

This enum type describes the mode for moving focus.

ConstantValueDescription
Qt::NavigationModeNone0Only the touch screen is used.
Qt::NavigationModeKeypadTabOrder1Qt::Key_Up and Qt::Key_Down are used to change focus.
Qt::NavigationModeKeypadDirectional2Qt::Key_Up, Qt::Key_Down, Qt::Key_Left and Qt::Key_Right are used to change focus.
Qt::NavigationModeCursorAuto3The mouse cursor is used to change focus, it is displayed only on non touchscreen devices. The keypad is used to implement a virtual cursor, unless the device has an analog mouse type of input device (e.g. touchpad). This is the recommended setting for an application such as a web browser that needs pointer control on both touch and non-touch devices.
Qt::NavigationModeCursorForceVisible4The mouse cursor is used to change focus, it is displayed regardless of device type. The keypad is used to implement a virtual cursor, unless the device has an analog mouse type of input device (e.g. touchpad)

Note: Cursor navigation is not currently implemented on any platform and behaves as NavigationModeNone.

See also QApplication::setNavigationMode() and QApplication::navigationMode().

enum Qt::Orientation
flags Qt::Orientations

This type is used to signify an object's orientation.

ConstantValue
Qt::Horizontal0x1
Qt::Vertical0x2

Orientation is used with QScrollBar for example.

The Orientations type is a typedef for QFlags<Orientation>. It stores an OR combination of Orientation values.

enum Qt::PenCapStyle

This enum type defines the pen cap styles supported by Qt, i.e. the line end caps that can be drawn using QPainter.

Qt::SquareCapQt::FlatCapQt::RoundCap
ConstantValueDescription
Qt::FlatCap0x00a square line end that does not cover the end point of the line.
Qt::SquareCap0x10a square line end that covers the end point and extends beyond it by half the line width.
Qt::RoundCap0x20a rounded line end.

See also QPen.

enum Qt::PenJoinStyle

This enum type defines the pen join styles supported by Qt, i.e. which joins between two connected lines can be drawn using QPainter.

Qt::BevelJoinQt::MiterJoinQt::RoundJoin
ConstantValueDescription
Qt::MiterJoin0x00The outer edges of the lines are extended to meet at an angle, and this area is filled.
Qt::BevelJoin0x40The triangular notch between the two lines is filled.
Qt::RoundJoin0x80A circular arc between the two lines is filled.
Qt::SvgMiterJoin0x100A miter join corresponding to the definition of a miter join in the SVG 1.2 Tiny specification.

See also QPen.

enum Qt::PenStyle

This enum type defines the pen styles that can be drawn using QPainter. The styles are:

Qt::SolidLineQt::DashLineQt::DotLine
Qt::DashDotLineQt::DashDotDotLineQt::CustomDashLine
ConstantValueDescription
Qt::NoPen0no line at all. For example, QPainter::drawRect() fills but does not draw any boundary line.
Qt::SolidLine1A plain line.
Qt::DashLine2Dashes separated by a few pixels.
Qt::DotLine3Dots separated by a few pixels.
Qt::DashDotLine4Alternate dots and dashes.
Qt::DashDotDotLine5One dash, two dots, one dash, two dots.
Qt::CustomDashLine6A custom pattern defined using QPainterPathStroker::setDashPattern().

See also QPen.

[since 5.15] enum Qt::ReturnByValueConstant

This is a dummy type, designed to help users transition from certain deprecated APIs to their replacement APIs.

This enum was introduced or modified in Qt 5.15.

See also QCursor::bitmap(), QCursor::mask(), QLabel::picture(), and QLabel::pixmap().

enum Qt::ScreenOrientation
flags Qt::ScreenOrientations

This enum type specifies the various orientations a screen might have.

ConstantValueDescription
Qt::PrimaryOrientation0x00000000The display's primary orientation.
Qt::LandscapeOrientation0x00000002Landscape orientation, display width is greater than display height.
Qt::PortraitOrientation0x00000001Portrait orientation, display height is greater than display width, rotated 90 degree clockwise relative to landscape.
Qt::InvertedLandscapeOrientation0x00000008Inverted landscape orientation, rotated 180 degrees relative to landscape.
Qt::InvertedPortraitOrientation0x00000004Inverted portrait orientation, rotated 180 degrees relative to portrait.

The ScreenOrientations type is a typedef for QFlags<ScreenOrientation>. It stores an OR combination of ScreenOrientation values.

enum Qt::ScrollBarPolicy

This enum type describes the various modes of QAbstractScrollArea's scroll bars.

ConstantValueDescription
Qt::ScrollBarAsNeeded0QAbstractScrollArea shows a scroll bar when the content is too large to fit and not otherwise. This is the default.
Qt::ScrollBarAlwaysOff1QAbstractScrollArea never shows a scroll bar.
Qt::ScrollBarAlwaysOn2QAbstractScrollArea always shows a scroll bar. This property is ignored on systems with transient scroll bars (e.g., on Mac from version 10.7).

(The modes for the horizontal and vertical scroll bars are independent.)

[since 5.2] enum Qt::ScrollPhase

This enum describes the phase of scrolling.

ConstantValueDescription
Qt::NoScrollPhase0The input device doesn't support scroll phase. This value was introduced in Qt 5.7.
Qt::ScrollBegin1Scrolling is about to begin, but the scrolling distance did not yet change.
Qt::ScrollUpdate2The scrolling distance has changed (default).
Qt::ScrollEnd3Scrolling has ended, and the scrolling distance did not change anymore.
Qt::ScrollMomentum4The user no longer touches the input device, but scrolling continues due to scroll momentum. This value was introduced in Qt 5.12.

This enum was introduced or modified in Qt 5.2.

enum Qt::ShortcutContext

For a QEvent::Shortcut event to occur, the shortcut's key sequence must be entered by the user in a context where the shortcut is active. The possible contexts are these:

ConstantValueDescription
Qt::WidgetShortcut0The shortcut is active when its parent widget has focus.
Qt::WidgetWithChildrenShortcut3The shortcut is active when its parent widget, or any of its children has focus. Children which are top-level widgets, except pop-ups, are not affected by this shortcut context.
Qt::WindowShortcut1The shortcut is active when its parent widget is a logical subwidget of the active top-level window.
Qt::ApplicationShortcut2The shortcut is active when one of the applications windows are active.

enum Qt::SizeHint

This enum is used by QGraphicsLayoutItem::sizeHint()

ConstantValueDescription
Qt::MinimumSize0is used to specify the minimum size of a graphics layout item.
Qt::PreferredSize1is used to specify the preferred size of a graphics layout item.
Qt::MaximumSize2is used to specify the maximum size of a graphics layout item.
Qt::MinimumDescent3is used to specify the minimum descent of a text string in a graphics layout item.

See also QGraphicsLayoutItem::sizeHint().

enum Qt::SizeMode

This enum is used by QPainter::drawRoundedRect() and QPainterPath::addRoundedRect() functions to specify the radii of rectangle corners with respect to the dimensions of the bounding rectangles specified.

ConstantValueDescription
Qt::AbsoluteSize0Specifies the size using absolute measurements.
Qt::RelativeSize1Specifies the size relative to the bounding rectangle, typically using percentage measurements.

enum Qt::SortOrder

This enum describes how the items in a widget are sorted.

ConstantValueDescription
Qt::AscendingOrder0The items are sorted ascending e.g. starts with 'AAA' ends with 'ZZZ' in Latin-1 locales
Qt::DescendingOrder1The items are sorted descending e.g. starts with 'ZZZ' ends with 'AAA' in Latin-1 locales

[since 5.14] enum Qt::SplitBehaviorFlags
flags Qt::SplitBehavior

This enum specifies how the split() functions should behave with respect to empty strings.

ConstantValueDescription
Qt::KeepEmptyParts0If a field is empty, keep it in the result.
Qt::SkipEmptyParts0x1If a field is empty, don't include it in the result.

This enum was introduced or modified in Qt 5.14.

The SplitBehavior type is a typedef for QFlags<SplitBehaviorFlags>. It stores an OR combination of SplitBehaviorFlags values.

See also QString::split().

[since 5.5] enum Qt::TabFocusBehavior

This enum type provides different focus behaviors for tab navigation.

ConstantValueDescription
Qt::NoTabFocus0x00iterate nothing.
Qt::TabFocusTextControls0x01iterate text controls and widgets.
Qt::TabFocusListControls0x02iterate list controls and widgets.
Qt::TabFocusAllControls0xffiterate all controls and widgets.

This enum was introduced or modified in Qt 5.5.

enum Qt::TextElideMode

This enum specifies where the ellipsis should appear when displaying texts that don't fit:

ConstantValueDescription
Qt::ElideLeft0The ellipsis should appear at the beginning of the text.
Qt::ElideRight1The ellipsis should appear at the end of the text.
Qt::ElideMiddle2The ellipsis should appear in the middle of the text.
Qt::ElideNone3Ellipsis should NOT appear in the text. When passed to functions such as QFontMetrics::elidedText(), this will cause the full string to return unless the text contains multi-length variants. Elision in this case must be done by clipping to the component width.

Qt::ElideMiddle is normally the most appropriate choice for URLs (e.g., "http://bugreports.qt.../QTWEBSITE-13/"), whereas Qt::ElideRight is appropriate for other strings (e.g., "Deploying Applications on Ma...").

See also QAbstractItemView::textElideMode, QFontMetrics::elidedText(), AlignmentFlag, and QTabBar::elideMode.

enum Qt::TextFlag

This enum type is used to define some modifier flags. Some of these flags only make sense in the context of printing:

ConstantValueDescription
Qt::TextSingleLine0x0100Treats all whitespace as spaces and prints just one line.
Qt::TextDontClip0x0200If it's impossible to stay within the given bounds, it prints outside.
Qt::TextExpandTabs0x0400Makes the U+0009 (ASCII tab) character move to the next tab stop.
Qt::TextShowMnemonic0x0800Displays the string "&P" as P For an ampersand, use "&&".
Qt::TextWordWrap0x1000Breaks lines at appropriate points, e.g. at word boundaries.
Qt::TextWrapAnywhere0x2000Breaks lines anywhere, even within words.
Qt::TextHideMnemonic0x8000Same as Qt::TextShowMnemonic but doesn't draw the underlines.
Qt::TextDontPrint0x4000Treat this text as "hidden" and don't print it.
Qt::TextIncludeTrailingSpaces0x08000000When this option is set, QTextLine::naturalTextWidth() and QTextLine::naturalTextRect() will return a value that includes the width of trailing spaces in the text; otherwise this width is excluded.
Qt::TextJustificationForced0x10000Ensures that text lines are justified.

You can use as many modifier flags as you want, except that Qt::TextSingleLine and Qt::TextWordWrap cannot be combined.

Flags that are inappropriate for a given use are generally ignored.

enum Qt::TextFormat

This enum is used in widgets that can display both plain text and rich text, for example QLabel. It is used for deciding whether a text string should be interpreted as one or the other. This is normally done by passing one of the enum values to a QTextEdit::setTextFormat() function.

ConstantValueDescription
Qt::PlainText0The text string is interpreted as a plain text string.
Qt::RichText1The text string is interpreted as a rich text string. See Supported HTML Subset for the definition of rich text.
Qt::AutoText2The text string is interpreted as for Qt::RichText if Qt::mightBeRichText() returns true, otherwise as Qt::PlainText.
Qt::MarkdownText3The text string is interpreted as Markdown-formatted text. This enum value was added in Qt 5.14.

enum Qt::TextInteractionFlag
flags Qt::TextInteractionFlags

This enum specifies how a text displaying widget reacts to user input.

ConstantValueDescription
Qt::NoTextInteraction0No interaction with the text is possible.
Qt::TextSelectableByMouse1Text can be selected with the mouse and copied to the clipboard using a context menu or standard keyboard shortcuts.
Qt::TextSelectableByKeyboard2Text can be selected with the cursor keys on the keyboard. A text cursor is shown.
Qt::LinksAccessibleByMouse4Links can be highlighted and activated with the mouse.
Qt::LinksAccessibleByKeyboard8Links can be focused using tab and activated with enter.
Qt::TextEditable16The text is fully editable.
Qt::TextEditorInteractionTextSelectableByMouse | TextSelectableByKeyboard | TextEditableThe default for a text editor.
Qt::TextBrowserInteractionTextSelectableByMouse | LinksAccessibleByMouse | LinksAccessibleByKeyboardThe default for QTextBrowser.

The TextInteractionFlags type is a typedef for QFlags<TextInteractionFlag>. It stores an OR combination of TextInteractionFlag values.

enum Qt::TileRule

This enum describes how to repeat or stretch the parts of an image when drawing.

ConstantValueDescription
Qt::StretchTile0Scale the image to fit to the available area.
Qt::RepeatTile1Repeat the image until there is no more space. May crop the last image.
Qt::RoundTile2Similar to Repeat, but scales the image down to ensure that the last tile is not cropped.

enum Qt::TimeSpec

ConstantValueDescription
Qt::LocalTime0Local time, controlled by a system time-zone setting.
Qt::UTC1Coordinated Universal Time.
Qt::OffsetFromUTC2An offset in seconds from Coordinated Universal Time.
Qt::TimeZone3A named time zone.

Both LocalTime and TimeZone will take care of transitions, such as the start and end of daylight-saving time. UTC is the standard time relative to which time-zones are usually specified: Greenwich Mean Time has zero offset from it. Neither UTC nor OffsetFromUTC has any transitions.

Note: After a change to the system time-zone setting, the behavior of LocalTime-based QDateTime objects created before the change is undefined: QDateTime may have cached data that the change invalidates. (This is not triggered by transitions of the system time-zone.) In long-running processes, updates to the system's time-zone data (e.g. when politicians change the rules for a zone) may likewise lead to conflicts between the updated time-zone information and data cached by QDateTime objects created before the update, using either LocalTime or TimeZone.

enum Qt::TimerType

The timer type indicates how accurate a timer can be.

ConstantValueDescription
Qt::PreciseTimer0Precise timers try to keep millisecond accuracy
Qt::CoarseTimer1Coarse timers try to keep accuracy within 5% of the desired interval
Qt::VeryCoarseTimer2Very coarse timers only keep full second accuracy

On UNIX (including Linux, macOS, and iOS), Qt will keep millisecond accuracy for Qt::PreciseTimer. For Qt::CoarseTimer, the interval will be adjusted up to 5% to align the timer with other timers that are expected to fire at or around the same time. The objective is to make most timers wake up at the same time, thereby reducing CPU wakeups and power consumption.

On Windows, Qt will use Windows's Multimedia timer facility (if available) for Qt::PreciseTimer and normal Windows timers for Qt::CoarseTimer and Qt::VeryCoarseTimer.

On all platforms, the interval for Qt::VeryCoarseTimer is rounded to the nearest full second (e.g. an interval of 23500ms will be rounded to 24000ms, and 20300ms to 20000ms).

enum Qt::ToolBarArea
flags Qt::ToolBarAreas

ConstantValue
Qt::LeftToolBarArea0x1
Qt::RightToolBarArea0x2
Qt::TopToolBarArea0x4
Qt::BottomToolBarArea0x8
Qt::AllToolBarAreasToolBarArea_Mask
Qt::NoToolBarArea0

The ToolBarAreas type is a typedef for QFlags<ToolBarArea>. It stores an OR combination of ToolBarArea values.

enum Qt::ToolButtonStyle

The style of the tool button, describing how the button's text and icon should be displayed.

ConstantValueDescription
Qt::ToolButtonIconOnly0Only display the icon.
Qt::ToolButtonTextOnly1Only display the text.
Qt::ToolButtonTextBesideIcon2The text appears beside the icon.
Qt::ToolButtonTextUnderIcon3The text appears under the icon.
Qt::ToolButtonFollowStyle4Follow the style.

enum Qt::TouchPointState
flags Qt::TouchPointStates

This enum represents the state of a touch point at the time a QTouchEvent occurred.

ConstantValueDescription
Qt::TouchPointUnknownState0x00The state of the touch point is not known.
Qt::TouchPointPressed0x01The touch point is now pressed.
Qt::TouchPointMoved0x02The touch point moved.
Qt::TouchPointStationary0x04The touch point did not move.
Qt::TouchPointReleased0x08The touch point was released.

The TouchPointStates type is a typedef for QFlags<TouchPointState>. It stores an OR combination of TouchPointState values.

enum Qt::TransformationMode

This enum type defines whether image transformations (e.g., scaling) should be smooth or not.

ConstantValueDescription
Qt::FastTransformation0The transformation is performed quickly, with no smoothing.
Qt::SmoothTransformation1The resulting image is transformed using bilinear filtering.

See also QImage::scaled().

enum Qt::UIEffect

This enum describes the available UI effects.

By default, Qt will try to use the platform specific desktop settings for each effect. Use the QApplication::setDesktopSettingsAware() function (passing false as argument) to prevent this, and the QApplication::setEffectEnabled() to enable or disable a particular effect.

Note that all effects are disabled on screens running at less than 16-bit color depth.

ConstantValueDescription
Qt::UI_AnimateMenu1Show animated menus.
Qt::UI_FadeMenu2Show faded menus.
Qt::UI_AnimateCombo3Show animated comboboxes.
Qt::UI_AnimateTooltip4Show tooltip animations.
Qt::UI_FadeTooltip5Show tooltip fading effects.
Qt::UI_AnimateToolBox6Reserved

See also QApplication::setEffectEnabled() and QGuiApplication::setDesktopSettingsAware().

enum Qt::WhiteSpaceMode

This enum describes the types of whitespace mode that are used by the QTextDocument class to meet the requirements of different kinds of textual information.

ConstantValueDescription
Qt::WhiteSpaceNormal0The whitespace mode used to display normal word wrapped text in paragraphs.
Qt::WhiteSpacePre1A preformatted text mode in which whitespace is reproduced exactly.
Qt::WhiteSpaceNoWrap2 

enum Qt::WidgetAttribute

This enum type is used to specify various widget attributes. Attributes are set and cleared with QWidget::setAttribute(), and queried with QWidget::testAttribute(), although some have special convenience functions which are mentioned below.

ConstantValueDescription
Qt::WA_AcceptDrops78Allows data from drag and drop operations to be dropped onto the widget (see QWidget::setAcceptDrops()).
Qt::WA_AlwaysShowToolTips84Enables tooltips for inactive windows.
Qt::WA_CustomWhatsThis47Indicates that the widget wants to continue operating normally in "What's This?" mode. This is set by the widget's author.
Qt::WA_DeleteOnClose55Makes Qt delete this widget when the widget has accepted the close event (see QWidget::closeEvent()).
Qt::WA_Disabled0Indicates that the widget is disabled, i.e. it does not receive any mouse or keyboard events. There is also a getter functions QWidget::isEnabled(). This is set/cleared by the Qt kernel.
Qt::WA_DontShowOnScreen103Indicates that the widget is hidden or is not a part of the viewable Desktop.
Qt::WA_ForceDisabled32Indicates that the widget is explicitly disabled, i.e. it will remain disabled even when all its ancestors are set to the enabled state. This implies WA_Disabled. This is set/cleared by QWidget::setEnabled() and QWidget::setDisabled().
Qt::WA_ForceUpdatesDisabled59Indicates that updates are explicitly disabled for the widget; i.e. it will remain disabled even when all its ancestors are set to the updates-enabled state. This implies WA_UpdatesDisabled. This is set/cleared by QWidget::setUpdatesEnabled().
Qt::WA_Hover74Forces Qt to generate paint events when the mouse enters or leaves the widget. This feature is typically used when implementing custom styles; see the Styles example for details.
Qt::WA_InputMethodEnabled14Enables input methods for Asian languages. Must be set when creating custom text editing widgets.
Qt::WA_KeyboardFocusChange77Set on a toplevel window when the users changes focus with the keyboard (tab, backtab, or shortcut).
Qt::WA_KeyCompression33Enables key event compression if set, and disables it if not set. By default key compression is off, so widgets receive one key press event for each key press (or more, since autorepeat is usually on). If you turn it on and your program doesn't keep up with key input, Qt may try to compress key events so that more than one character can be processed in each event. For example, a word processor widget might receive 2, 3 or more characters in each QKeyEvent::text(), if the layout recalculation takes too long for the CPU. If a widget supports multiple character unicode input, it is always safe to turn the compression on. Qt performs key event compression only for printable characters. Qt::Modifier keys, cursor movement keys, function keys and miscellaneous action keys (e.g. Escape, Enter, Backspace, PrintScreen) will stop key event compression, even if there are more compressible key events available. Platforms other than Mac and X11 do not support this compression, in which case turning it on will have no effect. This is set/cleared by the widget's author.
Qt::WA_LayoutOnEntireRect48Indicates that the widget wants QLayout to operate on the entire QWidget::rect(), not only on QWidget::contentsRect(). This is set by the widget's author.
Qt::WA_LayoutUsesWidgetRect92Ignore the layout item rect from the style when laying out this widget with QLayout.
Qt::WA_MacOpaqueSizeGrip85Indicates that the native size grip should be opaque instead of transparent (the default). This attribute is only applicable to macOS and is set by the widget's author.
Qt::WA_MacShowFocusRect88Indicates that this widget should get a QFocusFrame around it. Some widgets draw their own focus halo regardless of this attribute. Not that the QWidget::focusPolicy also plays the main role in whether something is given focus or not, this only controls whether or not this gets the focus frame. This attribute is only applicable to macOS.
Qt::WA_MacNormalSize89Indicates the widget should have the normal size for widgets in macOS. This attribute is only applicable to macOS.
Qt::WA_MacSmallSize90Indicates the widget should have the small size for widgets in macOS. This attribute is only applicable to macOS.
Qt::WA_MacMiniSize91Indicates the widget should have the mini size for widgets in macOS. This attribute is only applicable to macOS.
Qt::WA_Mapped11Indicates that the widget is mapped on screen. This is set/cleared by the Qt kernel.
Qt::WA_MouseNoMask71Makes the widget receive mouse events for the entire widget regardless of the currently set mask, overriding QWidget::setMask(). This is not applicable for top-level windows.
Qt::WA_MouseTracking2Indicates that the widget has mouse tracking enabled. See QWidget::mouseTracking.
Qt::WA_Moved43Indicates that the widget has an explicit position. This is set/cleared by QWidget::move() and by QWidget::setGeometry().
Qt::WA_NoChildEventsForParent58Indicates that the widget does not want ChildAdded or ChildRemoved events sent to its parent. This is rarely necessary but can help to avoid automatic insertion widgets like splitters and layouts. This is set by a widget's author.
Qt::WA_NoChildEventsFromChildren39Indicates that the widget does not want to receive ChildAdded or ChildRemoved events sent from its children. This is set by a widget's author.
Qt::WA_NoMouseReplay54Used for pop-up widgets. Indicates that the most recent mouse press event should not be replayed when the pop-up widget closes. The flag is set by the widget's author and cleared by the Qt kernel every time the widget receives a new mouse event.
Qt::WA_NoMousePropagation73Prohibits mouse events from being propagated to the widget's parent. This attribute is disabled by default.
Qt::WA_TransparentForMouseEvents51When enabled, this attribute disables the delivery of mouse events to the widget and its children. Mouse events are delivered to other widgets as if the widget and its children were not present in the widget hierarchy; mouse clicks and other events effectively "pass through" them. This attribute is disabled by default.
Qt::WA_NoSystemBackground9Indicates that the widget has no background, i.e. when the widget receives paint events, the background is not automatically repainted. Note: Unlike WA_OpaquePaintEvent, newly exposed areas are never filled with the background (e.g., after showing a window for the first time the user can see "through" it until the application processes the paint events). This flag is set or cleared by the widget's author.
Qt::WA_OpaquePaintEvent4Indicates that the widget paints all its pixels when it receives a paint event. Thus, it is not required for operations like updating, resizing, scrolling and focus changes to erase the widget before generating paint events. The use of WA_OpaquePaintEvent provides a small optimization by helping to reduce flicker on systems that do not support double buffering and avoiding computational cycles necessary to erase the background prior to painting. Note: Unlike WA_NoSystemBackground, WA_OpaquePaintEvent makes an effort to avoid transparent window backgrounds. This flag is set or cleared by the widget's author.
Qt::WA_OutsideWSRange49Indicates that the widget is outside the valid range of the window system's coordinate system. A widget outside the valid range cannot be mapped on screen. This is set/cleared by the Qt kernel.
Qt::WA_PaintOnScreen8Indicates that the widget wants to draw directly onto the screen. Widgets with this attribute set do not participate in composition management, i.e. they cannot be semi-transparent or shine through semi-transparent overlapping widgets. Note: This flag is only supported on X11 and it disables double buffering. On Qt for Embedded Linux, the flag only works when set on a top-level widget and it relies on support from the active screen driver. This flag is set or cleared by the widget's author. To render outside of Qt's paint system, e.g., if you require native painting primitives, you need to reimplement QWidget::paintEngine() to return 0 and set this flag.
Qt::WA_PaintUnclipped52Makes all painters operating on this widget unclipped. Children of this widget or other widgets in front of it do not clip the area the painter can paint on. This flag is only supported for widgets with the WA_PaintOnScreen flag set. The preferred way to do this in a cross platform way is to create a transparent widget that lies in front of the other widgets.
Qt::WA_PendingMoveEvent34Indicates that a move event is pending, e.g., when a hidden widget was moved. This flag is set or cleared by the Qt kernel.
Qt::WA_PendingResizeEvent35Indicates that a resize event is pending, e.g., when a hidden widget was resized. This flag is set or cleared by the Qt kernel.
Qt::WA_QuitOnClose76Makes Qt quit the application when the last widget with the attribute set has accepted closeEvent(). This behavior can be modified with the QGuiApplication::quitOnLastWindowClosed property. By default this attribute is set for all widgets of type Qt::Window.
Qt::WA_Resized42Indicates that the widget has an explicit size. This flag is set or cleared by QWidget::resize() and QWidget::setGeometry().
Qt::WA_RightToLeft56Indicates that the layout direction for the widget is right to left.
Qt::WA_SetCursor38Indicates that the widget has a cursor of its own. This flag is set or cleared by QWidget::setCursor() and QWidget::unsetCursor().
Qt::WA_SetFont37Indicates that the widget has a font of its own. This flag is set or cleared by QWidget::setFont().
Qt::WA_SetPalette36Indicates that the widget has a palette of its own. This flag is set or cleared by QWidget::setPalette().
Qt::WA_SetStyle86Indicates that the widget has a style of its own. This flag is set or cleared by QWidget::setStyle().
Qt::WA_ShowModal70This attribute has been deprecated. Use QWidget::windowModality instead.
Qt::WA_StaticContents5Indicates that the widget contents are north-west aligned and static. On resize, such a widget will receive paint events only for parts of itself that are newly visible. This flag is set or cleared by the widget's author.
Qt::WA_StyleSheet97Indicates that the widget is styled using a style sheet. WA_StyleSheet is set whenever a widget is subject to a style sheet, even if the style sheet did not affect the widget appearance.
Qt::WA_StyleSheetTarget131Indicates that the widget appearance was modified by a style sheet. WA_StyleSheet will also be set. This value was introduced in Qt 5.12.
Qt::WA_TabletTracking129Indicates that the widget has tablet tracking enabled. See QWidget::tabletTracking.
Qt::WA_TranslucentBackground120Indicates that the widget should have a translucent background, i.e., any non-opaque regions of the widgets will be translucent because the widget will have an alpha channel. Setting this flag causes WA_NoSystemBackground to be set. On Windows the widget also needs the Qt::FramelessWindowHint window flag to be set. This flag is set or cleared by the widget's author. As of Qt 5.0, toggling this attribute after the widget has been shown is not uniformly supported across platforms. When translucent background is desired, set the attribute early when creating the widget, and avoid altering it afterwards.
Qt::WA_UnderMouse1Indicates that the widget is under the mouse cursor. The value is not updated correctly during drag and drop operations. There is also a getter function, QWidget::underMouse(). This flag is set or cleared by the Qt kernel.
Qt::WA_UpdatesDisabled10Indicates that updates are blocked (including the system background). This flag is set or cleared by the Qt kernel. Warning: This flag must never be set or cleared by the widget's author.
Qt::WA_WindowModified41Indicates that the window is marked as modified. On some platforms this flag will do nothing, on others (including macOS and Windows) the window will take a modified appearance. This flag is set or cleared by QWidget::setWindowModified().
Qt::WA_WindowPropagation80Makes a toplevel window inherit font, palette and locale from its parent.
Qt::WA_MacAlwaysShowToolWindow96On macOS, show the tool window even when the application is not active. By default, all tool windows are hidden when the application is inactive.
Qt::WA_SetLocale87Indicates the locale should be taken into consideration in the widget.
Qt::WA_StyledBackground93Indicates the widget should be drawn using a styled background.
Qt::WA_ShowWithoutActivating98Show the widget without making it active.
Qt::WA_NativeWindow100Indicates that a native window is created for the widget. Enabling this flag will also force a native window for the widget's ancestors unless Qt::WA_DontCreateNativeAncestors is set.
Qt::WA_DontCreateNativeAncestors101Indicates that the widget's ancestors are kept non-native even though the widget itself is native.
Qt::WA_X11NetWmWindowTypeDesktop104Adds _NET_WM_WINDOW_TYPE_DESKTOP to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute has no effect on non-X11 platforms.
Qt::WA_X11NetWmWindowTypeDock105Adds _NET_WM_WINDOW_TYPE_DOCK to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute has no effect on non-X11 platforms.
Qt::WA_X11NetWmWindowTypeToolBar106Adds _NET_WM_WINDOW_TYPE_TOOLBAR to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute has no effect on non-X11 platforms. Note: Qt automatically sets this attribute for QToolBar.
Qt::WA_X11NetWmWindowTypeMenu107Adds _NET_WM_WINDOW_TYPE_MENU to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute has no effect on non-X11 platforms. Note: Qt automatically sets this attribute for QMenu when torn-off.
Qt::WA_X11NetWmWindowTypeUtility108Adds _NET_WM_WINDOW_TYPE_UTILITY to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute has no effect on non-X11 platforms. Note: Qt automatically sets this attribute for the Qt::Tool window type.
Qt::WA_X11NetWmWindowTypeSplash109Adds _NET_WM_WINDOW_TYPE_SPLASH to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute has no effect on non-X11 platforms. Note: Qt automatically sets this attribute for the Qt::SplashScreen window type.
Qt::WA_X11NetWmWindowTypeDialog110Adds _NET_WM_WINDOW_TYPE_DIALOG to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute has no effect on non-X11 platforms. Note: Qt automatically sets this attribute for the Qt::Dialog and Qt::Sheet window types.
Qt::WA_X11NetWmWindowTypeDropDownMenu111Adds _NET_WM_WINDOW_TYPE_DROPDOWN_MENU to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute has no effect on non-X11 platforms. Note: Qt automatically sets this attribute for QMenu objects added to a QMenuBar.
Qt::WA_X11NetWmWindowTypePopupMenu112Adds _NET_WM_WINDOW_TYPE_POPUP_MENU to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute has no effect on non-X11 platforms. Note: Qt automatically sets this attribute for QMenu.
Qt::WA_X11NetWmWindowTypeToolTip113Adds _NET_WM_WINDOW_TYPE_TOOLTIP to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute has no effect on non-X11 platforms. Note: Qt automatically sets this attribute for the Qt::ToolTip window type.
Qt::WA_X11NetWmWindowTypeNotification114Adds _NET_WM_WINDOW_TYPE_NOTIFICATION to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute has no effect on non-X11 platforms.
Qt::WA_X11NetWmWindowTypeCombo115Adds _NET_WM_WINDOW_TYPE_COMBO to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute has no effect on non-X11 platforms. Note: Qt automatically sets this attribute for the QComboBox pop-up.
Qt::WA_X11NetWmWindowTypeDND116Adds _NET_WM_WINDOW_TYPE_DND to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute has no effect on non-X11 platforms. Note: Qt automatically sets this attribute on the feedback widget used during a drag.
Qt::WA_AcceptTouchEvents121Allows touch events (see QTouchEvent) to be sent to the widget. Must be set on all widgets that can handle touch events. Without this attribute set, events from a touch device will be sent as mouse events.
Qt::WA_TouchPadAcceptSingleTouchEvents123Allows touchpad single touch events to be sent to the widget.
Qt::WA_X11DoNotAcceptFocus126Asks the window manager to not give focus to this top level window. This attribute has no effect on non-X11 platforms.
Qt::WA_AlwaysStackOnTop128Since Qt 5.4, this value forces QOpenGLWidget and QQuickWidget to be drawn last, on top of other widgets. Ignored for other type of widgets. Setting this attribute breaks the stacking order, but allows having a semi-transparent OpenGL widget with other widgets visible underneath. It is strongly recommended to call update() on the widget's top-level window after enabling or disabling this attribute.
Qt::WA_ContentsMarginsRespectsSafeArea130A QWidget respects the safe area margins of a window by incorporating the margins into its contents' margins by default. This means, that a QLayout will use the content area of a widget for its layout, unless the Qt::WA_LayoutOnEntireRect attribute is set. This along with a contents margin of 0 can be used on the actual layout, to allow for example a background image to underlay the status bar and other system areas on an iOS device, while still allowing child widgets of that background to be inset based on the safe area.

enum Qt::WindowFrameSection

This enum is used to describe parts of a window frame. It is returned by QGraphicsWidget::windowFrameSectionAt() to describe what section of the window frame is under the mouse.

ConstantValue
Qt::NoSection0
Qt::LeftSection1
Qt::TopLeftSection2
Qt::TopSection3
Qt::TopRightSection4
Qt::RightSection5
Qt::BottomRightSection6
Qt::BottomSection7
Qt::BottomLeftSection8
Qt::TitleBarArea9

See also QGraphicsWidget::windowFrameEvent(), QGraphicsWidget::paintWindowFrame(), and QGraphicsWidget::windowFrameSectionAt().

enum Qt::WindowModality

This enum specifies the behavior of a modal window. A modal window is one that blocks input to other windows. Note that windows that are children of a modal window are not blocked.

The values are:

ConstantValueDescription
Qt::NonModal0The window is not modal and does not block input to other windows.
Qt::WindowModal1The window is modal to a single window hierarchy and blocks input to its parent window, all grandparent windows, and all siblings of its parent and grandparent windows.
Qt::ApplicationModal2The window is modal to the application and blocks input to all windows.

See also QWidget::windowModality and QDialog.

enum Qt::WindowState
flags Qt::WindowStates

This enum type is used to specify the current state of a top-level window.

The states are

ConstantValueDescription
Qt::WindowNoState0x00000000The window has no state set (in normal state).
Qt::WindowMinimized0x00000001The window is minimized (i.e. iconified).
Qt::WindowMaximized0x00000002The window is maximized with a frame around it.
Qt::WindowFullScreen0x00000004The window fills the entire screen without any frame around it.
Qt::WindowActive0x00000008The window is the active window, i.e. it has keyboard focus.

The WindowStates type is a typedef for QFlags<WindowState>. It stores an OR combination of WindowState values.

enum Qt::WindowType
flags Qt::WindowFlags

This enum type is used to specify various window-system properties for the widget. They are fairly unusual but necessary in a few cases. Some of these flags depend on whether the underlying window manager supports them.

The main types are

ConstantValueDescription
Qt::Widget0x00000000This is the default type for QWidget. Widgets of this type are child widgets if they have a parent, and independent windows if they have no parent. See also Qt::Window and Qt::SubWindow.
Qt::Window0x00000001Indicates that the widget is a window, usually with a window system frame and a title bar, irrespective of whether the widget has a parent or not. Note that it is not possible to unset this flag if the widget does not have a parent.
Qt::Dialog0x00000002 | WindowIndicates that the widget is a window that should be decorated as a dialog (i.e., typically no maximize or minimize buttons in the title bar). This is the default type for QDialog. If you want to use it as a modal dialog, it should be launched from another window, or have a parent and used with the QWidget::windowModality property. If you make it modal, the dialog will prevent other top-level windows in the application from getting any input. We refer to a top-level window that has a parent as a secondary window.
Qt::Sheet0x00000004 | WindowIndicates that the window is a sheet on macOS. Since using a sheet implies window modality, the recommended way is to use QWidget::setWindowModality(), or QDialog::open(), instead.
Qt::DrawerSheet | DialogIndicates that the widget is a drawer on macOS. This feature is obsolete. Setting the flag has no effect.
Qt::Popup0x00000008 | WindowIndicates that the widget is a pop-up top-level window, i.e. that it is modal, but has a window system frame appropriate for pop-up menus.
Qt::ToolPopup | DialogIndicates that the widget is a tool window. A tool window is often a small window with a smaller than usual title bar and decoration, typically used for collections of tool buttons. If there is a parent, the tool window will always be kept on top of it. If there isn't a parent, you may consider using Qt::WindowStaysOnTopHint as well. If the window system supports it, a tool window can be decorated with a somewhat lighter frame. It can also be combined with Qt::FramelessWindowHint. On macOS, tool windows correspond to the NSPanel class of windows. This means that the window lives on a level above normal windows making it impossible to put a normal window on top of it. By default, tool windows will disappear when the application is inactive. This can be controlled by the Qt::WA_MacAlwaysShowToolWindow attribute.
Qt::ToolTipPopup | SheetIndicates that the widget is a tooltip. This is used internally to implement tooltips.
Qt::SplashScreenToolTip | DialogIndicates that the window is a splash screen. This is the default type for QSplashScreen.
Qt::SubWindow0x00000012Indicates that this widget is a sub-window, such as a QMdiSubWindow widget.
Qt::ForeignWindow0x00000020 | WindowIndicates that this window object is a handle representing a native platform window created by another process or by manually using native code.
Qt::CoverWindow0x00000040 | WindowIndicates that the window represents a cover window, which is shown when the application is minimized on some platforms.

There are also a number of flags which you can use to customize the appearance of top-level windows. These have no effect on other windows:

ConstantValueDescription
Qt::MSWindowsFixedSizeDialogHint0x00000100Gives the window a thin dialog border on Windows. This style is traditionally used for fixed-size dialogs.

Note: The use of this flag is not recommended in multi-monitor environments. This is because the system will enforce that the window maintains its native size when moving it across screens. This is particularly undesirable when using monitors with different resolutions.

ConstantValueDescription
Qt::MSWindowsOwnDC0x00000200Gives the window its own display context on Windows.
Qt::BypassWindowManagerHint0x00000400This flag can be used to indicate to the platform plugin that "all" window manager protocols should be disabled. This flag will behave different depending on what operating system the application is running on and what window manager is running. The flag can be used to get a native window with no configuration set.
Qt::X11BypassWindowManagerHintBypassWindowManagerHintBypass the window manager completely. This results in a borderless window that is not managed at all (i.e., no keyboard input unless you call QWidget::activateWindow() manually).
Qt::FramelessWindowHint0x00000800Produces a borderless window. The user cannot move or resize a borderless window via the window system. On X11, the result of the flag is dependent on the window manager and its ability to understand Motif and/or NETWM hints. Most existing modern window managers can handle this.
Qt::NoDropShadowWindowHint0x40000000Disables window drop shadow on supporting platforms.

The CustomizeWindowHint flag is used to enable customization of the window controls. This flag must be set to allow the WindowTitleHint, WindowSystemMenuHint, WindowMinimizeButtonHint, WindowMaximizeButtonHint and WindowCloseButtonHint flags to be changed.

ConstantValueDescription
Qt::CustomizeWindowHint0x02000000Turns off the default window title hints.
Qt::WindowTitleHint0x00001000Gives the window a title bar.
Qt::WindowSystemMenuHint0x00002000Adds a window system menu, and possibly a close button (for example on Mac). If you need to hide or show a close button, it is more portable to use WindowCloseButtonHint.
Qt::WindowMinimizeButtonHint0x00004000Adds a minimize button. On some platforms this implies Qt::WindowSystemMenuHint for it to work.
Qt::WindowMaximizeButtonHint0x00008000Adds a maximize button. On some platforms this implies Qt::WindowSystemMenuHint for it to work.
Qt::WindowMinMaxButtonsHintWindowMinimizeButtonHint | WindowMaximizeButtonHintAdds a minimize and a maximize button. On some platforms this implies Qt::WindowSystemMenuHint for it to work.
Qt::WindowCloseButtonHint0x08000000Adds a close button. On some platforms this implies Qt::WindowSystemMenuHint for it to work.
Qt::WindowContextHelpButtonHint0x00010000Adds a context help button to dialogs. On some platforms this implies Qt::WindowSystemMenuHint for it to work.
Qt::MacWindowToolBarButtonHint0x10000000On macOS adds a tool bar button (i.e., the oblong button that is on the top right of windows that have toolbars).
Qt::WindowFullscreenButtonHint0x80000000On macOS adds a fullscreen button.
Qt::BypassGraphicsProxyWidget0x20000000Prevents the window and its children from automatically embedding themselves into a QGraphicsProxyWidget if the parent widget is already embedded. You can set this flag if you want your widget to always be a toplevel widget on the desktop, regardless of whether the parent widget is embedded in a scene or not.
Qt::WindowShadeButtonHint0x00020000Adds a shade button in place of the minimize button if the underlying window manager supports it.
Qt::WindowStaysOnTopHint0x00040000Informs the window system that the window should stay on top of all other windows. Note that on some window managers on X11 you also have to pass Qt::X11BypassWindowManagerHint for this flag to work correctly.
Qt::WindowStaysOnBottomHint0x04000000Informs the window system that the window should stay on bottom of all other windows.

Note: On X11, this hint will work only in window managers that support _NET_WM_STATE_BELOW atom. If a window always on the bottom has a parent, the parent will also be left on the bottom. This window hint is currently not implemented for macOS.

Note: On Windows, this will work only for frameless or full-screen windows.

ConstantValueDescription
Qt::WindowTransparentForInput0x00080000Informs the window system that this window is used only for output (displaying something) and does not take input. Therefore input events should pass through as if it wasn't there.
Qt::WindowOverridesSystemGestures0x00100000Informs the window system that this window implements its own set of gestures and that system level gestures, like for instance three-finger desktop switching, should be disabled.
Qt::WindowDoesNotAcceptFocus0x00200000Informs the window system that this window should not receive the input focus.
Qt::MaximizeUsingFullscreenGeometryHint0x00400000Informs the window system that when maximizing the window it should use as much of the available screen geometry as possible, including areas that may be covered by system UI such as status bars or application launchers. This may result in the window being placed under these system UIs, but does not guarantee it, depending on whether or not the platform supports it. When the flag is enabled the user is responsible for taking QScreen::availableGeometry() into account, so that any UI elements in the application that require user interaction are not covered by system UI.
Qt::WindowType_Mask0x000000ffA mask for extracting the window type part of the window flags.

The WindowFlags type is a typedef for QFlags<WindowType>. It stores an OR combination of WindowType values.

See also QWidget::windowFlags and Window Flags Example.

Function Documentation

QKeyCombination operator|(Qt::Key key, Qt::KeyboardModifiers modifiers)

QKeyCombination operator|(Qt::Key key, Qt::Modifiers modifiers)

QKeyCombination operator|(Qt::KeyboardModifiers modifiers, Qt::Key key)

QKeyCombination operator|(Qt::Modifiers modifiers, Qt::Key key)

Returns a QKeyCombination object that represents the combination of key with the modifiers modifiers.

QKeyCombination operator|(Qt::Key key, Qt::KeyboardModifier modifier)

QKeyCombination operator|(Qt::Key key, Qt::Modifier modifier)

QKeyCombination operator|(Qt::KeyboardModifier modifier, Qt::Key key)

QKeyCombination operator|(Qt::Modifier modifier, Qt::Key key)

Returns a QKeyCombination object that represents the combination of key with the modifier modifier.

[since 6.2] void beginPropertyUpdateGroup()

Marks the beginning of a property update group. Inside this group, changing a property does neither immediately update any dependent properties nor does it trigger change notifications. Those are instead deferred until the group is ended by a call to endPropertyUpdateGroup.

Groups can be nested. In that case, the deferral ends only after the outermost group has been ended.

Note: Change notifications are only send after all property values affected by the group have been updated to their new values. This allows re-establishing a class invariant if multiple properties need to be updated, preventing any external observer from noticing an inconsistent state.

This function was introduced in Qt 6.2.

See also Qt::endPropertyUpdateGroup.

[since 5.14] QTextStream &Qt::bin(QTextStream &stream)

Calls QTextStream::setIntegerBase(2) on stream and returns stream.

This function was introduced in Qt 5.14.

See also oct(), dec(), hex(), and QTextStream manipulators.

[since 5.14] QTextStream &Qt::bom(QTextStream &stream)

Toggles insertion of the Byte Order Mark on stream when QTextStream is used with a UTF encoding.

This function was introduced in Qt 5.14.

See also QTextStream::setGenerateByteOrderMark() and QTextStream manipulators.

[since 5.14] QTextStream &Qt::center(QTextStream &stream)

Calls QTextStream::setFieldAlignment(QTextStream::AlignCenter) on stream and returns stream.

This function was introduced in Qt 5.14.

See also left(), right(), and QTextStream manipulators.

[since 5.14] QTextStream &Qt::dec(QTextStream &stream)

Calls QTextStream::setIntegerBase(10) on stream and returns stream.

This function was introduced in Qt 5.14.

See also bin(), oct(), hex(), and QTextStream manipulators.

[since 6.2] void endPropertyUpdateGroup()

Ends a property update group. If the outermost group has been ended, and deferred binding evaluations and notifications happen now.

Warning: Calling endPropertyUpdateGroup without a preceding call to beginPropertyUpdateGroup results in undefined behavior.

This function was introduced in Qt 6.2.

See also Qt::beginPropertyUpdateGroup.

[since 5.14] QTextStream &Qt::endl(QTextStream &stream)

Writes '\n' to the stream and flushes the stream.

Equivalent to

stream << '\n' << Qt::flush;

Note: On Windows, all '\n' characters are written as '\r\n' if QTextStream's device or string is opened using the QIODevice::Text flag.

This function was introduced in Qt 5.14.

See also flush(), reset(), and QTextStream manipulators.

[since 5.14] QTextStream &Qt::fixed(QTextStream &stream)

Calls QTextStream::setRealNumberNotation(QTextStream::FixedNotation) on stream and returns stream.

This function was introduced in Qt 5.14.

See also scientific() and QTextStream manipulators.

[since 5.14] QTextStream &Qt::flush(QTextStream &stream)

Calls QTextStream::flush() on stream and returns stream.

This function was introduced in Qt 5.14.

See also endl(), reset(), and QTextStream manipulators.

[since 5.14] QTextStream &Qt::forcepoint(QTextStream &stream)

Calls QTextStream::setNumberFlags(QTextStream::numberFlags() | QTextStream::ForcePoint) on stream and returns stream.

This function was introduced in Qt 5.14.

See also noforcepoint(), forcesign(), showbase(), and QTextStream manipulators.

[since 5.14] QTextStream &Qt::forcesign(QTextStream &stream)

Calls QTextStream::setNumberFlags(QTextStream::numberFlags() | QTextStream::ForceSign) on stream and returns stream.

This function was introduced in Qt 5.14.

See also noforcesign(), forcepoint(), showbase(), and QTextStream manipulators.

[since 5.14] QTextStream &Qt::hex(QTextStream &stream)

Calls QTextStream::setIntegerBase(16) on stream and returns stream.

Note: The hex modifier can only be used for writing to streams.

This function was introduced in Qt 5.14.

See also bin(), oct(), dec(), and QTextStream manipulators.

[since 5.14] QTextStream &Qt::left(QTextStream &stream)

Calls QTextStream::setFieldAlignment(QTextStream::AlignLeft) on stream and returns stream.

This function was introduced in Qt 5.14.

See also right(), center(), and QTextStream manipulators.

[since 5.14] QTextStream &Qt::lowercasebase(QTextStream &stream)

Calls QTextStream::setNumberFlags(QTextStream::numberFlags() & ~QTextStream::UppercaseBase) on stream and returns stream.

This function was introduced in Qt 5.14.

See also uppercasebase(), lowercasedigits(), and QTextStream manipulators.

[since 5.14] QTextStream &Qt::lowercasedigits(QTextStream &stream)

Calls QTextStream::setNumberFlags(QTextStream::numberFlags() & ~QTextStream::UppercaseDigits) on stream and returns stream.

This function was introduced in Qt 5.14.

See also uppercasedigits(), lowercasebase(), and QTextStream manipulators.

[since 5.14] QTextStream &Qt::noforcepoint(QTextStream &stream)

Calls QTextStream::setNumberFlags(QTextStream::numberFlags() & ~QTextStream::ForcePoint) on stream and returns stream.

This function was introduced in Qt 5.14.

See also forcepoint(), noforcesign(), noshowbase(), and QTextStream manipulators.

[since 5.14] QTextStream &Qt::noforcesign(QTextStream &stream)

Calls QTextStream::setNumberFlags(QTextStream::numberFlags() & ~QTextStream::ForceSign) on stream and returns stream.

This function was introduced in Qt 5.14.

See also forcesign(), noforcepoint(), noshowbase(), and QTextStream manipulators.

[since 5.14] QTextStream &Qt::noshowbase(QTextStream &stream)

Calls QTextStream::setNumberFlags(QTextStream::numberFlags() & ~QTextStream::ShowBase) on stream and returns stream.

This function was introduced in Qt 5.14.

See also showbase(), noforcesign(), noforcepoint(), and QTextStream manipulators.

[since 5.14] QTextStream &Qt::oct(QTextStream &stream)

Calls QTextStream::setIntegerBase(8) on stream and returns stream.

This function was introduced in Qt 5.14.

See also bin(), dec(), hex(), and QTextStream manipulators.

[since 5.14] QTextStream &Qt::reset(QTextStream &stream)

Calls QTextStream::reset() on stream and returns stream.

This function was introduced in Qt 5.14.

See also flush() and QTextStream manipulators.

Calls QTextStream::setFieldAlignment(QTextStream::AlignRight) on stream and returns stream.

This function was introduced in Qt 5.14.

See also left(), center(), and QTextStream manipulators.

[since 5.14] QTextStream &Qt::scientific(QTextStream &stream)

Calls QTextStream::setRealNumberNotation(QTextStream::ScientificNotation) on stream and returns stream.

This function was introduced in Qt 5.14.

See also fixed() and QTextStream manipulators.

[since 5.14] QTextStream &Qt::showbase(QTextStream &stream)

Calls QTextStream::setNumberFlags(QTextStream::numberFlags() | QTextStream::ShowBase) on stream and returns stream.

This function was introduced in Qt 5.14.

See also noshowbase(), forcesign(), forcepoint(), and QTextStream manipulators.

[since 5.14] QTextStream &Qt::uppercasebase(QTextStream &stream)

Calls QTextStream::setNumberFlags(QTextStream::numberFlags() | QTextStream::UppercaseBase) on stream and returns stream.

This function was introduced in Qt 5.14.

See also lowercasebase(), uppercasedigits(), and QTextStream manipulators.

[since 5.14] QTextStream &Qt::uppercasedigits(QTextStream &stream)

Calls QTextStream::setNumberFlags(QTextStream::numberFlags() | QTextStream::UppercaseDigits) on stream and returns stream.

This function was introduced in Qt 5.14.

See also lowercasedigits(), uppercasebase(), and QTextStream manipulators.

[since 5.14] QTextStream &Qt::ws(QTextStream &stream)

Calls skipWhiteSpace() on stream and returns stream.

This function was introduced in Qt 5.14.

See also QTextStream manipulators.

QKeyCombination operator|(Qt::Modifier modifier, Qt::Key key)

QKeyCombination operator|(Qt::KeyboardModifier modifier, Qt::Key key)

QKeyCombination operator|(Qt::Key key, Qt::Modifier modifier)

QKeyCombination operator|(Qt::Key key, Qt::KeyboardModifier modifier)

QKeyCombination operator|(Qt::Modifiers modifiers, Qt::Key key)

QKeyCombination operator|(Qt::KeyboardModifiers modifiers, Qt::Key key)

QKeyCombination operator|(Qt::Key key, Qt::Modifiers modifiers)

QKeyCombination operator|(Qt::Key key, Qt::KeyboardModifiers modifiers)

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.