File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -157,7 +157,11 @@ QSize CElidingLabel::minimumSizeHint() const
157157 return QLabel::minimumSizeHint ();
158158 }
159159 const QFontMetrics &fm = fontMetrics ();
160- QSize size (fm.width (d->Text .left (2 ) + " …" ), fm.height ());
160+ #if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
161+ QSize size (fm.horizontalAdvance (d->Text .left (2 ) + " …" ), fm.height ());
162+ #else
163+ QSize size (fm.width (d->Text .left (2 ) + " …" ), fm.height ());
164+ #endif
161165 return size;
162166}
163167
@@ -170,7 +174,11 @@ QSize CElidingLabel::sizeHint() const
170174 return QLabel::sizeHint ();
171175 }
172176 const QFontMetrics& fm = fontMetrics ();
173- QSize size (fm.width (d->Text ), QLabel::sizeHint ().height ());
177+ #if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
178+ QSize size (fm.horizontalAdvance (d->Text ), QLabel::sizeHint ().height ());
179+ #else
180+ QSize size (fm.width (d->Text ), QLabel::sizeHint ().height ());
181+ #endif
174182 return size;
175183}
176184
You can’t perform that action at this time.
0 commit comments