Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

Qt Namespace Reference
[QtCore module]

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

#include <Qt>

Types

  • flags Alignment
  • enum AlignmentFlag { AlignLeft, AlignRight, AlignHCenter, AlignJustify, ..., AlignVertical_Mask }
  • enum AnchorAttribute { AnchorName, AnchorHref }
  • enum ArrowType { NoArrow, UpArrow, DownArrow, LeftArrow, RightArrow }
  • enum AspectRatioMode { IgnoreAspectRatio, KeepAspectRatio, KeepAspectRatioByExpanding }
  • enum BGMode { TransparentMode, OpaqueMode }
  • enum BrushStyle { NoBrush, SolidPattern, Dense1Pattern, Dense2Pattern, ..., TexturePattern }
  • enum CaseSensitivity { CaseInsensitive, CaseSensitive }
  • enum CheckState { Unchecked, PartiallyChecked, Checked }
  • enum ClipOperation { NoClip, ReplaceClip, IntersectClip, UniteClip }
  • enum ConnectionType { DirectConnection, QueuedConnection, AutoConnection }
  • enum ContextMenuPolicy { NoContextMenu, DefaultContextMenu, ActionsContextMenu, CustomContextMenu }
  • enum Corner { TopLeftCorner, TopRightCorner, BottomLeftCorner, BottomRightCorner }
  • enum CursorShape { ArrowCursor, UpArrowCursor, CrossCursor, WaitCursor, ..., BitmapCursor }
  • enum DateFormat { TextDate, ISODate, LocalDate }
  • enum DayOfWeek { Monday, Tuesday, Wednesday, Thursday, ..., Sunday }
  • enum Dock { DockUnmanaged, DockTornOff, DockTop, DockBottom, ..., DockMinimized }
  • enum DockWidgetArea { LeftDockWidgetArea, RightDockWidgetArea, TopDockWidgetArea, BottomDockWidgetArea, AllDockWidgetAreas }
  • enum DropAction { CopyAction, MoveAction, LinkAction, ActionMask, TargetMoveAction, IgnoreAction }
  • enum FillRule { OddEvenFill, WindingFill }
  • enum FocusPolicy { TabFocus, ClickFocus, StrongFocus, WheelFocus, NoFocus }
  • enum FocusReason { MouseFocusReason, TabFocusReason, BacktabFocusReason, ActiveWindowFocusReason, ..., OtherFocusReason }
  • enum GlobalColor { white, black, red, darkRed, ..., color1 }
  • typedef HANDLE
  • enum HitTestAccuracy { ExactHit, FuzzyHit }
  • enum ImageConversionFlag { AutoColor, ColorOnly, MonoOnly, DiffuseDither, ..., AvoidDither }
  • enum InputMethodQuery { ImMicroFocus, ImFont, ImCursorPosition, ImSurroundingText, ImCurrentSelection }
  • enum ItemDataRole { DisplayRole, DecorationRole, EditRole, ToolTipRole, ..., UserRole }
  • enum ItemFlag { ItemIsSelectable, ItemIsEditable, ItemIsDragEnabled, ItemIsDropEnabled, ..., ItemIsTristate }
  • flags ItemFlags
  • enum Key { Key_Escape, Key_Tab, Key_Backtab, Key_Backspace, ..., Key_unknown }
  • enum KeyboardModifier { NoModifier, ShiftModifier, ControlModifier, AltModifier, MetaModifier, KeypadModifier }
  • enum LayoutDirection { LeftToRight, RightToLeft }
  • enum MatchFlag { MatchExactly, MatchContains, MatchStartsWith, MatchEndsWith, ..., MatchRecursive }
  • enum Modifier { SHIFT, META, CTRL, ALT, UNICODE_ACCEL }
  • enum MouseButton { NoButton, LeftButton, RightButton, MidButton, XButton1, XButton2 }
  • enum Orientation { Horizontal, Vertical }
  • enum PenCapStyle { FlatCap, SquareCap, RoundCap }
  • enum PenJoinStyle { MiterJoin, BevelJoin, RoundJoin }
  • enum PenStyle { NoPen, SolidLine, DashLine, DotLine, DashDotLine, DashDotDotLine }
  • enum ScrollBarPolicy { ScrollBarAsNeeded, ScrollBarAlwaysOff, ScrollBarAlwaysOn }
  • enum ShortcutContext { WidgetShortcut, WindowShortcut, ApplicationShortcut }
  • enum SortOrder { AscendingOrder, DescendingOrder }
  • enum TextElideMode { ElideLeft, ElideRight, ElideMiddle }
  • enum TextFlag { TextSingleLine, TextDontClip, TextExpandTabs, TextShowMnemonic, ..., TextIncludeTrailingSpaces }
  • enum TextFormat { PlainText, RichText, AutoText, LogText }
  • enum TimeSpec { LocalTime, UTC }
  • enum ToolBarArea { LeftToolBarArea, RightToolBarArea, TopToolBarArea, BottomToolBarArea, AllToolBarAreas }
  • enum ToolButtonStyle { ToolButtonIconOnly, ToolButtonTextOnly, ToolButtonTextBesideIcon, ToolButtonTextUnderIcon }
  • enum TransformationMode { FastTransformation, SmoothTransformation }
  • enum UIEffect { UI_General, UI_AnimateMenu, UI_FadeMenu, UI_AnimateCombo, ..., UI_AnimateToolBox }
  • typedef WFlags
  • enum WhiteSpaceMode { WhiteSpaceNormal, WhiteSpacePre, WhiteSpaceNoWrap }
  • enum WidgetAttribute { WA_AcceptDrops, WA_DeleteOnClose, WA_QuitOnClose, WA_KeyCompression, ..., WA_ShowModal }
  • enum WindowState { WindowNoState, WindowMinimized, WindowMaximized, WindowFullScreen, WindowActive }
  • enum WindowType { Widget, Window, Dialog, Sheet, ..., WMacNoSheet }

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.

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. Does not work for everything and may be interpreted as AlignAuto in some cases.

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

