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 = 0) | |
QString | maxText() const |
void | setMaxText(const QString &maxText) |
void | setText(const QString &text, const QString &maxText) |
QSize | sizeHint() const |
Signals
void | clicked() |
Protected Functions
void | mousePressEvent(QMouseEvent *ev) |
void | mouseReleaseEvent(QMouseEvent *ev) |
Detailed Description
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.
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 = 0)
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(QMouseEvent *ev)
[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.