#include <qpushbutton.h>
#include <qslider.h>
#include <qspinbox.h>
+#include <qtimer.h>
/*!
Constructor
myTimeStampsNumber->setText( "" );
myTimeStampStrings = new QComboBox( aTopBox );
+ myTimeStampStrings->setFixedWidth( 120 );
myTimeStampIndices = new QComboBox( aTopBox );
+ myTimeStampIndices->setFixedWidth( 50 );
// Buttons
QHBox* aBottomBox = new QHBox( aWidget );
myAVIBox = new QCheckBox( tr( "AVI" ), aBottomBox );
myAVIBox->setEnabled( false );
+ myTimer = new QTimer( this );
+
// Common
aLayout->addWidget( aTopBox );
aLayout->addWidget( aBottomBox );
connect( mySlider, SIGNAL( sliderMoved( int ) ), SLOT( onSliderMoved( int ) ) );
connect( mySlider, SIGNAL( valueChanged( int ) ), SLOT( onValueChanged( int ) ) );
+ connect( myTimer, SIGNAL( timeout() ), SLOT( onTimeout() ) );
+
enableControls( false );
}
void VisuGUI_Slider::onPlay( bool on )
{
- QString aText = on ? "||" : ">";
- myPlayButton->setText( aText );
+ if( on )
+ {
+ myPlayButton->setText( "||" );
+
+ double delay = 5000.0 / ( double )mySpeedBox->value();
+ myTimer->start( delay );
+ }
+ else
+ {
+ myTimer->stop();
+ myPlayButton->setText( ">" );
+ }
}
void VisuGUI_Slider::onNext()
myMainWindow->Repaint();
}
+
+void VisuGUI_Slider::onTimeout()
+{
+ int value = mySlider->value();
+ if( value < mySlider->maxValue() )
+ onNext();
+ else
+ myPlayButton->setOn( false );
+}