The Qt namespace contains miscellaneous identifiers used throughout the Qt library. More…
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Dark red (#800000)
Dark green (#008000)
Dark blue (#000080)
Dark cyan (#008080)
Dark magenta (#800080)
Dark yellow (#808000)
Dark gray (#808080)
Light gray (#c0c0c0)
a transparent black value (i.e.,
QColor(0, 0, 0, 0))
0 pixel value (for bitmaps)
1 pixel value (for bitmaps)
enum.Flag) This enum type describes the different mouse buttons.
The button state does not refer to any button (see
This value corresponds to a mask of all possible mouse buttons. Use to set the ‘acceptedButtons’ property of a MouseArea to accept ALL mouse buttons.
The left button is pressed, or an event refers to the left button. (The left button may be the right button on left-handed mice.)
The right button.
The middle button.
The ‘Back’ button. (Typically present on the ‘thumb’ side of a mouse with extra buttons. This is NOT the tilt wheel.)
The ‘Back’ Button.
The ‘Back’ Button.
The ‘Forward’ Button. (Typically present beside the ‘Back’ button, and also pressed by the thumb.)
The ‘Forward Button.
The ‘Forward’ Button.
The ‘Task’ Button.
The ‘Task’ Button.
The 7th non-wheel Mouse Button.
The 8th non-wheel Mouse Button.
The 9th non-wheel Mouse Button.
The 10th non-wheel Mouse Button.
The 11th non-wheel Mouse Button.
The 12th non-wheel Mouse Button.
The 13th non-wheel Mouse Button.
The 14th non-wheel Mouse Button.
The 15th non-wheel Mouse Button.
The 16th non-wheel Mouse Button.
The 17th non-wheel Mouse Button.
The 18th non-wheel Mouse Button.
The 19th non-wheel Mouse Button.
The 20th non-wheel Mouse Button.
The 21st non-wheel Mouse Button.
The 22nd non-wheel Mouse Button.
The 23rd non-wheel Mouse Button.
The 24th non-wheel Mouse Button.
The 25th non-wheel Mouse Button.
The 26th non-wheel Mouse Button.
The 27th non-wheel Mouse Button.
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).
enum.Flag) This type is used to signify an object’s orientation.
Orientation is used with
QScrollBar for example.
enum.IntFlag) This enum type defines the various policies a widget can have with respect to acquiring keyboard focus.
the widget accepts focus by tabbing.
the widget accepts focus by clicking.
the 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’.
like Qt::StrongFocus plus the widget accepts focus by using the mouse wheel.
the widget does not accept focus.
This enum type provides different focus behaviors for tab navigation.
iterate text controls and widgets.
iterate list controls and widgets.
iterate all controls and widgets.
This enum describes how the items in a widget are sorted.
The items are sorted ascending e.g. starts with ‘AAA’ ends with ‘ZZZ’ in Latin-1 locales
The items are sorted descending e.g. starts with ‘ZZZ’ ends with ‘AAA’ in Latin-1 locales
enum.Flag) This enum specifies how the split() functions should behave with respect to empty strings.
If a field is empty, keep it in the result.
If a field is empty, don’t include it in the result.
This enum describes how to repeat or stretch the parts of an image when drawing.
Scale the image to fit to the available area.
Repeat the image until there is no more space. May crop the last image.
Similar to Repeat, but scales the image down to ensure that the last tile is not cropped.
New in version 4.6.
enum.IntFlag) This enum type is used to describe alignment. It contains horizontal and vertical flags that can be combined to produce the required effect.
TextElideMode enum can also be used in many situations to fine-tune the appearance of aligned text.
The horizontal flags are:
Aligns with the left edge.
Aligns with the right edge.
Centers horizontally in the available space.
Justifies the text in the available space.
The vertical flags are:
Aligns with the top.
Aligns with the bottom.
Centers vertically in the available space.
Aligns with the baseline.
You can use only one of the horizontal flags at a time. There is one two-dimensional flag:
Centers 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:
If the widget’s layout direction is
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.
Synonym for Qt::AlignLeft.
Synonym for Qt::AlignRight.
Conflicting combinations of flags have undefined meanings.
enum.IntFlag) This enum type is used to define some modifier flags. Some of these flags only make sense in the context of printing:
Treats all whitespace as spaces and prints just one line.
If it’s impossible to stay within the given bounds, it prints outside.
Makes the U+0009 (ASCII tab) character move to the next tab stop.
Displays the string “&P” as P For an ampersand, use “&&”.
Breaks lines at appropriate points, e.g. at word boundaries.
Breaks lines anywhere, even within words.
Same as Qt::TextShowMnemonic but doesn’t draw the underlines.
Treat this text as “hidden” and don’t print it.
When this option is set,
naturalTextRect()will return a value that includes the width of trailing spaces in the text; otherwise this width is excluded.
Ensures 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.
This enum specifies where the ellipsis should appear when displaying texts that don’t fit:
The ellipsis should appear at the beginning of the text.
The ellipsis should appear at the end of the text.
The ellipsis should appear in the middle of the text.
Ellipsis should NOT appear in the text.
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… “).
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.
The whitespace mode used to display normal word wrapped text in paragraphs.
A preformatted text mode in which whitespace is reproduced exactly.
This enum contains the types of accuracy that can be used by the
QTextDocument class when testing for mouse clicks on text documents.
The point at which input occurred must coincide exactly with input-sensitive parts of the document.
The point at which input occurred can lie close to input-sensitive parts of the document.
enum.IntFlag) 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
This 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.
Indicates 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.
Indicates 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
windowModalityproperty. 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.
Indicates that the window is a sheet on macOS. Since using a sheet implies window modality, the recommended way is to use
Indicates that the widget is a drawer on macOS. This feature is obsolete. Setting the flag has no effect.
Indicates 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.
Indicates 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
Indicates that the widget is a tooltip. This is used internally to implement
Indicates that the window is a splash screen. This is the default type for
Indicates that this widget is a sub-window, such as a
Indicates that this window object is a handle representing a native platform window created by another process or by manually using native code.
Indicates 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:
Gives the window a thin dialog border on Windows. This style is traditionally used for fixed-size dialogs.
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.
Gives the window its own display context on Windows.
This 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.
Bypass the window manager completely. This results in a borderless window that is not managed at all (i.e., no keyboard input unless you call
Produces a borderless window.
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.
If the window manager relies on the frame to interactively manipulate the window, the user can no longer move or resize the window via the window system, but this side effect should not be relied on. To produce a fixed size window that can not be resized, please set
setMaximumSize() to the same size.
Disables window drop shadow on supporting platforms.
CustomizeWindowHint flag is used to enable customization of the window controls. This flag must be set to allow the
WindowCloseButtonHint flags to be changed.
Turns off the default window title hints.
Gives the window a title bar.
Adds 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
Adds a minimize button. On some platforms this implies Qt::WindowSystemMenuHint for it to work.
Adds a maximize button. On some platforms this implies Qt::WindowSystemMenuHint for it to work.
Adds a minimize and a maximize button. On some platforms this implies Qt::WindowSystemMenuHint for it to work.
Adds a close button. On some platforms this implies Qt::WindowSystemMenuHint for it to work.
Adds a context help button to dialogs. On some platforms this implies Qt::WindowSystemMenuHint for it to work.
On macOS adds a tool bar button (i.e., the oblong button that is on the top right of windows that have toolbars).
On macOS adds a fullscreen button.
Prevents the window and its children from automatically embedding themselves into a
QGraphicsProxyWidgetif 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.
Adds a shade button in place of the minimize button if the underlying window manager supports it.
Informs 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.
Informs the window system that the window should stay on bottom of all other windows.
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.
On Windows, this will work only for frameless or full-screen windows.
Informs 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.
Informs 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.
Informs the window system that this window should not receive the input focus.
Informs 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
A mask for extracting the window type part of the window flags.
windowFlags Window Flags Example
enum.Flag) This enum type is used to specify the current state of a top-level window.
The states are
The window has no state set (in normal state).
The window is minimized (i.e. iconified).
The window is maximized with a frame around it.
The window fills the entire screen without any frame around it.
The window is the active window, i.e. it has keyboard focus.
enum.Flag) This enum type is used to specify the current state of the application.
The states are
The 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).
The 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.
The 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.
The application is visible and selected to be in front.
enum.Flag) This enum type specifies the various orientations a screen might have.
The display’s primary orientation.
Landscape orientation, display width is greater than display height.
Portrait orientation, display height is greater than display width, rotated 90 degree clockwise relative to landscape.
Inverted landscape orientation, rotated 180 degrees relative to landscape.
Inverted portrait orientation, rotated 180 degrees relative to portrait.
This enum type is used to specify various widget attributes. Attributes are set and cleared with
setAttribute() , and queried with
testAttribute() , although some have special convenience functions which are mentioned below.
Allows data from drag and drop operations to be dropped onto the widget (see
Enables tooltips for inactive windows.
Indicates that the widget wants to continue operating normally in “What’s This?” mode. This is set by the widget’s author.
Makes Qt delete this widget when the widget has accepted the close event (see
Indicates that the widget is disabled, i.e. it does not receive any mouse or keyboard events. There is also a getter functions
isEnabled(). This is set/cleared by the Qt kernel.
Indicates that the widget is hidden or is not a part of the viewable Desktop.
Indicates 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
Indicates 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
Forces 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.
Enables input methods for Asian languages. Must be set when creating custom text editing widgets.
Set on a toplevel window when the users changes focus with the keyboard (tab, backtab, or shortcut).
Enables 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
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.
Modifierkeys, 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.
Indicates that the widget wants
QLayoutto operate on the entire
rect(), not only on
contentsRect(). This is set by the widget’s author.
Ignore the layout item rect from the style when laying out this widget with
Indicates 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.
Indicates that this widget should get a
QFocusFramearound it. Some widgets draw their own focus halo regardless of this attribute. Not that the
focusPolicyalso 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.
Indicates the widget should have the normal size for widgets in macOS. This attribute is only applicable to macOS.
Indicates the widget should have the small size for widgets in macOS. This attribute is only applicable to macOS.
Indicates the widget should have the mini size for widgets in macOS. This attribute is only applicable to macOS.
Indicates that the widget is mapped on screen. This is set/cleared by the Qt kernel.
Makes the widget receive mouse events for the entire widget regardless of the currently set mask, overriding
setMask(). This is not applicable for top-level windows.
Indicates that the widget has mouse tracking enabled. See
Indicates that the widget has an explicit position. This is set/cleared by
Indicates 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.
Indicates that the widget does not want to receive ChildAdded or ChildRemoved events sent from its children. This is set by a widget’s author.
Used 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.
Prohibits mouse events from being propagated to the widget’s parent. This attribute is disabled by default.
When 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.
Indicates 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.
Indicates 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.
Indicates 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.
Indicates 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
paintEngine()to return 0 and set this flag.
Makes 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.
Indicates that a move event is pending, e.g., when a hidden widget was moved. This flag is set or cleared by the Qt kernel.
Indicates that a resize event is pending, e.g., when a hidden widget was resized. This flag is set or cleared by the Qt kernel.
Indicates that the widget should be taken into account when deciding whether to quit the application when the last window is closed. This behavior can be modified with the
quitOnLastWindowClosedproperty. By default this attribute is set for all widgets of type
Indicates that the widget has an explicit size. This flag is set or cleared by
Indicates that the layout direction for the widget is right to left.
Indicates that the widget has a cursor of its own. This flag is set or cleared by
Indicates that the widget has a font of its own. This flag is set or cleared by
Indicates that the widget has a palette of its own. This flag is set or cleared by
Indicates that the widget has a style of its own. This flag is set or cleared by
This attribute has been deprecated. Use
Indicates 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.
Indicates 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.
Indicates that the widget appearance was modified by a style sheet . WA_StyleSheet will also be set. This value was introduced in Qt 5.12.
Indicates that the widget has tablet tracking enabled. See
Indicates 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
FramelessWindowHintwindow 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.
Indicates 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,
underMouse(). This flag is set or cleared by the Qt kernel.
Indicates 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.
Indicates 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
Makes a toplevel window inherit font, palette and locale from its parent.
On macOS, show the tool window even when the application is not active. By default, all tool windows are hidden when the application is inactive.
Indicates the locale should be taken into consideration in the widget.
Indicates the widget should be drawn using a styled background.
Show the widget without making it active.
Indicates 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.
Indicates that the widget’s ancestors are kept non-native even though the widget itself is native.
Adds _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.
Adds _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.
Adds _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
Adds _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
Adds _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
Adds _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
Adds _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
Adds _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
QMenuobjects added to a
Adds _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
Adds _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
Adds _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.
Adds _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
Adds _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.
Allows 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.
Allows touchpad single touch events to be sent to the widget.
Asks the window manager to not give focus to this top level window. This attribute has no effect on non-X11 platforms.
QQuickWidgetto 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.
QWidgetrespects the safe area margins of a window by incorporating the margins into its contents’ margins by default. This means, that a
QLayoutwill 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.
Actions with the Icon property won’t be shown in any menus unless specifically set by the
iconVisibleInMenuproperty. 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
iconVisibleInMenuproperty will always be picked up.
Actions with the Shortcut property won’t be shown in any shortcut menus unless specifically set by the
shortcutVisibleInContextMenuproperty. 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
QCoreApplicationhas been instantiated.
Ensures that widgets have native windows.
Ensures that siblings of native widgets stay non-native unless specifically set by the
Indicates 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
QGuiApplicationconstructed. This value was added in Qt 5.7.
All 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).
Keyboard 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
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
When this attribute is true Qt will not do the remapping, and pressing the Command modifier will result in
MetaModifier , while pressing the Control modifier will result in
Note that the
StandardKey sequences will always be based on the same modifier (i.e.,
Copy will be Command+C regardless of the value set), but what is output for
toString() will be different.
Assume 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.
All mouse events that are not accepted by the application will be translated to touch events instead.
All touch events that are not accepted by the application will be translated to left button mouse events instead. This attribute is enabled by default.
Make top-level widgets use pure raster surfaces, and do not support non-native GL-based child widgets.
Forces 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
QGuiApplicationis constructed. This value was added in Qt 5.3.
Forces 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
QGuiApplicationis constructed. This value was added in Qt 5.3.
Forces 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.dlland 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
QGuiApplicationis constructed. This value was added in Qt 5.4.
Enables resource sharing between the OpenGL contexts used by classes like
QQuickWidget. This allows sharing OpenGL resources, like textures, between
QOpenGLWidgetinstances that belong to different top-level windows. This attribute must be set before
QGuiApplicationis constructed. This value was added in Qt 5.4.
Indicates whether a palette was explicitly set on the
QGuiApplication. This value was added in Qt 5.5.
By default, Qt Style Sheets disable regular
QWidgetpalette and font propagation. When this flag is enabled, font and palette changes propagate as though the user had manually called the corresponding
QWidgetmethods. See The Style Sheet Syntax - Inheritance for more details. This value was added in Qt 5.7.
All 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.
All 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.
Enables compression of certain frequent events. On the X11 windowing system, the default value is true, which means that
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.
Enables 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.
When making a context current using
QOpenGLContext, do not check that the
QObject thread affinityof the
QOpenGLContextobject is the same thread calling
makeCurrent(). This value was added in Qt 5.8.
Disables caching of shader program binaries on disk. By default Qt Quick,
QPainter‘s OpenGL backend, and any application using
QOpenGLShaderProgramwith 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.
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
QGuiApplicationis constructed. This value was added in 5.14
When 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
enum.Flag) 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
(default) - If the image has
depth1 and contains only black and white pixels, the pixmap becomes monochrome.
The pixmap is dithered/converted to the
native display depth.
The pixmap becomes monochrome. If necessary, it is dithered using the chosen dithering algorithm.
Dithering mode preference:
(default) - A high-quality dither using error diffusion.
A faster, ordered dither.
No dithering; closest color is used.
Dithering mode preference for 1-bit alpha masks:
(default) - No dithering.
A faster, ordered dither.
A high-quality dither using error diffusion.
Color matching versus dithering preference:
Always dither images when converting to smaller color-spaces.
Only dither to indexed formats if the source image uses more different colors than the size of the color table of the destination format.
(default) - Only dither when down-converting to 1 or 8-bit indexed formats.
Do 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.
Don’t do any format conversions on the image. Can be useful when converting a
QPixmapfor a one-time rendering operation for example. Note that a
QPixmapnot in the preferred format will be much slower as a paint device.
enum.IntEnum) The key names used by Qt.
Typically located on the keypad.
The Pause/Break key (Note: Not related to pausing media)
Corresponds 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
On macOS, this corresponds to the Command keys.
On macOS, this corresponds to the Control keys. On Windows keyboards, this key is mapped to the Windows key.
On Windows, when the KeyDown event for this key is sent, the Ctrl+Alt modifiers are also set.
A key setting the state of the media player to play
A key setting the state of the media player to stop
A key setting the state of the media player to pause (Note: not the pause/break key)
A key to toggle the play/pause state in the media player (rather than setting an absolute state)
A key to answer or initiate a call (see Qt::Key_ToggleCallHangup for a key to toggle current call state)
A key to activate the camera shutter. On Windows Runtime, the environment variable QT_QPA_ENABLE_CAMERA_KEYS must be set to receive the event.
A key to focus the camera. On Windows Runtime, the environment variable QT_QPA_ENABLE_CAMERA_KEYS must be set to receive the event.
A key to end an ongoing call (see Qt::Key_ToggleCallHangup for a key to toggle current call state)
A key to toggle the current call state (ie. either answer, or hangup) depending on current call state
enum.Flag) This enum describes the modifier keys.
No modifier key is pressed.
A Shift key on the keyboard is pressed.
A Ctrl key on the keyboard is pressed.
An Alt key on the keyboard is pressed.
A Meta key on the keyboard is pressed.
A keypad button is pressed.
X11 only (unless activated on Windows by a command line argument). A Mode_switch key on the keyboard is pressed.
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.
On Windows Keyboards, Qt::MetaModifier and
Key_Meta are mapped to the Windows key.
enum.Flag) This enum provides shorter names for the keyboard modifier keys supported by Qt.
On macOS, the
CTRL value corresponds to the Command keys on the keyboard, and the
META value corresponds to the Control keys.
The Shift keys provided on all standard keyboards.
The Meta keys.
The Ctrl keys.
The normal Alt keys, but not keys like AltGr.
This enum type defines the pen styles that can be drawn using
QPainter . The styles are:
no line at all. For example,
drawRect()fills but does not draw any boundary line.
A plain line.
Dashes separated by a few pixels.
Dots separated by a few pixels.
Alternate dots and dashes.
One dash, two dots, one dash, two dots.
A custom pattern defined using
This enum type defines the pen cap styles supported by Qt, i.e. the line end caps that can be drawn using
a square line end that does not cover the end point of the line.
a square line end that covers the end point and extends beyond it by half the line width.
a rounded line end.
This enum type defines the pen join styles supported by Qt, i.e. which joins between two connected lines can be drawn using
The outer edges of the lines are extended to meet at an angle, and this area is filled.
The triangular notch between the two lines is filled.
A circular arc between the two lines is filled.
A miter join corresponding to the definition of a miter join in the SVG 1.2 Tiny specification.
This enum type defines the brush styles supported by Qt, i.e. the fill pattern of shapes drawn using
No brush pattern.
Extremely dense brush pattern.
Very dense brush pattern.
Somewhat dense brush pattern.
Half dense brush pattern.
Somewhat sparse brush pattern.
Very sparse brush pattern.
Extremely sparse brush pattern.
Crossing horizontal and vertical lines.
Backward diagonal lines.
Forward diagonal lines.
Crossing diagonal lines.
Linear gradient (set using a dedicated
Conical gradient (set using a dedicated
Radial gradient (set using a dedicated
Custom pattern (see
This enum is used by
addRoundedRect() functions to specify the radii of rectangle corners with respect to the dimensions of the bounding rectangles specified.
Specifies the size using absolute measurements.
Specifies the size relative to the bounding rectangle, typically using percentage measurements.
This enum describes the available UI effects.
By default, Qt will try to use the platform specific desktop settings for each effect. Use the
setDesktopSettingsAware() function (passing
false as argument) to prevent this, and the
setEffectEnabled() to enable or disable a particular effect.
Note that all effects are disabled on screens running at less than 16-bit color depth.
Show animated menus.
Show faded menus.
Show animated comboboxes.
Show tooltip animations.
Show tooltip fading effects.
This enum type defines the various cursors that can be used.
The standard arrow cursor is the default for widgets in a normal state.
The standard arrow cursor.
An arrow pointing upwards toward the top of the screen.
A crosshair cursor, typically used to help the user accurately select a point on the screen.
An hourglass or watch cursor, usually shown during operations that prevent the user from interacting with the application.
A caret or ibeam cursor, indicating that a widget can accept and display text input.
A cursor used for elements that are used to vertically resize top-level windows.
A cursor used for elements that are used to horizontally resize top-level windows.
A cursor used for elements that are used to diagonally resize top-level windows at their top-right and bottom-left corners.
A cursor used for elements that are used to diagonally resize top-level windows at their top-left and bottom-right corners.
A cursor used for elements that are used to resize top-level windows in any direction.
A blank/invisible cursor, typically used when the cursor shape needs to be hidden.
A cursor used for vertical splitters, indicating that a handle can be dragged horizontally to adjust the use of available space.
A cursor used for horizontal splitters, indicating that a handle can be dragged vertically to adjust the use of available space.
A pointing hand cursor that is typically used for clickable elements such as hyperlinks.
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.
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.
A cursor representing a closed hand, typically used to indicate that a dragging operation is in progress that involves scrolling.
An arrow with a question mark, typically used to indicate the presence of What’s This? help for a widget.
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.
A cursor that is usually used when dragging an item.
A cursor that is usually used when dragging an item to copy it.
A cursor that is usually used when dragging an item to make a link to it.
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.
The text string is interpreted as a plain text string.
The text string is interpreted as a rich text string. See Supported HTML Subset for the definition of rich text.
The text string is interpreted as for Qt::RichText if
true, otherwise as Qt::PlainText.
The text string is interpreted as Markdown-formatted text. This enum value was added in Qt 5.14.
This enum type defines what happens to the aspect ratio when scaling an rectangle.
The size is scaled freely. The aspect ratio is not preserved.
The size is scaled to a rectangle as large as possible inside a given rectangle, preserving the aspect ratio.
The size is scaled to a rectangle as small as possible outside a given rectangle, preserving the aspect ratio.
enum.Flag) Represents the areas a
QDockWidget can be plugged to.
A floating dock widget with tabs can be docked anywhere.
The left dock area of a
The right dock area of a
The top dock area of a
The bottom dock area of a
All dock widget areas (default).
No dock widget areas.
The 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:ssand combines these as
ddd MMM d HH:mm:ss yyyyfor 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
HH[[:]mm]format (two-digit hour and optional two-digit minutes, with optional colon separator); this shall change to use
UTCin place of
GMTin a future release of Qt, so the planned
UTCformat is recognized.
ISO 8601 extended format: uses
HH:mm:ss.zzzfor 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
HHformats for the time part, either of which may include a fractional part,
HH.zzz, applied to the last field present (hour or minute).
ISO 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.
RFC 2822 , RFC 850 and RFC 1036 format: when converting dates to string form, format
dd MMM yyyyis 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
tzoffis a timezone offset in
HHmmformat. 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.
ISODate formats, each
d represents a single digit of the year, month, and day used to specify the date. Each
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
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.
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).
Local time, controlled by a system time-zone setting.
Coordinated Universal Time.
An offset in seconds from Coordinated Universal Time.
A 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.
When specifying a datetime using OffsetFromUTC, the offset from UTC must also be supplied (it is measured in seconds). To specify a datetime using TimeZone, a
QTimeZone must be supplied. From Qt 6.5, a
QTimeZone can now package a timespec with, where needed, an offset as a lightweight time description, so that passing a
QTimeZone now provides a uniform way to use datetime APIs, saving the need to call them differently for different timespecs.
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.
This enum type describes the various modes of
QAbstractScrollArea ‘s scroll bars.
QAbstractScrollAreashows a scroll bar when the content is too large to fit and not otherwise. This is the default.
QAbstractScrollAreanever shows a scroll bar.
QAbstractScrollAreaalways 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.)
This enum type specifies a corner in a rectangle:
The top-left corner of the rectangle.
The top-right corner of the rectangle.
The bottom-left corner of the rectangle.
The bottom-right corner of the rectangle.
enum.Flag) This enum type specifies an edge in a rectangle:
The top edge of the rectangle.
The left edge of the rectangle.
The right edge of the rectangle.
The bottom edge of the rectangle.
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.
(Default) If the receiver
lives inthe thread that emits the signal, Qt::DirectConnection is used. Otherwise, Qt::QueuedConnection is used. The connection type is determined when the signal is emitted.
The slot is invoked immediately when the signal is emitted. The slot is executed in the signalling thread.
The slot is invoked when control returns to the event loop of the receiver’s thread. The slot is executed in the receiver’s thread.
Same 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.
This is a flag that can be combined with any one of the above connection types, using a bitwise OR. When Qt::UniqueConnection is set,
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.
This 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'
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 .
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:
The shortcut is active when its parent widget has focus.
The 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.
The shortcut is active when its parent widget is a logical subwidget of the active top-level window.
The shortcut is active when one of the applications windows are active.
Specifies which method should be used to fill the paths and polygons.
Specifies 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.
Specifies 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.
This enum specifies the behavior of the
Creates a mask where all pixels matching the given color are opaque.
Creates a mask where all pixels matching the given color are transparent.
This operation turns clipping off.
Replaces the current clip path/rect/region with the one supplied in the function call.
Intersects the current clip path/rect/region with the one supplied in the function call.
This enum is used in
QGraphicsView to specify how items are selected, or how to determine if shapes and items collide.
The output list contains only items whose
shapeis fully contained inside the selection area. Items that intersect with the area’s outline are not included.
The output list contains both items whose
shapeis fully contained inside the selection area, and items that intersect with the area’s outline. This is a common mode for rubber band selection.
The output list contains only items whose
bounding rectangleis fully contained inside the selection area. Items that intersect with the area’s outline are not included.
The output list contains both items whose
bounding rectangleis 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.
This enum is used in
QGraphicsScene to specify what to do with currently selected items when setting a selection area.
The currently selected items are replaced by items in the selection area.
The items in the selection area are added to the currently selected items.
This enum type defines whether image transformations (e.g., scaling) should be smooth or not.
The transformation is performed quickly, with no smoothing.
The resulting image is transformed using bilinear filtering.
This enum type defines three values to represent the three axes in the cartesian coordinate system.
The X axis.
The Y axis.
The Z axis.
This enum specifies why the focus changed. It will be passed through
setFocus and can be retrieved in the
QFocusEvent sent to the widget upon focus change.
A mouse action occurred.
The Tab key was pressed.
A Backtab occurred. The input for this may include the Shift or Control keys; e.g. Shift+Tab.
The window system made this window either active or inactive.
The application opened/closed a pop-up that grabbed/released the keyboard focus.
The user typed a label’s buddy shortcut
The menu bar took focus.
Another reason, usually application-specific.
This enum type defines the various policies a widget can have with respect to showing a context menu.
the widget does not feature a context menu, context menu handling is deferred to the widget’s parent.
the 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
contextMenuEvent()handler is called.
the widget displays its
actions()as context menu.
the widget emits the
enum.Flag) The widget accepts input method input.
The rectangle covering the area of the input cursor in widget coordinates.
The currently used font for text input.
The 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
The plain text around the input area, for example the current paragraph.
The currently selected text.
The maximum number of characters that the widget can hold. If there is no limit,
The 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
The hints for input method on expected input. (See
The preferred input language.
Platform specific data for input method.
The 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
The 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.
The 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.
The Enter key type.
The bounding rectangle of the selection anchor. This value was added in Qt 5.7.
The 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.
The widget is read only. This value was added in Qt 6.2.
Commonly changed properties on input.
Query for all input method properties.
enum.Flag) No hints.
Flags that alter the behavior:
The input method should not show the characters while typing. This is automatically set when setting
Password. Note that setting
ImhHiddenTextdoes not change the echo mode.
Typed text should not be stored by the active input method in any persistent storage like predictive user dictionary.
The input method should not try to automatically switch to upper case when a sentence ends.
Numbers are preferred (but not required).
Upper case letters are preferred (but not required).
Lower case letters are preferred (but not required).
Do not use predictive text (i.e. dictionary lookup) while typing.
The text editor functions as a date field.
The text editor functions as a time field.
Latin characters are preferred (but not required).
Multiple lines can be entered into the text field.
Do not use built-in edit menu. This flag was introduced in Qt 5.11.
Do not use built-in text cursor and selection handles. This flag was introduced in Qt 5.11.
Flags that restrict input (exclusive flags):
Only digits are allowed.
Only number input is allowed. This includes decimal point and minus sign.
Only upper case letter input is allowed.
Only lower case letter input is allowed.
Only characters suitable for phone dialing are allowed.
Only characters suitable for email addresses are allowed.
Only characters suitable for URLs are allowed.
Only latin based input is allowed.
This mask yields nonzero if any of the exclusive flags are used.
If several exclusive flags are OR-ed together, the resulting character set will consist of the union of the specified sets. For instance specifying
ImhUppercaseOnly would yield a set consisting of numbers and uppercase letters.
New in version 4.6.
This can be used to alter the appearance of the Return key on an on-screen keyboard.
Not all of these values are supported on all platforms. For unsupported values the default key will be used instead.
The 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.
Show a Return button that inserts a new line. The keyboard will not close when this button is pressed.
Show a “Done” button. The keyboard will close when this button is pressed.
Show a “Go” button. Typically used in an address bar when entering a URL; the keyboard will close when this button is pressed.
Show a “Send” button. The keyboard will close when this button is pressed.
Show a “Search” button. The keyboard will close when this button is pressed.
Show 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.
Show a “Previous” button. The keyboard will not close when this button is pressed.
The style of the tool button, describing how the button’s text and icon should be displayed.
Only display the icon.
Only display the text.
The text appears beside the icon.
The text appears under the icon.
Specifies the direction of Qt’s layouts and text handling.
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
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.
Specifies a side of a layout item that can be anchored. This is used by
The left side of a layout item.
A “virtual” side that is centered between the left and the right side of a layout item.
The right side of a layout item.
The top side of a layout item.
A “virtual” side that is centered between the top and the bottom side of a layout item.
The bottom side of a layout item.
New in version 4.6.
enum.Flag) Looks only at the direct children of the object.
Looks at all children of the object (recursive search).
enum.Flag) Copy the data to the target.
Move the data from the source to the target.
Create a link from the source to the target.
Ignore the action (do nothing with the data).
On 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.
This enum describes the state of checkable items, controls, and widgets.
The item is unchecked.
The item is partially checked. Items in hierarchical models may be partially checked if some, but not all, of their children are checked.
The item is checked.
enum.IntEnum) 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:
The key data to be rendered in the form of text. (
The data to be rendered as a decoration in the form of an icon. (
The data in a form suitable for editing in an editor. (
The data displayed in the item’s tooltip. (
The data displayed in the status bar. (
The data displayed for the item in “What’s This?” mode. (
The size hint for the item that will be supplied to views. (
Roles describing appearance and meta data (with associated types):
The font used for items rendered with the default delegate. (
The alignment of the text for items rendered with the default delegate. (
The background brush used for items rendered with the default delegate. (
The foreground brush (text color, typically) used for items rendered with the default delegate. (
This role is used to obtain the checked state of an item. (
This role is used to obtain the initial sort order of a header view section. (
SortOrder). This role was introduced in Qt 4.8.
Accessibility roles (with associated types):
The text to be used by accessibility extensions and plugins, such as screen readers. (
A description of the item for accessibility purposes. (
The 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.Flag) This enum describes the properties of an item:
It does not have any properties set.
It can be selected.
It can be edited.
It can be dragged.
It can be used as a drop target.
It can be checked or unchecked by the user.
The user can interact with the item.
The 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).
The item never has child items. This is used for optimization purposes only.
The 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
QTableWidgetItem , and
Note that it is undefined behavior to reimplement
hasChildren to return true for an index if that index has the Qt::ItemNeverHasChildren flag set.
enum.Flag) This enum describes the type of matches that can be used when searching for items in a model.
Performs string-based matching. String-based comparisons are case-insensitive unless the
MatchCaseSensitiveflag is also specified.
The search term is contained in the item.
The search term matches the start of the item.
The search term matches the end of the item.
The search is case sensitive.
Performs string-based matching using a regular expression as the search term. Uses
QRegularExpression. When using this flag, a
QRegularExpressionobject can be passed as parameter and will directly be used to perform the search. The case sensitivity flag will be ignored as the
QRegularExpressionobject is expected to be fully configured. This enum value was added in Qt 5.15.
Performs string-based matching using a string with wildcards as the search term.
Perform 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.
Searches the entire hierarchy.
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.
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:
The window is not modal and does not block input to other windows.
The 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.
The window is modal to the application and blocks input to all windows.
enum.Flag) This enum specifies how a text displaying widget reacts to user input.
No interaction with the text is possible.
Text can be selected with the mouse and copied to the clipboard using a context menu or standard keyboard shortcuts.
Text can be selected with the cursor keys on the keyboard. A text cursor is shown.
Links can be highlighted and activated with the mouse.
Links can be focused using tab and activated with enter.
The text is fully editable.
The default for a text editor.
The default for
This section contains snippets that were automatically translated from C++ to Python and may contain errors.
This enum can be used to specify event priorities.
Events with this priority are sent before events with NormalEventPriority or LowEventPriority.
Events with this priority are sent after events with HighEventPriority, but before events with LowEventPriority.
Events 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_MIN, inclusive. For example, you can define custom priorities as being relative to each other:
CustomEventPriority = enum() # 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
This enum is used by
is used to specify the minimum size of a graphics layout item.
is used to specify the preferred size of a graphics layout item.
is used to specify the maximum size of a graphics layout item.
is used to specify the minimum descent of a text string in a graphics layout item.
This enum is used to describe parts of a window frame. It is returned by
windowFrameSectionAt() to describe what section of the window frame is under the mouse.
This enum specifies the coordinate system.
Coordinates are relative to the top-left corner of the object’s paint device.
Coordinates are relative to the top-left corner of the object.
New in version 4.6.
enum.Flag) This enum represents the state of a touch point at the time a
The state of the touch point is not known.
The touch point is now pressed.
The touch point moved.
The touch point did not move.
The touch point was released.
New in version 4.6.
This enum type describes the state of a gesture.
No gesture has been detected.
A continuous gesture has started.
A gesture continues.
A gesture has finished.
A gesture was canceled.
New in version 4.6.
enum.IntEnum) This enum type describes the standard gestures.
A Tap gesture.
A Tap-And-Hold (Long-Tap) gesture.
A Pan gesture.
A Pinch gesture.
A Swipe gesture.
A flag that can be used to test if the gesture is a user-defined gesture ID.
User-defined gestures are registered with the
registerRecognizer() function which generates a custom gesture ID with the Qt::CustomGesture flag set.
New in version 4.6.
enum.Flag) This enum type describes additional flags that can be used when subscribing to a gesture.
By 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.
Allows any ignored gesture events to be propagated to parent widgets which have specified this hint. By default only gestures that are in the
GestureStartedstate are propagated and the widget always gets the full gesture sequence starting with a gesture in the
GestureStartedstate and ending with a gesture in the
Allows fine-tuning of gesture event propagation. By setting the flag when
grabbinga gesture all ignored partial gestures will propagate to their parent items.
New in version 4.6.
This enum returns the gesture type.
Sent before gesture event stream.
Sent after gesture event stream.
Specifies the displacement delta in pixels.
Specifies the magnification delta in percent.
Boolean magnification state.
Specifies the rotation delta in degrees.
Sent after a swipe movement.
This enum type describes the mode for moving focus.
Only the touch screen is used.
Key_Downare used to change focus.
Key_Rightare used to change focus.
The 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.
The 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)
Cursor navigation is not currently implemented on any platform and behaves as NavigationModeNone.
New in version 4.6.
This enum describes the movement style available to text cursors. The options are:
Within 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.
Pressing 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.
New in version 4.8.
The timer type indicates how accurate a timer can be.
Precise timers try to keep millisecond accuracy
Coarse timers try to keep accuracy within 5% of the desired interval
Very 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).
This enum describes the phase of scrolling.
The input device doesn’t support scroll phase. This value was introduced in Qt 5.7.
Scrolling is about to begin, but the scrolling distance did not yet change.
The scrolling distance has changed (default).
Scrolling has ended, and the scrolling distance did not change anymore.
The user no longer touches the input device, but scrolling continues due to scroll momentum. This value was introduced in Qt 5.12.
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.
The 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.
Indicates that the mouse event was synthesized from a touch event by the platform.
Indicates that the mouse event was synthesized from an unhandled touch event by Qt.
Indicates 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
enum.Flag) This enum provides additional information concerning a
Indicates that Qt has created a
MouseButtonDblClickevent from this event. The flag is set in the causing
MouseButtonPress, and not in the resulting
This enum describes the possible standards used by qChecksum().
Checksum calculation based on ISO 3309.
Checksum calculation based on ITU-V.41.
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.
Round up for .5 and above.
Always round up.
Always round down.
Round up for .75 and above.
This enum describes the possible statuses of a permissions.
The permission status is not yet known. Permission should be requested via
requestPermission()to determine the actual status. This status will never be the result of requesting a permission.
The user has explicitly granted the application the permission, or the permission is known to not require user authorization on the given platform.
The user has explicitly denied the application the requested permission, or the permission is known to not be accessible or applicable to applications on the given platform.
On Android, there is no
Undetermined status by the platform’s APIs. Thus, if a permission is denied for an app,
Undetermined by default until
requestPermission() is called. After that
checkPermission() reports a non
checkPermission() Application Permissions
New in version 6.5.
This is a dummy type, designed to help users transition from certain deprecated APIs to their replacement APIs.
- static PySide6.QtCore.Qt.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
Groups can be nested. In that case, the deferral ends only after the outermost group has been ended.
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.
- static PySide6.QtCore.Qt.bin(s)#
setIntegerBase (2) on
stream and returns
- static PySide6.QtCore.Qt.bom(s)#
Toggles insertion of the Byte Order Mark on
QTextStream is used with a UTF encoding.
- static PySide6.QtCore.Qt.center(s)#
AlignCenter ) on
stream and returns
- static PySide6.QtCore.Qt.dec(s)#
setIntegerBase (10) on
stream and returns
- static PySide6.QtCore.Qt.endPropertyUpdateGroup()#
Ends a property update group. If the outermost group has been ended, and deferred binding evaluations and notifications happen now.
Calling endPropertyUpdateGroup without a preceding call to
beginPropertyUpdateGroup results in undefined behavior.
- static PySide6.QtCore.Qt.endl(s)#
This section contains snippets that were automatically translated from C++ to Python and may contain errors.
Writes ‘\n’ to the
stream and flushes the stream.
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.
- static PySide6.QtCore.Qt.fixed(s)#
FixedNotation ) on
stream and returns
- static PySide6.QtCore.Qt.flush(s)#
stream and returns
- static PySide6.QtCore.Qt.forcepoint(s)#
- static PySide6.QtCore.Qt.forcesign(s)#
- static PySide6.QtCore.Qt.hex(s)#
setIntegerBase (16) on
stream and returns
The hex modifier can only be used for writing to streams.
- static PySide6.QtCore.Qt.left(s)#
AlignLeft ) on
stream and returns
- static PySide6.QtCore.Qt.lowercasebase(s)#
- static PySide6.QtCore.Qt.lowercasedigits(s)#
- static PySide6.QtCore.Qt.noforcepoint(s)#
- static PySide6.QtCore.Qt.noforcesign(s)#
- static PySide6.QtCore.Qt.noshowbase(s)#
- static PySide6.QtCore.Qt.oct(s)#
setIntegerBase (8) on
stream and returns
- static PySide6.QtCore.Qt.reset(s)#
stream and returns
- static PySide6.QtCore.Qt.right(s)#
AlignRight ) on
stream and returns
- static PySide6.QtCore.Qt.scientific(s)#
ScientificNotation ) on
stream and returns
- static PySide6.QtCore.Qt.showbase(s)#
- static PySide6.QtCore.Qt.uppercasebase(s)#
- static PySide6.QtCore.Qt.uppercasedigits(s)#
- static PySide6.QtCore.Qt.ws(s)#
stream and returns