File tree 12 files changed +187
-156
lines changed
12 files changed +187
-156
lines changed Original file line number Diff line number Diff line change @@ -15,20 +15,23 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CmakeModules")
15
15
set (CMAKE_CXX_STANDARD 20)
16
16
set (CMAKE_CXX_STANDARD_REQUIRED ON )
17
17
18
+
19
+ set (CMAKE_AUTOMOC ON )
18
20
include (Config)
19
21
include (CMakeDependentOption)
20
22
include (GNUInstallDirs)
21
23
22
24
23
25
find_package (Qt6 REQUIRED COMPONENTS
24
- Core
25
- Widgets
26
- Gui
27
- Quick
28
- Qml
29
- Test
30
- QuickControls2
31
- Network)
26
+ Core
27
+ Widgets
28
+ Gui
29
+ Quick
30
+ Qml
31
+ Test
32
+ QtWebEngine
33
+ QuickControls2
34
+ Network)
32
35
qt_standard_project_setup()
33
36
34
37
add_subdirectory (Source )
Original file line number Diff line number Diff line change @@ -65,10 +65,10 @@ endif()
65
65
66
66
if (AUTO_QT_LIBS)
67
67
add_custom_target (deploy ALL
68
- WORKING_DIRECTORY ${QtLib} /bin
68
+ WORKING_DIRECTORY ${QtLib} /bin
69
69
COMMAND ${platform} deployqt --qmldir ${CMAKE_SOURCE_DIR} /Gui --${type} --quick ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
70
70
COMMAND ${platform} deployqt --qmldir ${CMAKE_SOURCE_DIR} /Gui --${type} --quick ${UpdaterPath}
71
- COMMENT "========= Deploying Aplication ========="
71
+ COMMENT "========= Deploying Aplication ========="
72
72
USES_TERMINAL )
73
73
add_dependencies (deploy SharpsenBox)
74
74
endif ()
Original file line number Diff line number Diff line change 1
1
import QtQuick 2.0
2
2
import QtQuick.Controls 2.14
3
3
import QtQuick.Window 2.12
4
- import QtWebEngine 1.8
5
4
6
5
ApplicationWindow {
7
6
id: window
@@ -10,7 +9,7 @@ ApplicationWindow {
10
9
height: 500
11
10
color: " #202020"
12
11
flags: Qt .Window | Qt .FramelessWindowHint | Qt .WindowMinimizeButtonHint
13
- | Qt .WindowMaximizeButtonHint
12
+ | Qt .WindowMaximizeButtonHint
14
13
minimumWidth: 1000
15
14
minimumHeight: 600
16
15
// for window movement
@@ -25,11 +24,13 @@ ApplicationWindow {
25
24
26
25
function absoluteMousePos (mouseArea ) {
27
26
var windowAbs = mouseArea .mapToItem (null , mouseArea .mouseX ,
28
- mouseArea .mouseY )
27
+ mouseArea .mouseY )
29
28
return Qt .point (windowAbs .x + window .x , windowAbs .y + window .y )
30
29
}
31
30
32
- FontLoader { id: latoFont; source: " Font/Lato-Regular.ttf" }
31
+ FontLoader {
32
+ id: latoFont; source: " Font/Lato-Regular.ttf"
33
+ }
33
34
34
35
TopBar {
35
36
id: topBar
@@ -68,38 +69,40 @@ ApplicationWindow {
68
69
69
70
onStageChanged: {
70
71
switch (stage) {
71
- case 0 :
72
- if (source != " " ){
73
- hide ()
74
- } else {
75
- active = false
76
- source = " "
77
- }
78
- break
79
- case 1 :
80
- active = true
81
- source = " PopOutInfo.qml"
82
- show ()
83
- break
84
- case 2 :
85
- active = true
86
- source = " InstallPopOut.qml"
87
- show ()
88
- break
89
- case 3 :
90
- active = true
91
- source = " PopOutDialog.qml"
92
- show ()
93
- break
72
+ case 0 :
73
+ if (source != " " ) {
74
+ hide ()
75
+ } else {
76
+ active = false
77
+ source = " "
78
+ }
79
+ break
80
+ case 1 :
81
+ active = true
82
+ source = " PopOutInfo.qml"
83
+ show ()
84
+ break
85
+ case 2 :
86
+ active = true
87
+ source = " InstallPopOut.qml"
88
+ show ()
89
+ break
90
+ case 3 :
91
+ active = true
92
+ source = " PopOutDialog.qml"
93
+ show ()
94
+ break
94
95
}
95
96
}
96
97
active: false
97
98
source: " "
98
- function show (){
99
+
100
+ function show () {
99
101
showAnim .stop ()
100
102
showAnim .start ()
101
103
}
102
- function hide (){
104
+
105
+ function hide () {
103
106
hideAnim .stop ()
104
107
hideAnim .start ()
105
108
}
Original file line number Diff line number Diff line change 1
1
2
- qt6_add_resources (
3
- RESOURCES
4
- "../../../Gui/SharpsenBox.qrc" )
2
+ qt_add_resources (
3
+ RESOURCES
4
+ "../../../Gui/SharpsenBox.qrc" )
5
5
6
6
qt_add_executable(SharpsenBox
7
- main.cpp
8
- Backend.cpp
9
- ${RESOURCES} )
7
+ main.cpp
8
+ Backend.cpp
9
+ ${RESOURCES} )
10
10
11
11
message (${WIN} AND ${RELEASE} asfa ${64BIT} )
12
12
13
- if (WIN AND RELEASE)
13
+ if (WIN AND RELEASE)
14
14
set_target_properties (SharpsenBox PROPERTIES WIN32_EXECUTABLE TRUE )
15
- endif ()
15
+ endif ()
16
16
17
17
target_link_libraries (SharpsenBox PUBLIC
18
- ComponentRegister
19
- Dialog
20
- GameManager
21
- LoadingBar
22
- Config
23
- Qt6::Widgets
24
- Qt6::Gui
25
- Qt6::Core
26
- Qt6::Quick
27
- Qt6::Qml
28
- Qt6::QuickControls2
29
- ${CURL_LIBRARY} )
30
-
31
- target_include_directories (SharpsenBox PUBLIC
32
- "../../Component"
33
- "../../Component/h"
34
- "../../QConfig"
35
- "../../QConfig/h"
36
- "../../UpdateManager"
37
- "../../UpdateManager/h"
38
- "../QDialog"
39
- "../QDialog/h"
40
- "../QGameManager"
41
- "../QGameManager/h"
42
- "../QLoadingBar"
43
- "../QLoadingBar/h" )
44
-
45
- file ( COPY ${CMAKE_SOURCE_DIR} /orbit2.ico DESTINATION ${CMAKE_BINARY_DIR} )
18
+ ComponentRegister
19
+ Dialog
20
+ GameManager
21
+ LoadingBar
22
+ Config
23
+ Qt6::Widgets
24
+ Qt6::Gui
25
+ Qt6::Core
26
+ Qt6::Quick
27
+ Qt6::Qml
28
+ Qt6::QuickControls2
29
+ ${CURL_LIBRARY} )
30
+
31
+ target_include_directories (SharpsenBox PUBLIC
32
+ "../../Component"
33
+ "../../Component/h"
34
+ "../../QConfig"
35
+ "../../QConfig/h"
36
+ "../../UpdateManager"
37
+ "../../UpdateManager/h"
38
+ "../QDialog"
39
+ "../QDialog/h"
40
+ "../QGameManager"
41
+ "../QGameManager/h"
42
+ "../QLoadingBar"
43
+ "../QLoadingBar/h" )
44
+
45
+ file (COPY ${CMAKE_SOURCE_DIR} /orbit2.ico DESTINATION ${CMAKE_BINARY_DIR} )
46
+
47
+ qt_generate_deploy_app_script(
48
+ TARGET SharpsenBox
49
+ OUTPUT_SCRIPT deploy_script
50
+ NO_UNSUPPORTED_PLATFORM_ERROR
51
+ )
52
+ install (SCRIPT ${deploy_script} )
46
53
47
54
install (TARGETS SharpsenBox DESTINATION ${SharpsenBoxPath} /bin)
Original file line number Diff line number Diff line change 5
5
#include < QIcon>
6
6
#include " Backend.hpp"
7
7
8
- int main (int argc, char ** argv) {
8
+ int main (int argc, char ** argv)
9
+ {
9
10
// responsible is more efficient but animations are too fast
10
11
// QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL);
11
12
QGuiApplication app (argc, argv);
12
13
app.setWindowIcon (QIcon (" orbit2.ico" ));
13
14
QQmlApplicationEngine engine;
15
+ engine.addImportPath (" ." );
16
+ engine.addImportPath (" qrc:/" );
14
17
15
18
sb::Backend backend (&engine);
16
19
backend.RegisterComponents ();
Original file line number Diff line number Diff line change 1
1
2
2
qt_add_library(Dialog STATIC
3
- Dialog.cpp)
3
+ Dialog.cpp)
4
4
5
5
target_include_directories (Dialog PUBLIC
6
- "../../Component/h"
7
- "../QGameManager/h"
8
- "../QConfig/h"
9
- "h" )
6
+ "../../Component/h"
7
+ "../QGameManager/h"
8
+ "../QConfig/h"
9
+ "h" )
10
10
11
11
target_link_libraries (Dialog
12
- Qt6::Widgets
13
- Qt6::Gui
14
- Qt6::Core)
12
+ Qt6::Widgets
13
+ Qt6::Gui
14
+ Qt6::Qml
15
+ Qt6::Core)
Original file line number Diff line number Diff line change 1
1
2
2
qt_add_library(LoadingBar STATIC
3
- LoadingBar.cpp)
3
+ LoadingBar.cpp)
4
4
5
5
target_include_directories (LoadingBar PUBLIC
6
- "../JsonParsers"
7
- "../AppUpdater"
8
- "../QDialog/h"
9
- "../QGameManager/h"
10
- "../../UpdateManager/h"
11
- "../../QConfig/h"
12
- "../../Component/h"
13
- "h" )
6
+ "../JsonParsers"
7
+ "../AppUpdater"
8
+ "../QDialog/h"
9
+ "../QGameManager/h"
10
+ "../../UpdateManager/h"
11
+ "../../QConfig/h"
12
+ "../../Component/h"
13
+ "h" )
14
14
15
15
target_link_libraries (LoadingBar
16
- Qt6::Widgets
17
- Qt6::Gui
18
- Qt6::Core)
16
+ Qt6::Widgets
17
+ Qt6::Gui
18
+ Qt6::Qml
19
+ Qt6::Core)
Original file line number Diff line number Diff line change 1
1
2
2
qt_add_library(ComponentRegister STATIC
3
- ComponentRegister.cpp)
3
+ ComponentRegister.cpp)
4
4
5
- target_include_directories (ComponentRegister PUBLIC
6
- "h" )
5
+ target_include_directories (ComponentRegister PUBLIC
6
+ "h" )
7
7
8
8
target_link_libraries (ComponentRegister
9
- Qt6::Widgets
10
- Qt6::Gui
11
- Qt6::Core)
9
+ Qt6::Widgets
10
+ Qt6::Gui
11
+ Qt6::Qml
12
+ Qt6::Core)
Original file line number Diff line number Diff line change 1
1
2
2
qt_add_library(Config STATIC
3
- Config.cpp)
3
+ Config.cpp)
4
4
5
5
6
6
target_include_directories (Config PUBLIC
7
- "../Component/h"
8
- "../UpdateManager/h"
9
- "h" )
7
+ "../Component/h"
8
+ "../UpdateManager/h"
9
+ "h" )
10
10
11
11
target_link_libraries (Config
12
- Qt6::Widgets
13
- Qt6::Gui
14
- Qt6::Core
15
- Qt6::Widgets)
12
+ Qt6::Widgets
13
+ Qt6::Gui
14
+ Qt6::Core
15
+ Qt6::Qml
16
+ Qt6::Widgets)
You can’t perform that action at this time.
0 commit comments