myIsCycled->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
myIsCycled->setLayoutDirection( Qt::LeftToRight );
myIsCycled->setCheckable( true );
- myIsCycled->setEnabled( false );
+ //myIsCycled->setEnabled( false );
aGridLayout->addWidget( myIsCycled, 2, 2, 1, 1 );
myTimeStampStrings = new QComboBox( aParent );
aHBoxLayout->addWidget( aLabel );
mySpeedSlider = new QSlider( aParent );
- mySpeedSlider->setLayoutDirection( Qt::RightToLeft );
+ mySpeedSlider->setMinimum( 1 );
mySpeedSlider->setMaximum( 100 );
- mySpeedSlider->setValue( 55 );
+ mySpeedSlider->setValue( mySpeedSlider->maximum() / 2 );
+ mySpeedSlider->setPageStep( mySpeedSlider->maximum() / 5 );
+ mySpeedSlider->setTickInterval( mySpeedSlider->pageStep() );
mySpeedSlider->setOrientation( Qt::Horizontal );
mySpeedSlider->setTickPosition( QSlider::TicksBelow );
- mySpeedSlider->setTickInterval( 20 );
aHBoxLayout->addWidget( mySpeedSlider );
aVBoxLayout->addLayout( aHBoxLayout );
{
if( on )
{
- myPlayButton->setIcon( myPlayPixmap );
+ myPlayButton->setIcon( myPausePixmap );
- int delay = int(5000.0 / double(mySpeedSlider->value()));
+ int delay = int( 50.0 * mySpeedSlider->maximum() / mySpeedSlider->value() );
myTimer->start( delay );
}
else
{
myTimer->stop();
- myPlayButton->setIcon( myPausePixmap );
+ myPlayButton->setIcon( myPlayPixmap );
}
}
void VisuGUI_Slider::onSpeedChanged( int value )
{
if(myPlayButton->isChecked()){
- int delay = int(5000.0 / double(mySpeedSlider->value()));
+ int delay = int( 50.0 * mySpeedSlider->maximum() / mySpeedSlider->value() );
myTimer->start( delay );
}
}
void VisuGUI_Slider::onTimeout()
{
int value = mySlider->value();
- if( value < mySlider->maximum() )
+ if ( value < mySlider->maximum() ) {
onNext();
- else
- myPlayButton->setChecked( false );
+ } else {
+ if ( myIsCycled->isChecked() )
+ onFirst();
+ else
+ myPlayButton->setChecked( false );
+ }
}