@@ -46,24 +46,25 VariableInspectorWidget::~VariableInspectorWidget() | |||
|
46 | 46 | |
|
47 | 47 | void VariableInspectorWidget::onTableMenuRequested(const QPoint &pos) noexcept |
|
48 | 48 | { |
|
49 |
auto selected |
|
|
50 | if (selectedIndex.isValid()) { | |
|
51 |
|
|
|
49 | auto selectedRows = ui->tableView->selectionModel()->selectedRows(); | |
|
50 | ||
|
51 | // Gets the model to retrieve the underlying selected variables | |
|
52 | 52 |
|
|
53 | if (auto selectedVariable = model->variable(selectedIndex.row())) { | |
|
53 | auto selectedVariables = QVector<std::shared_ptr<Variable> >{}; | |
|
54 | for (const auto &selectedRow : qAsConst(selectedRows)) { | |
|
55 | if (auto selectedVariable = model->variable(selectedRow.row())) { | |
|
56 | selectedVariables.push_back(selectedVariable); | |
|
57 | } | |
|
58 | } | |
|
59 | ||
|
54 | 60 |
|
|
55 | 61 | |
|
56 |
|
|
|
57 | emit tableMenuAboutToBeDisplayed(&tableMenu, selectedVariable); | |
|
62 | // Emits a signal so that potential receivers can populate the menu before displaying it | |
|
63 | /// @todo ALX : handles list of variables in the signal | |
|
64 | emit tableMenuAboutToBeDisplayed(&tableMenu, selectedVariables); | |
|
58 | 65 | |
|
59 | 66 |
|
|
67 | // Displays menu | |
|
60 | 68 |
|
|
61 | 69 | } |
|
62 | 70 | } |
|
63 | } | |
|
64 | else { | |
|
65 | qCCritical(LOG_VariableInspectorWidget()) | |
|
66 | << tr("Can't display menu : invalid index (%1;%2)") | |
|
67 | .arg(selectedIndex.row(), selectedIndex.column()); | |
|
68 | } | |
|
69 | } |
General Comments 0
You need to be logged in to leave comments.
Login now