ButtonBox控件

标签:
linuxit |
分类: QT |
1.控件位置
Buttons→ButtonBox
2.控件介绍
ButtonBox控件(按钮盒)的样式如图3-28所示。ButtonBox控件是由QDialogButtonBox类包装成的。
http://images.51cto.com/files/uploadimg/20120314/090703607.jpg |
图3-28 ButtonBox控件 |
3.控件设置选项
在ButtonBox控件的properties选项中,一般常对以下选项进行设置。
name:该控件对应源代码中的名称;
font:设置text的字体;
enabled:该控件是否可用;
centerButtons:ButtonBox中的按钮是否居中布局,默认值为false;
orientation:按钮布局方向,Qt提供QT::Horizontal和QT::Vertical两种;
standardButtons:标准按钮集合。
4.常用成员函数
-
1)
QDialogButtonBox::QDialogButtonBox parent( QWidget * = 0)
-
2)
QDialogButtonBox::QDialogButtonBox parent( QT::Orientation orientation, QWidget * = 0)
-
3)
QDialogButtonBox::QDialogButtonBox(StandardButtons orientationbuttons, QT::Orientation = QT::Horizontal,QWidget parent* = 0)
-
4)
void QDialogButtonBox::accepted () [signal]
-
5)
void QDialogButtonBox::addButton ( QAbstractButton *button, ButtonRole role )
-
6)
QPushButton *QDialogButtonBox::addButton ( const QString & text, ButtonRole role )
-
7)
QPushButton *QDialogButtonBox::addButton ( StandardButton button )
-
8)
void QDialogButtonBox::clear ()
-
9)
void QDialogButtonBox::clicked ( QAbstractButton *button ) [signal]
-
10)
void QDialogButtonBox::helpRequested () [signal]
-
11)
void QDialogButtonBox::rejected () [signal]
-
12)
void QDialogButtonBox::removeButton ( QAbstractButton *button )
前一篇:ATmega64熔丝位
后一篇:tr函数