[vlmc-devel] commit: EffectInstanceWidget: Converting from QDialog to QWidget. ( Hugo Beauzée-Luyssen )
git at videolan.org
git at videolan.org
Mon Aug 30 00:55:27 CEST 2010
vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Sun Aug 29 22:52:30 2010 +0200| [7601f7768381a590cf33265aef296a809516aa0a] | committer: Hugo Beauzée-Luyssen
EffectInstanceWidget: Converting from QDialog to QWidget.
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=7601f7768381a590cf33265aef296a809516aa0a
---
src/Gui/effectsengine/EffectInstanceWidget.cpp | 19 +-----
src/Gui/effectsengine/EffectInstanceWidget.h | 11 ++--
src/Gui/effectsengine/ui/EffectInstanceWidget.ui | 78 ++++++++++------------
3 files changed, 42 insertions(+), 66 deletions(-)
diff --git a/src/Gui/effectsengine/EffectInstanceWidget.cpp b/src/Gui/effectsengine/EffectInstanceWidget.cpp
index 80d0b5a..b7611b0 100644
--- a/src/Gui/effectsengine/EffectInstanceWidget.cpp
+++ b/src/Gui/effectsengine/EffectInstanceWidget.cpp
@@ -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 ;
- }
-}
diff --git a/src/Gui/effectsengine/EffectInstanceWidget.h b/src/Gui/effectsengine/EffectInstanceWidget.h
index a5c41ca..f62acf1 100644
--- a/src/Gui/effectsengine/EffectInstanceWidget.h
+++ b/src/Gui/effectsengine/EffectInstanceWidget.h
@@ -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
diff --git a/src/Gui/effectsengine/ui/EffectInstanceWidget.ui b/src/Gui/effectsengine/ui/EffectInstanceWidget.ui
index f2709a2..b74340a 100644
--- a/src/Gui/effectsengine/ui/EffectInstanceWidget.ui
+++ b/src/Gui/effectsengine/ui/EffectInstanceWidget.ui
@@ -1,7 +1,7 @@
<?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>
More information about the Vlmc-devel
mailing list