Add SDK launcher
This commit is contained in:
parent
2c49b8eaa1
commit
b6b5a71803
6 changed files with 65 additions and 1 deletions
|
@ -3,3 +3,4 @@ find_package(Qt5Widgets CONFIG REQUIRED)
|
|||
add_subdirectory(common)
|
||||
add_subdirectory(leveleditor)
|
||||
add_subdirectory(materialeditor)
|
||||
add_subdirectory(sdklauncher)
|
||||
|
|
|
@ -8,5 +8,5 @@ add_executable(MaterialEditor
|
|||
src/mainwindow.cpp
|
||||
${EDITOR_SRC})
|
||||
target_include_directories(MaterialEditor PRIVATE include)
|
||||
target_link_libraries(MaterialEditor Qt5::Widgets Engine ToolWindowManager EditorCommon)
|
||||
target_link_libraries(MaterialEditor Qt5::Widgets Engine EditorCommon)
|
||||
|
||||
|
|
13
tools/sdklauncher/CMakeLists.txt
Normal file
13
tools/sdklauncher/CMakeLists.txt
Normal file
|
@ -0,0 +1,13 @@
|
|||
set(INCLUDE_FILES
|
||||
include/mainwindow.h)
|
||||
|
||||
qt5_wrap_cpp(EDITOR_SRC ${INCLUDE_FILES})
|
||||
|
||||
add_executable(SDKLauncher
|
||||
src/main.cpp
|
||||
src/mainwindow.cpp
|
||||
${EDITOR_SRC})
|
||||
target_include_directories(SDKLauncher PRIVATE include)
|
||||
target_link_libraries(SDKLauncher Qt5::Widgets Engine EditorCommon)
|
||||
|
||||
|
9
tools/sdklauncher/include/mainwindow.h
Normal file
9
tools/sdklauncher/include/mainwindow.h
Normal file
|
@ -0,0 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
class MainWindow : public QMainWindow {
|
||||
public:
|
||||
MainWindow();
|
||||
};
|
||||
|
15
tools/sdklauncher/src/main.cpp
Normal file
15
tools/sdklauncher/src/main.cpp
Normal file
|
@ -0,0 +1,15 @@
|
|||
#include <QApplication>
|
||||
|
||||
#include "editorstyle.h"
|
||||
#include "mainwindow.h"
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
QApplication app(argc, argv);
|
||||
app.setStyle(new EditorStyle());
|
||||
|
||||
MainWindow window;
|
||||
window.show();
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
26
tools/sdklauncher/src/mainwindow.cpp
Normal file
26
tools/sdklauncher/src/mainwindow.cpp
Normal file
|
@ -0,0 +1,26 @@
|
|||
#include "mainwindow.h"
|
||||
|
||||
#include <QListWidget>
|
||||
#include <QProcess>
|
||||
|
||||
MainWindow::MainWindow() {
|
||||
setWindowTitle("SDK Launcher");
|
||||
|
||||
QListWidget* appList = new QListWidget();
|
||||
appList->addItem("Level Editor");
|
||||
appList->addItem("Material Editor");
|
||||
|
||||
connect(appList, &QListWidget::itemClicked, [](QListWidgetItem* item) {
|
||||
QString exec;
|
||||
if(item->text() == "Level Editor")
|
||||
exec = "tools/leveleditor/LevelEditor";
|
||||
else if(item->text() == "Material Editor")
|
||||
exec = "tools/materialeditor/MaterialEditor";
|
||||
|
||||
QProcess* process = new QProcess();
|
||||
process->start(exec);
|
||||
});
|
||||
|
||||
setCentralWidget(appList);
|
||||
}
|
||||
|
Reference in a new issue