refactor: move to interface class

This commit is contained in:
parker
2025-06-19 01:27:19 +01:00
parent 9830bf21ae
commit 4a56bca765
5 changed files with 28 additions and 6 deletions

1
.gitignore vendored
View File

@@ -1 +1,2 @@
build build
.cache

View File

@@ -1,9 +1,16 @@
cmake_minimum_required(VERSION 3.10) cmake_minimum_required(VERSION 3.10)
project(enzo_project)
set(AppExec enzo_gui) # set vars
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# set exec names
set(AppExec enzoGui)
set(TestExec tests) set(TestExec tests)
# setup project
project(enzo_project)
# qt
find_package(Qt6 REQUIRED COMPONENTS Core Widgets) find_package(Qt6 REQUIRED COMPONENTS Core Widgets)
qt_standard_project_setup() qt_standard_project_setup()
@@ -13,6 +20,7 @@ qt_add_executable(${AppExec}
) )
target_link_libraries(${AppExec} PRIVATE Qt6::Core Qt6::Widgets) target_link_libraries(${AppExec} PRIVATE Qt6::Core Qt6::Widgets)
target_include_directories(${AppExec} PUBLIC src)
# tests # tests
add_executable(${TestExec} tests/main-tests.cpp) add_executable(${TestExec} tests/main-tests.cpp)

0
src/gui/Interface.cpp Normal file
View File

11
src/gui/Interface.h Normal file
View File

@@ -0,0 +1,11 @@
#pragma once
#include <QWidget>
class EnzoUI
: public QWidget
{
public:
private:
};

View File

@@ -1,12 +1,14 @@
#include <QApplication> #include <QApplication>
#include <QPushButton> #include <QPushButton>
#include "Interface.h"
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
QApplication app (argc, argv); QApplication app (argc, argv);
QPushButton button ("Hello world !"); EnzoUI interface;
button.show(); interface.show();
return app.exec(); return app.exec();
} }