banner



Make App Designer Check Box Turned On By Default

QCheckBox Class

The QCheckBox widget provides a checkbox with a text label. More...

Header: #include <QCheckBox>
qmake: QT += widgets
Inherits: QAbstractButton
  • List of all members, including inherited members

Properties

  • tristate : bool

Public Functions

Reimplemented Public Functions

Signals

Protected Functions

Reimplemented Protected Functions

Detailed Description

A QCheckBox is an option button that can be switched on (checked) or off (unchecked). Checkboxes are typically used to represent features in an application that can be enabled or disabled without affecting others. Different types of behavior can be implemented. For example, a QButtonGroup can be used to group check buttons logically, allowing exclusive checkboxes. However, QButtonGroup does not provide any visual representation.

The image below further illustrates the differences between exclusive and non-exclusive checkboxes.

Whenever a checkbox is checked or cleared, it emits the signal stateChanged(). Connect to this signal if you want to trigger an action each time the checkbox changes state. You can use isChecked() to query whether or not a checkbox is checked.

In addition to the usual checked and unchecked states, QCheckBox optionally provides a third state to indicate "no change". This is useful whenever you need to give the user the option of neither checking nor unchecking a checkbox. If you need this third state, enable it with setTristate(), and use checkState() to query the current toggle state.

Just like QPushButton, a checkbox displays text, and optionally a small icon. The icon is set with setIcon(). The text can be set in the constructor or with setText(). A shortcut key can be specified by preceding the preferred character with an ampersand. For example:

In this example, the shortcut is Alt+A. See the QShortcut documentation for details. To display an actual ampersand, use '&&'.

Important inherited functions: text(), setText(), text(), pixmap(), setPixmap(), accel(), setAccel(), isToggleButton(), setDown(), isDown(), isOn(), checkState(), autoRepeat(), isExclusiveToggle(), group(), setAutoRepeat(), toggle(), pressed(), released(), clicked(), toggled(), checkState(), and stateChanged().

See also QAbstractButton, QRadioButton, and GUI Design Handbook: Check Box.

Property Documentation

tristate : bool

This property holds whether the checkbox is a tri-state checkbox

The default is false, i.e., the checkbox has only two states.

Access functions:

bool isTristate () const
void setTristate (bool y = true)

© 2021 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.

Make App Designer Check Box Turned On By Default

Source: https://doc.qt.io/qt-5/qcheckbox.html

Posted by: clyburnnotle1973.blogspot.com

0 Response to "Make App Designer Check Box Turned On By Default"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel