##// END OF EJS Templates
Affects model to the Variable Widget
Alexandre Leroux -
r152:53848f21863d
parent child
Show More
@@ -7,6 +7,8
7 #include <Common/spimpl.h>
7 #include <Common/spimpl.h>
8
8
9 class Variable;
9 class Variable;
10 class VariableModel;
11
10 Q_DECLARE_LOGGING_CATEGORY(LOG_VariableController)
12 Q_DECLARE_LOGGING_CATEGORY(LOG_VariableController)
11
13
12 /**
14 /**
@@ -25,6 +27,8 public:
25 */
27 */
26 Variable *createVariable(const QString &name) noexcept;
28 Variable *createVariable(const QString &name) noexcept;
27
29
30 VariableModel *variableModel() noexcept;
31
28 public slots:
32 public slots:
29 void initialize();
33 void initialize();
30 void finalize();
34 void finalize();
@@ -35,6 +35,11 Variable *VariableController::createVariable(const QString &name) noexcept
35 return impl->m_VariableModel->createVariable(name);
35 return impl->m_VariableModel->createVariable(name);
36 }
36 }
37
37
38 VariableModel *VariableController::variableModel() noexcept
39 {
40 return impl->m_VariableModel.get();
41 }
42
38 void VariableController::initialize()
43 void VariableController::initialize()
39 {
44 {
40 qCDebug(LOG_VariableController()) << tr("VariableController init") << QThread::currentThread();
45 qCDebug(LOG_VariableController()) << tr("VariableController init") << QThread::currentThread();
@@ -1,11 +1,23
1 #include <Variable/VariableController.h>
1 #include <Variable/VariableInspectorWidget.h>
2 #include <Variable/VariableInspectorWidget.h>
3 #include <Variable/VariableModel.h>
2
4
3 #include <ui_VariableInspectorWidget.h>
5 #include <ui_VariableInspectorWidget.h>
4
6
7 #include <QSortFilterProxyModel>
8
9 #include <SqpApplication.h>
10
5 VariableInspectorWidget::VariableInspectorWidget(QWidget *parent)
11 VariableInspectorWidget::VariableInspectorWidget(QWidget *parent)
6 : QWidget{parent}, ui{new Ui::VariableInspectorWidget}
12 : QWidget{parent}, ui{new Ui::VariableInspectorWidget}
7 {
13 {
8 ui->setupUi(this);
14 ui->setupUi(this);
15
16 // Sets model for table
17 auto sortFilterModel = new QSortFilterProxyModel{this};
18 sortFilterModel->setSourceModel(sqpApp->variableController().variableModel());
19
20 ui->tableView->setModel(sortFilterModel);
9 }
21 }
10
22
11 VariableInspectorWidget::~VariableInspectorWidget()
23 VariableInspectorWidget::~VariableInspectorWidget()
General Comments 0
You need to be logged in to leave comments. Login now