Qt: Fix Qt5 deprecation warnings
Mostly the warnings were about QString::sprintf and QFontMetrics::width. sprintf replacement is asprintf, which annoyingly behaves differently from sprintf - it seems to append to the string. Not thoroughly tested, but seems to work.
This commit is contained in:
+1
-1
@@ -24,7 +24,7 @@ public:
|
||||
int width = 0;
|
||||
QFontMetrics fm(font());
|
||||
for (int i = 0; i < count(); i++) {
|
||||
int lwidth = fm.width(item(i)->text());
|
||||
int lwidth = fm.horizontalAdvance(item(i)->text());
|
||||
width = std::max(width, lwidth);
|
||||
}
|
||||
return width;
|
||||
|
||||
Reference in New Issue
Block a user