From 0483d4913603935dda9cd60e2e473d68134dea0a Mon Sep 17 00:00:00 2001 From: apo Date: Thu, 24 May 2007 06:11:26 +0000 Subject: [PATCH] Fix for Bug IPAL15982 - IOLS. Incorrect work of play slider with mouse --- src/VISUGUI/VisuGUI_Slider.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/VISUGUI/VisuGUI_Slider.cxx b/src/VISUGUI/VisuGUI_Slider.cxx index e28de0dc..fbc6cc00 100644 --- a/src/VISUGUI/VisuGUI_Slider.cxx +++ b/src/VISUGUI/VisuGUI_Slider.cxx @@ -90,6 +90,7 @@ VisuGUI_Slider::VisuGUI_Slider( VisuGUI_Module* theModule, setHorizontallyStretchable( true ); QWidget* aWidget = new QWidget( this ); + aWidget->setFocusPolicy(StrongFocus); setWidget( aWidget ); QGridLayout* aLayout = new QGridLayout( aWidget, 2, 13, 11, 6 ); @@ -104,6 +105,7 @@ VisuGUI_Slider::VisuGUI_Slider( VisuGUI_Module* theModule, mySlider->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); mySlider->setOrientation( QSlider::Horizontal ); mySlider->setTracking( false ); + mySlider->setFocusPolicy(StrongFocus); aLayout->addMultiCellWidget( mySlider, 0, 0, 1, 8 ); myLastTimeStamp = new QLabel( aWidget ); @@ -170,10 +172,12 @@ VisuGUI_Slider::VisuGUI_Slider( VisuGUI_Module* theModule, myTimeStampStrings = new QComboBox( aWidget ); myTimeStampStrings->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); + myTimeStampStrings->setFocusPolicy(StrongFocus); aLayout->addWidget( myTimeStampStrings, 1, 9 ); myTimeStampIndices = new QComboBox( aWidget ); myTimeStampIndices->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); + myTimeStampIndices->setFocusPolicy(StrongFocus); aLayout->addWidget( myTimeStampIndices, 1, 10 ); // Speed @@ -183,6 +187,7 @@ VisuGUI_Slider::VisuGUI_Slider( VisuGUI_Module* theModule, mySpeedBox = new QSpinBox( 1, 100, 1, aWidget ); mySpeedBox->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); + mySpeedBox->setFocusPolicy(StrongFocus); mySpeedBox->setValue( 50 ); aLayout->addWidget( mySpeedBox, 1, 12 ); @@ -255,6 +260,10 @@ void VisuGUI_Slider::enableControls( bool on ) myLastTimeStamp->setText( aTimeStampsRange[aLength-1].myTime.in() ); myTimeStampsNumber->setText( QString("(") + QString::number( aLength ) + ")" ); + int aPageStep = aLength / 10; + aPageStep = std::max(aPageStep, 1); + mySlider->setPageStep(aPageStep); + CORBA::Long a_current_index = 0; for( CORBA::Long an_index = 0; an_index < aLength; an_index++ ) { -- 2.39.2