-
Notifications
You must be signed in to change notification settings - Fork 0
What We Know About QComboBox with Model
Table of Contents
A QComboBox is a drop-down list box (also known as a combo box or DDL) used in GUI applications to let the user select one item from a list. Combo boxes may also support editing, allowing users to type in values that are not in the list.
There are two general types one uses strings to populate the QComboBox, the other uses a Model. This documentation is for a QComboBox driven by a model. ( for the type based on strings see What We Know About QComboBox with Strings
This tab demonstrates and documents the use of the QComboBox widget in a QTPY application. One boxes is used and controlled by several methods that mutates its appearance and behavior.
The key points:
- When clicked, combo boxes expand to show their entire list of values.
- When one item on the list is clicked, combo boxes shrink to show only the one selected value.
- They emit signals when the user changes selection or enters text.
- They can be modified at runtime, with items added, removed, or reloaded.
Like other tabs in this application, this is a reference tab, showing expected widget behavior and tab structure.
📄 Code file:
💡 View it in your IDE for full effect.
The documentation includes detailed comments in _build_gui_widgets() and the various mutate_ methods. This is part of the tab documentation pattern used throughout the project. See also: Tab Framework Code.
Try the following actions on this tab:
- Use the dropdown in the box to select values from the object's list.
- Use the mutate button to explore different programmatic changes to the combo boxes, and/or object state.
- Observe the signal messages logged in the text area below the widgets.
- Use Inspect to examine internal state.
- Text changes and index changes trigger signal handlers.
- Mutate methods alter content, selection, or visibility, and/or examine some state of the object.
- You can inspect widget properties via
mutate_3()andinspect().
Initializes two combo boxes:
- to be written for now just read the code
- to be written for now just read the code
- to be written for now just read the code
- to be written for now just read the code