29 lines
791 B
C++
29 lines
791 B
C++
|
|
#include "mainWindow.h"
|
||
|
|
|
||
|
|
#include <QApplication>
|
||
|
|
#include <QScreen>
|
||
|
|
|
||
|
|
int main(int argc, char *argv[])
|
||
|
|
{
|
||
|
|
|
||
|
|
// qreal physicalDPI = 1.0;
|
||
|
|
// qreal logicalDPI = 1.0;
|
||
|
|
// QList<QScreen*> listScreen = QGuiApplication::screens();
|
||
|
|
// for(int n=0; n<listScreen.count(); n++)
|
||
|
|
// {
|
||
|
|
// QScreen* screen = listScreen.at(n);
|
||
|
|
// physicalDPI = screen->physicalDotsPerInch();
|
||
|
|
// logicalDPI = screen->logicalDotsPerInch();
|
||
|
|
// int a = 1;
|
||
|
|
// }
|
||
|
|
|
||
|
|
qputenv("QT_ENABLE_HIGHDPI_SCALING", "1");
|
||
|
|
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
|
||
|
|
QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||
|
|
|
||
|
|
QApplication a(argc, argv);
|
||
|
|
MainWindow w;
|
||
|
|
w.showMaximized();
|
||
|
|
return a.exec();
|
||
|
|
}
|