gqtbuttonswidget
Loading...
Searching...
No Matches
Qt Buttons Widgets Module

Introduction

This module provides lightweight Qt widgets to present button-like UI controls in a compact form:

These widgets are intended for GUI-thread usage inside Qt applications.

Design overview

Icon buttons (GQTButtonsWidget)

The icon-buttons widget uses a QListWidget configured in QListView::IconMode. Each logical button is represented by a QListWidgetItem whose icon is updated based on interaction:

  • State 1 : "normal" icon
  • State 2 : "pressed" icon

Icons are loaded by filename convention:

<base_icon_name>_<state>.svg

For example, if the base icon is ":/images/firstButton" then the widget will look for:

:/images/firstButton_1.svg
:/images/firstButton_2.svg

Toggle buttons (GQTToggleButtonWidget)

The toggle-buttons widget creates one QPushButton per title string, marks it checkable, and arranges buttons either vertically (QVBoxLayout) or horizontally (QHBoxLayout). The widget tracks the last pressed button index and emits a signal whenever that index changes.

Available Options and their usage

This module currently does not define or consume any module-specific option keys.

Notes:

  • Host applications typically decide GUI creation and logging via global keys defined by GOptions(argc,argv,...) (for example gui, verbosity, and debug), but these widgets themselves do not read options directly.

Usage

The typical usage pattern is:

  • Construct the widget with the desired dimensions and labels/icons.
  • Connect to signals (e.g. buttonPressedIndexChanged()) to react to user interaction.
  • Optionally invoke helper functions (e.g. press_button(), reset_buttons()) to drive state from code.

Examples

The project contains example code demonstrating how to instantiate and display these widgets. Each entry includes a short summary and a small code excerpt.

Author

© Maurizio Ungaro
e-mail: ungar.nosp@m.o@jl.nosp@m.ab.or.nosp@m.g