From 2deadc6cfbf71e06908963fb1bae628cfe370f9d Mon Sep 17 00:00:00 2001 From: jaseg Date: Sun, 16 Aug 2020 17:04:32 +0200 Subject: Basic model/view action works --- tagscene.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tagscene.h') diff --git a/tagscene.h b/tagscene.h index 006fffd..4c81fe5 100644 --- a/tagscene.h +++ b/tagscene.h @@ -14,14 +14,18 @@ class TagScene : public QGraphicsScene Q_OBJECT public: - TagScene(SQLiteSaveFile &proj); + TagScene() {} + const QGraphicsPixmapItem *backgroundPixmapItem() const { return pix_it; } public slots: void reloadPicture(); - void reloadTags(); + void reloadScene(); + + void setProject(SQLiteSaveFile *proj); signals: void tagDoubleClicked(const Tag &tag); + void imageLoaded(); protected: void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override; @@ -32,9 +36,9 @@ private slots: private: void addTag(const Tag tag); - SQLiteSaveFile &proj; + SQLiteSaveFile *m_proj = nullptr; - QGraphicsPixmapItem *pix_it; + QGraphicsPixmapItem *pix_it = nullptr; QPixmap pix; QMap tags; }; -- cgit