@@ -15,7 +15,7 class CatalogueEventsWidget : public QWidget { | |||
|
15 | 15 | Q_OBJECT |
|
16 | 16 | |
|
17 | 17 | signals: |
|
18 | void eventSelected(const DBEvent &event); | |
|
18 | void eventsSelected(const QVector<DBEvent> &event); | |
|
19 | 19 | |
|
20 | 20 | public: |
|
21 | 21 | explicit CatalogueEventsWidget(QWidget *parent = 0); |
@@ -42,17 +42,22 CatalogueEventsWidget::CatalogueEventsWidget(QWidget *parent) | |||
|
42 | 42 | }); |
|
43 | 43 | |
|
44 | 44 | connect(ui->tableView, &QTableView::clicked, [this](auto index) { |
|
45 | auto event = impl->m_Model->getEvent(index.row()); | |
|
46 | emit this->eventSelected(event); | |
|
45 | QVector<DBEvent> events; | |
|
46 | for (auto rowIndex : ui->tableView->selectionModel()->selectedRows()) { | |
|
47 | events << impl->m_Model->getEvent(rowIndex.row()); | |
|
48 | } | |
|
49 | ||
|
50 | emit this->eventsSelected(events); | |
|
47 | 51 | }); |
|
48 | 52 | |
|
49 |
connect(ui->tableView->selectionModel(), &QItemSelectionModel:: |
|
|
50 | [this](auto current, auto previous) { | |
|
51 | if (current.isValid() && current.row() >= 0) { | |
|
52 |
|
|
|
53 | emit this->eventSelected(event); | |
|
54 | } | |
|
55 | }); | |
|
53 | connect(ui->tableView->selectionModel(), &QItemSelectionModel::selectionChanged, [this]() { | |
|
54 | QVector<DBEvent> events; | |
|
55 | for (auto rowIndex : ui->tableView->selectionModel()->selectedRows()) { | |
|
56 | events << impl->m_Model->getEvent(rowIndex.row()); | |
|
57 | } | |
|
58 | ||
|
59 | emit this->eventsSelected(events); | |
|
60 | }); | |
|
56 | 61 | |
|
57 | 62 | connect(ui->tableView->selectionModel(), &QItemSelectionModel::selectionChanged, [this]() { |
|
58 | 63 | auto isNotMultiSelection = ui->tableView->selectionModel()->selectedRows().count() <= 1; |
@@ -15,8 +15,14 CatalogueExplorer::CatalogueExplorer(QWidget *parent) | |||
|
15 | 15 | ui->events->populateWithCatalogue(catalogue); |
|
16 | 16 | }); |
|
17 | 17 | |
|
18 | connect(ui->events, &CatalogueEventsWidget::eventSelected, | |
|
19 | [this](auto event) { ui->inspector->setEvent(event); }); | |
|
18 | connect(ui->events, &CatalogueEventsWidget::eventsSelected, [this](auto events) { | |
|
19 | if (events.count() == 1) { | |
|
20 | ui->inspector->setEvent(events.first()); | |
|
21 | } | |
|
22 | else { | |
|
23 | ui->inspector->showPage(CatalogueInspectorWidget::Page::Empty); | |
|
24 | } | |
|
25 | }); | |
|
20 | 26 | } |
|
21 | 27 | |
|
22 | 28 | CatalogueExplorer::~CatalogueExplorer() |
General Comments 0
You need to be logged in to leave comments.
Login now