QSint::ActionLabel Class Reference

Class representing an action similar to Windows Vista/7 control panel item. More...

#include <actionlabel.h>

Public Member Functions

 ActionLabel (QAction *action, QWidget *parent=nullptr)
 Constructor. More...
 
 ActionLabel (QWidget *parent=nullptr)
 Constructor. More...
 
virtual QSize minimumSizeHint () const
 
virtual QSize sizeHint () const
 
virtual ~ActionLabel ()
 

Protected Member Functions

void init ()
 

Detailed Description

Class representing an action similar to Windows Vista/7 control panel item.

An example of ActionLabel

ActionLabel normally consists of an icon and text. It also can have tooltip and status tip, be clickable and checkable etc. i.e. behave like a normal QToolButton.

Customization of ActionLabel via CSS

ActionLabel objects are easily customizable via CSS technology - you can get different look just by writing corresponding style sheet and applying it with setStyleSheet().

See the following example of the complete ActionLabel customization. Note that QSint--ActionLabel is used as a main class name.

// define a string representing CSS style
const char* ActionLabelNewStyle =
"QSint--ActionLabel[class='action'] {"
"background-color: transparent;"
"border: 1px solid transparent;"
"color: #0033ff;"
"text-align: left;"
"font: 11px;"
"}"
"QSint--ActionLabel[class='action']:hover {"
"color: #0099ff;"
"text-decoration: underline;"
"}"
"QSint--ActionLabel[class='action']:focus {"
"border: 1px dotted black;"
"}"
"QSint--ActionLabel[class='action']:on {"
"background-color: #ddeeff;"
"color: #006600;"
"}"
;
// apply the style
label1->setStyleSheet(ActionLabelNewStyle);

Constructor & Destructor Documentation

◆ ActionLabel() [1/2]

QSint::ActionLabel::ActionLabel ( QWidget parent = nullptr)
explicit

Constructor.

References init().

◆ ActionLabel() [2/2]

QSint::ActionLabel::ActionLabel ( QAction *  action,
QWidget parent = nullptr 
)
explicit

Constructor.

Creates ActionLabel from the action.

Since
0.2

References init().

◆ ~ActionLabel()

virtual QSint::ActionLabel::~ActionLabel ( )
virtual

Member Function Documentation

◆ init()

void QSint::ActionLabel::init ( void  )
protected

◆ minimumSizeHint()

QSize QSint::ActionLabel::minimumSizeHint ( ) const
virtual

References sizeHint().

◆ sizeHint()

QSize QSint::ActionLabel::sizeHint ( ) const
virtual

The documentation for this class was generated from the following files: