-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
28 lines (27 loc) · 901 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "mainwindow.h"
#include "utils.h"
#include <QApplication>
#include <QFontDatabase>
#include <QScreen>
#include <windows.h>
//#include <wingdi.h>
#include "settingdialog.h"
int main(int argc, char *argv[])
{
//qreal cx = GetSystemMetrics(SM_CXSCREEN);
//qreal cy = GetSystemMetrics(SM_CYSCREEN);
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
//QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication a(argc, argv);
int fontId = QFontDatabase::addApplicationFont(QCoreApplication::applicationDirPath()+"arlrdbd.ttf" );
QStringList fontFamilies = QFontDatabase::applicationFontFamilies(fontId);
MainWindow w;
return a.exec();
}
/*
HDC hDC = GetDC(0);
double cx = GetDeviceCaps(hDC, DESKTOPHORZRES);
qDebug() << cx;
qreal scale = cx / 960; // 960 = 1920 / 2
qputenv("QT_SCALE_FACTOR", QString::number(scale).toLatin1());
*/