KRSqueezedTextLabel::KRSqueezedTextLabel(const QString &text , QWidget *parent, const char *name)
    : QLabel(parent, name)
{
    setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
    fullText = text;
    squeezeTextToLabel();
}
KSqueezedTextLabel::KSqueezedTextLabel(const QString &text , QWidget *parent)
 : QLabel (parent),
  d(new KSqueezedTextLabelPrivate)
{
  setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
  d->fullText = text;
  d->elideMode = Qt::ElideMiddle;
  squeezeTextToLabel();
}
void KRSqueezedTextLabel::setText(const QString &text)
{
    fullText = text;
    squeezeTextToLabel();
}
void KRSqueezedTextLabel::resizeEvent(QResizeEvent *)
{
    squeezeTextToLabel();
}
Example #5
0
void SqueezedLabel::setText(const QString &text)
{
    d->fullText = text;
    squeezeTextToLabel();
}
Example #6
0
void SqueezedLabel::setTextElideMode(Qt::TextElideMode mode)
{
    d->elideMode = mode;
    squeezeTextToLabel();
}