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.
This commit is contained in:
caremoli 2011-01-10 14:48:04 +00:00
parent 03f77667e6
commit 2afbe2f2dc
2 changed files with 12 additions and 1 deletions

View File

@ -120,6 +120,7 @@ GEOMToolsGUI_TransparencyDlg::GEOMToolsGUI_TransparencyDlg( QWidget* parent )
mySlider->setSingleStep( 1 ); mySlider->setSingleStep( 1 );
mySlider->setPageStep( 10 ); mySlider->setPageStep( 10 );
//mySlider->setValue( 5 ); //mySlider->setValue( 5 );
mySlider->setTracking(false);
mySlider->setTickPosition( QSlider::TicksLeft ); mySlider->setTickPosition( QSlider::TicksLeft );
GroupC1Layout->addWidget( mySlider, 1, 0, 1, 3 ); 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(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(mySlider, SIGNAL(valueChanged(int)), this, SLOT(SetTransparency())); 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() ) ); 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() // function : SetTransparency()
// purpose : Called when value of slider change // purpose : Called when value of slider change

View File

@ -61,6 +61,7 @@ private slots:
void ClickOnClose(); void ClickOnClose();
void ClickOnHelp(); void ClickOnHelp();
void ValueHasChanged(); void ValueHasChanged();
void SliderHasMoved(int);
void SetTransparency(); void SetTransparency();
}; };