56 lines
1.4 KiB
C++
56 lines
1.4 KiB
C++
|
// FlightController.cpp: 定义应用程序的入口点。
|
||
|
//
|
||
|
|
||
|
#include <QApplication>
|
||
|
|
||
|
#include <QMessageBox>
|
||
|
#include <QTimer>
|
||
|
|
||
|
#include "SpdLog.h"
|
||
|
|
||
|
#include "MainWindow.h"
|
||
|
|
||
|
int main(int argc, char* argv[]) {
|
||
|
QApplication app(argc, argv);
|
||
|
InitSpdlog("PhotoDisplay_log", "logs/PhotoDisplay_log.txt", 5);
|
||
|
|
||
|
|
||
|
//QTimer::singleShot(50000, []() {
|
||
|
// MainWindow* mainWindow = new MainWindow;
|
||
|
// mainWindow->show();
|
||
|
// });
|
||
|
MainWindow mainWindow;
|
||
|
mainWindow.show();
|
||
|
|
||
|
//QList<QScreen*> screens = QGuiApplication::screens();
|
||
|
// 检查屏幕索引是否有效
|
||
|
//int screenIndex = 0; // 替换为实际的屏幕索引
|
||
|
//if (screenIndex >= 0 && screenIndex < screens.size()) {
|
||
|
// // 获取指定索引的屏幕
|
||
|
// QScreen* targetScreen = screens[screenIndex];
|
||
|
|
||
|
// // 获取屏幕的几何属性
|
||
|
// QRect screenGeometry = targetScreen->geometry();
|
||
|
|
||
|
// // 移除边框和标题栏
|
||
|
// mainWindow.setWindowFlags(Qt::FramelessWindowHint);
|
||
|
|
||
|
// // 设置窗口的几何属性
|
||
|
// mainWindow.setGeometry(screenGeometry);
|
||
|
// // 将窗口移动到指定屏幕
|
||
|
// mainWindow.move(screenGeometry.topLeft());
|
||
|
|
||
|
// // 设置窗口大小与屏幕相同
|
||
|
// mainWindow.resize(screenGeometry.size());
|
||
|
|
||
|
// // 显示窗口
|
||
|
// mainWindow.show();
|
||
|
// // 将窗口移动到指定屏幕
|
||
|
// mainWindow.move(screenGeometry.topLeft());
|
||
|
//}
|
||
|
|
||
|
int ret = app.exec();
|
||
|
UninitSpdlog();
|
||
|
return ret;
|
||
|
}
|