#include "spectrum.h"
#include <qlayout.h>
+#include <qlabel.h>
#include <kglobal.h>
#include <kstandarddirs.h>
QHBoxLayout *hbox = new QHBoxLayout( this );
m_spinbox_left = new QSpinBox( 380, 779, 1, this );
m_spinbox_right = new QSpinBox( 381, 780, 1, this );
+ m_spinbox_right->setValue( 700 );
+ m_spinbox_left->setValue( 400 );
+
+ connect( m_spinbox_right, SIGNAL( valueChanged( int ) ), m_spectrum, SLOT( setRightBorder( int ) ) );
+ connect( m_spinbox_left, SIGNAL( valueChanged( int ) ), m_spectrum, SLOT( setLeftBorder( int ) ) );
+
+ hbox->addWidget( new QLabel( i18n( "Minimumvalue" ), this ) );
hbox->addWidget( m_spinbox_left );
+ hbox->addWidget( new QLabel( i18n( "Maximumvalue" ), this ) );
hbox->addWidget( m_spinbox_right );
spectrumLayout->addLayout( hbox );
int m_realHeight;
double m_stretch;
+
+ public slots:
+ /**
+ * set the the minimumvalue to @p value
+ */
+ void setRightBorder( int value ){
+ endValue = value;
+ if ( endValue < startValue )
+ startValue = endValue-1;
+ update();
+ }
+
+ /**
+ * set the the maximumvalue to @p value
+ */
+ void setLeftBorder( int value ){
+ startValue = value;
+ if ( startValue > endValue )
+ endValue = startValue+1;
+ update();
+ }
protected:
virtual void paintEvent( QPaintEvent *e );