Qt 樣式錶支持各種特性、僞狀態及子控件 (使定製 Widget 外觀成為可能)。
下錶列齣可以使用樣式錶進行定製的 Qt Widgets:
| Widget | 如何樣式化 |
|---|---|
| QAbstractScrollArea |
支持
Box 模型
.
所有衍生的
QAbstractScrollArea
,包括
QTextEdit
,和
QAbstractItemView
(所有項視圖類),支持可捲動背景使用
background-attachment
. Setting the background-attachment to
見 定製 QAbstractScrollArea 範例。 |
| QCheckBox |
支持
Box 模型
。可以樣式化復選指示器使用
::indicator
子控件。默認情況下,指示器放在 Widget 內容矩形的左上角。
The spacing 特性指定復選指示器和文本之間的間距。 見 定製 QCheckBox 範例。 |
| QColumnView | 握把的樣式化可以使用 image 特性。箭頭指示器的樣式化可以使用 ::left-arrow 子控件和 ::right-arrow 子控件。 |
| QComboBox |
The frame around the combobox can be styled using the
Box 模型
. The drop-down button can be styled using the
::drop-down
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
::down-arrow
subcontrol. By default, the arrow is placed in the center of the contents rectangle of the drop-down subcontrol.
見 定製 QComboBox 範例。 |
| QDateEdit | 見 QSpinBox . |
| QDateTimeEdit | 見 QSpinBox . |
| QDialog |
僅支持
background
,
background-clip
and
background-origin
特性。
警告: 確保定義 Q_OBJECT 宏為自定義 Widget。 |
| QDialogButtonBox | The layout of buttons can be altered using the button-layout 特性。 |
| QDockWidget |
Supports styling of the title bar and the title bar buttons when docked. The dock widget border can be styled using the border property. The ::title subcontrol can be used to customize the title bar. The close and float buttons are positioned with respect to the ::title subcontrol using the ::close-button and ::float-button 分彆。 When the title bar is vertical, the :vertical pseudo class is set. In addition, depending on QDockWidget::DockWidgetFeature , :closable , :floatable and :movable pseudo states are set. 注意: 使用 QMainWindow::separator 以樣式化重置手柄大小。 警告: 樣式錶不起作用當 QDockWidget is undocked as Qt uses native top level windows when undocked. 見 定製 QDockWidget 範例。 |
| QDoubleSpinBox | 見 QSpinBox . |
| QFrame |
支持
Box 模型
.
從 4.3 起,設置樣式錶在 QLabel 自動設置 QFrame::frameStyle 特性到 QFrame::StyledPanel . 見 定製 QFrame 範例。 |
| QGroupBox |
支持
Box 模型
. The title can be styled using the
::title
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 ::indicator 子控件。 spacing property can be used to control the spacing between the text and indicator. 見 定製 QGroupBox 範例。 |
| QHeaderView |
支持
Box 模型
. The sections of the header view are styled using the
::section
子控件。
section
子控件支持
:middle
,
:first
,
:last
,
:only-one
,
:next-selected
,
:previous-selected
,
:selected
,和
:checked
僞狀態。
The sort indicator can be styled using the ::up-arrow 和 ::down-arrow 子控件。 見 定製 QHeaderView 範例。 |
| QLabel |
支持
Box 模型
。不支持
:hover
僞狀態。
從 4.3 起,設置樣式錶在 QLabel 自動設置 QFrame::frameStyle 特性到 QFrame::StyledPanel . |
| QLineEdit |
支持
Box 模型
.
樣式化選中項的顔色和背景是使用 selection-color and selection-background-color 分彆。 The password character can be styled using the lineedit-password-character 特性。 The password mask delay can be changed using the lineedit-password-mask-delay 見 定製 QLineEdit 範例。 |
| QListView |
支持
Box 模型
。當
交替行顔色
被啓用,樣式化交替顔色可以使用
alternate-background-color
特性。
樣式化選中項的顔色和背景是使用 selection-color and selection-background-color 分彆。 選定行為的控製是通過 show-decoration-selected 特性。 使用 ::item subcontrol for more fine grained control over the items in the QListView . 見 QAbsractScrollArea 以樣式化可捲動背景。 見 定製 QListView 範例。 |
| QListWidget | 見 QListView . |
| QMainWindow |
支持分隔符樣式化
分隔符在 QMainWindow 當使用 QDockWidget 的樣式化是使用 ::separator 子控件。 見 定製 QMainWindow 範例。 |
| QMenu |
支持
Box 模型
.
Individual items are styled using the
::item
subcontrol. In addition to the usually supported pseudo states,
The indicator of checkable menu items is styled using the ::indicator 子控件。 The separator is styled using the ::separator 子控件。 For items with a sub menu, the arrow marks are styled using the right-arrow and left-arrow . The scroller is styled using the ::scroller . The tear-off is styled using the ::tearoff . 見 定製 QMenu 範例。 |
| QMenuBar |
支持
Box 模型
。
spacing
property specifies the spacing between menu items. Individual items are styled using the
::item
子控件。
警告: 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. 見 定製 QMenuBar 範例。 |
| QMessageBox | The messagebox-text-interaction-flags property can be used to alter the interaction with text in the message box. |
| QProgressBar |
支持
Box 模型
. The chunks of the progress bar can be styled using the
::chunk
subcontrol. The chunk is displayed on the Contents rectangle of the widget.
If the progress bar displays text, use the text-align property to position the text. 不確定的進度條擁有 :indeterminate 僞狀態設置。 見 定製 QProgressBar 範例。 |
| QPushButton |
支持
Box 模型
。支持
:default
,
:flat
,
:checked
僞狀態。
For QPushButton with a menu, the menu indicator is styled using the ::menu-indicator subcontrol. Appearance of checkable push buttons can be customized using the :open and :closed 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, QPushButton { background-color: red; border: none; } 見 定製 QPushButton 範例。 |
| QRadioButton |
支持
Box 模型
。可以樣式化復選指示器使用
::indicator
子控件。默認情況下,指示器放在 Widget 內容矩形的左上角。
The spacing 特性指定復選指示器和文本之間的間距。 見 定製 QRadioButton 範例。 |
| QScrollBar |
支持
Box 模型
. 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
width
or
height
property respectively. To determine the orientation, use the
:horizontal
和
:vertical
僞狀態。
The slider can be styled using the ::handle subcontrol. Setting the min-width or min-height provides size contraints for the slider depending on the orientation. The ::add-line 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 ::right-arrow or ::down-arrow . By default, the arrows are placed in the center of the Contents rectangle of the add-line subcontrol. The ::sub-line 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 ::left-arrow or ::up-arrow . By default, the arrows are placed in the center of the Contents rectangle of the sub-line subcontrol. The ::sub-page subcontrol can be used to style the region of the slider that subtracts a page. The ::add-page subcontrol can be used to style the region of the slider that adds a page. 見 定製 QScrollBar 範例。 |
| QSizeGrip |
支持
width
,
height
,和
image
特性。
見 定製 QSizeGrip 範例。 |
| QSlider |
支持
Box 模型
。對於水平滑動,
min-width
and
height
特性必須提供。對於垂直滑塊,
min-height
and
width
特性必須提供。
The groove of the slider is styled using the ::groove . The groove is positioned by default in the Contents rectangle of the widget. The thumb of the slider is styled using ::handle subcontrol. The subcontrol moves in the Contents rectangle of the groove subcontrol. 見 定製 QSlider 範例。 |
| QSpinBox |
自鏇框框架樣式化可以使用
Box 模型
.
The up button and arrow can be styled using the ::up-button and ::up-arrow 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 ::down-button and ::down-arrow 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. 見 定製 QSpinBox 範例。 |
| QSplitter |
支持
Box 模型
。分割器手柄的樣式化是使用
::handle
子控件。
見 定製 QSplitter 範例。 |
| QStatusBar |
僅支持
background
特性。單個項框架的樣式化可以使用
::item
子控件。
見 定製 QStatusBar 範例。 |
| QTabBar |
單個選項卡的樣式化可以使用
::tab
子控件。關閉按鈕使用
::close-button
選項卡支持
:only-one
,
:first
,
:last
,
:middle
,
:previous--selected
,
:next-selected
,
:selected
僞狀態。
The :top , :left , :right , :bottom 僞狀態從屬選項卡取嚮。
selected 狀態重疊選項卡的創建可以使用負邊距或使用
撕裂指示器對於 QTabBar 的樣式化是使用 ::tear 子控件。
QTabBar
使用兩 QToolButton 的滾動器的樣式化可以使用
選項卡的對齊方式在 QTabBar 的樣式化是使用 alignment 特性。 警告: 要改變位置對於 QTabBar 在 QTabWidget ,使用 tab-bar 子控件 (並設置 subcontrol-position)。 見 Customizing QTabBar 範例。 |
| QTabWidget |
QTabWidget 框架的樣式化是使用
::pane
子控件。左右角落的樣式化是使用
::left-corner
and
::right-corner
分彆。選項卡欄位置的控製是使用
::tab-bar
子控件。
默認情況下,子控件擁有位置對於 QTabWidget 在 QWindowsStyle。要放置 QTabBar 在中心,設置選項卡欄子控件的 subcontrol-position。 The :top , :left , :right , :bottom 僞狀態從屬選項卡取嚮。 見 定製 QTabWidget 範例。 |
| QTableView |
支持
Box 模型
。當
交替行顔色
被啓用,樣式化交替顔色可以使用
alternate-background-color
特性。
樣式化選中項的顔色和背景是使用 selection-color and selection-background-color 分彆。 角落 Widget 在 QTableView 的實現如 QAbstractButton 且樣式化可以使用 QTableView QTableCornerButton::section 選擇器。 警告: 若僅設置 QTableCornerButton 背景色,背景可能不齣現,除非將 border (邊框) 特性設為某值。這是因為,默認情況下,QTableCornerButton 會繪製完全重疊背景色的本機邊框。 柵格顔色的指定可以使用 gridline-color 特性。 見 QAbsractScrollArea 以樣式化可捲動背景。 見 定製 QTableView 範例。 |
| QTableWidget | 見 QTableView . |
| QTextEdit |
支持
Box 模型
.
選中文本的顔色和背景的樣式化是使用 selection-color and selection-background-color 分彆。 見 QAbsractScrollArea 以樣式化可捲動背景。 |
| QTimeEdit | 見 QSpinBox . |
| QToolBar |
支持
Box 模型
.
The :top , :left , :right , :bottom pseudo states depending on the area in which the tool bar is grouped. The :first , :last , :middle , :only-one pseudo states indicator the position of the tool bar within a line group (See QStyleOptionToolBar::positionWithinLine ). 分隔符對於 QToolBar 的樣式化是使用 ::separator 子控件。 (移動工具欄的) 手柄的樣式化是使用 ::handle 子控件。 見 定製 QToolBar 範例。 |
| QToolButton |
支持
Box 模型
.
若 QToolButton 擁有菜單,是 ::menu-indicator 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. 若 QToolButton 是在 QToolButton::MenuButtonPopup 模式, ::menu-button subcontrol is used to draw the menu button. ::menu-arrow 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. 當 QToolButton 顯示箭頭, ::up-arrow , ::down-arrow , ::left-arrow and ::right-arrow 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, QToolButton { background-color: red; border: none; } 見 定製 QToolButton 範例。 |
| QToolBox |
支持
Box 模型
.
The individual tabs can by styled using the ::tab subcontrol. The tabs support the :only-one , :first , :last , :middle , :previous-selected , :next-selected , :selected 僞狀態。 |
| QToolTip | 支持 Box 模型 。 opacity property controls the opacity of the tooltip. |
| QTreeView |
支持
Box 模型
。當
交替行顔色
被啓用,樣式化交替顔色可以使用
alternate-background-color
特性。
樣式化選中項的顔色和背景是使用 selection-color and selection-background-color 分彆。 選定行為的控製是通過 show-decoration-selected 特性。 The branches of the tree view can be styled using the ::branch subcontrol. The ::branch Sub-control supports the :open , :closed , :has-sibling and :has-children 僞狀態。 使用 ::item subcontrol for more fine grained control over the items in the QTreeView . 見 QAbsractScrollArea 以樣式化可捲動背景。 見 定製 QTreeView for an example to style the branches. |
| QTreeWidget | 見 QTreeView . |
| QWidget |
僅支持
background
,
background-clip
and
background-origin
特性。
若子類來自 QWidget ,需要提供 paintEvent 為自定義 QWidget 如下: void CustomWidget::paintEvent(QPaintEvent *) { QStyleOption opt; opt.init(this); QPainter p(this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); } 以上代碼無操作,若未設置樣式錶。 警告: 確保定義 Q_OBJECT 宏為自定義 Widget。 |
The table below lists all the properties supported by Qt Style Sheets. Which values can be given to an property depend on the 特性類型 . 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.
| 特性 | 類型 | 描述 |
|---|---|---|
alternate-background-color
|
Brush |
The
替代背景色
用於
QAbstractItemView
子類。
若此特性未設置,將默認值設為調色闆的 AlternateBase 角色。 範例: QTreeView { alternate-background-color: blue; background: yellow; } 另請參閱 background and selection-background-color . |
background
|
Background |
Shorthand notation for setting the background. Equivalent to specifying
background-color
,
background-image
,
background-repeat
, and/or
background-position
.
此特性的支持通過 QAbstractItemView 子類, QAbstractSpinBox 子類, QCheckBox , QComboBox , QDialog , QFrame , QGroupBox , QLabel , QLineEdit , QMenu , QMenuBar , QPushButton , QRadioButton , QSplitter , QTextEdit , QToolTip ,和純 QWidget 。 範例:
QTextEdit { background: yellow }
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. 範例: QLabel { background-image: url(dense6pattern.png); background-repeat: repeat-xy; } 另請參閱 background-origin , selection-background-color , background-clip , background-attachment and alternate-background-color . |
background-color
|
Brush |
用於 Widget 的背景色。 範例: QLabel { background-color: yellow } QLineEdit { background-color: rgb(255, 0, 0) } |
background-image
|
Url |
The background image used for the widget. Semi-transparent parts of the image let the
background-color
shine through.
範例: QFrame { background-image: url(:/images/hydro.png) } |
background-repeat
|
Repeat |
Whether and how the background image is repeated to fill the
background-origin
矩形。
If this property is not specified, the background image is repeated in both directions (
範例: QFrame { background: white url(:/images/ring.png); background-repeat: repeat-y; background-position: left; } |
background-position
|
Alignment |
背景圖像的對齊方式在
background-origin
矩形。
若此特性未指定,對齊方式為
範例: QFrame { background: url(:/images/footer.png); background-position: bottom left; } |
background-attachment
|
Attachment |
確定 background-image 是否在
QAbstractScrollArea
is scrolled or fixed with respect to the viewport. By default, the background-image scrolls with the viewport.
範例: QTextEdit { background-image: url("leaves.png"); background-attachment: fixed; } 另請參閱 background |
background-clip
|
Origin |
Widget 的矩形,在那裏
background
被繪製。
此特性指定矩形以在那裏
此特性的支持通過 QAbstractItemView 子類, QAbstractSpinBox 子類, QCheckBox , QComboBox , QDialog , QFrame , QGroupBox , QLabel , QPushButton , QRadioButton , QSplitter , QTextEdit , QToolTip ,和純 QWidget 。
若此特性未指定,默認為
範例: QFrame { background-image: url(:/images/header.png); background-position: top left; background-origin: content; background-clip: padding; } 另請參閱 background , background-origin and Box 模型 . |
background-origin
|
Origin |
Widget 的背景矩形,用於結閤
background-position
and
background-image
.
此特性的支持通過 QAbstractItemView 子類, QAbstractSpinBox 子類, QCheckBox , QComboBox , QDialog , QFrame , QGroupBox , QLabel , QPushButton , QRadioButton , QSplitter , QTextEdit , QToolTip ,和純 QWidget 。
若此特性未指定,默認為
範例: QFrame { background-image: url(:/images/header.png); background-position: top left; background-origin: content; } 另請參閱 background and Box 模型 . |
border
|
Border |
Shorthand notation for setting the widget's border. Equivalent to specifying
border-color
,
border-style
, and/or
border-width
.
此特性的支持通過 QAbstractItemView 子類, QAbstractSpinBox 子類, QCheckBox , QComboBox , QFrame , QGroupBox , QLabel , QLineEdit , QMenu , QMenuBar , QPushButton , QRadioButton , QSplitter , QTextEdit , QToolTip ,和純 QWidget 。 範例: QLineEdit { border: 1px solid white } |
border-top
|
Border |
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
|
Border |
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
|
Border |
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
|
Border |
Shorthand notation for setting the widget's left border. Equivalent to specifying
border-left-color
,
border-left-style
, and/or
border-left-width
.
|
border-color
|
Box Colors |
The color of all the border's edges. Equivalent to specifying
border-top-color
,
border-right-color
,
border-bottom-color
,和
border-left-color
.
此特性的支持通過 QAbstractItemView 子類, QAbstractSpinBox 子類, QCheckBox , QComboBox , QFrame , QGroupBox , QLabel , QLineEdit , QMenu , QMenuBar , QPushButton , QRadioButton , QSplitter , QTextEdit , QToolTip ,和純 QWidget 。 若此特性未指定,默認為 color (i.e., the widget's foreground color). 範例: QLineEdit { border-width: 1px; border-style: solid; border-color: white; } 另請參閱 border-style , border-width , border-image ,和 Box 模型 . |
border-top-color
|
Brush | The color of the border's top edge. |
border-right-color
|
Brush | The color of the border's right edge. |
border-bottom-color
|
Brush | The color of the border's bottom edge. |
border-left-color
|
Brush | The color of the border's left edge. |
border-image
|
Border Image |
The image used to fill the border. The image is cut into nine parts and stretched appropriately if necessary. See
Border Image
瞭解細節。
此特性的支持通過 QAbstractItemView 子類, QAbstractSpinBox 子類, QCheckBox , QComboBox , QFrame , QGroupBox , QLabel , QLineEdit , QMenu , QMenuBar , QPushButton , QRadioButton , QSplitter , QTextEdit and QToolTip . 另請參閱 border-color , border-style , border-width ,和 Box 模型 . |
border-radius
|
半徑 |
The radius of the border's corners. Equivalent to specifying
border-top-left-radius
,
border-top-right-radius
,
border-bottom-right-radius
,和
border-bottom-left-radius
.
The border-radius clips the element's background . 此特性的支持通過 QAbstractItemView 子類, QAbstractSpinBox 子類, QCheckBox , QComboBox , QFrame , QGroupBox , QLabel , QLineEdit , QMenu , QMenuBar , QPushButton , QRadioButton , QSplitter , QTextEdit ,和 QToolTip . If this property is not specified, it defaults to 0. 範例: QLineEdit { border-width: 1px; border-style: solid; border-radius: 4px; } 另請參閱 border-width and Box 模型 . |
border-top-left-radius
|
半徑 | The radius of the border's top-left corner. |
border-top-right-radius
|
半徑 | The radius of the border's top-right corner. |
border-bottom-right-radius
|
半徑 | 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
|
半徑 | The radius of the border's bottom-left corner. Setting this property to a positive value results in a rounded corner. |
border-style
|
Border Style |
所有邊框邊緣的樣式。 此特性的支持通過 QAbstractItemView 子類, QAbstractSpinBox 子類, QCheckBox , QComboBox , QFrame , QGroupBox , QLabel , QLineEdit , QMenu , QMenuBar , QPushButton , QRadioButton , QSplitter , QTextEdit ,和 QToolTip .
若此特性未指定,默認為
範例: QLineEdit { border-width: 1px; border-style: solid; border-color: blue; } 另請參閱 border-color , border-style , border-image ,和 Box 模型 . |
border-top-style
|
Border Style | The style of the border's top edge. |
border-right-style
|
Border Style | The style of the border's right edge/ |
border-bottom-style
|
Border Style | The style of the border's bottom edge. |
border-left-style
|
Border Style | The style of the border's left edge. |
border-width
|
Box Lengths |
The width of the border. Equivalent to setting
border-top-width
,
border-right-width
,
border-bottom-width
,和
border-left-width
.
此特性的支持通過 QAbstractItemView 子類, QAbstractSpinBox 子類, QCheckBox , QComboBox , QFrame , QGroupBox , QLabel , QLineEdit , QMenu , QMenuBar , QPushButton , QRadioButton , QSplitter , QTextEdit ,和 QToolTip . 範例: QLineEdit { border-width: 2px; border-style: solid; border-color: darkblue; } 另請參閱 border-color , border-radius , border-style , border-image ,和 Box 模型 . |
border-top-width
|
長度 | The width of the border's top edge. |
border-right-width
|
長度 | The width of the border's right edge. |
border-bottom-width
|
長度 | The width of the border's bottom edge. |
border-left-width
|
長度 | The width of the border's left edge. |
bottom
|
長度 |
若
position
is
relative
(the default), moves a subcontrol by a certain offset up; specifying
bottom: y
is then equivalent to specifying
top: -y
.
若
position
is
範例: QSpinBox::down-button { bottom: 2px } |
button-layout
|
Number |
The layout of buttons in a
QDialogButtonBox
或
QMessageBox
. The possible values are 0 (
WinLayout
), 1 (
MacLayout
), 2 (
KdeLayout
), 3 (
GnomeLayout
) and 5 (
AndroidLayout
).
若此特性未指定,默認為當前樣式指定值對於 SH_DialogButtonLayout 樣式提示。 範例: * { button-layout: 2 } |
color
|
Brush |
顔色用於渲染文本。 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). 範例:
QPushButton { color: red }
另請參閱 background and selection-color . |
dialogbuttonbox-buttons-have-icons
|
布爾 |
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. 見 圖標列錶 section for information on how to set icons. QDialogButtonBox { dialogbuttonbox-buttons-have-icons: 1; } 注意: 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. |
font
|
Font |
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 . 範例: QCheckBox { font: bold italic large "Times New Roman" } |
font-family
|
字符串 |
字體係列。 範例: QCheckBox { font-family: "New Century Schoolbook" } |
font-size
|
字體大小 |
字體大小。在此版本的 Qt 中,僅支持 pt 和 px 規格。 範例: QTextEdit { font-size: 12px } |
font-style
|
字體樣式 |
字體樣式。 範例: QTextEdit { font-style: italic } |
font-weight
|
字體粗細 | 字體的精細。 |
gridline-color
*
|
顔色 |
柵格綫的顔色在
QTableView
.
若此特性未指定,默認為當前樣式指定值對於 SH_Table_GridLineColor 樣式提示。 範例: * { gridline-color: gray } |
height
|
長度 |
子控件 (或在某些情況下的 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 min-height and max-height to the same value. 範例: QSpinBox::down-button { height: 10px } 另請參閱 width . |
icon-size
|
長度 |
Widget 圖標的寬度和高度。 使用此特性,可以設置下列 Widget 的圖標大小。 |
image
*
|
Url + |
The image that is drawn in the contents rectangle of a subcontrol.
The image property accepts a list of
Url
s or an
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 image-position . This property is for subcontrols only--we don't support it for other elements. 警告: The QIcon SVG plugin is needed to render SVG images. 範例: // implicitly sets the size of down-button to the // size of spindown.png QSpinBox::down-button { image: url(:/images/spindown.png) } |
image-position
|
alignment | In Qt 4.3 and later, the alignment of the image image's position can be specified using relative or absolute position. |
left
|
長度 |
若
position
is
relative
(the default), moves a subcontrol by a certain offset to the right.
若
position
is
若此特性未指定,默認為
範例: QSpinBox::down-button { left: 2px } |
lineedit-password-character*
|
Number |
The
QLineEdit
password character as a Unicode number.
若此特性未指定,默認為當前樣式指定值對於 SH_LineEdit_PasswordCharacter 樣式提示。 範例: * { lineedit-password-character: 9679 } |
lineedit-password-mask-delay*
|
Number |
The
QLineEdit
password mask delay in milliseconds before
lineedit-password-character
is applied to visible character.
若此特性未指定,默認為當前樣式指定值對於 SH_LineEdit_PasswordMaskDelay 樣式提示。 This property was added in Qt 5.4. 範例: * { lineedit-password-mask-delay: 1000 } |
margin
|
Box Lengths |
The widget's margins. Equivalent to specifying
margin-top
,
margin-right
,
margin-bottom
,和
margin-left
.
此特性的支持通過 QAbstractItemView 子類, QAbstractSpinBox 子類, QCheckBox , QComboBox , QFrame , QGroupBox , QLabel , QLineEdit , QMenu , QMenuBar , QPushButton , QRadioButton , QSplitter , QTextEdit ,和 QToolTip .
若此特性未指定,默認為
範例: QLineEdit { margin: 2px } |
margin-top
|
長度 | Widget 上邊距。 |
margin-right
|
長度 | Widget 右邊距。 |
margin-bottom
|
長度 | Widget 下邊距。 |
margin-left
|
長度 | Widget 左邊距。 |
max-height
|
長度 |
Widget 或子控件的最大高度。 此特性的支持通過 QAbstractItemView 子類, QAbstractSpinBox 子類, QCheckBox , QComboBox , QFrame , QGroupBox , QLabel , QLineEdit , QMenu , QMenuBar , QPushButton , QRadioButton , QSizeGrip , QSpinBox , QSplitter , QStatusBar , QTextEdit ,和 QToolTip . The value is relative to the contents rect in the Box 模型 . 範例: QSpinBox { max-height: 24px } 另請參閱 max-width . |
max-width
|
長度 |
Widget 或子控件的最大寬度。 此特性的支持通過 QAbstractItemView 子類, QAbstractSpinBox 子類, QCheckBox , QComboBox , QFrame , QGroupBox , QLabel , QLineEdit , QMenu , QMenuBar , QPushButton , QRadioButton , QSizeGrip , QSpinBox , QSplitter , QStatusBar , QTextEdit ,和 QToolTip . The value is relative to the contents rect in the Box 模型 . 範例: QComboBox { max-width: 72px } 另請參閱 max-height . |
messagebox-text-interaction-flags*
|
Number |
The interaction behavior for text in a message box. Possible values are based on
Qt::TextInteractionFlags
.
若此特性未指定,默認為當前樣式指定值對於 SH_MessageBox_TextInteractionFlags 樣式提示。 範例: QMessageBox { messagebox-text-interaction-flags: 5 } |
min-height
|
長度 |
Widget 或子控件的最小高度。 此特性的支持通過 QAbstractItemView 子類, QAbstractSpinBox 子類, QCheckBox , QComboBox , QFrame , QGroupBox , QLabel , QLineEdit , QMenu , QMenuBar , QPushButton , QRadioButton , QSizeGrip , QSpinBox , QSplitter , QStatusBar , QTextEdit ,和 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 Box 模型 . 範例: QComboBox { min-height: 24px } 另請參閱 min-width . |
min-width
|
長度 |
Widget 或子控件的最小寬度。 此特性的支持通過 QAbstractItemView 子類, QAbstractSpinBox 子類, QCheckBox , QComboBox , QFrame , QGroupBox , QLabel , QLineEdit , QMenu , QMenuBar , QPushButton , QRadioButton , QSizeGrip , QSpinBox , QSplitter , QStatusBar , QTextEdit ,和 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 Box 模型 . 範例: QComboBox { min-width: 72px } 另請參閱 min-height . |
opacity*
|
Number |
The opacity for a widget. Possible values are from 0 (transparent) to 255 (opaque). For the moment, this is only supported for
tooltips
.
若此特性未指定,默認為當前樣式指定值對於 SH_ToolTipLabel_Opacity 樣式提示。 範例: QToolTip { opacity: 223 } |
| outline | 圍繞對象邊框繪製的輪廓。 | |
| outline-color | 顔色 | 輪廓的顔色。另請參閱 border-color |
| outline-offset | 長度 | 從 Widget 邊框起的輪廓偏移。 |
| outline-style | 指定用於繪製輪廓的模式。另請參閱 border-style | |
| outline-radius | 把圓角添加到輪廓 | |
| outline-bottom-left-radius | 半徑 | The radius for the bottom-left rounded corner of the outline. |
| outline-bottom-right-radius | 半徑 | The radius for the bottom-right rounded corner of the outline. |
| outline-top-left-radius | 半徑 | The radius for the top-left corner of the outline. |
| outline-top-right-radius | 半徑 | The radius for the top-right rounded corner of the outline. |
padding
|
Box Lengths |
The widget's padding. Equivalent to specifying
padding-top
,
padding-right
,
padding-bottom
,和
padding-left
.
此特性的支持通過 QAbstractItemView 子類, QAbstractSpinBox 子類, QCheckBox , QComboBox , QFrame , QGroupBox , QLabel , QLineEdit , QMenu , QMenuBar , QPushButton , QRadioButton , QSplitter , QTextEdit ,和 QToolTip .
若此特性未指定,默認為
範例: QLineEdit { padding: 3px } |
padding-top
|
長度 | Widget 的頂部鋪墊。 |
padding-right
|
長度 | Widget 的右側鋪墊。 |
padding-bottom
|
長度 | Widget 的底部鋪墊。 |
padding-left
|
長度 | Widget 的左側鋪墊。 |
paint-alternating-row-colors-for-empty-area
|
bool
|
是否 QTreeView 描繪用於空區域 (即:不存在項的區域) 的交替行顔色 |
位置
|
relative
|
absolute
|
是否偏移指定使用
left
,
right
,
top
,和
bottom
是相對 (或絕對) 坐標。
若此特性未指定,默認為
|
right
|
長度 |
若
position
is
relative
(the default), moves a subcontrol by a certain offset to the left; specifying
right: x
is then equivalent to specifying
left: -x
.
若
position
is
範例: QSpinBox::down-button { right: 2px } |
selection-background-color*
|
Brush |
選中文本 (或項) 的背景。 This property is supported by all widgets that respect the QWidget::palette and that show selection text. 若此特性未設置,將默認值設為調色闆的 Highlight 角色。 範例: QTextEdit { selection-background-color: darkblue } 另請參閱 selection-color and background . |
selection-color*
|
Brush |
選中文本 (或項) 的前景。 This property is supported by all widgets that respect the QWidget::palette and that show selection text. 若此特性未設置,將默認值設為調色闆的 HighlightedText 角色。 範例: QTextEdit { selection-color: white } 另請參閱 selection-background-color and color . |
show-decoration-selected*
|
布爾 |
Controls whether selections in a
QListView
cover the entire row or just the extent of the text.
若此特性未指定,默認為當前樣式指定值對於 SH_ItemView_ShowDecorationSelected 樣式提示。 範例: * { show-decoration-selected: 1 } |
spacing*
|
長度 |
Internal spacing in the widget. 此特性的支持通過 QCheckBox , checkable QGroupBox es, QMenuBar ,和 QRadioButton . If this property is not specified, the default value depends on the widget and on the current style. 範例: QMenuBar { spacing: 10 } |
subcontrol-origin*
|
Origin |
The origin rectangle of the subcontrol within the parent element.
若此特性未指定,默認為
範例: QSpinBox::up-button { image: url(:/images/spinup.png); subcontrol-origin: content; subcontrol-position: right top; } 另請參閱 subcontrol-position . |
subcontrol-position*
|
Alignment |
The alignment of the subcontrol within the origin rectangle specified by
subcontrol-origin
.
If this property is not specified, it defaults to a value that depends on the subcontrol. 範例: QSpinBox::down-button { image: url(:/images/spindown.png); subcontrol-origin: padding; subcontrol-position: right bottom; } 另請參閱 subcontrol-origin . |
titlebar-show-tooltips-on-buttons
}
|
bool
|
Whether tool tips are shown on window title bar buttons. |
widget-animation-duration*
|
Number |
How much an animation should last (in milliseconds). A value equal to zero means that the animations will be disabled. 若此特性未指定,默認為當前樣式指定值對於 SH_Widget_Animation_Duration 樣式提示。 該特性在 Qt 5.10 添加。 範例: * { widget-animation-duration: 100 } |
text-align
|
Alignment |
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. 範例: QPushButton { text-align: left; } 此特性目前僅支持通過 QPushButton and QProgressBar . |
text-decoration
|
none
underline
overline
line-through
|
額外文本效果 |
top
|
長度 |
若
position
is
relative
(the default), moves a subcontrol by a certain offset down.
若
position
is
若此特性未指定,默認為
範例: QSpinBox::up-button { top: 2px } |
width
|
長度 |
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 min-width and max-width to the same value. 範例: QSpinBox::up-button { width: 12px } 另請參閱 height . |
Icons used in Qt can be customized using the following properties. Each of the properties listed in this section have the type Icon .
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.
下錶匯總瞭不同特性類型的句法和含義。
| 類型 | 句法 | 描述 |
|---|---|---|
| Alignment |
{
top
|
bottom
|
left
|
right
|
center
}*
|
水平和/或垂直對齊。 範例: QTextEdit { background-position: bottom center } |
| Attachment |
{
scroll
|
fixed
}*
|
捲動或固定附件。 |
| Background |
{
Brush
| Url | Repeat | Alignment }* |
A sequence of Brush , Url , Repeat ,和 Alignment . |
| 布爾 | 0 | 1 |
True (
1
) or false (
0
).
範例: QDialog { etch-disabled-text: 1 } |
| Border |
{
Border Style
| 長度 | Brush }* |
Shorthand border property. |
| Border Image |
none
| Url Number {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. 見 CSS3 Draft Specification 瞭解細節。 |
| Border Style |
dashed
|
dot-dash
|
dot-dot-dash
|
dotted
|
double
|
groove
|
inset
|
outset
|
ridge
|
solid
|
none
|
Specifies the pattern used to draw a border. See the CSS3 Draft Specification 瞭解細節。 |
| Box Colors | Brush {1,4} |
One to four occurrences of
Brush
, 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.
範例: QLabel { border-color: red } /* red red red red */ QLabel { border-color: red blue } /* red blue red blue */ QLabel { border-color: red blue green } /* red blue green blue */ QLabel { border-color: red blue green yellow } /* red blue green yellow */ |
| Box Lengths | 長度 {1,4} |
One to four occurrences of
長度
, 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.
範例: QLabel { border-width: 1px } /* 1px 1px 1px 1px */ QLabel { border-width: 1px 2px } /* 1px 2px 1px 2px */ QLabel { border-width: 1px 2px 3px } /* 1px 2px 3px 2px */ QLabel { border-width: 1px 2px 3px 4px } /* 1px 2px 3px 4px */ |
| Brush |
顔色
| 漸變 | PaletteRole |
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)
|
#rrggbb
| Color Name |
Specifies a color as RGB (red, green, blue) or RGBA (red, green, blue, alpha) or HSV (hue, saturation, value) or HSVA (hue, saturation, value, 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, and a in
hsv()
or
hsva()
must all be in the range 0-255; the value of h must be in the range 0-359.
範例: QLabel { border-color: red } /* opaque red */ QLabel { border-color: #FF0000 } /* opaque red */ QLabel { border-color: rgba(255, 0, 0, 75%) } /* 75% opaque red */ QLabel { border-color: rgb(255, 0, 0) } /* opaque red */ QLabel { border-color: rgb(100%, 0%, 0%) } /* opaque red */ QLabel { border-color: hsv(60, 255, 255) } /* opaque yellow */ QLabel { border-color: hsva(240, 255, 255, 75%) } /* 75% blue */ 注意: The RGB colors allowed are the same as those allowed with CSS 2.1, as listed here . |
| Font | ( 字體樣式 | 字體粗細 ){0,2} 字體大小 字符串 | Shorthand font property. |
| 字體大小 | 長度 | 字體大小。 |
| 字體樣式 |
normal
|
italic
|
oblique
|
字體樣式。 |
| 字體粗細 |
normal
|
bold
|
100
|
200
... |
900
|
字體的粗細。 |
| 漸變 |
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. 範例: /* linear gradient from white to green */ QTextEdit { background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 white, stop: 0.4 gray, stop:1 green) } /* linear gradient from white to green */ QTextEdit { background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 white, stop: 0.4 rgba(10, 20, 30, 40), stop:1 rgb(0, 200, 230, 200)) } /* conical gradient from white to green */ QTextEdit { background: qconicalgradient(cx:0.5, cy:0.5, angle:30, stop:0 white, stop:1 #00FF00) } /* radial gradient from white to green */ QTextEdit { background: qradialgradient(cx:0, cy:0, radius: 1, fx:0.5, fy:0.5, stop:0 white, stop:1 green) } |
| 圖標 |
(
Url
(
被禁用
|
active
|
normal
|
selected
)? (
on
|
off
)? )*
|
A list of url,
QIcon::Mode
and
QIcon::State
.
範例: * { file-icon: url(file.png), url(file_selected.png) selected; } QMessageBox { dialogbuttonbox-buttons-have-icons: true; dialog-ok-icon: url(ok.svg); dialog-cancel-icon: url(cancel.png), url(grayed_cancel.png) disabled; } |
| 長度 |
Number
(
px
|
pt
|
em
|
ex
)?
|
A number followed by a measurement unit. The CSS standard recommends that user agents must
ignore
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
|
| Number | A decimal integer or a real number |
範例:
0
,
18
,
+127
,
-255
,
12.34
,
-.5
,
0009
.
|
| Origin |
margin
|
border
|
padding
|
content
|
Indicates which of four rectangles to use.
另請參閱 Box 模型 . |
| PaletteRole |
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
.
例如,
QPushButton { color: palette(dark); }
|
| 半徑 | 長度 {1, 2} | One or two occurrences of 長度 . 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 |
repeat-x
|
repeat-y
|
repeat
|
no-repeat
|
A value indicating the nature of repetition.
|
| Url |
url(filename)
|
filename
is the name of a file on the local disk or stored using
Qt 資源係統
. Setting an image implicitly sets the width and height of the element.
|
支持下列僞狀態:
| 僞狀態 | 描述 |
|---|---|
:active
|
此狀態被設置,當 Widget 在活動窗口中時。 |
:adjoins-item
|
This state is set when the ::branch 的 QTreeView is adjacent to an item. |
:alternate
|
This state is set for every alternate row whe painting the row of a QAbstractItemView 當 QAbstractItemView::alternatingRowColors () is set to true. |
:bottom
|
The item is positioned at the bottom. For example, a QTabBar that has its tabs positioned at the bottom. |
:checked
|
The item is checked. For example, the checked state of QAbstractButton . |
:closable
|
The items can be closed. For example, the QDockWidget 擁有 QDockWidget::DockWidgetClosable feature turned on. |
:closed
|
The item is in the closed state. For example, an non-expanded item in a QTreeView |
:default
|
The item is the default. For example, a default QPushButton or a default action in a QMenu . |
:disabled
|
項是 被禁用 . |
:editable
|
The QComboBox 是可編輯的。 |
:edit-focus
|
The item has edit focus (See QStyle::State_HasEditFocus ). This state is available only for Qt Extended applications. |
:enabled
|
項是 enabled . |
:exclusive
|
The item is part of an exclusive item group. For example, a menu item in a exclusive QActionGroup . |
:first
|
The item is the first (in a list). For example, the first tab in a QTabBar . |
:flat
|
項是扁平的。例如, flat QPushButton . |
:floatable
|
The items can be floated. For example, the QDockWidget 擁有 QDockWidget::DockWidgetFloatable feature turned on. |
:focus
|
項有 輸入聚焦 . |
:has-children
|
The item has children. For example, an item in a QTreeView that has child items. |
:has-siblings
|
The item has siblings. For example, an item in a QTreeView that siblings. |
:horizontal
|
The item has horizontal orientation |
:hover
|
The mouse is hovering over the item. |
:indeterminate
|
The item has indeterminate state. For example, a QCheckBox or QRadioButton is partially checked . |
:last
|
The item is the last (in a list). For example, the last tab in a QTabBar . |
:left
|
The item is positioned at the left. For example, a QTabBar that has its tabs positioned at the left. |
:maximized
|
The item is maximized. For example, a maximized QMdiSubWindow . |
:middle
|
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 . |
:minimized
|
The item is minimized. For example, a minimized QMdiSubWindow . |
:movable
|
The item can be moved around. For example, the QDockWidget 擁有 QDockWidget::DockWidgetMovable feature turned on. |
:no-frame
|
The item has no frame. For example, a frameless QSpinBox or QLineEdit . |
:non-exclusive
|
The item is part of a non-exclusive item group. For example, a menu item in a non-exclusive QActionGroup . |
:off
|
For items that can be toggled, this applies to items in the "off" state. |
:on
|
For items that can be toggled, this applies to widgets in the "on" state. |
:only-one
|
The item is the only one (in a list). For example, a lone tab in a QTabBar . |
:open
|
The item is in the open state. For example, an expanded item in a QTreeView ,或 QComboBox or QPushButton with an open menu. |
:next-selected
|
The next item (in a list) is selected. For example, the selected tab of a QTabBar is next to this item. |
:pressed
|
The item is being pressed using the mouse. |
:previous-selected
|
The previous item (in a list) is selected. For example, a tab in a QTabBar that is next to the selected tab. |
:read-only
|
The item is marked read only or non-editable. For example, a read only QLineEdit or a non-editable QComboBox . |
:right
|
The item is positioned at the right. For example, a QTabBar that has its tabs positioned at the right. |
:selected
|
The item is selected. For example, the selected tab in a QTabBar or the selected item in a QMenu . |
:top
|
The item is positioned at the top. For example, a QTabBar that has its tabs positioned at the top. |
:unchecked
|
項是 unchecked . |
:vertical
|
項有垂直取嚮。 |
:window
|
The widget is a window (i.e top level widget) |
下列子控件可用:
| Sub-Control | 描述 |
|---|---|
::add-line
|
The button to add a line of a QScrollBar . |
::add-page
|
The region between the handle (slider) and the add-line 的 QScrollBar . |
::branch
|
The branch indicator of a QTreeView . |
::chunk
|
The progress chunk of a QProgressBar . |
::close-button
|
The close button of a QDockWidget or tabs of QTabBar |
::corner
|
The corner between two scrollbars in a QAbstractScrollArea |
::down-arrow
|
The down arrow of a QComboBox , QHeaderView (sort indicator), QScrollBar or QSpinBox . |
::down-button
|
The down button of a QScrollBar 或 QSpinBox . |
::drop-down
|
The drop-down button of a QComboBox . |
::float-button
|
浮動按鈕對於 QDockWidget |
::groove
|
凹槽對於 QSlider . |
::indicator
|
指示器對於 QAbstractItemView , QCheckBox , QRadioButton ,可復選 QMenu item or a checkable QGroupBox . |
::handle
|
The handle (slider) of a QScrollBar , QSplitter ,或 QSlider . |
::icon
|
The icon of a QAbstractItemView 或 QMenu . |
::item
|
項對於 QAbstractItemView , QMenuBar , QMenu ,或 QStatusBar . |
::left-arrow
|
The left arrow of a QScrollBar . |
::left-corner
|
The left corner of a QTabWidget . For example, this control can be used to control position the left corner widget in a QTabWidget . |
::menu-arrow
|
The arrow of a QToolButton with a menu. |
::menu-button
|
The menu button of a QToolButton . |
::menu-indicator
|
The menu indicator of a QPushButton . |
::right-arrow
|
The right arrow of a QMenu 或 QScrollBar . |
::pane
|
窗格 (框架) 對於 QTabWidget . |
::right-corner
|
The right corner of a QTabWidget . For example, this control can be used to control the position the right corner widget in a QTabWidget . |
::scroller
|
The scroller of a QMenu or QTabBar . |
::section
|
The section of a QHeaderView . |
::separator
|
分隔符對於 QMenu 或在 QMainWindow . |
::sub-line
|
The button to subtract a line of a QScrollBar . |
::sub-page
|
The region between the handle (slider) and the sub-line 的 QScrollBar . |
::tab
|
選項卡對於 QTabBar or QToolBox . |
::tab-bar
|
選項卡欄對於 QTabWidget 。此子控件的存在僅用於控製位置對於 QTabBar 在 QTabWidget 。要樣式選項卡使用 ::tab 子控件。 |
::tear
|
撕裂指示器對於 QTabBar . |
::tearoff
|
The tear-off indicator of a QMenu . |
::text
|
The text of a QAbstractItemView . |
::title
|
The title of a QGroupBox 或 QDockWidget . |
::up-arrow
|
The up arrow of a QHeaderView (sort indicator), QScrollBar 或 QSpinBox . |
::up-button
|
The up button of a QSpinBox . |
見 定製 QPushButton 的菜單指示器子控件 有關如何定製子控件的範例。