QPushButton
(一)QPushButton
QPushButton继承自 QAbstractButton ,后者继承自 QWidget 。
(二)常用属性和方法
(1) QString text () const: 返回按键上的文字;
(2) void setText ( const QString & text ): 设置按键上的文字;
(3) bool autoDefault() const;: autoDefault属性,它会影响按键的外观;
(4) void setAutoDefault(bool);: 设置autoDefault属性;
(5) bool isDefault() const;: default属性,仅在Dialog中此属性有效;
(6) void setDefault(bool);: 设置default属性;
(7) void setFlat(bool);: 设置FLAT属性
(8) bool isFlat() const;: 设置按键的外观是否有突起。
信号
- 继承自QAbstractButton的
- void clicked ( bool checked = false )
- void pressed ()
- void released ()
- void toggled ( bool checked )
- 继承自QWidget的
- void customContextMenuRequested ( const QPoint & pos )
- 继承自QObject的
- void destroyed ( QObject * obj = 0 )
(三)详解