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>
Inherits: QLabel

Properties

  • 12 properties inherited from QLabel
  • 6 properties inherited from QFrame
  • 58 properties inherited from QWidget

Public Functions

FixedSizeClickLabel(QWidget *parent = 0)
QString maxText() const
void setMaxText(const QString &maxText)
void setText(const QString &text, const QString &maxText)

Reimplemented Public Functions

virtual QSize sizeHint() const
  • 29 public functions inherited from QLabel
  • 14 public functions inherited from QFrame
  • 213 public functions inherited from QWidget

Signals

void clicked()
  • 2 signals inherited from QLabel
  • 3 signals inherited from QWidget

Reimplemented Protected Functions

virtual void mousePressEvent(QMouseEvent *ev)
virtual void mouseReleaseEvent(QMouseEvent *ev)
  • 11 protected functions inherited from QLabel
  • 4 protected functions inherited from QFrame
  • 35 protected functions inherited from QWidget

Additional Inherited Members

  • 7 public slots inherited from QLabel
  • 19 public slots inherited from QWidget
  • 5 static public members inherited from QWidget
  • 11 protected functions inherited from QLabel
  • 4 protected functions inherited from QFrame
  • 35 protected functions inherited from QWidget
  • 1 protected slot inherited from QWidget

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.

[virtual protected] void FixedSizeClickLabel::mousePressEvent(QMouseEvent *ev)

Reimplemented from QWidget::mousePressEvent().

[virtual protected] void FixedSizeClickLabel::mouseReleaseEvent(QMouseEvent *ev)

Reimplemented from QWidget::mouseReleaseEvent().

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.

[virtual] QSize FixedSizeClickLabel::sizeHint() const

Reimplemented from QWidget::sizeHint().