You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
|
#include <QtWidgets/QApplication>
|
|
|
|
|
|
#include <QMessageBox>
|
|
|
|
|
|
#include "IMainWidget.h"
|
|
|
|
|
|
#include <QLibrary>
|
|
|
|
|
|
#include "QSignleApplication.h"
|
|
|
|
|
|
|
|
|
|
|
|
#pragma execution_character_set("utf-8")
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
|
|
{
|
|
|
|
|
|
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
|
|
|
|
|
IMainWidget* pMain = nullptr;
|
|
|
|
|
|
QWidget* pMainWid = nullptr;
|
|
|
|
|
|
|
|
|
|
|
|
SingleApplication a(argc, argv, "mainApp");
|
|
|
|
|
|
if (!a.getInstanceRunning()) {
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef _DEBUG
|
|
|
|
|
|
QLibrary lib("lpMaind");
|
|
|
|
|
|
#else
|
|
|
|
|
|
QLibrary lib("lpMain");
|
|
|
|
|
|
#endif
|
|
|
|
|
|
_MainWidget_Create func = (_MainWidget_Create)lib.resolve("MainWidget_Create");
|
|
|
|
|
|
if (func)
|
|
|
|
|
|
{
|
|
|
|
|
|
pMain = func();
|
|
|
|
|
|
if (pMain) {
|
|
|
|
|
|
pMain->showWidget();
|
|
|
|
|
|
a.exec();
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
QMessageBox::information(0, "", QObject::tr("lpMain<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>"));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
QMessageBox::information(0, "", QObject::tr("lpMain<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>"));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (pMain) {
|
|
|
|
|
|
delete pMain;
|
|
|
|
|
|
pMain = nullptr;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (lib.isLoaded())
|
|
|
|
|
|
lib.unload();
|
|
|
|
|
|
}
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|