From dc85c32ef5531220f7aeade287037eee580d91d3 Mon Sep 17 00:00:00 2001 From: apo Date: Fri, 3 Nov 2006 14:18:38 +0000 Subject: [PATCH] To improve layouting system --- src/VISUGUI/VisuGUI_Slider.cxx | 67 ++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 24 deletions(-) diff --git a/src/VISUGUI/VisuGUI_Slider.cxx b/src/VISUGUI/VisuGUI_Slider.cxx index d4b69b82..dff1bac4 100644 --- a/src/VISUGUI/VisuGUI_Slider.cxx +++ b/src/VISUGUI/VisuGUI_Slider.cxx @@ -77,75 +77,94 @@ VisuGUI_Slider::VisuGUI_Slider( VVTK_ViewWindow* theViewWondow, QWidget* aWidget = new QWidget( this ); setWidget( aWidget ); - QVBoxLayout* aLayout = new QVBoxLayout( aWidget, 11, 6 ); + QVBoxLayout* aBasicLayout = new QVBoxLayout( aWidget, 11, 6 ); // Slider and time stamps - QHBox* aTopBox = new QHBox( aWidget ); - aTopBox->setSpacing( 6 ); + QHBoxLayout* aSliderLayout = new QHBoxLayout( 0, 0, 6); - myFirstTimeStamp = new QLabel( aTopBox ); + myFirstTimeStamp = new QLabel( aWidget ); myFirstTimeStamp->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); myFirstTimeStamp->setText( "" ); + aSliderLayout->addWidget( myFirstTimeStamp ); - mySlider = new QSlider( 0, 1, 1, 0, Qt::Horizontal, aTopBox ); - //mySlider->setTickmarks( QSlider::Below ); + mySlider = new QSlider( aWidget ); mySlider->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + mySlider->setOrientation( QSlider::Horizontal ); + //mySlider->setTickmarks( QSlider::Below ); mySlider->setTracking( false ); + aSliderLayout->addWidget( mySlider ); - myLastTimeStamp = new QLabel( aTopBox ); + myLastTimeStamp = new QLabel( aWidget ); myLastTimeStamp->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); myLastTimeStamp->setText( "" ); + aSliderLayout->addWidget( myLastTimeStamp ); - myTimeStampsNumber = new QLabel( aTopBox ); + myTimeStampsNumber = new QLabel( aWidget ); myTimeStampsNumber->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); myTimeStampsNumber->setText( "" ); + aSliderLayout->addWidget( myTimeStampsNumber ); - myTimeStampStrings = new QComboBox( aTopBox ); + myTimeStampStrings = new QComboBox( aWidget ); myTimeStampStrings->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); + aSliderLayout->addWidget( myTimeStampStrings ); - myTimeStampIndices = new QComboBox( aTopBox ); + myTimeStampIndices = new QComboBox( aWidget ); myTimeStampIndices->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); + aSliderLayout->addWidget( myTimeStampIndices ); + aBasicLayout->addLayout( aSliderLayout ); // Buttons - QHBox* aBottomBox = new QHBox( aWidget ); - aBottomBox->setSpacing( 6 ); + QHBoxLayout* aButtonsLayout = new QHBoxLayout( 0, 0, 6); - myMoreButton = new QPushButton( tr( "MORE" ), aBottomBox ); + myMoreButton = new QPushButton( tr( "MORE" ), aWidget ); myMoreButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); myMoreButton->setToggleButton( true ); myMoreButton->setEnabled( false ); + aButtonsLayout->addWidget( myMoreButton ); + + aButtonsLayout->addItem( new QSpacerItem( 16, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); - myFirstButton = new QPushButton( tr( "|<<" ), aBottomBox ); + myFirstButton = new QPushButton( tr( "|<<" ), aWidget ); myFirstButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); + aButtonsLayout->addWidget( myFirstButton ); - myPreviousButton = new QPushButton( tr( "<<" ), aBottomBox ); + myPreviousButton = new QPushButton( tr( "<<" ), aWidget ); myPreviousButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); + aButtonsLayout->addWidget( myPreviousButton ); - myPlayButton = new QPushButton( tr( ">" ), aBottomBox ); + myPlayButton = new QPushButton( tr( ">" ), aWidget ); myPlayButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); myPlayButton->setToggleButton( true ); + aButtonsLayout->addWidget( myPlayButton ); - myNextButton = new QPushButton( tr( ">>" ), aBottomBox ); + myNextButton = new QPushButton( tr( ">>" ), aWidget ); myNextButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); + aButtonsLayout->addWidget( myNextButton ); - myLastButton = new QPushButton( tr( ">>|" ), aBottomBox ); + myLastButton = new QPushButton( tr( ">>|" ), aWidget ); myLastButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); + aButtonsLayout->addWidget( myLastButton ); - new QLabel( tr( "SPEED" ), aBottomBox ); - mySpeedBox = new QSpinBox( 1, 100, 1, aBottomBox ); + aButtonsLayout->addItem( new QSpacerItem( 16, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); + + QLabel* aSpeedLabel = new QLabel( tr( "SPEED" ), aWidget ); + aSpeedLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); + aButtonsLayout->addWidget( aSpeedLabel ); + + mySpeedBox = new QSpinBox( 1, 100, 1, aWidget ); mySpeedBox->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); mySpeedBox->setValue( 50 ); + aButtonsLayout->addWidget( mySpeedBox ); - myAVIBox = new QCheckBox( tr( "AVI" ), aBottomBox ); + myAVIBox = new QCheckBox( tr( "AVI" ), aWidget ); myAVIBox->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); myAVIBox->setEnabled( false ); + aButtonsLayout->addWidget( myAVIBox ); + aBasicLayout->addLayout( aButtonsLayout ); myTimer = new QTimer( this ); // Common - aLayout->addWidget( aTopBox ); - aLayout->addWidget( aBottomBox ); - connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), SLOT( onSelectionChanged() ) ); connect( myTimeStampStrings, SIGNAL( activated( int ) ), SLOT( onTimeStampActivated( int ) ) ); -- 2.39.2