From 4a56bca765f22eba43275cc04e9d9c58c95d6bcb Mon Sep 17 00:00:00 2001 From: parker Date: Thu, 19 Jun 2025 01:27:19 +0100 Subject: [PATCH] refactor: move to interface class --- .gitignore | 1 + CMakeLists.txt | 12 ++++++++++-- src/gui/Interface.cpp | 0 src/gui/Interface.h | 11 +++++++++++ src/gui/main.cpp | 10 ++++++---- 5 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 src/gui/Interface.cpp create mode 100644 src/gui/Interface.h diff --git a/.gitignore b/.gitignore index 378eac2..9785597 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ build +.cache diff --git a/CMakeLists.txt b/CMakeLists.txt index a677319..f62d81d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,16 @@ 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) +# setup project +project(enzo_project) + + +# qt find_package(Qt6 REQUIRED COMPONENTS Core Widgets) qt_standard_project_setup() @@ -13,6 +20,7 @@ qt_add_executable(${AppExec} ) target_link_libraries(${AppExec} PRIVATE Qt6::Core Qt6::Widgets) +target_include_directories(${AppExec} PUBLIC src) # tests add_executable(${TestExec} tests/main-tests.cpp) diff --git a/src/gui/Interface.cpp b/src/gui/Interface.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/gui/Interface.h b/src/gui/Interface.h new file mode 100644 index 0000000..b68ae91 --- /dev/null +++ b/src/gui/Interface.h @@ -0,0 +1,11 @@ +#pragma once +#include + +class EnzoUI +: public QWidget +{ + public: + + private: + +}; diff --git a/src/gui/main.cpp b/src/gui/main.cpp index 9518147..738ccc6 100644 --- a/src/gui/main.cpp +++ b/src/gui/main.cpp @@ -1,12 +1,14 @@ #include #include +#include "Interface.h" + int main(int argc, char **argv) { - QApplication app (argc, argv); + QApplication app (argc, argv); - QPushButton button ("Hello world !"); - button.show(); + EnzoUI interface; + interface.show(); - return app.exec(); + return app.exec(); }