31 #include <QMouseEvent> 67 QFontMetrics fm =
_this->fontMetrics();
79 _this->QLabel::setText(str);
94 : QLabel(text, parent,f),
133 Super::mouseReleaseEvent(event);
134 if (event->button() != Qt::LeftButton)
148 Super::mouseDoubleClickEvent(ev);
159 Super::resizeEvent(event);
168 return QLabel::minimumSizeHint();
170 const QFontMetrics &fm = fontMetrics();
171 #if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)) 172 QSize size(fm.horizontalAdvance(
d->
Text.left(2) +
"…"), fm.height());
174 QSize size(fm.width(
d->
Text.left(2) +
"…"), fm.height());
185 return QLabel::sizeHint();
187 const QFontMetrics& fm = fontMetrics();
188 #if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)) 189 QSize size(fm.horizontalAdvance(
d->
Text), QLabel::sizeHint().height());
191 QSize size(fm.width(
d->
Text), QLabel::sizeHint().height());
203 Super::setText(text);
void setToolTip(QObjectPtr obj, const QString &tip)
Qt::TextElideMode elideMode() const
void setText(const QString &text)
Declaration of CElidingLabel.
Qt::TextElideMode ElideMode
void elideText(int Width)
ElidingLabelPrivate(CElidingLabel *_public)
void setElideMode(Qt::TextElideMode mode)
virtual void mouseDoubleClickEvent(QMouseEvent *ev) override
virtual QSize minimumSizeHint() const override
bool isModeElideNone() const
void elidedChanged(bool elided)
CElidingLabel(QWidget *parent=0, Qt::WindowFlags f=0)
virtual QSize sizeHint() const override
virtual void mouseReleaseEvent(QMouseEvent *event) override
virtual void resizeEvent(QResizeEvent *event) override