ifdef QFontMetrics::horizontalAdvance to make it work with older Qt
This commit is contained in:
@@ -48,7 +48,11 @@ QSize LineTextEdit::sizeHint() const {
|
||||
|
||||
static const int kMargin = 5;
|
||||
int h = 2 * kMargin + qMax(fm.height(), 14);
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
|
||||
int w = 2 * kMargin + fm.horizontalAdvance("W") * 15;
|
||||
#else
|
||||
int w = 2 * kMargin + fm.width("W") * 15;
|
||||
#endif
|
||||
|
||||
return QSize(w, h);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user