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:
@@ -27,5 +27,14 @@
|
||||
#pragma GCC diagnostic ignored "-Wshadow"
|
||||
#endif
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
/* QFontMetrics::width was deprecated in Qt 5.11 */
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
|
||||
#define QFM_WIDTH(foo) width(foo)
|
||||
#else
|
||||
#define QFM_WIDTH(foo) horizontalAdvance(foo)
|
||||
#endif
|
||||
|
||||
/*qt_pre.h*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user