summaryrefslogtreecommitdiff
path: root/tagview.h
blob: eedd01939c0602b919f5d65c284b6a2afaf941c9 (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
#ifndef TAGVIEW_H
#define TAGVIEW_H

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

#include <QGraphicsView>
#include <QTimer>


class TagView : public QGraphicsView
{
public:
    TagView(SQLiteSaveFile &proj);

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

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