summaryrefslogtreecommitdiff
path: root/tagview.h
diff options
context:
space:
mode:
Diffstat (limited to 'tagview.h')
-rw-r--r--tagview.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/tagview.h b/tagview.h
index 71b418c..edafcf4 100644
--- a/tagview.h
+++ b/tagview.h
@@ -13,19 +13,24 @@ class TagView : public QGraphicsView
Q_OBJECT
public:
- TagView(SQLiteSaveFile &proj);
+ TagView(QWidget *parent=nullptr);
+ virtual ~TagView();
public slots:
void zoomToFit();
void setZoom(qreal zoom);
- void zoomIn(qreal delta);
+ void zoomIn(qreal delta=120);
+ void zoomOut(qreal delta=120) { zoomIn(-delta); }
void rotate(int angle);
+ void setProject(SQLiteSaveFile *proj);
+
signals:
void tagDoubleClicked(const Tag &tag);
protected:
void wheelEvent(QWheelEvent *evt) override;
+ void scrollContentsBy(int dx, int dy) override;
private slots:
void saveCenter();
@@ -33,9 +38,10 @@ private slots:
private:
void restoreViewport();
- TagScene scene;
- SQLiteSaveFile &proj;
QTimer saveCenterTimer;
+ bool were_done = false;
+ TagScene m_scene;
+ SQLiteSaveFile *m_proj = nullptr;
int rotation;
double zoom;
};