diff --git a/CMakeLists.txt b/CMakeLists.txt index 40ab47c..9d354b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(QT NAMES Qt6 REQUIRED COMPONENTS Core LinguistTools) -find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core LinguistTools) +find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core LinguistTools Gui) configure_file(CoreConfig.h.in CoreConfig.h) @@ -28,7 +28,7 @@ add_library(${TARGET_APP} STATIC include_directories(${CMAKE_CURRENT_BINARY_DIR}) -target_link_libraries(${TARGET_APP} PRIVATE Qt${QT_VERSION_MAJOR}::Core) +target_link_libraries(${TARGET_APP} PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui) target_compile_definitions(${TARGET_APP} PRIVATE ${TARGET_APP}_LIBRARY) diff --git a/genericcore.cpp b/genericcore.cpp index b589405..6191f1c 100644 --- a/genericcore.cpp +++ b/genericcore.cpp @@ -12,11 +12,15 @@ #include "constants.h" #include "model/tablemodel.h" +#include + using namespace std; GenericCore::GenericCore() { qDebug() << "Creating core..."; + m_modelUndoStack = make_shared(this); + setupModels(); } @@ -70,6 +74,8 @@ void GenericCore::triggerApplicationUpdate() { QProcess::startDetached(toolFilePath, args); } +std::shared_ptr GenericCore::getModUndoStack() const { return m_modelUndoStack; } + std::shared_ptr GenericCore::getModel() const { return m_mainModel; } void GenericCore::setupModels() { diff --git a/genericcore.h b/genericcore.h index e017fb3..9fb0176 100644 --- a/genericcore.h +++ b/genericcore.h @@ -3,6 +3,7 @@ #include +class QUndoStack; class QAbstractItemModel; class QString; @@ -21,12 +22,14 @@ class GenericCore : public QObject { bool isApplicationUpdateAvailable(); void triggerApplicationUpdate(); + std::shared_ptr getModUndoStack() const; std::shared_ptr getModel() const; signals: void displayStatusMessage(QString message); private: + std::shared_ptr m_modelUndoStack; std::shared_ptr m_mainModel; void setupModels();