From 921eb687af0335c030d7095da7c7be1069f10490 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 27 Aug 2015 06:43:54 +0200 Subject: Make PictureViewer2 controls work Now the controls actually do something. Not still as promised, but they kinda work! --- pictureviewer2.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'pictureviewer2.h') diff --git a/pictureviewer2.h b/pictureviewer2.h index a3f1f2d..1592b5d 100644 --- a/pictureviewer2.h +++ b/pictureviewer2.h @@ -58,6 +58,9 @@ class PictureViewer2 : public QGraphicsView { void previous(); void skip(int amount); void selectPic(const QString &path); + void stopSlide(); + void startSlide(); + void startSlideAll(); void toggleSlide(bool slide); void slide(bool); void slideThrouhghAll(bool); @@ -71,6 +74,7 @@ class PictureViewer2 : public QGraphicsView { void addToNewPics(); void markCurrent(); void clearMarks(); + void doControl(QGraphicsItem *item); protected: virtual void wheelEvent(QWheelEvent *event); @@ -102,6 +106,7 @@ class PictureViewer2 : public QGraphicsView { int mCurPos; int mConfigInfoPos; int mConfigMapPos; + int mCursorOffset; QTimer *mSlideTimer; QTimer *mSlideTimerAll; QTimer *mCurTimer; @@ -119,6 +124,7 @@ class PictureViewer2 : public QGraphicsView { QGraphicsTextItem *mSlideAllC; bool mUseGradient; QColor mBgColor; + QColor mDefaultTextColor; QPointF mInfoPos; QPointF mMappingPos; QPointF mBoundingPos; @@ -166,11 +172,19 @@ class BoundingRectItem : public QGraphicsItem { }; class PictureViewerGraphicsScene : public QGraphicsScene { + Q_OBJECT public: explicit PictureViewerGraphicsScene(QObject *parent = 0) : QGraphicsScene(parent) {} + void setCursorOffset(int offset) { mCursorOffset = offset; } + + signals: + void itemClicked(QGraphicsItem *item); protected: virtual void mousePressEvent(QGraphicsSceneMouseEvent *e); + + private: + int mCursorOffset; }; #endif // PICTUREVIEWER2_H -- cgit v1.2.3-70-g09d2