]> git.sesse.net Git - kdenlive/blobdiff - src/dvdwizardmenu.h
Fix Coverity #980690
[kdenlive] / src / dvdwizardmenu.h
index 85eea94adadc770b54b0fbfa478baf94c9139bf8..8c4dd999ab2ea84c083a1cf9f1228aa4561837e7 100644 (file)
@@ -40,7 +40,7 @@
 
 class DvdScene : public QGraphicsScene
 {
-
+Q_OBJECT
 public:
     DvdScene(QObject * parent = 0): QGraphicsScene(parent) {
         m_width = 0; m_height = 0;
@@ -59,6 +59,14 @@ public:
 private:
     int m_width;
     int m_height;
+    
+protected:
+    void mouseReleaseEvent( QGraphicsSceneMouseEvent * mouseEvent ) {
+       QGraphicsScene::mouseReleaseEvent(mouseEvent);
+       emit sceneChanged();
+    }
+signals:
+    void sceneChanged();
 };
 
 class DvdButtonUnderline : public QGraphicsRectItem
@@ -113,11 +121,11 @@ protected:
 
     virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value) {
         if (change == ItemPositionChange && scene()) {
-            QPointF newPos = value.toPointF();
+            QPoint newPos = value.toPoint();
             QRectF sceneShape = sceneBoundingRect();
             DvdScene *sc = static_cast < DvdScene * >(scene());
-            newPos.setX(qMax(newPos.x(), (qreal)0));
-            newPos.setY(qMax(newPos.y(), (qreal)0));
+            newPos.setX(qMax(newPos.x(), 0));
+            newPos.setY(qMax(newPos.y(), 0));
             if (newPos.x() + sceneShape.width() > sc->width()) newPos.setX(sc->width() - sceneShape.width());
             if (newPos.y() + sceneShape.height() > sc->height()) newPos.setY(sc->height() - sceneShape.height());