This repository was archived by the owner on May 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInfinity_global.cpp
More file actions
55 lines (45 loc) · 1.36 KB
/
Infinity_global.cpp
File metadata and controls
55 lines (45 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include "Infinity_global.h"
Infinity_global::Infinity_global()
{
}
Infinity_global Infinity_global::i_global;
QString Infinity_global::projectName = "org.infinity.infinitystudio";
Infinity_global& Infinity_global::getGlobal()
{
return Infinity_global::i_global;
}
bool Infinity_global::get_RAII_memory_OK()
{
return this->RAII_memory_OK;
}
void Infinity_global::set_RAII_memory_OK(bool RAII_memory_OK)
{
this->RAII_memory_OK = RAII_memory_OK;
}
bool Infinity_global::get_App_init_OK()
{
return this->App_init_OK;
}
void Infinity_global::set_App_init_OK(bool App_init_OK)
{
this->App_init_OK = App_init_OK;
}
QMainWindow* Infinity_global::getMainWindow()
{
foreach(QWidget * w, qApp->topLevelWidgets())
{
if (QMainWindow* mainWin = qobject_cast<QMainWindow*>(w))
return mainWin;
}
return nullptr;
}
QSize Infinity_global::getScreenSize()
{
if (Infinity_global::getMainWindow() == nullptr) {
return QApplication::screens().at(0)->availableSize();
}
if (QApplication::screenAt((Infinity_global::getMainWindow()->frameGeometry().topLeft() + Infinity_global::getMainWindow()->frameGeometry().topRight()) / 2) == nullptr) {
return QApplication::screens().at(0)->availableSize();
}
return QApplication::screenAt((Infinity_global::getMainWindow()->frameGeometry().topLeft() + Infinity_global::getMainWindow()->frameGeometry().bottomRight()) / 2)->availableSize();
}