43 lines
677 B
C++
43 lines
677 B
C++
#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
|