首次提交

This commit is contained in:
2026-06-16 13:33:27 +08:00
commit 81e2f99ab5
187 changed files with 26001 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
#include "export.h"
#include <QGuiApplication>
ScreenInfo getScreenInfo()
{
ScreenInfo info;
#if QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)
// Qt5.3+ / Qt6
QScreen* screen = QGuiApplication::primaryScreen();
if (!screen)
return info;
info.fullSize = screen->geometry().size();
info.availableSize = screen->availableGeometry().size();
#elif QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
// Qt5 早期版本
QDesktopWidget* desktop = QApplication::desktop();
if (!desktop)
return info;
info.fullSize = desktop->screenGeometry().size();
info.availableSize = desktop->availableGeometry().size();
#else
// Qt4
QDesktopWidget* desktop = QApplication::desktop();
if (!desktop)
return info;
info.fullSize = desktop->screenGeometry().size();
info.availableSize = desktop->availableGeometry().size();
#endif
return info;
}