Commit a921aeda authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

EffectInstanceWidget: Make the widget promotable.

parent 94a45f31
......@@ -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();
......
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment