Home · All Namespaces · All Classes · Main Classes · Grouped Classes · Modules · Functions

Qt Namespace Reference
[QtGui module]

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

 #include <Qt>

Types

Functions


Detailed Description

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


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.

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

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::AnchorAttribute

An anchor has one or more of the following attributes:

ConstantValueDescription
Qt::AnchorName0the name attribute of the anchor. This attribute is used when scrolling to an anchor in the document.
Qt::AnchorHref1the href attribute of the anchor. This attribute is used when a link is clicked to determine what content to load.

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_ImmediateWidgetCreation0Ensures that widgets are created as soon as they are constructed. By default, resources for widgets are allocated on demand to improve efficiency and minimize resource usage. Setting or clearing this attribute affects widgets constructed after the change. Setting it tells Qt to create toplevel windows immediately. Therefore, if it is important to minimize resource consumption, do not set this attribute.
Qt::AA_MSWindowsUseDirect3DByDefault1Is a Windows specific attribute, that will make the Direct3D paint engine the default Qt widget paint engine. Note that you can toggle usage of the Direct3D engine on individual QWidgets by setting/clearing the WA_MSWindowsUseDirect3D attribute on a specific widget. This functionality is experimental.
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 Mac OS X menubar MAY NOT pick up a change in this attribute. Changes in the QAction::iconVisibleInMenu property will always be picked up.

ConstantValueDescription
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_MacPluginApplication5Stops the a Qt mac application from doing specific initializations that do not necessarily make sense when using Qt to author a plugin. This includes avoiding loading our nib for the main menu and not taking possession of the native menu bar.

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.

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.
Qt::UniteClip3Unites 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::DirectConnection1When emitted, the signal is immediately delivered to the slot.
Qt::QueuedConnection2When emitted, the signal is queued until the event loop is able to deliver it to the slot.
Qt::BlockingQueuedConnection4Same as QueuedConnection, except that the current thread blocks until the slot has been delivered. This connection type should only be used for receivers in a different thread. Note that misuse of this type can lead to deadlocks in your application.
Qt::AutoConnection0If the signal is emitted from the thread in which the receiving object lives, the slot is invoked directly, as with Qt::DirectConnection; otherwise the signal is queued, as with Qt::QueuedConnection.

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.

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

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 mousePressEvent(), and 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::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::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::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, localized names. This is basically equivalent to using the date format string, "ddd MMM d yyyy". See QDate::toString() for more information.
Qt::ISODate1ISO 8601 extended format: either YYYY-MM-DD for dates or YYYY-MM-DDTHH:MM:SS for combined dates and times.
Qt::SystemLocaleShortDate?The short format used by the operating system.
Qt::SystemLocaleLongDate?The long format used by the operating system.
Qt::DefaultLocaleShortDate?The short format specified by the application's locale.
Qt::DefaultLocaleLongDate?The long format used by the application's locale.
Qt::SystemLocaleDate2This enum value is deprecated. Use Qt::SystemLocaleShortDate instead (or Qt::SystemLocaleLongDate if you want long dates).
Qt::LocaleDate?This enum value is deprecated. Use Qt::DefaultLocaleShortDate instead (or Qt::DefaultLocaleLongDate if you want long dates).
Qt::LocalDateSystemLocaleDateThis enum value is deprecated. Use Qt::SystemLocaleShortDate instead (or Qt::SystemLocaleLongDate if you want long dates).

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, minute and second used to specify the time. The presence of a literal T character is used to separate the date and time when both are specified.

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.

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::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 Mac OS X 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.

enum Qt::GlobalColor

Qt's predefined QColor objects:

