38 lines
1.0 KiB
C++
38 lines
1.0 KiB
C++
#include "mainwindow.h"
|
||
|
||
#include <QApplication>
|
||
#include <QTextCodec>
|
||
#include <QDebug>
|
||
#include "global.h"
|
||
|
||
|
||
//初始化数据
|
||
QVector<QMap<QString, QString>> g_param[4];
|
||
QMap<QString, bool> namelist;
|
||
QFile file;
|
||
QCompleter *completer;
|
||
|
||
int main(int argc, char *argv[]) {
|
||
//设置logo
|
||
QApplication::setWindowIcon(QIcon("logo.ico"));
|
||
//放大窗口
|
||
// qputenv("QT_SCALE_FACTOR", "2.0");
|
||
//设置使用UTF8字符集,正确显示中文
|
||
QTextCodec *codec = QTextCodec::codecForName("UTF-8");
|
||
QTextCodec::setCodecForLocale(codec);
|
||
|
||
//运行程序
|
||
QApplication a(argc, argv);
|
||
/* 获取分辨率
|
||
QDesktopWidget *desktopWidget = QApplication::desktop();
|
||
//获取可用桌面大小
|
||
QRect deskRect = desktopWidget->availableGeometry();
|
||
qDebug() << deskRect.width() << "x" << deskRect.height();
|
||
//获取设备屏幕大小
|
||
QRect screenRect = desktopWidget->screenGeometry();
|
||
qDebug() << screenRect.width() << "x" << screenRect.height();*/
|
||
MainWindow w;
|
||
w.show();
|
||
return a.exec();
|
||
}
|