QPushButton
什么是QPushButton?
QPushButton是一个按键类。
class Q_GUI_EXPORT QPushButton : public QAbstractButton
{
Q_OBJECT
构造函数
QPushButton ( QWidget * parent = 0 )
QPushButton ( const QString & text, QWidget * parent = 0 )
QPushButton ( const QIcon & icon, const QString & text, QWidget * parent = 0 )
常用属性和方法
(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;:设置按键的外观是否有突起。