From 2afbe2f2dc77da963e6bdd80688452e054ceed51 Mon Sep 17 00:00:00 2001 From: caremoli Date: Mon, 10 Jan 2011 14:48:04 +0000 Subject: [PATCH] CCAR: In transparency dialog set tracking to false to avoid setting transparency for each move of the cursor. The transparency is only set when cursor is up. --- src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx | 12 +++++++++++- src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx index 33940d0a0..6e39d15d0 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx @@ -120,6 +120,7 @@ GEOMToolsGUI_TransparencyDlg::GEOMToolsGUI_TransparencyDlg( QWidget* parent ) mySlider->setSingleStep( 1 ); mySlider->setPageStep( 10 ); //mySlider->setValue( 5 ); + mySlider->setTracking(false); mySlider->setTickPosition( QSlider::TicksLeft ); GroupC1Layout->addWidget( mySlider, 1, 0, 1, 3 ); @@ -155,7 +156,7 @@ GEOMToolsGUI_TransparencyDlg::GEOMToolsGUI_TransparencyDlg( QWidget* parent ) connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(mySlider, SIGNAL(valueChanged(int)), this, SLOT(SetTransparency())); - connect(mySlider, SIGNAL(sliderMoved(int)), this, SLOT(ValueHasChanged())); + connect(mySlider, SIGNAL(sliderMoved(int)), this, SLOT(SliderHasMoved(int))); } @@ -224,6 +225,15 @@ void GEOMToolsGUI_TransparencyDlg::ValueHasChanged() myValueLab->setText( QString("%1%").arg( mySlider->value() ) ); } +//================================================================================= +// function : SliderHasMoved() +// purpose : Called when value of slider change +//================================================================================= +void GEOMToolsGUI_TransparencyDlg::SliderHasMoved(int value) +{ + myValueLab->setText( QString("%1%").arg( value ) ); +} + //================================================================================= // function : SetTransparency() // purpose : Called when value of slider change diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.h b/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.h index 1b05179af..e33303d6c 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.h +++ b/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.h @@ -61,6 +61,7 @@ private slots: void ClickOnClose(); void ClickOnHelp(); void ValueHasChanged(); + void SliderHasMoved(int); void SetTransparency(); };