Skip to content

What We Know About QCheckBox

russ_hensel edited this page Feb 8, 2026 · 1 revision
Table of Contents

FIXME: incomplete draft

Introduction

Content here... A checkbox is a GUI element that typically:

  • has a little square box "[]"
  • has a label like ""
  • visually switches between "checked" ("on") (a little cross "X" or checkmark inside the square box) a "unchecked" ("cleared") ("off") (an empty square box) when clicked.
  • When there are multiple checkboxes, any combination of them may be checked. (Two of them, one of them, a few of them, all of them, or none of them may be checked).

The QCheckBox is a lot like a QRadioButton. The QRadioButton is for when you want exactly one item checked. The QCheckBox is for when you want to allow some or all or none of the items to be checked. If you want to be clever you can sometimes substitute one for the other, but this is usually a bad idea.

After a QCheckBox widget is created we can change may of its characteristics ( and some of these can also be set up in its init, but changing at runtime is more general )

These characteristics are part of the widgets state. Some related to appearance. For example:

  • Is the QCheckBox currently on or off? ( isChecked() ).
  • size
  • font
  • colors

Others are related to user actions the widget can detect and act on

  • checkbox checked or cleared ( checkStateChanged() )
  • get focus

The code for the tab is: qt5_by_example/tabs/basic_widgets/tab_q_push_button.py at main · russ-hensel/qt5_by_example https://github.com/russ-hensel/qt5_by_example/blob/main/tabs/basic_widgets/tab_q_push_button.py but is better viewed in your own IDE. Also NOTE: this code is our reference for how a tab should be written and is documented by comments in the code, both the framework and the code relavant to the widges of interest. The framework code is not documented as well in other tabs. See Tab Framework Code

Interactions

Interaction to try on this tab:

  • click on the checkboxes
  • hover look for tool tips
  • poke around -- do not forget to look [FIXME:]

To see and change the state use the mutate/examine button and read the code in the mutate_x methods.
the documentation is in the code. Coverage is not complete, work continues.

You can use the wat-inspect to find out more or dive into the documentation which is all over the web.

[FIXME: mention toggle switches https://github.com/Prx001/QSwitchControl ]

Some general usability tips on checkboxes, radiobuttons, and drop-down menus:

Screenshot

Alt text)

Clone this wiki locally