29 #include <QtCore/QString>
31 #include "../WGuiConsts.h"
46 WScaleLabel(
size_t length = WPREFERRED_LABEL_LENGTH, QWidget* parent = NULL );
55 WScaleLabel(
const QString &text,
size_t length = WPREFERRED_LABEL_LENGTH, QWidget* parent = NULL );
70 WScaleLabel(
const QString &text, QWidget* parent );
91 virtual void setText(
const QString &text );
Special Label that can shrink and expand in a layout.
virtual size_t calculateSize(size_t chars) const
Calculate the size that is needed for the given number of chars.
void fitTextToSize()
set the actual text which is shown on the QLabel
virtual void setMinimalLength(size_t chars)
How many characters should be visible all the time?
void construct()
Deferred construction.
virtual QSize sizeHint() const
overwritten from QLabel, returning the widgets prefered size
size_t m_minLength
Minimal character number.
int m_additionalWidth
The additional width we need to reserver (like for margins).
virtual QSize minimumSizeHint() const
overwritten from QLabel, returning the widgets prefered size
virtual size_t getMinimalLength() const
Get the current minimal number of characters.
virtual void resizeEvent(QResizeEvent *event)
custom implementation of the resize event to fit the QString into the labels current size
WScaleLabel(size_t length=WPREFERRED_LABEL_LENGTH, QWidget *parent=NULL)
Constructor.
virtual void addAdditionalWidth(int margin)
Set this to reserve extra space for a margin.
virtual void setText(const QString &text)
reimplemented function to setText
QString m_orgText
QString to remember the original unshortend text of the widget.