2025-06-17 11:48:13 +08:00
|
|
|
#include <QApplication>
|
2025-06-20 10:33:03 +08:00
|
|
|
#include <QDir>
|
2025-06-15 14:31:54 +08:00
|
|
|
#include <QFile>
|
2025-06-21 12:08:01 +08:00
|
|
|
#include <SingleApplication>
|
2025-06-15 14:31:54 +08:00
|
|
|
|
|
|
|
|
#include "frelayGUI.h"
|
|
|
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
|
{
|
2025-11-11 13:47:36 +08:00
|
|
|
qRegisterMetaType<QSharedPointer<FrameBuffer>>("QSharedPointer<FrameBuffer>");
|
|
|
|
|
qRegisterMetaType<InfoClientVec>("InfoClientVec");
|
|
|
|
|
qRegisterMetaType<DirFileInfoVec>("DirFileInfoVec");
|
|
|
|
|
qRegisterMetaType<TransTask>("TransTask");
|
|
|
|
|
qRegisterMetaType<QVector<QString>>("QVector<QString>");
|
2025-06-20 16:20:34 +08:00
|
|
|
|
2025-06-25 23:49:40 +08:00
|
|
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
|
|
|
|
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
|
|
|
|
#endif
|
|
|
|
|
|
2025-07-04 21:44:52 +08:00
|
|
|
SingleApplication a(argc, argv);
|
|
|
|
|
|
2025-06-15 14:31:54 +08:00
|
|
|
#ifdef _WIN32
|
|
|
|
|
QFont font("Microsoft YaHei", 9);
|
|
|
|
|
a.setFont(font);
|
2025-07-06 23:51:45 +08:00
|
|
|
// a.setStyle("fusion");
|
2025-09-26 15:43:16 +08:00
|
|
|
// a.setStyle("windows");
|
2025-06-15 14:31:54 +08:00
|
|
|
#endif
|
|
|
|
|
|
2025-06-21 12:08:01 +08:00
|
|
|
qInstallMessageHandler(frelayGUI::ControlMsgHander);
|
|
|
|
|
|
2025-06-15 14:31:54 +08:00
|
|
|
frelayGUI w;
|
2025-06-21 12:08:01 +08:00
|
|
|
|
2025-11-15 17:26:09 +08:00
|
|
|
// QFile file(":/QtTheme/theme/Flat/Light/Blue/Pink.qss");
|
|
|
|
|
// if (file.open(QFile::ReadOnly)) {
|
|
|
|
|
// a.setStyleSheet(file.readAll());
|
|
|
|
|
// }
|
2025-10-20 15:17:31 +08:00
|
|
|
|
2025-06-21 12:08:01 +08:00
|
|
|
QObject::connect(&a, &SingleApplication::instanceStarted, &w, [&w]() {
|
|
|
|
|
w.showNormal();
|
|
|
|
|
w.raise();
|
|
|
|
|
w.activateWindow();
|
|
|
|
|
});
|
|
|
|
|
|
2025-06-15 14:31:54 +08:00
|
|
|
w.show();
|
|
|
|
|
return a.exec();
|
|
|
|
|
}
|