QT获取屏幕分表率(PC、安卓)

QRect screenRect = QGuiApplication::primaryScreen()->geometry();
double devicePixelRatio = QGuiApplication::primaryScreen()->devicePixelRatio();
int screenW = screenRect.width();
int screenH = screenRect.height();




原文地址:https://www.cnblogs.com/LCLBook/p/11250838.html