Maki
Formally verfied low-code orchestration
Loading...
Searching...
No Matches
ClickableIcon Class Reference

A clickable icon widget that can be checked or unchecked. More...

#include <clickable_icon.h>

Inheritance diagram for ClickableIcon:

Signals

void clicked ()
 Emitted when the icon is clicked.
void toggled (bool check)
 Emitted when the checked state of the icon changes.

Public Member Functions

 ClickableIcon (const QIcon &icon, QWidget *parent=nullptr)
 Constructs a new ClickableIcon with the given icon and parent widget.
 ClickableIcon (const QIcon &icon, const QSize &size, QWidget *parent=nullptr)
 Constructs a new ClickableIcon with the given icon, size, and parent widget.
void setCheckable (bool checkable)
 Sets whether the icon is checkable.
void setChecked (bool check)
 Sets the checked state of the icon.
bool isChecked ()
 Returns whether the icon is currently checked.

Protected Member Functions

void mousePressEvent (QMouseEvent *event) override
 Handles mouse press events.

Private Attributes

bool mCheckable
 True if the icon is currently checked, false otherwise.
bool mHovered
 True if the icon can be checked or unchecked, false otherwise.

Detailed Description

A clickable icon widget that can be checked or unchecked.

Constructor & Destructor Documentation

◆ ClickableIcon() [1/2]

ClickableIcon::ClickableIcon ( const QIcon & icon,
QWidget * parent = nullptr )

Constructs a new ClickableIcon with the given icon and parent widget.

Parameters
iconThe QIcon to display on the button.
parentThe parent QWidget of this ClickableIcon.

◆ ClickableIcon() [2/2]

ClickableIcon::ClickableIcon ( const QIcon & icon,
const QSize & size,
QWidget * parent = nullptr )

Constructs a new ClickableIcon with the given icon, size, and parent widget.

Parameters
iconThe QIcon to display on the button.
sizeThe QSize of the button.
parentThe parent QWidget of this ClickableIcon.

Member Function Documentation

◆ isChecked()

bool ClickableIcon::isChecked ( )

Returns whether the icon is currently checked.

Returns
True if the icon is checked, false otherwise.

◆ mousePressEvent()

void ClickableIcon::mousePressEvent ( QMouseEvent * event)
overrideprotected

Handles mouse press events.

Parameters
eventThe QMouseEvent to handle.

◆ setCheckable()

void ClickableIcon::setCheckable ( bool checkable)

Sets whether the icon is checkable.

Parameters
checkableTrue if the icon should be checkable, false otherwise.

◆ setChecked()

void ClickableIcon::setChecked ( bool check)

Sets the checked state of the icon.

Parameters
checkTrue to check the icon, false to uncheck it.

◆ toggled

void ClickableIcon::toggled ( bool check)
signal

Emitted when the checked state of the icon changes.

Parameters
checkThe new checked state of the icon.

The documentation for this class was generated from the following files:
  • /__w/maki/maki/app/widgets/clickable_icon.h
  • /__w/maki/maki/app/widgets/clickable_icon.cpp