Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.

Qt Buttons/zh

From Qt Wiki
< Qt Buttons
Revision as of 12:29, 17 April 2015 by AutoSpider (talk | contribs) (Remove non-functioning "toc" command)
Jump to navigation Jump to search
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