Files
ReadLog/main.cpp
2024-09-18 10:28:04 +08:00

38 lines
1.0 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#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();
}