changeset 277:960531792d88

Equalizer property box is a bit modify
author benoitrigolleau
date Thu, 16 Oct 2008 09:13:21 +0000
parents a9af42a93073
children 65dfc1027ed6
files sv/filter/EqualizerFilter.cpp widgets/PropertyBox.cpp widgets/Slider.cpp widgets/Slider.h
diffstat 4 files changed, 35 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/sv/filter/EqualizerFilter.cpp	Wed Oct 15 16:18:18 2008 +0000
+++ b/sv/filter/EqualizerFilter.cpp	Thu Oct 16 09:13:21 2008 +0000
@@ -112,7 +112,7 @@
 
 QString EqualizerFilter::getPropertyGroupName(const PropertyName &name) const
 {
-	if (name.left(8) == "GainBand") return "GainBand";
+	if (name.left(8) == "GainBand") return " ";
 	if ((name == "Equalizer") || (name == "DrawCurve")) return "Draw Curve";
     return QString();
 }
--- a/widgets/PropertyBox.cpp	Wed Oct 15 16:18:18 2008 +0000
+++ b/widgets/PropertyBox.cpp	Thu Oct 16 09:13:21 2008 +0000
@@ -443,9 +443,28 @@
 				slider->setOrientation(Qt::Vertical);
 				slider->setFixedWidth(48);
 				slider->setFixedHeight(100);
-				m_groupLayouts[groupName]->addWidget(slider);
+				
+				//HotFIX for the equalizer
+
+				if(groupName==" "){
+					slider->setShowToolTip(false);
+					slider->useLabel(false);
+					QWidget *widaux = new QWidget;
+					QGridLayout *equalizerLayout = new QGridLayout();
+					equalizerLayout->setMargin(1);
+					equalizerLayout->setSpacing(0);
+
+					widaux->setLayout(equalizerLayout);
+					equalizerLayout->addWidget(new QLabel("+6db"),0,0,Qt::AlignBottom);
+					equalizerLayout->addWidget(new QLabel("-inf"),2,0,Qt::AlignTop);
+					equalizerLayout->addWidget(slider,1,0,1,1,Qt::AlignLeft);
+					
+					m_groupLayouts[groupName]->addWidget(widaux);
+				}else{
+					m_groupLayouts[groupName]->addWidget(slider);
+				}
 				connect(m_container, SIGNAL(enableDrawCurve(bool)), slider, SLOT(setDisabled(bool)));
-
+				//</HoTFIX>
 			} else {
 				slider->setFixedWidth(100);
 				slider->setFixedHeight(32);
--- a/widgets/Slider.cpp	Wed Oct 15 16:18:18 2008 +0000
+++ b/widgets/Slider.cpp	Thu Oct 16 09:13:21 2008 +0000
@@ -139,4 +139,15 @@
         }
         setToolTip(text);
     }
+}
+
+void Slider::useLabel(bool val){
+	if(val){
+		connect(m_slider, SIGNAL(valueChanged(int)), m_label, SLOT(setNum(int)));
+		m_label->setVisible(true);
+	}else{
+		disconnect(m_slider, SIGNAL(valueChanged(int)), m_label, SLOT(setNum(int)));
+		m_label->setVisible(false);
+		m_label->setText("");
+	}
 }
\ No newline at end of file
--- a/widgets/Slider.h	Wed Oct 15 16:18:18 2008 +0000
+++ b/widgets/Slider.h	Thu Oct 16 09:13:21 2008 +0000
@@ -38,6 +38,8 @@
 
 	inline int value () const {return m_slider->value();}
 	inline void setValue(int value) {m_slider->setValue(value); m_label->setNum(value);}
+
+	void useLabel(bool val);
 
 
 signals: