@@ -1,8 +1,13 | |||||
1 | #ifndef SCIQLOP_VARIABLEINSPECTORWIDGET_H |
|
1 | #ifndef SCIQLOP_VARIABLEINSPECTORWIDGET_H | |
2 | #define SCIQLOP_VARIABLEINSPECTORWIDGET_H |
|
2 | #define SCIQLOP_VARIABLEINSPECTORWIDGET_H | |
3 |
|
3 | |||
|
4 | #include <QMenu> | |||
4 | #include <QWidget> |
|
5 | #include <QWidget> | |
5 |
|
6 | |||
|
7 | #include <memory> | |||
|
8 | ||||
|
9 | class Variable; | |||
|
10 | ||||
6 | namespace Ui { |
|
11 | namespace Ui { | |
7 | class VariableInspectorWidget; |
|
12 | class VariableInspectorWidget; | |
8 | } // Ui |
|
13 | } // Ui | |
@@ -21,6 +26,10 public: | |||||
21 |
|
26 | |||
22 | private: |
|
27 | private: | |
23 | Ui::VariableInspectorWidget *ui; |
|
28 | Ui::VariableInspectorWidget *ui; | |
|
29 | ||||
|
30 | private slots: | |||
|
31 | /// Slot called when right clicking on an variable in the table (displays a menu) | |||
|
32 | void onTableMenuRequested(const QPoint &pos) noexcept; | |||
24 | }; |
|
33 | }; | |
25 |
|
34 | |||
26 | #endif // SCIQLOP_VARIABLEINSPECTORWIDGET_H |
|
35 | #endif // SCIQLOP_VARIABLEINSPECTORWIDGET_H |
@@ -18,9 +18,18 VariableInspectorWidget::VariableInspectorWidget(QWidget *parent) | |||||
18 | sortFilterModel->setSourceModel(sqpApp->variableController().variableModel()); |
|
18 | sortFilterModel->setSourceModel(sqpApp->variableController().variableModel()); | |
19 |
|
19 | |||
20 | ui->tableView->setModel(sortFilterModel); |
|
20 | ui->tableView->setModel(sortFilterModel); | |
|
21 | ||||
|
22 | // Connection to show a menu when right clicking on the tree | |||
|
23 | ui->tableView->setContextMenuPolicy(Qt::CustomContextMenu); | |||
|
24 | connect(ui->tableView, &QTableView::customContextMenuRequested, this, | |||
|
25 | &VariableInspectorWidget::onTableMenuRequested); | |||
21 | } |
|
26 | } | |
22 |
|
27 | |||
23 | VariableInspectorWidget::~VariableInspectorWidget() |
|
28 | VariableInspectorWidget::~VariableInspectorWidget() | |
24 | { |
|
29 | { | |
25 | delete ui; |
|
30 | delete ui; | |
26 | } |
|
31 | } | |
|
32 | ||||
|
33 | void VariableInspectorWidget::onTableMenuRequested(const QPoint &pos) noexcept | |||
|
34 | { | |||
|
35 | } |
General Comments 0
You need to be logged in to leave comments.
Login now