代码拉取完成,页面将自动刷新
#include "mainwindow.h"
#include <QApplication>
#include <QSplashScreen>
#include <QTextCodec>
#include <QFile>
#include <QDebug>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
// a.setFont(QFont("Microsoft Yahei", 11));
QSplashScreen *splash = new QSplashScreen;
splash->setPixmap(QPixmap(":/res/fonts/start.png"));
splash->show();
// Start photo
Qt::Alignment pos = Qt::AlignRight| Qt::AlignBottom;
splash->showMessage(QObject::tr("Loading Settings......."),pos,Qt::white);
// Set start time
for(int i=0;i<5000;i++){
splash->repaint();
}
// Load Settings
QString iniName = QCoreApplication::applicationDirPath() + "/Settings.ini";
QSettings *iniSetting = new QSettings(iniName,QSettings::IniFormat);
QString color = iniSetting->value("/THEME/color").toString();
QString fontsize = iniSetting->value("/THEME/fontsize").toString();
delete iniSetting;
// Theme style
QString style;
if("Light" == color){
style = ":/res/light/style.qss";
}else{
style = ":/res/dark/style.qss";
}
QFile file(style);
if(file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QString qss = QLatin1String(file.readAll());
qApp->setStyleSheet(qss);
file.close();
}else{
qDebug() << "Failed to load: " << file.fileName();
}
// Set App's icon and name
MainWindow w;
QIcon appIcon(":/res/fonts/barchart.png"); // Get the icon for the right corner
w.setWindowIcon(appIcon);
w.setWindowTitle("QMavPlotter (QMP)");
w.show();
// Close the start picture
splash->finish(&w);
delete splash;
return a.exec();
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。