mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-11-15 21:25:44 +08:00
commit
3fcf05fb29
@ -157,7 +157,11 @@ QSize CElidingLabel::minimumSizeHint() const
|
|||||||
return QLabel::minimumSizeHint();
|
return QLabel::minimumSizeHint();
|
||||||
}
|
}
|
||||||
const QFontMetrics &fm = fontMetrics();
|
const QFontMetrics &fm = fontMetrics();
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
|
||||||
|
QSize size(fm.horizontalAdvance(d->Text.left(2) + "…"), fm.height());
|
||||||
|
#else
|
||||||
QSize size(fm.width(d->Text.left(2) + "…"), fm.height());
|
QSize size(fm.width(d->Text.left(2) + "…"), fm.height());
|
||||||
|
#endif
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,7 +174,11 @@ QSize CElidingLabel::sizeHint() const
|
|||||||
return QLabel::sizeHint();
|
return QLabel::sizeHint();
|
||||||
}
|
}
|
||||||
const QFontMetrics& fm = fontMetrics();
|
const QFontMetrics& fm = fontMetrics();
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
|
||||||
|
QSize size(fm.horizontalAdvance(d->Text), QLabel::sizeHint().height());
|
||||||
|
#else
|
||||||
QSize size(fm.width(d->Text), QLabel::sizeHint().height());
|
QSize size(fm.width(d->Text), QLabel::sizeHint().height());
|
||||||
|
#endif
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user