From 7de45efc41ced8383a6b79fd749bf47f0f02c8df Mon Sep 17 00:00:00 2001 From: tobiglaser <76131623+tobiglaser@users.noreply.github.com> Date: Fri, 5 Aug 2022 17:10:57 +0200 Subject: [PATCH] PanelCommandType communication fix --- src/PanelCommandTypes.cpp | 6 +++--- src/PanelCommandTypes.h | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/PanelCommandTypes.cpp b/src/PanelCommandTypes.cpp index 776bf1e..4cc86ae 100644 --- a/src/PanelCommandTypes.cpp +++ b/src/PanelCommandTypes.cpp @@ -4,8 +4,9 @@ #include "ComTypeListWidgetItem.h" -PanelCommandTypes::PanelCommandTypes(ControlModel *_cM) +PanelCommandTypes::PanelCommandTypes(ControlModel *_cM, ControlUI *_cui) { + cui = _cui; cM = _cM; setView(); setController(); @@ -38,7 +39,6 @@ void PanelCommandTypes::onAddButton() { std::shared_ptr<ICommand> newCommand = listItem->getCommandType()->createInstance(); cM->getCommandList().add(newCommand); - - cM->getCommandList().printCommands(); + cui->updateTableView(); } } \ No newline at end of file diff --git a/src/PanelCommandTypes.h b/src/PanelCommandTypes.h index fced766..4c5f00f 100644 --- a/src/PanelCommandTypes.h +++ b/src/PanelCommandTypes.h @@ -2,6 +2,7 @@ #include <QListWidget> #include <QPushButton> #include "ControlModel.h" +#include "ControlUI.h" class PanelCommandTypes : public QWidget { @@ -12,6 +13,7 @@ private: QListWidget *commandTypeList; QPushButton *bAdd; ControlModel *cM; + ControlUI *cui; void setView(); void setController(); @@ -20,5 +22,5 @@ private slots: void onAddButton(); public: - PanelCommandTypes(ControlModel *_cM); + PanelCommandTypes(ControlModel *_cM, ControlUI *_cui); }; -- GitLab