ConstantValueDescription
Qt::white3 White (#ffffff)
Qt::black2 Black (#000000)
Qt::red7 Red (#ff0000)
Qt::darkRed13 Dark red (#800000)
Qt::green8 Green (#00ff00)
Qt::darkGreen14 Dark green (#008000)
Qt::blue9 Blue (#0000ff)
Qt::darkBlue15 Dark blue (#000080)
Qt::cyan10 Cyan (#00ffff)
Qt::darkCyan16 Dark cyan (#008080)
Qt::magenta11 Magenta (#ff00ff)
Qt::darkMagenta17 Dark magenta (#800080)
Qt::yellow12 Yellow (#ffff00)
Qt::darkYellow18 Dark yellow (#808000)
Qt::gray5 Gray (#a0a0a4)
Qt::darkGray4 Dark gray (#808080)
Qt::lightGray6 Light 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.

typedef Qt::HANDLE

Platform-specific handle type for system objects. This is equivalent to void * on Windows and Mac OS X, and embedded Linux, and to unsigned long on X11.

Warning: Using this type is not portable.

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.

This enum is defined in the <QTextDocument> header file.

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 for RGB channels:

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

Dithering mode preference for alpha channel:

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

Color matching versus dithering preference:

ConstantValueDescription
Qt::PreferDither0x00000040(default when converting to a pixmap) - Always dither 32-bit images when the image is converted to 8 bits.
Qt::AvoidDither0x00000080(default when converting for the purpose of saving to file) - Dither 32-bit images only if the image has more than 256 colors and it is being converted to 8 bits.

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

enum Qt::InputMethodQuery

ConstantValueDescription
Qt::ImMicroFocus0The rectangle covering the area of the input cursor in widget coordinates.
Qt::ImFont1The currently used font for text input.
Qt::ImCursorPosition2The logical position of the cursor within the text surrounding the input area (see ImSurroundingText). If any text is selected, the position returned will be at the logical end of the selection, even if the real cursor is located at the logical start.
Qt::ImSurroundingText3The plain text around the input area, for example the current paragraph.
Qt::ImCurrentSelection4The currently selected text.

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.

The general purpose roles are:

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

Roles describing appearance and meta data:

ConstantValueDescription
Qt::FontRole6The font used for items rendered with the default delegate.
Qt::TextAlignmentRole7The alignment of the text for items rendered with the default delegate.
Qt::BackgroundRole8The background brush used for items rendered with the default delegate.
Qt::BackgroundColorRole8This role is obsolete. Use BackgroundRole instead.
Qt::ForegroundRole9The foreground brush (text color, typically) used for items rendered with the default delegate.
Qt::TextColorRole9This role is obsolete. Use ForegroundRole instead.
Qt::CheckStateRole10This role is used to obtain the checked state of an item (see Qt::CheckState).

Accessibility roles:

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

User roles:

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

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::ItemIsTristate64The item is checkable with three separate states.

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.

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 a 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::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_Pause0x01000008 
Qt::Key_Print0x01000009 
Qt::Key_SysReq0x0100000a 
Qt::Key_Clear0x0100000b 
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 Mac OS X, this corresponds to the Command keys.
Qt::Key_Meta0x01000022On Mac OS X, 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_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_MediaPlay0x01000080 
Qt::Key_MediaStop0x01000081 
Qt::Key_MediaPrevious0x01000082 
Qt::Key_MediaNext0x01000083 
Qt::Key_MediaRecord0x01000084 
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_MediaLast0x0100ffff 
Qt::Key_unknown0x01ffffff 
Qt::Key_Call0x01100004 
Qt::Key_Context10x01100000 
Qt::Key_Context20x01100001 
Qt::Key_Context30x01100002 
Qt::Key_Context40x01100003 
Qt::Key_Flip0x01100006 
Qt::Key_Hangup0x01100005 
Qt::Key_No0x01010002 
Qt::Key_Select0x01010000 
Qt::Key_Yes0x01010001 
Qt::Key_Execute0x01020003 
Qt::Key_Printer0x01020002 
Qt::Key_Play0x01020005 
Qt::Key_Sleep0x01020004 
Qt::Key_Zoom0x01020006 
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. A Mode_switch key on the keyboard is pressed.

Note: On Mac OS X, the ControlModifier value corresponds to the Command keys on the Macintosh 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:

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

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

See also QApplication::setLayoutDirection() and QWidget::setLayoutDirection().

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::MatchRegExp4Performs string-based matching using a regular expression as the search term.
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.

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

See also QString::compare() and QRegExp.

enum Qt::Modifier

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

Note: On Mac OS X, the CTRL value corresponds to the Command keys on the Macintosh 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.
Qt::UNICODE_ACCEL0x00000000The shortcut is specified as a Unicode code point, not as a Qt Key.

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::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::MidButton0x00000004The middle button.
Qt::XButton10x00000008The first X button.
Qt::XButton20x00000010The second X button.

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

See also KeyboardModifier and Modifier.

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.

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.

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

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.

This enum was introduced in Qt 4.4.

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.

This enum was introduced in Qt 4.4.

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

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.

Qt::ElideMiddle is normally the most appropriate choice for URLs (e.g., "http://www.qtsof...ovingto/beijing/"), 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 (see QButton for an example). 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::IncludeTrailingSpacesTextIncludeTrailingSpacesWhen this option is set, QTextLine::naturalTextWidth() and naturalTextRect() will return a value that includes the width of trailing spaces in the text; otherwise this width is excluded.
Qt::TextIncludeTrailingSpaces0x08000000Same as IncludeTrailingSpaces
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, e.g. 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 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.
Qt::AutoText2The text string is interpreted as for Qt::RichText if Qt::mightBeRichText() returns true, otherwise as Qt::PlainText.
Qt::LogText3A special, limited text format which is only used by Q3TextEdit in an optimized mode.

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::TimeSpec

ConstantValueDescription
Qt::LocalTime0Locale dependent time (Timezones and Daylight Savings Time).
Qt::UTC1Coordinated Universal Time, replaces Greenwich Mean Time.
Qt::OffsetFromUTC2An offset in seconds from Coordinated Universal Time.

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.

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 QApplication::setDesktopSettingsAware().

typedef Qt::WFlags

Synonym for Qt::WindowFlags.

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 

This enum is defined in the <QTextDocument> header file.

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_ContentsPropagated3This flag is superfluous and obsolete; it no longer has any effect. Since Qt 4.1, all widgets that do not set WA_PaintOnScreen propagate their contents.
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_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_GroupLeader72This attribute has been deprecated. Use QWidget::windowModality instead.
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. On Windows CE this flag can be used in addition to QApplication::autoSipEnabled to automatically display the SIP when entering a widget.
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. This makes a difference in QMacStyle and QPlastiqueStyle for some widgets.
Qt::WA_MacNoClickThrough12When a widget that has this attribute set is clicked, and its window is inactive, the click will make the window active but won't be seen by the widget. Typical use of this attribute is on widgets with "destructive" actions, such as a "Delete" button. WA_MacNoClickThrough also applies to all child widgets of the widget that has it set.
Qt::WA_MacOpaqueSizeGrip85Indicates that the native Carbon size grip should be opaque instead of transparent (the default). This attribute is only applicable to Mac OS X 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 Mac OS X.
Qt::WA_MacNormalSize89Indicates the widget should have the normal size for widgets in Mac OS X. This attribute is only applicable to Mac OS X.
Qt::WA_MacSmallSize90Indicates the widget should have the small size for widgets in Mac OS X. This attribute is only applicable to Mac OS X.
Qt::WA_MacMiniSize91Indicates the widget should have the mini size for widgets in Mac OS X. This attribute is only applicable to Mac OS X.
Qt::WA_MacVariableSize102Indicates the widget can choose between alternative sizes for widgets to avoid clipping. This attribute is only applicable to Mac OS X.
Qt::WA_MacBrushedMetal46Indicates the widget should be drawn in the brushed metal style as supported by the windowing system. This attribute is only applicable to Mac OS X.
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_MSWindowsUseDirect3D94Makes drawing to a widget with this attribute set use the Direct3D paint engine, if the Direct3D paint engine is available. This functionality is experimental.
Qt::WA_NoBackgroundWA_OpaquePaintEventThis value is obsolete. Use WA_OpaquePaintEvent instead.
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_PaintOutsidePaintEvent13Makes it possible to use QPainter to paint on the widget outside paintEvent(). This flag is not supported on Windows, Mac OS X or Embedded Linux. We recommend that you use it only when porting Qt 3 code to Qt 4.
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 QApplication::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.
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.
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.

ConstantValueDescription
Qt::WA_WindowModified41Indicates that the window is marked as modified. On some platforms this flag will do nothing, on others (including Mac OS X 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 and palette from its parent.
Qt::WA_MacAlwaysShowToolWindow96On Mac OS X, 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 automaticaly 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 QMenus 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_MacFrameworkScaled117Enables resolution independence aware mode on Mac when using Carbon. This attribute has no effect on Cocoa. The attribute is off by default and can be enabled on a per-window basis.

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

This enum was introduced in Qt 4.4.

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 widget is a Macintosh sheet.
Qt::Drawer0x00000006 | WindowIndicates that the widget is a Macintosh drawer.
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::Tool0x0000000a | WindowIndicates 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. It 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 Mac OS X, tool windows correspond to the Floating class of windows. This means that the window lives on a level above normal windows; 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::ToolTip0x0000000c | WindowIndicates that the widget is a tooltip. This is used internally to implement tooltips.
Qt::SplashScreen0x0000000e | WindowIndicates that the window is a splash screen. This is the default type for QSplashScreen.
Qt::Desktop0x00000010 | WindowIndicates that this widget is the desktop. This is the type for QDesktopWidget.
Qt::SubWindow0x00000012Indicates that this widget is a sub-window, such as a QMdiSubWindow widget.

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.
Qt::MSWindowsOwnDC0x00000200Gives the window its own display context on Windows.
Qt::X11BypassWindowManagerHint0x00000400Bypass 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.

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 Mac OS X adds a tool bar button (i.e., the oblong button that is on the top right of windows that have toolbars.
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::WindowShadeButtonHint0x00020000 
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 that 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 Mac OS X.
Qt::WindowOkButtonHint0x00080000Adds an OK button to the window decoration of a dialog. Only supported for Windows CE.
Qt::WindowCancelButtonHint0x00100000Adds a Cancel button to the window decoration of a dialog. Only supported for Windows CE.
Qt::WindowType_Mask0x000000ffA mask for extracting the window type part of the window flags.

Obsolete flags:

ConstantValueDescription
Qt::WMouseNoMask0x00080000Use Qt::WA_MouseNoMask instead.
Qt::WDestructiveClose0x00100000Use Qt::WA_DeleteOnClose instead.
Qt::WStaticContents0x00200000Use Qt::WA_StaticContents instead.
Qt::WGroupLeader0x00400000No longer needed.
Qt::WShowModal0x00800000Use QWidget::windowModality instead.
Qt::WNoMousePropagation0x01000000Use Qt::WA_NoMousePropagation instead.
Qt::WType_TopLevelWindowUse Qt::Window instead.
Qt::WType_DialogDialogUse Qt::Dialog instead.
Qt::WType_PopupPopupUse Qt::Popup instead.
Qt::WType_DesktopDesktopUse Qt::Desktop instead.
Qt::WType_MaskWindowType_MaskUse Qt::WindowType_Mask instead.
Qt::WStyle_Customize0No longer needed.
Qt::WStyle_NormalBorder0No longer needed.
Qt::WStyle_DialogBorderMSWindowsFixedSizeDialogHintUse Qt::MSWindowsFixedSizeDialogHint instead.
Qt::WStyle_NoBorderFramelessWindowHintUse Qt::FramelessWindowHint instead.
Qt::WStyle_TitleWindowTitleHintUse Qt::WindowTitleHint instead.
Qt::WStyle_SysMenuWindowSystemMenuHintUse Qt::WindowSystemMenuHint instead.
Qt::WStyle_MinimizeWindowMinimizeButtonHintUse Qt::WindowMinimizeButtonHint instead.
Qt::WStyle_MaximizeWindowMaximizeButtonHintUse Qt::WindowMaximizeButtonHint instead.
Qt::WStyle_MinMaxWStyle_Minimize | WStyle_MaximizeUse Qt::WindowMinMaxButtonsHint instead.
Qt::WStyle_ToolToolUse Qt::Tool instead.
Qt::WStyle_StaysOnTopWindowStaysOnTopHintUse Qt::WindowStaysOnTopHint instead.
Qt::WStyle_ContextHelpWindowContextHelpButtonHintUse Qt::WindowContextHelpButtonHint instead.
Qt::WPaintDesktop0No longer needed.
Qt::WPaintClever0No longer needed.
Qt::WX11BypassWMX11BypassWindowManagerHintUse Qt::X11BypassWindowManagerHint instead.
Qt::WWinOwnDCMSWindowsOwnDCUse Qt::MSWindowsOwnDC instead.
Qt::WMacSheetSheetUse Qt::Sheet instead.
Qt::WMacDrawerDrawerUse Qt::Drawer instead.
Qt::WStyle_SplashSplashScreenUse Qt::SplashScreen instead.
Qt::WNoAutoErase0No longer needed.
Qt::WRepaintNoErase0No longer needed.
Qt::WNorthWestGravityWStaticContentsUse Qt::WA_StaticContents instead.
Qt::WType_ModalDialog | WShowModalUse Qt::Dialog and QWidget::windowModality instead.
Qt::WStyle_DialogDialogUse Qt::Dialog instead.
Qt::WStyle_NoBorderExFramelessWindowHintUse Qt::FramelessWindowHint instead.
Qt::WResizeNoErase0No longer needed.
Qt::WMacNoSheet0No longer needed.

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

QString Qt::convertFromPlainText ( const QString & plain, WhiteSpaceMode mode = WhiteSpacePre )

Converts the plain text string plain to an HTML-formatted paragraph while preserving most of its look.

mode defines how whitespace is handled.

This function is defined in the <QTextDocument> header file.

See also escape() and mightBeRichText().

QString Qt::escape ( const QString & plain )

Converts the plain text string plain to a HTML string with HTML metacharacters <, >, and & replaced by HTML entities.

Example:

 QString plain = "#include <QtCore>"
 QString html = Qt::escape(plain);
 // html == "#include &lt;QtCore&gt;"

This function is defined in the <QTextDocument> header file.

See also convertFromPlainText() and mightBeRichText().

bool Qt::mightBeRichText ( const QString & text )

Returns true if the string text is likely to be rich text; otherwise returns false.

This function uses a fast and therefore simple heuristic. It mainly checks whether there is something that looks like a tag before the first line break. Although the result may be correct for common cases, there is no guarantee.

This function is defined in the <QTextDocument> header file.


Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) Trademarks
Qt 4.5.1