summaryrefslogtreecommitdiff
path: root/tagview.h
blob: 71b418c4fbf6c763c13f6e10ac5cfff944d858f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef TAGVIEW_H
#define TAGVIEW_H

#include "sqlitebackend.h"
#include "tagscene.h"

#include <QGraphicsView>
#include <QTimer>


class TagView : public QGraphicsView
{
    Q_OBJECT

public:
    TagView(SQLiteSaveFile &proj);

public slots:
    void zoomToFit();
    void setZoom(qreal zoom);
    void zoomIn(qreal delta);
    void rotate(int angle);

signals:
    void tagDoubleClicked(const Tag &tag);

protected:
    void wheelEvent(QWheelEvent *evt) override;

private slots:
    void saveCenter();

private:
    void restoreViewport();

    TagScene scene;
    SQLiteSaveFile &proj;
    QTimer saveCenterTimer;
    int rotation;
    double zoom;
};

#endif // TAGVIEW_H