summaryrefslogtreecommitdiff
path: root/numberator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'numberator.cpp')
-rw-r--r--numberator.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/numberator.cpp b/numberator.cpp
index 912c5e3..29c0d6b 100644
--- a/numberator.cpp
+++ b/numberator.cpp
@@ -29,6 +29,8 @@ Numberator::Numberator(QWidget *parent)
connect(ui->actionReload_Image, &QAction::triggered,
&proj, &SQLiteSaveFile::reloadImageFromDisk);
+ ui->graphicsView->setProject(&proj);
+
tagsDockUi->tagList->setModel(&tagListModel);
tagsDockUi->propertyTable->setModel(&tagPropTableModel);
@@ -78,11 +80,15 @@ Numberator::Numberator(QWidget *parent)
});
connect(ui->actionAbout, &QAction::triggered, &aboutDialog, &AboutDialog::open);
- connect(tagsDockUi->tagList->selectionModel(), &QItemSelectionModel::currentChanged,
- [=](const QModelIndex &current, const QModelIndex &previous) {
- Q_UNUSED(previous);
- tagPropTableModel.showTag(tagListModel.getTag(current));
+ connect(tagsDockUi->tagList->selectionModel(), &QItemSelectionModel::selectionChanged,
+ [=](const QItemSelection &selected, const QItemSelection &deselected) {
+ Q_UNUSED(deselected);
+ tagPropTableModel.showTag(tagListModel.getTag(selected.indexes().first()));
});
+
+ connect(ui->actionZoom_to_fit, &QAction::triggered, ui->graphicsView, &TagView::zoomToFit);
+ connect(ui->actionZoom_in, &QAction::triggered, ui->graphicsView, &TagView::zoomIn);
+ connect(ui->actionZoom_out, &QAction::triggered, ui->graphicsView, &TagView::zoomOut);
}
Numberator::~Numberator()