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