diff options
author | jaseg <git-bigdata-wsl-arch@jaseg.de> | 2020-08-16 17:04:32 +0200 |
---|---|---|
committer | jaseg <git-bigdata-wsl-arch@jaseg.de> | 2020-08-16 17:04:32 +0200 |
commit | 2deadc6cfbf71e06908963fb1bae628cfe370f9d (patch) | |
tree | d737d2e1e9cfde305840179680610d015f5dbf0e /numberator.cpp | |
parent | 752f270cf81bc8c88cb4bf428e5aceb51405c06a (diff) | |
download | numberator-2deadc6cfbf71e06908963fb1bae628cfe370f9d.tar.gz numberator-2deadc6cfbf71e06908963fb1bae628cfe370f9d.tar.bz2 numberator-2deadc6cfbf71e06908963fb1bae628cfe370f9d.zip |
Basic model/view action works
Diffstat (limited to 'numberator.cpp')
-rw-r--r-- | numberator.cpp | 14 |
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 ¤t, 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()
|