QAbstractButton
按鈕,常常被理解為觸發一種動作請求或者命令,是與用戶進行指令交互的操作。Qt中Button系列根據用途被劃分為不同的定義Qt Designer提供6種Button控制項
按鈕,常常被理解為觸發一種動作請求或者命令,是與用戶進行指令交互的操作。
Qt Designer
Button
QPushButton 按鈕
QPushButton
QAbstractButton類屬性
text
icon
iconSize
shortcut
checkable
checked
autoRepeat
autoExclusive
autoRepeatDelay
autoRepeatInterval
QPushButton類屬性
autoDefault
default
flat
QPushButton信號
信號觸發條件:
clicked()
clicked(bool)
pressed()
released()
toggled(bool)
QToolButton工具按鈕
QToolButton
QToolButton類屬性
popupMode
DelayedPopup 延遲彈出MenuButtonPopup 菜單按鈕彈出 InstantPopup 即時彈出
DelayedPopup 延遲彈出
DelayedPopup
MenuButtonPopup
InstantPopup 即時彈出
InstantPopup
toolButtonStyle
ToolButtonIconOnly 僅顯示圖標ToolButtonTextOnly 僅顯示文本ToolButtonTextBesideIcon 文本出現在圖標的旁邊ToolButtonTextUnderIcon 文本出現在圖標的下邊ToolButtonFollowStyle 按照樣式顯示
ToolButtonIconOnly 僅顯示圖標
ToolButtonIconOnly
ToolButtonTextOnly
ToolButtonTextBesideIcon
ToolButtonTextUnderIcon
ToolButtonFollowStyle
autoRaise
arrowType
NoArrow 沒有箭頭UpArrow 向上箭頭DownArrow 向下箭頭LeftArrow 向左箭頭RightArrow 向右箭頭
NoArrow 沒有箭頭
NoArrow
UpArrow
DownArrow
LeftArrow
RightArrow
QToolButton信號
triggered(QAction*)
action
QRadioButton
QRadioButton 信號
QCheckBox 多選按鈕
QCheckBox
QCheckBox類屬性
tristate
True
False
stateChanged(int)
QCommandLinkButton 命令鏈接按鈕
QCommandLinkButton
QDialogButtonBox 按鈕盒子
QDialogButtonBox
QDialogButtonBox類屬性
orientation
Horizontal 水平排列 Vertical 垂直排列
Horizontal 水平排列
Horizontal
Vertical 垂直排列
Vertical
standardButtons
centerButtons
QDialogButtonBox 信號
accepted()
yes
ok
clicked(QAbstractButton*)
helpRequested()
help
rejected()
no
close
推薦閱讀: