Qt Style Sheets Reference▲
<Unknown command>contentspage{Qt Style Sheets}{Contents}
Qt Style Sheets support various properties, pseudo-states, and subcontrols that make it possible to customize the look of widgets.
List of Stylable Widgets▲
The following table lists the Qt widgets that can be customized using style sheets:
|
Widget |
How to Style |
|---|---|
|
Supports the https://. All derivatives of QAbstractScrollArea, including QTextEdit, and QAbstractItemView (all item view classes), support scrollable backgrounds using https://. Setting the background-attachment to fixed provides a background-image that does not scroll with the viewport. Setting the background-attachment to scroll, scrolls the background-image when the scroll bars move. See https:// for an example. |
|
|
Supports the https://. The check indicator can be styled using the https:// subcontrol. By default, the indicator is placed in the Top Left corner of the Contents rectangle of the widget. The https:// property specifies the spacing between the check indicator and the text. See https:// for an example. |
|
|
The grip can be styled be using the https:// property. The arrow indicators can by styled using the https:// subcontrol and the https:// subcontrol. |
|
|
The frame around the combobox can be styled using the https://. The drop-down button can be styled using the https:// subcontrol. By default, the drop-down button is placed in the top right corner of the padding rectangle of the widget. The arrow mark inside the drop-down button can be styled using the https:// subcontrol. By default, the arrow is placed in the center of the contents rectangle of the drop-down subcontrol. See https:// for an example. |
|
|
See https://. |
|
|
See https://. |
|
|
Supports only the https://, https:// and https:// properties. Make sure you define the https:// macro for your custom widget. |
|
|
The layout of buttons can be altered using the https:// property. |
|
|
Supports styling of the title bar and the title bar buttons when docked. The dock widget border can be styled using the https:// property. The https:// subcontrol can be used to customize the title bar. The close and float buttons are positioned with respect to the https:// subcontrol using the https:// and https:// respectively. When the title bar is vertical, the https:// pseudo class is set. In addition, depending on QDockWidget::DockWidgetFeature, the https://, https:// and https:// pseudo states are set. Use QMainWindow::separator to style the resize handle. The style sheet has no effect when the QDockWidget is undocked as Qt uses native top level windows when undocked. See https:// for an example. |
|
|
See https://. |
|
|
Supports the https://. Since 4.3, setting a stylesheet on a QLabel automatically sets the QFrame::frameStyle property to QFrame::StyledPanel. See https:// for an example. |
|
|
Supports the https://. The title can be styled using the https:// subcontrol. By default, the title is placed depending on QGroupBox::textAlignment. In the case of a checkable QGroupBox, the title includes the check indicator. The indicator is styled using the https:// subcontrol. The https:// property can be used to control the spacing between the text and indicator. See https:// for an example. |
|
|
Supports the https://. The sections of the header view are styled using the https:// sub control. The section Sub-control supports the https://, https://, https://, https://, https://, https://, https://, and https:// pseudo states. The sort indicator can be styled using the https:// and the https:// Sub-control. See https:// for an example. |
|
|
Supports the https://. Does not support the https:// pseudo-state. Since 4.3, setting a stylesheet on a QLabel automatically sets the QFrame::frameStyle property to QFrame::StyledPanel. See https:// for an example (a QLabel derives from QFrame). |
|
|
Support the https://. The color and background of the selected item is styled using https:// and https:// respectively. The password character can be styled using the https:// property. The password mask delay can be changed using the https:// See https:// for an example. |
|
|
Supports the https://. When https:// is enabled, the alternating colors can be styled using the alternate-background-color property. The color and background of the selected item is styled using https:// and https:// respectively. The selection behavior is controlled by the https:// property. Use the https:// subcontrol for more fine grained control over the items in the QListView. See https:// to style scrollable backgrounds. See https:// for an example. |
|
|
See https://. |
|
|
Supports styling of the separator The separator in a QMainWindow when using QDockWidget is styled using the https:// subcontrol. See https:// for an example. |
|
|
Supports the https://. Individual items are styled using the https:// subcontrol. In addition to the usually supported pseudo states, item subcontrol supports the https://, https://, https:// and the https:// pseudo states. The indicator of checkable menu items is styled using the https:// subcontrol. The separator is styled using the https:// subcontrol. For items with a sub menu, the arrow marks are styled using the https:// and https://. The scroller is styled using the https://. The tear-off is styled using the https://. See https:// for an example. |
|
|
Supports the https://. The https:// property specifies the spacing between menu items. Individual items are styled using the https:// subcontrol. When running on Qt/Mac, the menu bar is usually embedded into the system-wide menu bar. In this case, the style sheet will have no effect. See https:// for an example. |
|
|
The https:// property can be used to alter the interaction with text in the message box. |
|
|
Supports the https://. The chunks of the progress bar can be styled using the https:// subcontrol. The chunk is displayed on the Contents rectangle of the widget. If the progress bar displays text, use the https:// property to position the text. Indeterminate progress bars have the https:// pseudo state set. See https:// for an example. |
|
|
Supports the https://. Supports the https://, https://, https:// pseudo states. For QPushButton with a menu, the menu indicator is styled using the https:// subcontrol. Appearance of checkable push buttons can be customized using the https:// and https:// pseudo-states. If you only set a background-color on a QPushButton, the background may not appear unless you set the border property to some value. This is because, by default, the QPushButton draws a native border which completely overlaps the background-color. For example, Sélectionnez See https:// for an example. |
|
|
Supports the https://. The check indicator can be styled using the https:// subcontrol. By default, the indicator is placed in the Top Left corner of the Contents rectangle of the widget. The https:// property specifies the spacing between the check indicator and the text. See https:// for an example. |
|
|
Supports the https://. The Contents rectangle of the widget is considered to be the groove over which the slider moves. The extent of the QScrollBar (i.e the width or the height depending on the orientation) is set using the https:// or https:// property respectively. To determine the orientation, use the https:// and the https:// pseudo states. The slider can be styled using the https:// subcontrol. Setting the https:// or https:// provides size contraints for the slider depending on the orientation. The https:// subcontrol can be used to style the button to add a line. By default, the add-line subcontrol is placed in top right corner of the Border rectangle of the widget. Depending on the orientation the https:// or https://. By default, the arrows are placed in the center of the Contents rectangle of the add-line subcontrol. The https:// subcontrol can be used to style the button to subtract a line. By default, the sub-line subcontrol is placed in bottom right corner of the Border rectangle of the widget. Depending on the orientation the https:// or https://. By default, the arrows are placed in the center of the Contents rectangle of the sub-line subcontrol. The https:// subcontrol can be used to style the region of the slider that subtracts a page. The https:// subcontrol can be used to style the region of the slider that adds a page. See https:// for an example. |
|
|
Supports the https://, https://, and https:// properties. See https:// for an example. |
|
|
Supports the https://. For horizontal slides, the https:// and https:// properties must be provided. For vertical sliders, the https:// and https:// properties must be provided. The groove of the slider is styled using the https://. The groove is positioned by default in the Contents rectangle of the widget. The thumb of the slider is styled using https:// subcontrol. The subcontrol moves in the Contents rectangle of the groove subcontrol. See https:// for an example. |
|
|
The frame of the spin box can be styled using the https://. The up button and arrow can be styled using the https:// and https:// subcontrols. By default, the up-button is placed in the top right corner in the Padding rectangle of the widget. Without an explicit size, it occupies half the height of its reference rectangle. The up-arrow is placed in the center of the Contents rectangle of the up-button. The down button and arrow can be styled using the https:// and https:// subcontrols. By default, the down-button is placed in the bottom right corner in the Padding rectangle of the widget. Without an explicit size, it occupies half the height of its reference rectangle. The bottom-arrow is placed in the center of the Contents rectangle of the bottom-button. See https:// for an example. |
|
|
Supports the https://. The handle of the splitter is styled using the https:// subcontrol. See https:// for an example. |
|
|
Supports only the https:// property. The frame for individual items can be style using the https:// subcontrol. See https:// for an example. |
|
|
Individual tabs may be styled using the https:// subcontrol. Close buttons using the https:// The tabs support the https://, https://, https://, https://, https://, https://, https:// pseudo states. The https://, https://, https://, https:// pseudo states depending on the orientation of the tabs. Overlapping tabs for the selected state are created by using negative margins or using the absolute position scheme. The tear indicator of the QTabBar is styled using the https:// subcontrol. QTabBar used two QToolButtons for its scrollers that can be styled using the QTabBar QToolButton selector. To specify the width of the scroll button use the https:// subcontrol. The alignment of the tabs within the QTabBar is styled using the https:// property. To change the position of the QTabBar within a QTabWidget, use the https:// subcontrol (and set subcontrol-position). See https:// for an example. |
|
|
The frame of the tab widget is styled using the https:// subcontrol. The left and right corners are styled using the https:// and https:// respectively. The position of the tab bar is controlled using the https:// subcontrol. By default, the subcontrols have positions of a QTabWidget in the QWindowsStyle. To place the QTabBar in the center, set the subcontrol-position of the tab-bar subcontrol. The https://, https://, https://, https:// pseudo states depending on the orientation of the tabs. See https:// for an example. |
|
|
Supports the https://. When https:// is enabled, the alternating colors can be styled using the alternate-background-color property. The color and background of the selected item is styled using https:// and https:// respectively. The corner widget in a QTableView is implemented as a QAbstractButton and can be styled using the "QTableView QTableCornerButton::section" selector. If you only set a background-color on a QTableCornerButton, the background may not appear unless you set the border property to some value. This is because, by default, the QTableCornerButton draws a native border which completely overlaps the background-color. The color of the grid can be specified using the https:// property. See https:// to style scrollable backgrounds. See https:// for an example. |
|
|
See https://. |
|
|
Supports the https://. The color and background of selected text is styled using https:// and https:// respectively. See https:// to style scrollable backgrounds. |
|
|
See https://. |
|
|
Supports the https://. The https://, https://, https://, https:// pseudo states depending on the area in which the tool bar is grouped. The https://, https://, https://, https:// pseudo states indicator the position of the tool bar within a line group (See QStyleOptionToolBar::positionWithinLine). The separator of a QToolBar is styled using the https:// subcontrol. The handle (to move the toolbar) is styled using the https:// subcontrol. See https:// for an example. |
|
|
Supports the https://. If the QToolButton has a menu, is https:// subcontrol can be used to style the indicator. By default, the menu-indicator is positioned at the bottom right of the Padding rectangle of the widget. If the QToolButton is in QToolButton::MenuButtonPopup mode, the https:// subcontrol is used to draw the menu button. https:// subcontrol is used to draw the menu arrow inside the menu-button. By default, it is positioned in the center of the Contents rectangle of the menu-button subcontrol. When the QToolButton displays arrows, the https://, https://, https:// and https:// subcontrols are used. If you only set a background-color on a QToolButton, the background will not appear unless you set the border property to some value. This is because, by default, the QToolButton draws a native border which completely overlaps the background-color. For example, Sélectionnez See https:// for an example. |
|
|
Supports the https://. The individual tabs can by styled using the https:// subcontrol. The tabs support the https://, https://, https://, https://, https://, https://, https:// pseudo states. |
|
|
Supports the https://. The https:// property controls the opacity of the tooltip. See https:// for an example (a QToolTip is a QFrame). |
|
|
Supports the https://. When https:// is enabled, the alternating colors can be styled using the alternate-background-color property. The color and background of the selected item is styled using https:// and https:// respectively. The selection behavior is controlled by the https:// property. The branches of the tree view can be styled using the https:// subcontrol. The ::branch Sub-control supports the https://, https://, https:// and https:// pseudo states. Use the https:// subcontrol for more fine grained control over the items in the QTreeView. See https:// to style scrollable backgrounds. See https:// for an example to style the branches. |
|
|
See https://. |
|
|
Supports only the https://, https:// and https:// properties. If you subclass from QWidget, you need to provide a paintEvent for your custom QWidget as below: Sélectionnez The above code is a no-operation if there is no stylesheet set. Make sure you define the https:// macro for your custom widget. |
List of Properties▲
The table below lists all the properties supported by Qt Style Sheets. Which values can be given to an property depend on the https://. Unless otherwise specified, properties below apply to all widgets. Properties marked with an asterisk * are specific to Qt and have no equivalent in CSS2 or CSS3.
|
Property |
Type |
Description |
|---|---|---|
|
https:// |
The alternate background color used in QAbstractItemView subclasses. If this property is not set, the default value is whatever is set for the palette's AlternateBase role. Example: Sélectionnez See also https:// and https://. |
|
|
https:// |
Shorthand notation for setting the background. Equivalent to specifying background-color, background-image, background-repeat, and/or background-position. This property is supported by QAbstractItemView subclasses, QAbstractSpinBox subclasses, QCheckBox, QComboBox, QDialog, QFrame, QGroupBox, QLabel, QLineEdit, QMenu, QMenuBar, QPushButton, QRadioButton, QSplitter, QTextEdit, QToolTip, and plain https://s. Example: Sélectionnez Often, it is required to set a fill pattern similar to the styles in Qt::BrushStyle. You can use the background-color property for Qt::SolidPattern, Qt::RadialGradientPattern, Qt::LinearGradientPattern and Qt::ConicalGradientPattern. The other patterns are easily achieved by creating a background image that contains the pattern. Example: Sélectionnez See also https://, https://, https://, https:// and https://. |
|
|
https:// |
The background color used for the widget. Examples: Sélectionnez |
|
|
https:// |
The background image used for the widget. Semi-transparent parts of the image let the background-color shine through. Example: Sélectionnez |
|
|
https:// |
Whether and how the background image is repeated to fill the background-origin rectangle. If this property is not specified, the background image is repeated in both directions (repeat). Example: Sélectionnez |
|
|
background-position |
https:// |
The alignment of the background image within the background-origin rectangle. If this property is not specified, the alignment is top left. Example: Sélectionnez |
|
https:// |
Determines whether the background-image in a QAbstractScrollArea is scrolled or fixed with respect to the viewport. By default, the background-image scrolls with the viewport. Example: Sélectionnez See also https:// |
|
|
https:// |
The widget's rectangle, in which the background is drawn. This property specifies the rectangle to which the background-color and background-image are clipped. This property is supported by QAbstractItemView subclasses, QAbstractSpinBox subclasses, QCheckBox, QComboBox, QDialog, QFrame, QGroupBox, QLabel, QPushButton, QRadioButton, QSplitter, QTextEdit, QToolTip, and plain https://s. If this property is not specified, the default is border. Example: Sélectionnez See also https://, https:// and https://. |
|
|
https:// |
The widget's background rectangle, to use in conjunction with background-position and background-image. This property is supported by QAbstractItemView subclasses, QAbstractSpinBox subclasses, QCheckBox, QComboBox, QDialog, QFrame, QGroupBox, QLabel, QPushButton, QRadioButton, QSplitter, QTextEdit, QToolTip, and plain https://s. If this property is not specified, the default is padding. Example: Sélectionnez See also https:// and https://. |
|
|
https:// |
Shorthand notation for setting the widget's border. Equivalent to specifying border-color, border-style, and/or border-width. This property is supported by QAbstractItemView subclasses, QAbstractSpinBox subclasses, QCheckBox, QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu, QMenuBar, QPushButton, QRadioButton, QSplitter, QTextEdit, QToolTip, and plain https://s. Example: Sélectionnez |
|
|
border-top |
https:// |
Shorthand notation for setting the widget's top border. Equivalent to specifying border-top-color, border-top-style, and/or border-top-width. |
|
border-right |
https:// |
Shorthand notation for setting the widget's right border. Equivalent to specifying border-right-color, border-right-style, and/or border-right-width. |
|
border-bottom |
https:// |
Shorthand notation for setting the widget's bottom border. Equivalent to specifying border-bottom-color, border-bottom-style, and/or border-bottom-width. |
|
border-left |
https:// |
Shorthand notation for setting the widget's left border. Equivalent to specifying border-left-color, border-left-style, and/or border-left-width. |
|
https:// |
The color of all the border's edges. Equivalent to specifying border-top-color, border-right-color, border-bottom-color, and border-left-color. This property is supported by QAbstractItemView subclasses, QAbstractSpinBox subclasses, QCheckBox, QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu, QMenuBar, QPushButton, QRadioButton, QSplitter, QTextEdit, QToolTip, and plain https://s. If this property is not specified, it defaults to https:// (i.e., the widget's foreground color). Example: Sélectionnez See also https://, https://, https://, and https://. |
|
|
border-top-color |
https:// |
The color of the border's top edge. |
|
border-right-color |
https:// |
The color of the border's right edge. |
|
border-bottom-color |
https:// |
The color of the border's bottom edge. |
|
border-left-color |
https:// |
The color of the border's left edge. |
|
https:// |
The image used to fill the border. The image is cut into nine parts and stretched appropriately if necessary. See https:// for details. This property is supported by QAbstractItemView subclasses, QAbstractSpinBox subclasses, QCheckBox, QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu, QMenuBar, QPushButton, QRadioButton, QSplitter, QTextEdit and QToolTip. See also https://, https://, https://, and https://. |
|
|
https:// |
The radius of the border's corners. Equivalent to specifying border-top-left-radius, border-top-right-radius, border-bottom-right-radius, and border-bottom-left-radius. The border-radius clips the element's https://. This property is supported by QAbstractItemView subclasses, QAbstractSpinBox subclasses, QCheckBox, QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu, QMenuBar, QPushButton, QRadioButton, QSplitter, QTextEdit, and QToolTip. If this property is not specified, it defaults to 0. Example: Sélectionnez See also https:// and https://. |
|
|
border-top-left-radius |
https:// |
The radius of the border's top-left corner. |
|
border-top-right-radius |
https:// |
The radius of the border's top-right corner. |
|
border-bottom-right-radius |
https:// |
The radius of the border's bottom-right corner. Setting this property to a positive value results in a rounded corner. |
|
border-bottom-left-radius |
https:// |
The radius of the border's bottom-left corner. Setting this property to a positive value results in a rounded corner. |
|
https:// |
The style of all the border's edges. This property is supported by QAbstractItemView subclasses, QAbstractSpinBox subclasses, QCheckBox, QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu, QMenuBar, QPushButton, QRadioButton, QSplitter, QTextEdit, and QToolTip. If this property is not specified, it defaults to none. Example: Sélectionnez See also https://, https://, https://, and https://. |
|
|
border-top-style |
https:// |
The style of the border's top edge. |
|
border-right-style |
https:// |
The style of the border's right edge/ |
|
border-bottom-style |
https:// |
The style of the border's bottom edge. |
|
border-left-style |
https:// |
The style of the border's left edge. |
|
https:// |
The width of the border. Equivalent to setting border-top-width, border-right-width, border-bottom-width, and border-left-width. This property is supported by QAbstractItemView subclasses, QAbstractSpinBox subclasses, QCheckBox, QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu, QMenuBar, QPushButton, QRadioButton, QSplitter, QTextEdit, and QToolTip. Example: Sélectionnez See also https://, https://, https://, https://, and https://. |
|
|
border-top-width |
https:// |
The width of the border's top edge. |
|
border-right-width |
https:// |
The width of the border's right edge. |
|
border-bottom-width |
https:// |
The width of the border's bottom edge. |
|
border-left-width |
https:// |
The width of the border's left edge. |
|
https:// |
If https:// is relative (the default), moves a subcontrol by a certain offset up; specifying bottom: y is then equivalent to specifying https://: -y. If https:// is absolute, the bottom property specifies the subcontrol's bottom edge in relation to the parent's bottom edge (see also https://). Example: Sélectionnez See also https://, https://, and https://. |
|
|
https:// |
The layout of buttons in a QDialogButtonBox or a QMessageBox. The possible values are 0 (WinLayout), 1 (MacLayout), 2 (KdeLayout), 3 (GnomeLayout) and 5 (AndroidLayout). If this property is not specified, it defaults to the value specified by the current style for the SH_DialogButtonLayout style hint. Example: Sélectionnez |
|
|
https:// |
The color used to render text. This property is supported by all widgets that respect the QWidget::palette. If this property is not set, the default is whatever is set for in the widget's palette for the QWidget::foregroundRole (typically black). Example: Sélectionnez See also https:// and https://. |
|
|
dialogbuttonbox-buttons-have-icons |
https:// |
Whether the buttons in a QDialogButtonBox show icons If this property is set to 1, the buttons of a QDialogButtonBox show icons; if it is set to 0, the icons are not shown. See the https:// section for information on how to set icons. Sélectionnez Styles defining this property must be applied before the QDialogButtonBox is created; this means that you must apply the style to the parent widget or to the application itself. |
|
https:// |
Shorthand notation for setting the text's font. Equivalent to specifying font-family, font-size, font-style, and/or font-weight. This property is supported by all widgets that respect the QWidget::font. If this property is not set, the default is the QWidget::font. Example: Sélectionnez |
|
|
font-family |
String |
The font family. Example: Sélectionnez |
|
font-size |
https:// |
The font size. In this version of Qt, only pt and px metrics are supported. Example: Sélectionnez |
|
font-style |
https:// |
The font style. Example: Sélectionnez |
|
font-weight |
https:// |
The weight of the font. |
|
https:// |
The color of the grid line in a QTableView. If this property is not specified, it defaults to the value specified by the current style for the SH_Table_GridLineColor style hint. Example: Sélectionnez |
|
|
https:// |
The height of a subcontrol (or in some case, a widget). If this property is not specified, it defaults to a value that depends on the subcontrol/widget and on the current style. Unless otherwise specified, this property has no effect when set on widgets. If you want a widget with a fixed height, set the https:// and https:// to the same value. Example: Sélectionnez See also https://. |
|
|
https:// |
The width and height of the icon in a widget. The icon size of the following widgets can be set using this property.
|
|
|
https://+ |
The image that is drawn in the contents rectangle of a subcontrol. The image property accepts a list of https://s or an svg. The actual image that is drawn is determined using the same algorithm as QIcon (i.e) the image is never scaled up but always scaled down if necessary. If a svg is specified, the image is scaled to the size of the contents rectangle. Setting the image property on sub controls implicitly sets the width and height of the sub-control (unless the image in a SVG). In Qt 4.3 and later, the alignment of the image within the rectangle can be specified using https://. This property is for subcontrols only–we don't support it for other elements. The QIcon SVG plugin is needed to render SVG images. Example: Sélectionnez |
|
|
https:// |
In Qt 4.3 and later, the alignment of the image image's position can be specified using relative or absolute position. |
|
|
https:// |
If https:// is relative (the default), moves a subcontrol by a certain offset to the right. If https:// is absolute, the left property specifies the subcontrol's left edge in relation to the parent's left edge (see also https://). If this property is not specified, it defaults to 0. Example: Sélectionnez See also https://, https://, and https://. |
|
|
https:// |
The QLineEdit password character as a Unicode number. If this property is not specified, it defaults to the value specified by the current style for the SH_LineEdit_PasswordCharacter style hint. Example: Sélectionnez |
|
|
https:// |
The QLineEdit password mask delay in milliseconds before https:// is applied to visible character. If this property is not specified, it defaults to the value specified by the current style for the SH_LineEdit_PasswordMaskDelay style hint. This property was added in Qt 5.4. Example: Sélectionnez |
|
|
https:// |
The widget's margins. Equivalent to specifying margin-top, margin-right, margin-bottom, and margin-left. This property is supported by QAbstractItemView subclasses, QAbstractSpinBox subclasses, QCheckBox, QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu, QMenuBar, QPushButton, QRadioButton, QSplitter, QTextEdit, and QToolTip. If this property is not specified, it defaults to 0. Example: Sélectionnez See also https://, https://, and https://. |
|
|
margin-top |
https:// |
The widget's top margin. |
|
margin-right |
https:// |
The widget's right margin. |
|
margin-bottom |
https:// |
The widget's bottom margin. |
|
margin-left |
https:// |
The widget's left margin. |
|
https:// |
The widget's or a subcontrol's maximum height. This property is supported by QAbstractItemView subclasses, QAbstractSpinBox subclasses, QCheckBox, QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu, QMenuBar, QPushButton, QRadioButton, QSizeGrip, QSpinBox, QSplitter, QStatusBar, QTextEdit, and QToolTip. The value is relative to the contents rect in the https://. Example: Sélectionnez See also https://. |
|
|
https:// |
The widget's or a subcontrol's maximum width. This property is supported by QAbstractItemView subclasses, QAbstractSpinBox subclasses, QCheckBox, QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu, QMenuBar, QPushButton, QRadioButton, QSizeGrip, QSpinBox, QSplitter, QStatusBar, QTextEdit, and QToolTip. The value is relative to the contents rect in the https://. Example: Sélectionnez See also https://. |
|
|
https:// |
The interaction behavior for text in a message box. Possible values are based on Qt::TextInteractionFlags. If this property is not specified, it defaults to the value specified by the current style for the SH_MessageBox_TextInteractionFlags style hint. Example: Sélectionnez |
|
|
https:// |
The widget's or a subcontrol's minimum height. This property is supported by QAbstractItemView subclasses, QAbstractSpinBox subclasses, QCheckBox, QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu, QMenuBar, QPushButton, QRadioButton, QSizeGrip, QSpinBox, QSplitter, QStatusBar, QTextEdit, and QToolTip. If this property is not specified, the minimum height is derived based on the widget's contents and the style. The value is relative to the contents rect in the https://. Example: Sélectionnez See also https://. |
|
|
https:// |
The widget's or a subcontrol's minimum width. This property is supported by QAbstractItemView subclasses, QAbstractSpinBox subclasses, QCheckBox, QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu, QMenuBar, QPushButton, QRadioButton, QSizeGrip, QSpinBox, QSplitter, QStatusBar, QTextEdit, and QToolTip. If this property is not specified, the minimum width is derived based on the widget's contents and the style. The value is relative to the contents rect in the https://. Example: Sélectionnez See also https://. |
|
|
https:// |
The opacity for a widget. Possible values are from 0 (transparent) to 255 (opaque). For the moment, this is only supported for tooltips. If this property is not specified, it defaults to the value specified by the current style for the SH_ToolTipLabel_Opacity style hint. Example: Sélectionnez |
|
|
outline |
The outline drawn around the object's border. |
|
|
outline-color |
https:// |
The color of the outline. See also https:// |
|
outline-offset |
https:// |
The outline's offset from the border of the widget. |
|
outline-style |
Specifies the pattern used to draw the outline. See also https:// |
|
|
outline-radius |
Adds rounded corners to the outline |
|
|
outline-bottom-left-radius |
https:// |
The radius for the bottom-left rounded corner of the outline. |
|
outline-bottom-right-radius |
https:// |
The radius for the bottom-right rounded corner of the outline. |
|
outline-top-left-radius |
https:// |
The radius for the top-left corner of the outline. |
|
outline-top-right-radius |
https:// |
The radius for the top-right rounded corner of the outline. |
|
https:// |
The widget's padding. Equivalent to specifying padding-top, padding-right, padding-bottom, and padding-left. This property is supported by QAbstractItemView subclasses, QAbstractSpinBox subclasses, QCheckBox, QComboBox, QFrame, QGroupBox, QLabel, QLineEdit, QMenu, QMenuBar, QPushButton, QRadioButton, QSplitter, QTextEdit, and QToolTip. If this property is not specified, it defaults to 0. Example: Sélectionnez See also https://, https://, and https://. |
|
|
padding-top |
https:// |
The widget's top padding. |
|
padding-right |
https:// |
The widget's right padding. |
|
padding-bottom |
https:// |
The widget's bottom padding. |
|
padding-left |
https:// |
The widget's left padding. |
|
bool |
Whether the QTreeView paints alternating row colors for the empty area (i.e the area where there are no items) |
|
|
relative | absolute |
Whether offsets specified using https://, https://, https://, and https:// are relative or absolute coordinates. If this property is not specified, it defaults to relative. |
|
|
https:// |
If https:// is relative (the default), moves a subcontrol by a certain offset to the left; specifying right: x is then equivalent to specifying https://: -x. If https:// is absolute, the right property specifies the subcontrol's right edge in relation to the parent's right edge (see also https://). Example: Sélectionnez See also https://, https://, and https://. |
|
|
https:// |
The background of selected text or items. This property is supported by all widgets that respect the QWidget::palette and that show selection text. If this property is not set, the default value is whatever is set for the palette's Highlight role. Example: Sélectionnez See also https:// and https://. |
|
|
https:// |
The foreground of selected text or items. This property is supported by all widgets that respect the QWidget::palette and that show selection text. If this property is not set, the default value is whatever is set for the palette's HighlightedText role. Example: Sélectionnez See also https:// and https://. |
|
|
https:// |
Controls whether selections in a QListView cover the entire row or just the extent of the text. If this property is not specified, it defaults to the value specified by the current style for the SH_ItemView_ShowDecorationSelected style hint. Example: Sélectionnez |
|
|
https:// |
Internal spacing in the widget. This property is supported by QCheckBox, checkable QGroupBoxes, QMenuBar, and QRadioButton. If this property is not specified, the default value depends on the widget and on the current style. Example: Sélectionnez See also https:// and https://. |
|
|
https:// |
The origin rectangle of the subcontrol within the parent element. If this property is not specified, the default is padding. Example: Sélectionnez See also https://. |
|
|
https:// |
The alignment of the subcontrol within the origin rectangle specified by https://. If this property is not specified, it defaults to a value that depends on the subcontrol. Example: Sélectionnez See also https://. |
|
|
bool |
Whether tool tips are shown on window title bar buttons. |
|
|
https:// |
How much an animation should last (in milliseconds). A value equal to zero means that the animations will be disabled. If this property is not specified, it defaults to the value specified by the current style for the SH_Widget_Animation_Duration style hint. This property was added in Qt 5.10. Example: Sélectionnez |
|
|
https:// |
The alignment of text and icon within the contents of the widget. If this value is not specified, it defaults to the value that depends on the native style. Example: Sélectionnez This property is currently supported only by QPushButton and QProgressBar. |
|
|
text-decoration |
none underline overline line-through |
Additional text effects |
|
https:// |
If https:// is relative (the default), moves a subcontrol by a certain offset down. If https:// is absolute, the top property specifies the subcontrol's top edge in relation to the parent's top edge (see also https://). If this property is not specified, it defaults to 0. Example: Sélectionnez See also https://, https://, and https://. |
|
|
https:// |
The width of a subcontrol (or a widget in some cases). If this property is not specified, it defaults to a value that depends on the subcontrol/widget and on the current style. Unless otherwise specified, this property has no effect when set on widgets. If you want a widget with a fixed width, set the https:// and https:// to the same value. Example: Sélectionnez See also https://. |
|
|
-qt-background-role |
https:// |
The background-color for the subcontrol or widget based on the chosen role. |
|
-qt-style-features |
list |
The list of CSS properties that you want to apply Qt-specific styles on. The list can only include properties that are not pixmap-based. |
List of Icons▲
Icons used in Qt can be customized using the following properties. Each of the properties listed in this section have the type https://.
Note that for icons to appear in buttons in a QDialogButtonBox, you need to set the dialogbuttonbox-buttons-have-icons property to true. Also, to customize the size of the icons, use the icon-size property.
|
Name |
QStyle::StandardPixmap |
|---|---|
|
backward-icon |
QStyle::SP_ArrowBack |
|
cd-icon |
QStyle::SP_DriveCDIcon |
|
computer-icon |
QStyle::SP_ComputerIcon |
|
desktop-icon |
QStyle::SP_DesktopIcon |
|
dialog-apply-icon |
QStyle::SP_DialogApplyButton |
|
dialog-cancel-icon |
QStyle::SP_DialogCancelButton |
|
dialog-close-icon |
QStyle::SP_DialogCloseButton |
|
dialog-discard-icon |
QStyle::SP_DialogDiscardButton |
|
dialog-help-icon |
QStyle::SP_DialogHelpButton |
|
dialog-no-icon |
QStyle::SP_DialogNoButton |
|
dialog-ok-icon |
QStyle::SP_DialogOkButton |
|
dialog-open-icon |
QStyle::SP_DialogOpenButton |
|
dialog-reset-icon |
QStyle::SP_DialogResetButton |
|
dialog-save-icon |
QStyle::SP_DialogSaveButton |
|
dialog-yes-icon |
QStyle::SP_DialogYesButton |
|
directory-closed-icon |
QStyle::SP_DirClosedIcon |
|
directory-icon |
QStyle::SP_DirIcon |
|
directory-link-icon |
QStyle::SP_DirLinkIcon |
|
directory-open-icon |
QStyle::SP_DirOpenIcon |
|
dockwidget-close-icon |
QStyle::SP_DockWidgetCloseButton |
|
downarrow-icon |
QStyle::SP_ArrowDown |
|
dvd-icon |
QStyle::SP_DriveDVDIcon |
|
file-icon |
QStyle::SP_FileIcon |
|
file-link-icon |
QStyle::SP_FileLinkIcon |
|
filedialog-contentsview-icon |
QStyle::SP_FileDialogContentsView |
|
filedialog-detailedview-icon |
QStyle::SP_FileDialogDetailedView |
|
filedialog-end-icon |
QStyle::SP_FileDialogEnd |
|
filedialog-infoview-icon |
QStyle::SP_FileDialogInfoView |
|
filedialog-listview-icon |
QStyle::SP_FileDialogListView |
|
filedialog-new-directory-icon |
QStyle::SP_FileDialogNewFolder |
|
filedialog-parent-directory-icon |
QStyle::SP_FileDialogToParent |
|
filedialog-start-icon |
QStyle::SP_FileDialogStart |
|
floppy-icon |
QStyle::SP_DriveFDIcon |
|
forward-icon |
QStyle::SP_ArrowForward |
|
harddisk-icon |
QStyle::SP_DriveHDIcon |
|
home-icon |
QStyle::SP_DirHomeIcon |
|
leftarrow-icon |
QStyle::SP_ArrowLeft |
|
messagebox-critical-icon |
QStyle::SP_MessageBoxCritical |
|
messagebox-information-icon |
QStyle::SP_MessageBoxInformation |
|
messagebox-question-icon |
QStyle::SP_MessageBoxQuestion |
|
messagebox-warning-icon |
QStyle::SP_MessageBoxWarning |
|
network-icon |
QStyle::SP_DriveNetIcon |
|
rightarrow-icon |
QStyle::SP_ArrowRight |
|
titlebar-contexthelp-icon |
QStyle::SP_TitleBarContextHelpButton |
|
titlebar-maximize-icon |
QStyle::SP_TitleBarMaxButton |
|
titlebar-menu-icon |
QStyle::SP_TitleBarMenuButton |
|
titlebar-minimize-icon |
QStyle::SP_TitleBarMinButton |
|
titlebar-normal-icon |
QStyle::SP_TitleBarNormalButton |
|
titlebar-shade-icon |
QStyle::SP_TitleBarShadeButton |
|
titlebar-unshade-icon |
QStyle::SP_TitleBarUnshadeButton |
|
trash-icon |
QStyle::SP_TrashIcon |
|
uparrow-icon |
QStyle::SP_ArrowUp |
List of Property Types▲
The following table summarizes the syntax and meaning of the different property types.
|
Type |
Syntax |
Description |
|---|---|---|
|
{ top | bottom | left | right | center }* |
Horizontal and/or vertical alignment. Example: Sélectionnez |
|
|
{ scroll | fixed }* |
Scroll or fixed attachment. |
|
|
{ https:// | https:// | https:// | https:// }* |
A sequence of https://, https://, https://, and https://. |
|
|
0 | 1 |
True (1) or false (0). Example: Sélectionnez |
|
|
{ https:// | https:// | https:// }* |
Shorthand border property. |
|
|
none | https:// https://{4} (stretch | repeat){0,2} |
A border image is an image that is composed of nine parts (top left, top center, top right, center left, center, center right, bottom left, bottom center, and bottom right). When a border of a certain size is required, the corner parts are used as is, and the top, right, bottom, and left parts are stretched or repeated to produce a border with the desired size. See the http:// for details. |
|
|
dashed | dot-dash | dot-dot-dash | dotted | double | groove | inset | outset | ridge | solid | none |
Specifies the pattern used to draw a border. See the http:// for details. |
|
|
https://{1,4} |
One to four occurrences of https://, specifying the top, right, bottom, and left edges of a box, respectively. If the left color is not specified, it is taken to be the same as the right color. If the bottom color is not specified, it is taken to be the same as the top color. If the right color is not specified, it is taken to be the same as the top color. Example: Sélectionnez |
|
|
https://{1,4} |
One to four occurrences of https://, specifying the top, right, bottom, and left edges of a box, respectively. If the left length is not specified, it is taken to be the same as the right length. If the bottom length is not specified, is it taken to be the same as the top length. If the right length is not specified, it is taken to be the same as the top length. Examples: Sélectionnez |
|
|
https:// | https:// | https:// |
Specifies a Color or a Gradient or an entry in the Palette. |
|
|
rgb(r, g, b) | rgba(r, g, b, a) | hsv(h, s, v) | hsva(h, s, v, a) | hsl(h, s, l) | hsla(h, s, l, a) | #rrggbb | Color Name |
Specifies a color as RGB (red, green, blue), RGBA (red, green, blue, alpha), HSV (hue, saturation, value), HSVA (hue, saturation, value, alpha), HSL (hue, saturation, lightness), HSLA (hue, saturation, lightness, alpha) or a named color. The rgb() or rgba() syntax can be used with integer values between 0 and 255, or with percentages. The value of s, v, l and a in hsv(), hsva() hsl() or hsla() must all be in the range 0-255 or with percentages, the value of h must be in the range 0-359. The support for HSL(A) is available since 5.13. Examples: Sélectionnez The RGB colors allowed are the same as those allowed with CSS 2.1, as listed http://. |
|
|
(https:// | https://){0,2} https:// String |
Shorthand font property. |
|
|
https:// |
The size of a font. |
|
|
normal | italic | oblique |
The style of a font. |
|
|
normal | bold | 100 | 200 ... | 900 |
The weight of a font. |
|
|
qlineargradient | qradialgradient | qconicalgradient |
Specifies gradient fills. There are three types of gradient fills:
Gradients are specified in Object Bounding Mode. Imagine the box in which the gradient is rendered, to have its top left corner at (0, 0) and its bottom right corner at (1, 1). Gradient parameters are then specified as percentages from 0 to 1. These values are extrapolated to actual box coordinates at runtime. It is possible specify values that lie outside the bounding box (-0.6 or 1.8, for instance). The stops have to appear sorted in ascending order. Examples: Sélectionnez |
|
|
(https:// (disabled | active | normal | selected)? (on | off)? )* |
A list of url, QIcon::Mode and QIcon::State. Example: Sélectionnez |
|
|
https:// (px | pt | em | ex)? |
A number followed by a measurement unit. The CSS standard recommends that user agents must http:// a declaration with an illegal value. In Qt, it is mandatory to specify measurement units. For compatibility with earlier versions of Qt, numbers without measurement units are treated as pixels in most contexts. The supported units are:
However, Qt is limited to font sizes in pt and px and any other size must be in px, em or ex. |
|
|
A decimal integer or a real number |
Examples: 0, 18, +127, -255, 12.34, -.5, 0009. |
|
|
margin | border | padding | content |
Indicates which of four rectangles to use.
See also https://. |
|
|
alternate-base | base | bright-text | button | button-text | dark | highlight | highlighted-text | light | link | link-visited | mid | midlight | shadow | text | window | window-text |
These values correspond the Color roles in the widget's QPalette. For example, Sélectionnez |
|
|
https://{1, 2} |
One or two occurrences of https://. If only one length is specified, it is used as the radius of the quarter circle defining the corner. If two lengths are specified, the first length is the horizontal radius of a quarter ellipse, whereas the second length is the vertical radius. |
|
|
repeat-x | repeat-y | repeat | no-repeat |
A value indicating the nature of repetition.
|
|
|
url(filename) |
filename is the name of a file on the local disk or stored using https://. Setting an image implicitly sets the width and height of the element. |
List of Pseudo-States▲
The following pseudo-states are supported:
|
Pseudo-State |
Description |
|---|---|
|
This state is set when the widget resides in an active window. |
|
|
This state is set when the https:// of a QTreeView is adjacent to an item. |
|
|
This state is set for every alternate row whe painting the row of a QAbstractItemView when QAbstractItemView::alternatingRowColors() is set to true. |
|
|
The item is positioned at the bottom. For example, a QTabBar that has its tabs positioned at the bottom. |
|
|
The item is checked. For example, the checked state of QAbstractButton. |
|
|
The items can be closed. For example, the QDockWidget has the QDockWidget::DockWidgetClosable feature turned on. |
|
|
The item is in the closed state. For example, an non-expanded item in a QTreeView |
|
|
The item is the default. For example, a default QPushButton or a default action in a QMenu. |
|
|
The item is disabled. |
|
|
The QComboBox is editable. |
|
|
The item has edit focus (See QStyle::State_HasEditFocus). This state is available only for Qt Extended applications. |
|
|
The item is enabled. |
|
|
The item is part of an exclusive item group. For example, a menu item in a exclusive QActionGroup. |
|
|
The item is the first (in a list). For example, the first tab in a QTabBar. |
|
|
The item is flat. For example, a flat QPushButton. |
|
|
The items can be floated. For example, the QDockWidget has the QDockWidget::DockWidgetFloatable feature turned on. |
|
|
The item has input focus. |
|
|
The item has children. For example, an item in a QTreeView that has child items. |
|
|
The item has siblings. For example, an item in a QTreeView that siblings. |
|
|
The item has horizontal orientation |
|
|
The mouse is hovering over the item. |
|
|
The item has indeterminate state. For example, a QCheckBox or QRadioButton is partially checked. |
|
|
The item is the last (in a list). For example, the last tab in a QTabBar. |
|
|
The item is positioned at the left. For example, a QTabBar that has its tabs positioned at the left. |
|
|
The item is maximized. For example, a maximized QMdiSubWindow. |
|
|
The item is in the middle (in a list). For example, a tab that is not in the beginning or the end in a QTabBar. |
|
|
The item is minimized. For example, a minimized QMdiSubWindow. |
|
|
The item can be moved around. For example, the QDockWidget has the QDockWidget::DockWidgetMovable feature turned on. |
|
|
The item has no frame. For example, a frameless QSpinBox or QLineEdit. |
|
|
The item is part of a non-exclusive item group. For example, a menu item in a non-exclusive QActionGroup. |
|
|
For items that can be toggled, this applies to items in the "off" state. |
|
|
For items that can be toggled, this applies to widgets in the "on" state. |
|
|
The item is the only one (in a list). For example, a lone tab in a QTabBar. |
|
|
The item is in the open state. For example, an expanded item in a QTreeView, or a QComboBox or QPushButton with an open menu. |
|
|
The next item (in a list) is selected. For example, the selected tab of a QTabBar is next to this item. |
|
|
The item is being pressed using the mouse. |
|
|
The previous item (in a list) is selected. For example, a tab in a QTabBar that is next to the selected tab. |
|
|
The item is marked read only or non-editable. For example, a read only QLineEdit or a non-editable QComboBox. |
|
|
The item is positioned at the right. For example, a QTabBar that has its tabs positioned at the right. |
|
|
The item is selected. For example, the selected tab in a QTabBar or the selected item in a QMenu. |
|
|
The item is positioned at the top. For example, a QTabBar that has its tabs positioned at the top. |
|
|
The item is unchecked. |
|
|
The item has vertical orientation. |
|
|
The widget is a window (i.e top level widget) |
List of Sub-Controls▲
The following subcontrols are available:
|
Sub-Control |
Description |
|---|---|
|
The button to add a line of a QScrollBar. |
|
|
The region between the handle (slider) and the https:// of a QScrollBar. |
|
|
The branch indicator of a QTreeView. |
|
|
The progress chunk of a QProgressBar. |
|
|
The close button of a QDockWidget or tabs of QTabBar |
|
|
The corner between two scrollbars in a QAbstractScrollArea |
|
|
The down arrow of a QComboBox, QHeaderView (sort indicator), QScrollBar or QSpinBox. |
|
|
The down button of a QScrollBar or a QSpinBox. |
|
|
The drop-down button of a QComboBox. |
|
|
The float button of a QDockWidget |
|
|
The groove of a QSlider. |
|
|
The indicator of a QAbstractItemView, a QCheckBox, a QRadioButton, a checkable QMenu item or a checkable QGroupBox. |
|
|
The handle (slider) of a QScrollBar, a QSplitter, or a QSlider. |
|
|
The icon of a QAbstractItemView or a QMenu. |
|
|
An item of a QAbstractItemView, a QMenuBar, a QMenu, or a QStatusBar. |
|
|
The left arrow of a QScrollBar. |
|
|
The left corner of a QTabWidget. For example, this control can be used to control position the left corner widget in a QTabWidget. |
|
|
The arrow of a QToolButton with a menu. |
|
|
The menu button of a QToolButton. |
|
|
The menu indicator of a QPushButton. |
|
|
The right arrow of a QMenu or a QScrollBar. |
|
|
The pane (frame) of a QTabWidget. |
|
|
The right corner of a QTabWidget. For example, this control can be used to control the position the right corner widget in a QTabWidget. |
|
|
The scroller of a QMenu or QTabBar. |
|
|
The section of a QHeaderView. |
|
|
The separator of a QMenu or in a QMainWindow. |
|
|
The button to subtract a line of a QScrollBar. |
|
|
The region between the handle (slider) and the https:// of a QScrollBar. |
|
|
The tab of a QTabBar or QToolBox. |
|
|
The tab bar of a QTabWidget. This subcontrol exists only to control the position of the QTabBar inside the QTabWidget. To style the tabs using the https:// subcontrol. |
|
|
The tear indicator of a QTabBar. |
|
|
The tear-off indicator of a QMenu. |
|
|
The text of a QAbstractItemView. |
|
|
The title of a QGroupBox or a QDockWidget. |
|
|
The up arrow of a QHeaderView (sort indicator), QScrollBar or a QSpinBox. |
|
|
The up button of a QSpinBox. |
See https:// for an example of how to customize a subcontrol.
▲
| https:// | https:// |


