Composite widget showing a text label alongside an icon.
More...
#include <iconlabel.h>
|
| | IconLabel (QWidget *parent=nullptr) |
| | Construct an empty IconLabel.
|
| |
| | IconLabel (const QString &text, QWidget *parent=nullptr) |
| | Construct with text only.
|
| |
| | IconLabel (const QString &text, const QIcon &icon, QWidget *parent=nullptr) |
| | Construct with text and an icon.
|
| |
| QString | text () const |
| | Return the current label text.
|
| |
| void | setText (const QString &text) |
| | Set the label text.
|
| |
| QIcon | icon () const |
| | Return the current icon.
|
| |
| void | setIcon (const QIcon &icon) |
| | Set the icon.
|
| |
| void | setIconAlignment (Qt::Alignment alignment) |
| | Set the alignment of the icon within the layout.
|
| |
Composite widget showing a text label alongside an icon.
IconLabel places a QLabel for text and a QLabel for a QIcon side by side. The icon alignment within the layout can be controlled independently of the text alignment.
Definition at line 16 of file iconlabel.h.
◆ IconLabel() [1/3]
| IconLabel::IconLabel |
( |
QWidget * |
parent = nullptr | ) |
|
|
explicit |
Construct an empty IconLabel.
- Parameters
-
| parent | Optional QWidget parent |
◆ IconLabel() [2/3]
| IconLabel::IconLabel |
( |
const QString & |
text, |
|
|
QWidget * |
parent = nullptr |
|
) |
| |
|
explicit |
Construct with text only.
- Parameters
-
| text | Initial label text |
| parent | Optional QWidget parent |
◆ IconLabel() [3/3]
| IconLabel::IconLabel |
( |
const QString & |
text, |
|
|
const QIcon & |
icon, |
|
|
QWidget * |
parent = nullptr |
|
) |
| |
|
explicit |
Construct with text and an icon.
- Parameters
-
| text | Initial label text |
| icon | Icon to display alongside the text |
| parent | Optional QWidget parent |
◆ icon()
| QIcon IconLabel::icon |
( |
| ) |
const |
Return the current icon.
- Returns
- Icon displayed in the widget
◆ setIcon()
| void IconLabel::setIcon |
( |
const QIcon & |
icon | ) |
|
◆ setIconAlignment()
| void IconLabel::setIconAlignment |
( |
Qt::Alignment |
alignment | ) |
|
Set the alignment of the icon within the layout.
- Parameters
-
| alignment | Qt alignment flags |
◆ setText()
| void IconLabel::setText |
( |
const QString & |
text | ) |
|
Set the label text.
- Parameters
-
◆ text()
| QString IconLabel::text |
( |
| ) |
const |
Return the current label text.
- Returns
- Text string
The documentation for this class was generated from the following file: