代码拉取完成,页面将自动刷新
同步操作将从 KingJamesGyq/QtWebAdmin 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#include <QApplication>
#include <QWebEngineView>
#include <QWebEngineProfile>
#include <QWebEngineCookieStore>
#include <QList>
#include <QSqlDatabase>
#include <QFileInfo>
#include <QDir>
#include "global.h"
#include "httplistener.h"
#include "requestmapper.h"
#include "utils/dictionaryutil.h"
#include "utils/monitorutil.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setApplicationName("QtWebAdmin");
QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
qDebug()<<"...............main...................currentThreadId():"<<QThread::currentThreadId();
MonitorUtil::instance()->init();
//初始化数据库
bool ok = SqlHelper::instance()->initDB("QtWebAdmin.db");
//初始化字典
DictionaryUtil::instance()->initDictionary();
GlobalFunc::instance()->configDir = GlobalFunc::searchConfigDir();
QString configFileName = GlobalFunc::instance()->configDir + "/etc/WEB.ini";
QSettings* logSettings=new QSettings(configFileName,QSettings::IniFormat,&a);
logSettings->beginGroup("logging");
FileLogger* logger=new FileLogger(logSettings,10000,&a);
logger->installMsgHandler();
// Configure template loader and cache
QSettings* templateSettings=new QSettings(configFileName,QSettings::IniFormat,&a);
templateSettings->beginGroup("templates");
templateCache=new TemplateCache(templateSettings,&a);
// Configure session store
QSettings* sessionSettings=new QSettings(configFileName,QSettings::IniFormat,&a);
sessionSettings->beginGroup("sessions");
sessionStore=new HttpSessionStore(sessionSettings,&a);
// Configure static file controller
QSettings* fileSettings=new QSettings(configFileName,QSettings::IniFormat,&a);
fileSettings->beginGroup("docroot");
staticFileController=new StaticFileController(fileSettings,&a);
// Configure and start the TCP listener
QSettings* listenerSettings=new QSettings(configFileName,QSettings::IniFormat,&a);
listenerSettings->beginGroup("listener");
new HttpListener(listenerSettings,new RequestMapper(&a),&a);
//如定义了ISGUI,启动界面
#ifdef ISGUI
QFileInfo configFile(configFileName);
QString filePath = fileSettings->value("path",".").toString();
filePath = QFileInfo(configFile.absolutePath(), filePath).absoluteFilePath();
QString path = filePath + "/index.html";
QWebEngineView view;
view.setUrl(QUrl(path));
view.resize(1024, 750);
view.show();
#endif
qWarning("Application has started");
a.exec();
qWarning("Application has stopped");
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。