]> git.sesse.net Git - kdenlive/blobdiff - src/onmonitoritems/onmonitorrectitem.h
Integrate with the required MLT hooks for getting Movit to work.
[kdenlive] / src / onmonitoritems / onmonitorrectitem.h
index 047f3e6a191c8a894bb5a0e663be06b60322e26d..6530495fa10acd4d716aabb7157c4838a390cd63 100644 (file)
 #define ONMONITORRECTITEM_H
 
 
-#include <QtCore>
 #include <QGraphicsRectItem>
 
+class QGraphicsView;
+
 enum rectActions { Move, ResizeTopLeft, ResizeBottomLeft, ResizeTopRight, ResizeBottomRight, ResizeLeft, ResizeRight, ResizeTop, ResizeBottom, NoAction };
 
+
 class OnMonitorRectItem : public QObject, public QGraphicsRectItem
 {
     Q_OBJECT
@@ -35,16 +37,16 @@ public:
 
     /** @brief Gets The action mode for the area @param pos +- 4.
      * e.g. pos(0,0) returns ResizeTopLeft */
-    rectActions getMode(QPointF pos);
+    rectActions getMode(const QPointF &pos);
 
     /** @brief Reimplemented to draw the handles. */
     virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0 );
 
 protected:
-    virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
-    virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
-    virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
-    virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
+    void mousePressEvent(QGraphicsSceneMouseEvent *event);
+    void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
+    void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
+    void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
 
 private:
     double m_dar;
@@ -53,6 +55,11 @@ private:
     QPointF m_lastPoint;
     bool m_modified;
 
+    QGraphicsView *m_view;
+
+    /** @brief Tries to get the view of the scene. */
+    bool getView();
+
 signals:
     void changed();
 };