Qt Buttons/zh

From Qt Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
This article may require cleanup to meet the Qt Wiki's quality standards. Reason: Auto-imported from ExpressionEngine.
Please improve this article if you can. Remove the {{cleanup}} tag and add this page to Updated pages list after it's clean.


简体中文 English Български Spanish

Qt中的按钮

概览

作为一个高级的GUI创建框架,Qt提供了丰富多样的按钮以满足不同的需求。Qt中的这些类继承自 QAbstractButton ,并且实现了不同类型的按钮。QAbstractButton继承自 QWidget ,它是按钮部件类的抽象基类。

信号

QAbstractButton提供下列信号:

  • void clicked ( bool checked = false )
  • void pressed ()
  • void released ()
  • void toggled ( bool checked )

按钮的类型

QPushButton

QPushButton 是一个用于命令按钮的可定制部件。阅读 怎样使用QPushButton 系列文章,以了解更多的关于这方面的信息和例子。

push button

QCheckBox

QCheckBox 是一个看上去像是旁边有一个文本标签的复选框按钮。

checkbox

QRadioButton

QRadioButton 是一个带有一个文本标签的单选按钮。

radio button

QToolButton

QToolButton 提供了一个"快速-获取"的按钮组合,它们通常被用于一个 QToolBar

button inside toolbar

参见

Basic Qt Programming Tutorial How to Use QPushButton