FixedSizeClickLabel Class
(Utils::FixedSizeClickLabel)The FixedSizeClickLabel class is a label with a size hint derived from a sample text that can be different to the text that is shown. More...
| Header: | #include <FixedSizeClickLabel> |
Properties
- maxText : QString
Public Functions
| FixedSizeClickLabel(QWidget *parent = nullptr) | |
| class QString | maxText() const |
| void | setMaxText(const class QString &maxText) |
| void | setText(const class QString &text, const class QString &maxText) |
| QSize | sizeHint() const |
Signals
| void | clicked() |
Protected Functions
| void | mousePressEvent(int *ev) override |
| void | mouseReleaseEvent(int *ev) override |
Detailed Description
For convenience it also has a clicked signal that is emitted whenever the label receives a mouse click.
Property Documentation
maxText : QString
This property holds the text that is used to calculate the label's size hint.
Access functions:
| class QString | maxText() const |
| void | setMaxText(const class QString &maxText) |
Member Function Documentation
FixedSizeClickLabel::FixedSizeClickLabel(QWidget *parent = nullptr)
Constructs a FixedSizeClickLabel with the parent parent.
[signal] void FixedSizeClickLabel::clicked()
This signal is emitted when the label is clicked with the left mouse button.
[protected] void FixedSizeClickLabel::mousePressEvent(int *ev)
[protected] void FixedSizeClickLabel::mouseReleaseEvent(int *ev)
void FixedSizeClickLabel::setText(const class QString &text, const class QString &maxText)
Sets the label's text to text, and changes the size hint of the label to the size of maxText.
See also maxText and setMaxText.