Background mode:

ConstantValue
Qt::TransparentMode0
Qt::OpaqueMode1

enum Qt::BrushStyle

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 dedicated QBrush constructor).
Qt::ConicalGradientPattern17Linear gradient (set using dedicated QBrush constructor).
Qt::RadialGradientPattern16Linear gradient (set using dedicated QBrush constructor).
Qt::TexturePattern24Custom pattern (see QBrush::setTexture()).
Brush Styles

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::AutoConnection0If the signal is emitted from an object in the same thread as the receiving object, the slot is invoked directly, as with Qt::DirectConnection; otherwise the signal is queued, as with Qt::QueuedConnection.

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

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.
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.

ConstantValueDescription
Qt::ArrowCursor0standard arrow cursor
Qt::UpArrowCursor1upwards arrow
Qt::CrossCursor2crosshair
Qt::WaitCursor3hourglass/watch
Qt::IBeamCursor4ibeam/text entry
Qt::SizeVerCursor5vertical resize
Qt::SizeHorCursor6horizontal resize
Qt::SizeFDiagCursor8diagonal resize ()
Qt::SizeBDiagCursor7diagonal resize (/)
Qt::SizeAllCursor9all directions resize
Qt::BlankCursor10blank/invisible cursor
Qt::SplitVCursor11vertical splitting
Qt::SplitHCursor12horizontal splitting
Qt::PointingHandCursor13a pointing hand
Qt::ForbiddenCursor14a slashed circle
Qt::WhatsThisCursor15an arrow with a question mark
Qt::BusyCursor16standard arrow with hourglass/watch
Qt::BitmapCursor24ArrowCursor is the default for widgets in a normal state.
Cursor Shapes

enum Qt::DateFormat

ConstantValueDescription
Qt::TextDate0The default Qt format.
Qt::ISODate1ISO 8601 extended format (YYYY-MM-DD, or with time, YYYY-MM-DDTHH:MM:SS).
Qt::LocalDate2The locale-dependent format.

enum Qt::DayOfWeek

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

enum Qt::Dock

Each dock window can be in one of the following positions:

ConstantValueDescription
Qt::DockUnmanaged0not managed by a Q3MainWindow.
Qt::DockTornOff1the dock window floats as its own top level window which always stays on top of the main window.
Qt::DockTop2above the central widget, below the menu bar.
Qt::DockBottom3below the central widget, above the status bar.
Qt::DockRight4to the right of the central widget.
Qt::DockLeft5to the left of the central widget.
Qt::DockMinimized6the dock window is not shown (this is effectively a 'hidden' dock area); the handles of all minimized dock windows are drawn in one row below the menu bar.

enum Qt::DockWidgetArea
flags Qt::DockWidgetAreas

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

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 date from the source to the target.
Qt::LinkAction0x4Create a link from the source to the target.
Qt::ActionMask0xff 
Qt::TargetMoveAction0x8002 
Qt::IgnoreAction0x0Ignore the action (do nothing with the data).

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

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 popup 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.

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

