Qt: deprecation warnings, again

Check Qt version for the QFontMetrics::width vs horizontalAdvance.
Of course can't just #define horizontalAdvance to width, that would
be too easy ...
This commit is contained in:
Pasi Kallinen
2021-08-15 10:58:42 +03:00
parent 29aca6276e
commit 98ec66e00c
7 changed files with 22 additions and 13 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ public:
int width = 0;
QFontMetrics fm(font());
for (int i = 0; i < count(); i++) {
int lwidth = fm.horizontalAdvance(item(i)->text());
int lwidth = fm.QFM_WIDTH(item(i)->text());
width = std::max(width, lwidth);
}
return width;