FreeCAD C++
Public Member Functions | List of all members
QSint::ActionLabel Class Reference

#include <Gui/QSint/actionpanel/actionlabel.h>

Detailed Description

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

ActionLabel.png
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);

Public Member Functions

 ActionLabel (QWidget *parent=0)
 
 ActionLabel (QAction *action, QWidget *parent=0)
 

Constructor & Destructor Documentation

◆ ActionLabel() [1/2]

QSint::ActionLabel::ActionLabel ( QWidget *  parent = 0)
explicit

Constructor.

◆ ActionLabel() [2/2]

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

Constructor. Creates ActionLabel from the action.

Since
0.2