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

EffectInstanceWidget: Converting from QDialog to QWidget.

parent 376e3d75
......@@ -35,7 +35,7 @@
#include <QVBoxLayout>
EffectInstanceWidget::EffectInstanceWidget( EffectInstance *effect, QWidget *parent ) :
QDialog( parent ),
QWidget( parent ),
m_ui( new Ui::EffectSettingWidget )
{
m_ui->setupUi( this );
......@@ -58,8 +58,8 @@ EffectInstanceWidget::EffectInstanceWidget( EffectInstance *effect, QWidget *par
m_settings.push_back( widget );
++it;
}
connect( m_ui->buttons, SIGNAL( clicked( QAbstractButton* ) ),
this, SLOT( buttonsClicked( QAbstractButton* ) ) );
connect( m_ui->applyButton, SIGNAL( clicked() ),
this, SLOT( save() ) );
}
QString
......@@ -102,16 +102,3 @@ EffectInstanceWidget::save()
foreach ( ISettingsCategoryWidget* val, m_settings )
val->save();
}
void
EffectInstanceWidget::buttonsClicked( QAbstractButton *button )
{
switch ( m_ui->buttons->standardButton( button ) )
{
case QDialogButtonBox::Ok:
case QDialogButtonBox::Apply:
save();
default:
break ;
}
}
......@@ -23,7 +23,7 @@
#ifndef EFFECTINSTANCEWIDGET_H
#define EFFECTINSTANCEWIDGET_H
#include <QDialog>
#include <QWidget>
class EffectInstance;
class EffectSettingValue;
......@@ -33,7 +33,7 @@ class EffectSettingValue;
class ISettingsCategoryWidget;
class EffectInstanceWidget : public QDialog
class EffectInstanceWidget : public QWidget
{
Q_OBJECT
......@@ -43,14 +43,13 @@ class EffectInstanceWidget : public QDialog
private:
static QString nameFromType( Effect::Type type );
ISettingsCategoryWidget *widgetFactory( EffectSettingValue *s );
void save();
private:
EffectInstance *m_effect;
QList<ISettingsCategoryWidget*> m_settings;
Ui::EffectSettingWidget *m_ui;
private slots:
void buttonsClicked( QAbstractButton* button );
};
public slots:
void save();
};
#endif // EFFECTINSTANCEWIDGET_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>EffectSettingWidget</class>
<widget class="QDialog" name="EffectSettingWidget">
<widget class="QWidget" name="EffectSettingWidget">
<property name="geometry">
<rect>
<x>0</x>
......@@ -156,7 +156,7 @@
<x>0</x>
<y>0</y>
<width>386</width>
<height>145</height>
<height>147</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
......@@ -168,50 +168,40 @@
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttons">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="topMargin">
<number>0</number>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="applyButton">
<property name="text">
<string>Apply</string>
</property>
<property name="icon">
<iconset resource="../../../../resources.qrc">
<normaloff>:/images/ok</normaloff>:/images/ok</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttons</sender>
<signal>accepted()</signal>
<receiver>EffectSettingWidget</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttons</sender>
<signal>rejected()</signal>
<receiver>EffectSettingWidget</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
<resources>
<include location="../../../../resources.qrc"/>
</resources>
<connections/>
</ui>
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