[vlmc-devel] commit: GraphicsItem: Adding signals/ slot to watch effect container movements ( Hugo Beauzée-Luyssen )
git at videolan.org
git at videolan.org
Thu Sep 16 01:36:12 CEST 2010
vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Thu Sep 16 01:36:27 2010 +0200| [09d27c79a586eaff5d84ff52839694dc3de010b1] | committer: Hugo Beauzée-Luyssen
GraphicsItem: Adding signals/slot to watch effect container movements
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=09d27c79a586eaff5d84ff52839694dc3de010b1
---
src/Gui/timeline/AbstractGraphicsItem.h | 3 +++
src/Gui/timeline/AbstractGraphicsMediaItem.cpp | 7 +++++++
src/Gui/timeline/AbstractGraphicsMediaItem.h | 1 +
src/Gui/timeline/GraphicsEffectItem.cpp | 5 +++++
src/Gui/timeline/GraphicsEffectItem.h | 2 ++
5 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/src/Gui/timeline/AbstractGraphicsItem.h b/src/Gui/timeline/AbstractGraphicsItem.h
index 99f085f..3fe0a61 100644
--- a/src/Gui/timeline/AbstractGraphicsItem.h
+++ b/src/Gui/timeline/AbstractGraphicsItem.h
@@ -185,6 +185,9 @@ class AbstractGraphicsItem : public QObject, public QGraphicsItem
*/
void adjustLength();
+ signals:
+ void moved( qint64 pos );
+
friend class TracksView;
};
diff --git a/src/Gui/timeline/AbstractGraphicsMediaItem.cpp b/src/Gui/timeline/AbstractGraphicsMediaItem.cpp
index 31fc6e8..38512e5 100644
--- a/src/Gui/timeline/AbstractGraphicsMediaItem.cpp
+++ b/src/Gui/timeline/AbstractGraphicsMediaItem.cpp
@@ -311,3 +311,10 @@ AbstractGraphicsMediaItem::zNotSelected() const
{
return 50;
}
+
+void
+AbstractGraphicsMediaItem::setStartPos( qint64 position )
+{
+ emit moved( position );
+ AbstractGraphicsItem::setStartPos( position );
+}
diff --git a/src/Gui/timeline/AbstractGraphicsMediaItem.h b/src/Gui/timeline/AbstractGraphicsMediaItem.h
index 3c5e570..df47ff4 100644
--- a/src/Gui/timeline/AbstractGraphicsMediaItem.h
+++ b/src/Gui/timeline/AbstractGraphicsMediaItem.h
@@ -63,6 +63,7 @@ public:
virtual qint64 itemHeight() const;
virtual qint32 zSelected() const;
virtual qint32 zNotSelected() const;
+ virtual void setStartPos( qint64 position );
protected:
virtual void contextMenuEvent( QGraphicsSceneContextMenuEvent* event );
diff --git a/src/Gui/timeline/GraphicsEffectItem.cpp b/src/Gui/timeline/GraphicsEffectItem.cpp
index da977ca..391aa9f 100644
--- a/src/Gui/timeline/GraphicsEffectItem.cpp
+++ b/src/Gui/timeline/GraphicsEffectItem.cpp
@@ -276,3 +276,8 @@ GraphicsEffectItem::zNotSelected() const
return 200;
}
+void
+GraphicsEffectItem::containerMoved( qint64 pos )
+{
+ setStartPos( m_effectHelper->begin() + pos );
+}
diff --git a/src/Gui/timeline/GraphicsEffectItem.h b/src/Gui/timeline/GraphicsEffectItem.h
index 76baaa2..55aa4fc 100644
--- a/src/Gui/timeline/GraphicsEffectItem.h
+++ b/src/Gui/timeline/GraphicsEffectItem.h
@@ -70,6 +70,8 @@ class GraphicsEffectItem : public AbstractGraphicsItem
* \param option Painting options.
*/
void paintTitle( QPainter* painter, const QStyleOptionGraphicsItem* option );
+ private slots:
+ void containerMoved( qint64 pos );
private:
Effect *m_effect;
More information about the Vlmc-devel
mailing list