[vlmc-devel] [PATCH 2/3] ProjectWizard: Set proper values to sample/bitrate settingvalues
Yikai Lu
luyikei.qmltu at gmail.com
Sun Apr 10 16:25:28 CEST 2016
For QComboBox, just doing field( "samplerate" ) will get the currentIndex, which is wrong.
---
src/Gui/wizard/ProjectWizard.cpp | 4 ++--
src/Gui/wizard/VideoPage.cpp | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/Gui/wizard/ProjectWizard.cpp b/src/Gui/wizard/ProjectWizard.cpp
index 5607b29..f1ba18a 100644
--- a/src/Gui/wizard/ProjectWizard.cpp
+++ b/src/Gui/wizard/ProjectWizard.cpp
@@ -113,8 +113,8 @@ ProjectWizard::accept()
projectPreferences->setValue( "video/VideoProjectWidth", field( "width" ) );
projectPreferences->setValue( "video/AspectRatio", field( "aspectratio" ) );
projectPreferences->setValue( "video/VideoBitRate", field( "vbitrate" ) );
- projectPreferences->setValue( "audio/AudioSampleRate", field( "samplerate" ) );
- projectPreferences->setValue( "audio/AudioBitRate", field( "abitrate" ) );
+ projectPreferences->setValue( "audio/AudioSampleRate", field( "samplerate" ).toString().replace( " Hz", "" ) );
+ projectPreferences->setValue( "audio/AudioBitRate", field( "abitrate" ).toString().replace( " Kbps", "" ) );
projectPreferences->setValue( "audio/NbChannels", field( "samplerate" ) );
}
QDialog::accept();
diff --git a/src/Gui/wizard/VideoPage.cpp b/src/Gui/wizard/VideoPage.cpp
index b997c3c..53c2b05 100644
--- a/src/Gui/wizard/VideoPage.cpp
+++ b/src/Gui/wizard/VideoPage.cpp
@@ -41,9 +41,9 @@ VideoPage::VideoPage( QWidget* parent ) :
registerField( "width", ui.spinBoxVideoWidth );
registerField( "height", ui.spinBoxVideoHeight );
registerField( "aspectratio", ui.lineEditVideoAspectRatio );
- registerField( "samplerate", ui.comboBoxAudioSamplerate );
+ registerField( "samplerate", ui.comboBoxAudioSamplerate, "currentText" );
registerField( "channels", ui.spinBoxAudioChannels );
- registerField( "abitrate", ui.comboBoxAudioBitrate );
+ registerField( "abitrate", ui.comboBoxAudioBitrate, "currentText" );
registerField( "vbitrate", ui.spinBoxVideoBitrate );
}
--
1.9.1
More information about the Vlmc-devel
mailing list