完成文件读取
This commit is contained in:
33
main.cpp
33
main.cpp
@ -1,12 +1,37 @@
|
||||
#include "mainwindow.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QTextCodec>
|
||||
#include <QDebug>
|
||||
#include "global.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
//初始化数据
|
||||
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);
|
||||
MainWindow w;
|
||||
w.show();
|
||||
/* 获取分辨率
|
||||
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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user