ConstantValue
Qt::ImMicroFocus0
Qt::ImFont1
Qt::ImCursorPosition2
Qt::ImSurroundingText3
Qt::ImCurrentSelection4

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 (usually text).
Qt::DecorationRole1The data to be rendered as a decoration (usually 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.

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::BackgroundColorRole8The background color used for items rendered with the default delegate.
Qt::TextColorRole9The text color used for items rendered with the default delegate.
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::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.

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

enum Qt::Key

The key names used by Qt.

ConstantValue
Qt::Key_Escape0x01000000
Qt::Key_Tab0x01000001
Qt::Key_Backtab0x01000002
Qt::Key_Backspace0x01000003
Qt::Key_Return0x01000004
Qt::Key_Enter0x01000005
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_Control0x01000021
Qt::Key_Meta0x01000022
Qt::Key_Alt0x01000023
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

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.

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::MatchFlag
flags Qt::MatchFlags

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

ConstantValueDescription
Qt::MatchExactly0The value matches the item exactly.
Qt::MatchContains1The value is contained in the item.
Qt::MatchStartsWith2The value matches the start of the item.
Qt::MatchEndsWith3The value matches the end of the item.
Qt::MatchCaseSensitive16The search is case sensitive.
Qt::MatchRegExp4The value is a regular expression.
Qt::MatchWildcard5The value is a string with wildcards.
Qt::MatchWrap32The search wraps around.
Qt::MatchRecursive64The the entire hierarchy is searched.

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

enum Qt::Modifier

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

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.

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.
Pen Cap Styles

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.

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.
Pen Join Styles

See also QPen.

enum Qt::PenStyle

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

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.
Pen Styles

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 only triggered when its parent widget has focus.
Qt::WindowShortcut1The shortcut is triggered when its parent widget is a logical subwidget of the active top-level window.
Qt::ApplicationShortcut2The shortcut is triggered when the application is active.

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::ElideMiddle is normally the most appropriate choice for URLs (e.g., "http://www.trolltech.cn/news...s/Beijing-Office-Opening.pdf"), whereas Qt::ElideRight is appropriate for other strings (e.g., "Deploying Applications on Ma...").

See also QAbstractItemView::textElideMode and QAbstractItemDelegate::elidedText().

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::TextIncludeTrailingSpaces0x08000000Don't automatically delete trailing whitespace.

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 using the current Q3StyleSheet::defaultSheet().
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 QTextEdit in an optimized mode.

enum Qt::TimeSpec

ConstantValueDescription
Qt::LocalTime0Locale dependent time (Timezones and Daylight Savings Time).
Qt::UTC1Coordinated Universal Time, replaces Greenwich Mean Time.

enum Qt::ToolBarArea
flags Qt::ToolBarAreas

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

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 has smoothed edges.

See also QImage::scaled().

enum Qt::UIEffect

ConstantValueDescription
Qt::UI_General0 
Qt::UI_AnimateMenu1 
Qt::UI_FadeMenu2 
Qt::UI_AnimateCombo3 
Qt::UI_AnimateTooltip4 
Qt::UI_FadeTooltip5 
Qt::UI_AnimateToolBox6Reserved

See also QApplication::setEffectEnabled().

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 

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_DeleteOnClose55Makes Qt delete this widget when the widget has accepted the close event (see QWidget::closeEvent()).
Qt::WA_QuitOnClose76Makes Qt quit the application when the last widget with the attribute set has accepted closeEvent(). This behaviour can be adjusted with the QApplication::quitOnLastWindowClosed property. By default the attribute is set for all widgets of type Qt::Window.
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. Not all platforms support this compression, in which case turning it on will have no effect. This is set/cleared by the widget's author.
Qt::WA_PendingMoveEvent34Indicates that a move event is pending, e.g. when a hidden widget was moved. This is set/cleared by the Qt kernel
Qt::WA_PendingResizeEvent35Indicates that a resize event is pending, e.g. when a hidden widget was resized. This is set/cleared by the Qt kernel.
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 is set/cleared by the Qt kernel.
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_ContentsPropagated3Allows the contents painted in a QWidget::paintEvent() to be used as the background for children that inherit their background. This is set/cleared by the widget author or by the style.
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_SetPalette36Indicates that the widgets has a palette of its own. This is set/cleared by QWidget::setPalette().
Qt::WA_SetFont37Indicates that the widgets has a font of its own. This is set/cleared by QWidget::setFont().
Qt::WA_SetCursor38Indicates that the widgets has a cursor of its own. This is set/cleared by QWidget::setCursor() and QWidget::unsetCursor().
Qt::WA_NoBackground4Indicates that the widget paints all its pixels when it receives a paint event. It is thus not required for operations like updating, resizing, scrolling and focus changes to call erase the widget before generating paint events. Using WA_NoBackground is a small optimization. It can help to reduce flicker on systems that do not provide double buffer support, and it avoids the computational cycles necessary to erase the background prior to paint. NOTE: Unlike WA_NoSystemBackground, WA_NoBackground makes an effort to avoid transparent window backgrounds. This is set/cleared by the widget's author.
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_NoBackground, 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). Setting this flag implicitly disables double buffering for the widget. This is set/cleared by the widget's author.
Qt::WA_UpdatesDisabled10Indicates that updates are blocked (including the system background). This flag must never be set/cleared by the widget author. It is set/cleared by the Qt kernel.
Qt::WA_ForceUpdatesDisabled59Indicates that the widget is explicitly updates disabled, 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_StaticContents5Indicates that the widget contents are north-west aligned and static. On resize, such a widget will receive paint events only for the newly visible part of itself. This is set/cleared by the widget's author.
Qt::WA_PaintOnScreen8Indicates that the widget wants to draw directly onto the screen (implies no double buffering). This is not supported on all platforms. This is set/cleared by the widget's author.
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.
Qt::WA_PaintOutsidePaintEvent13Makes it possible to use QPainter to paint on the widget outside paintEvent(). This is currently not supported on Mac OS X. We recommend that you use this attribute only when porting Qt 3 code to Qt 4.
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_WindowModified41Indicates that the window is marked as modified. On some platforms this will mean nothing, on others (including Mac OS X and Windows) the window will take a modified appearance. This is set/cleared by QWidget::setWindowModified().
Qt::WA_Resized42Indicates that the widget has an explicit size. This is set/cleared by QWidget::resize() and by QWidget::setGeometry().
Qt::WA_Moved43Indicates that the widget has an explicit position. This is set/cleared by QWidget::move() and by QWidget::setGeometry().
Qt::WA_Mapped11Indicates that the widget is mapped on screen. This is set/cleared by the Qt kernel.
Qt::WA_NoMouseReplay54Used for popup widgets. Indicates that the most recent mouse press event should not be replayed when the popup 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_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_MacMetalStyle46Indicates the the widget should be drawn in metal style as supported by the windowing system (only meaningfull on Mac OS X). This is set by widget's author.
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_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_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_MouseTracking2Indicates that the widget has mouse tracking enabled. See QWidget::mouseTracking.
Qt::WA_GroupLeader72Makes this window a group leader. A group leader should not have a parent (i.e. it should be a top-level window). Any decendant windows (direct or indirect) of a group leader are in its group; other windows are not. If you show a secondary window from the group (i.e. show a window whose top-most parent is a group leader), that window will be modal with respect to the other windows in the group, but modeless with respect to windows in other groups.
Qt::WA_KeyboardFocusChange77Set on a toplevel window when the users changes focus with the keyboard (tab, backtab, or shortcut).
Qt::WA_InputMethodEnabled14 
Qt::WA_InputMethodTransparent75 
Qt::WA_MacNoClickThrough12 
Qt::WA_MouseNoMask71 
Qt::WA_NoMousePropagation73 
Qt::WA_RightToLeft56 
Qt::WA_SetLayoutDirection57 
Qt::WA_ShowModal70 

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.
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 Qt::WA_ShowModal attribute. 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. (See also Qt::WA_GroupLeader.)
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 popup top-level window, i.e. that it is modal, but has a window system frame appropriate for popup 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.
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 child widget, irrespective of whether the widget has a parent or not.

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.
Qt::WindowTitleHint0x00001000Gives the window a title bar.
Qt::WindowSystemMenuHint0x00002000Adds a window system menu, and possibly a close button.
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::WindowContextHelpButtonHint0x00010000Adds a context help button to dialogs. On some platforms this implies Qt::WindowSystemMenuHint for it to work.
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::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::WGroupLeader0x00400000Use Qt::WA_GroupLeader instead.
Qt::WShowModal0x00800000Use Qt::WA_ShowModal 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 Qt::WA_ShowModal 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.


Function Documentation

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

Auxiliary function. Converts the plain text string plain to a rich text formatted paragraph while preserving most of its look.

mode defines the whitespace mode. Possible values are QStyleSheetItem::WhiteSpacePre (no wrapping, all whitespaces preserved) and QStyleSheetItem::WhiteSpaceNormal (wrapping, simplified whitespaces).

See also escape().

QString Qt::escape ( const QString & plain )

Auxiliary function. Converts the plain text string plain to a rich text formatted string with any HTML meta-characters escaped.

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.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 68
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique PyQt/PySide a besoin de vous ! 0
Page suivante

Le Qt Labs au hasard

Logo

Le moteur de rendu OpenGL

Les Qt Labs sont les laboratoires des développeurs de Qt, où ils peuvent partager des impressions sur le framework, son utilisation, ce que pourrait être son futur. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 4.0
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web