FixedSizeClickLabel Class
class Utils::FixedSizeClickLabelThe 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) | |
| QString | maxText() const |
| void | setMaxText(const QString &maxText) |
| void | setText(const QString &text, const QString &maxText) |
Reimplemented Public Functions
| virtual QSize | sizeHint() const override |
Signals
| void | clicked() |
Reimplemented Protected Functions
| virtual void | mousePressEvent(QMouseEvent *ev) override |
| virtual void | mouseReleaseEvent(QMouseEvent *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:
| QString | maxText() const |
| void | setMaxText(const 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.
[override virtual protected] void FixedSizeClickLabel::mousePressEvent(QMouseEvent *ev)
[override virtual protected] void FixedSizeClickLabel::mouseReleaseEvent(QMouseEvent *ev)
void FixedSizeClickLabel::setText(const QString &text, const 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.