1 #ifndef _ELLIPSIS_LABEL_H
2 #define _ELLIPSIS_LABEL_H 1
6 class EllipsisLabel : public QLabel {
10 EllipsisLabel(QWidget *parent) : QLabel(parent) {}
12 void setFullText(const QString &s)
19 void resizeEvent(QResizeEvent *event) override
21 QLabel::resizeEvent(event);
26 void updateEllipsisText()
28 QFontMetrics metrics(this->font());
29 this->setText(metrics.elidedText(full_text, Qt::ElideRight, this->width()));
35 #endif // !defined(_ELLIPSIS_LABEL_H)