##// END OF EJS Templates
Affects model to the Variable Widget
Alexandre Leroux -
r143:53848f21863d
parent child
Show More
@@ -7,6 +7,8
7 7 #include <Common/spimpl.h>
8 8
9 9 class Variable;
10 class VariableModel;
11
10 12 Q_DECLARE_LOGGING_CATEGORY(LOG_VariableController)
11 13
12 14 /**
@@ -25,6 +27,8 public:
25 27 */
26 28 Variable *createVariable(const QString &name) noexcept;
27 29
30 VariableModel *variableModel() noexcept;
31
28 32 public slots:
29 33 void initialize();
30 34 void finalize();
@@ -35,6 +35,11 Variable *VariableController::createVariable(const QString &name) noexcept
35 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 43 void VariableController::initialize()
39 44 {
40 45 qCDebug(LOG_VariableController()) << tr("VariableController init") << QThread::currentThread();
@@ -1,11 +1,23
1 #include <Variable/VariableController.h>
1 2 #include <Variable/VariableInspectorWidget.h>
3 #include <Variable/VariableModel.h>
2 4
3 5 #include <ui_VariableInspectorWidget.h>
4 6
7 #include <QSortFilterProxyModel>
8
9 #include <SqpApplication.h>
10
5 11 VariableInspectorWidget::VariableInspectorWidget(QWidget *parent)
6 12 : QWidget{parent}, ui{new Ui::VariableInspectorWidget}
7 13 {
8 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 23 VariableInspectorWidget::~VariableInspectorWidget()
General Comments 4
Under Review
author

Pull request updated. Auto status change to "Under Review"

Changed commits:
  * 1 added
  * 0 removed

Changed files:
  * M core/src/Variable/VariableModel.cpp
Approved
author

Status change > Approved

You need to be logged in to leave comments. Login now