Qt 6 works on Windows host

This commit is contained in:
2022-01-23 12:59:57 +03:00
parent fcdc142991
commit bdb2acb414
14 changed files with 139 additions and 34 deletions

View File

@@ -270,7 +270,11 @@ int fontHeight(const QWidget * w) {
qDebug() << s->logicalDotsPerInch() << s->logicalDotsPerInch()/96.*QApplication::font().pointSizeF();
}
}*/
return QFontMetrics(QApplication::font(), pw).size(0, "0").height();
return QFontMetrics(QApplication::font(), pw).size(0, "0").height()
#if QT_VERSION_MAJOR == 6
/ 1.25
#endif
;
}
}
# endif
@@ -310,3 +314,14 @@ void enableHighDPI() {
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
#endif
}
const QMetaObject * getQtMetaObject() {
#if QT_VERSION_MAJOR <= 5
return qt_getQtMetaObject();
#endif
#if QT_VERSION_MAJOR == 6
return &(Qt::staticMetaObject);
#endif
return nullptr;
}

View File

@@ -218,6 +218,7 @@ QAD_UTILS_EXPORT int lineThickness(const QWidget * w = 0);
QAD_UTILS_EXPORT QSize preferredIconSize(float x = 1.f, const QWidget * w = 0);
QAD_UTILS_EXPORT double appScale(const QWidget * w = 0);
QAD_UTILS_EXPORT void enableHighDPI();
QAD_UTILS_EXPORT const QMetaObject * getQtMetaObject();
#endif // QAD_TYPES_H