X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmonitorscene.h;h=f5efa8e93f0566bebb49cadf907105b361922e39;hb=c3302003093710ee247ad84c0fe2ef3c579d417f;hp=c0f75bc49460d7f5d95dd67a6c3e867d2b89fa9a;hpb=81be3bf632b306ffd8795f0c81d4372e358e88d2;p=kdenlive diff --git a/src/monitorscene.h b/src/monitorscene.h index c0f75bc4..f5efa8e9 100644 --- a/src/monitorscene.h +++ b/src/monitorscene.h @@ -31,7 +31,7 @@ class MonitorScene : public QGraphicsScene { Q_OBJECT public: - MonitorScene(Render *renderer, QObject* parent = 0); + explicit MonitorScene(Render *renderer, QObject* parent = 0); /** @brief Sets m_view to this scenes view. */ void setUp(); @@ -42,13 +42,21 @@ public: /** @brief Makes the background frame fit again after the profile changed (and therefore the resolution might have changed). */ void resetProfile(); + + /** @brief Reset scene size. */ + void cleanup(); + + /** @brief Center view on frame border. */ + void centerView(); protected: - virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event); + void mousePressEvent(QGraphicsSceneMouseEvent *event); + void mouseMoveEvent(QGraphicsSceneMouseEvent *event); + void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); /** @brief Adds a keyframe if scene is disabled. */ - virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); + void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); /** @brief Reimplemented to allow zooming using ctrl + mouse wheel. */ - virtual void wheelEvent(QGraphicsSceneWheelEvent *event); + void wheelEvent(QGraphicsSceneWheelEvent *event); public slots: /** @brief Sets the backgrounditem's pixmap to m_backgroundImage (only if a certain amount of time has passed since last update). */ @@ -79,6 +87,8 @@ private: QImage m_backgroundImage; bool m_enabled; qreal m_zoom; + bool m_groupMove; + QPointF m_lastPos; signals: void zoomChanged(int);