[vlmc-devel] commit: EffectInstanceWidget: Make the widget promotable. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Mon Aug 30 00:55:28 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Sun Aug 29 23:20:26 2010 +0200| [a921aedafab86911785920c2545a16474573d02a] | committer: Hugo Beauzée-Luyssen 

EffectInstanceWidget: Make the widget promotable.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=a921aedafab86911785920c2545a16474573d02a
---

 src/Gui/effectsengine/EffectInstanceWidget.cpp |   24 +++++++++++++++---------
 src/Gui/effectsengine/EffectInstanceWidget.h   |    4 ++--
 2 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/src/Gui/effectsengine/EffectInstanceWidget.cpp b/src/Gui/effectsengine/EffectInstanceWidget.cpp
index b7611b0..dcbd3a2 100644
--- a/src/Gui/effectsengine/EffectInstanceWidget.cpp
+++ b/src/Gui/effectsengine/EffectInstanceWidget.cpp
@@ -34,20 +34,26 @@
 #include <QLabel>
 #include <QVBoxLayout>
 
-EffectInstanceWidget::EffectInstanceWidget( EffectInstance *effect, QWidget *parent ) :
+EffectInstanceWidget::EffectInstanceWidget( QWidget *parent ) :
     QWidget( parent ),
     m_ui( new Ui::EffectSettingWidget )
 {
     m_ui->setupUi( this );
-    m_ui->nameValueLabel->setText( effect->effect()->name() );
-    m_ui->descValueLabel->setText( effect->effect()->description() );
-    m_ui->typeValueLabel->setText( nameFromType( effect->effect()->type() ) );
-    m_ui->authorValueLabel->setText( effect->effect()->author() );
-    QString version = QString::number( effect->effect()->getMajor() ) + '.' +
-                      QString::number( effect->effect()->getMinor() );
+}
+
+void
+EffectInstanceWidget::setEffectInstance( EffectInstance *instance )
+{
+    m_effect = instance;
+    m_ui->nameValueLabel->setText( instance->effect()->name() );
+    m_ui->descValueLabel->setText( instance->effect()->description() );
+    m_ui->typeValueLabel->setText( nameFromType( instance->effect()->type() ) );
+    m_ui->authorValueLabel->setText( instance->effect()->author() );
+    QString version = QString::number( instance->effect()->getMajor() ) + '.' +
+                      QString::number( instance->effect()->getMinor() );
     m_ui->versionValueLabel->setText( version );
-    EffectInstance::ParamList::iterator         it = effect->params().begin();
-    EffectInstance::ParamList::iterator         ite = effect->params().end();
+    EffectInstance::ParamList::iterator         it = instance->params().begin();
+    EffectInstance::ParamList::iterator         ite = instance->params().end();
     while ( it != ite )
     {
         EffectSettingValue          *s = it.value();
diff --git a/src/Gui/effectsengine/EffectInstanceWidget.h b/src/Gui/effectsengine/EffectInstanceWidget.h
index f62acf1..fb5cbad 100644
--- a/src/Gui/effectsengine/EffectInstanceWidget.h
+++ b/src/Gui/effectsengine/EffectInstanceWidget.h
@@ -38,8 +38,8 @@ class EffectInstanceWidget : public QWidget
     Q_OBJECT
 
     public:
-        explicit EffectInstanceWidget( EffectInstance* effect, QWidget *parent = 0);
-
+        explicit EffectInstanceWidget( QWidget *parent = 0);
+        void        setEffectInstance( EffectInstance* effectInstance );
     private:
         static QString                      nameFromType( Effect::Type type );
         ISettingsCategoryWidget             *widgetFactory( EffectSettingValue *s );



More information about the Vlmc-devel mailing list