#include <ElidedLabel.h>
Public Member Functions | |
| ElidedLabel (QWidget *pParent=NULL) | |
| ElidedLabel (const QString &text, QWidget *pParent=NULL) | |
| virtual | ~ElidedLabel () |
| void | setElideMode (Qt::TextElideMode mode) |
| Qt::TextElideMode | getElideMode () const |
Protected Member Functions | |
| virtual void | paintEvent (QPaintEvent *pEvent) |
If the text string displayed in the label is longer than the width of the label, an ellipsis is drawn based on the elide mode returned by getElideMode(). To allow the label to resize smaller than the text string, a minimum size must be set (e.g. QWidget::setMimimumWidth()).
Definition at line 29 of file ElidedLabel.h.
| ElidedLabel::ElidedLabel | ( | QWidget * | pParent = NULL |
) |
Creates a new elided label with a default elide mode of Qt::ElideLeft.
| pParent | The parent widget. |
| ElidedLabel::ElidedLabel | ( | const QString & | text, | |
| QWidget * | pParent = NULL | |||
| ) |
Creates a new elided label with initial text and a default elide mode of Qt::ElideLeft.
| text | The text string to display in the label. | |
| pParent | The parent widget. |
| virtual ElidedLabel::~ElidedLabel | ( | ) | [virtual] |
Destroys the label.
| void ElidedLabel::setElideMode | ( | Qt::TextElideMode | mode | ) |
Sets the position in the text of the ellipsis that is drawn when the text is longer the label width.
| mode | The new ellipsis position within the text. |
| Qt::TextElideMode ElidedLabel::getElideMode | ( | ) | const |
Returns the position in the text of the ellipsis that is drawn when the text is longer the label width.
| virtual void ElidedLabel::paintEvent | ( | QPaintEvent * | pEvent | ) | [protected, virtual] |
Draws the label and its text.
The default implementation draws an ellipsis based on the elide mode returned by getElideMode() if the text string is longer than the label width. Otherwise, the QLabel base class implementation is called.
| pEvent | The paint event. |