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: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
(Convert ExpressionEngine links)
(Simplify punctuation)
 
(2 intermediate revisions by the same user not shown)
Line 3: Line 3:
[[Category:Developing_with_Qt::General]]
[[Category:Developing_with_Qt::General]]


[toc align_right="yes" depth="3"]


'''简体中文''' [[Qt_Buttons|English]] [[Qt_Buttons_Bulgarian|Български]] [[Qt_Buttons_Spanish|Spanish]]
'''简体中文''' [[Qt_Buttons|English]] [[Qt_Buttons_Bulgarian|Български]] [[Qt_Buttons_Spanish|Spanish]]
Line 44: Line 43:
=== QToolButton ===
=== QToolButton ===


[http://doc.qt.nokia.com/4.7/qtoolbutton.html QToolButton] 提供了一个“快速-获取”的按钮组合,它们通常被用于一个 [http://doc.qt.nokia.com/4.7/qtoolbar.html之中。 QToolBar]
[http://doc.qt.nokia.com/4.7/qtoolbutton.html QToolButton] 提供了一个"快速-获取"的按钮组合,它们通常被用于一个 [http://doc.qt.nokia.com/4.7/qtoolbar.html之中。 QToolBar]


[[Image:http://doc.qt.nokia.com/4.7/images/assistant-toolbar.png|button inside toolbar]]
[[Image:http://doc.qt.nokia.com/4.7/images/assistant-toolbar.png|button inside toolbar]]

Latest revision as of 13:23, 23 August 2015

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