mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-29 06:50:33 +05:00
Fix for bug IPAL18578 (Qt4 porting: Menu - New Entity - Sketch: self activation of Apply button. Impossible to work).
This commit is contained in:
parent
7de585b1b9
commit
90400ffdc0
@ -217,26 +217,17 @@ EntityGUI_SketcherDlg::EntityGUI_SketcherDlg( GeometryGUI* GUI, QWidget* parent,
|
|||||||
connect( myGeometryGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) );
|
connect( myGeometryGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) );
|
||||||
connect( myGeometryGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) );
|
connect( myGeometryGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) );
|
||||||
|
|
||||||
connect( Group1Spin->SpinBox_DX, SIGNAL( editingFinished() ),
|
// install event filter on spin-boxes to provide Apply action on Return pressed
|
||||||
Group1Spin->buttonApply, SLOT( animateClick() ) );
|
Group1Spin->SpinBox_DX->installEventFilter(this);
|
||||||
connect( Group2Spin->SpinBox_DX, SIGNAL( editingFinished() ),
|
Group2Spin->SpinBox_DX->installEventFilter(this);
|
||||||
Group2Spin->buttonApply, SLOT( animateClick() ) );
|
Group2Spin->SpinBox_DY->installEventFilter(this);
|
||||||
connect( Group2Spin->SpinBox_DY, SIGNAL( editingFinished() ),
|
Group3Spin->SpinBox_DX->installEventFilter(this);
|
||||||
Group2Spin->buttonApply, SLOT( animateClick() ) );
|
Group3Spin->SpinBox_DY->installEventFilter(this);
|
||||||
connect( Group3Spin->SpinBox_DX, SIGNAL( editingFinished() ),
|
Group3Spin->SpinBox_DZ->installEventFilter(this);
|
||||||
Group3Spin->buttonApply, SLOT( animateClick() ) );
|
Group4Spin->SpinBox_DX->installEventFilter(this);
|
||||||
connect( Group3Spin->SpinBox_DY, SIGNAL( editingFinished() ),
|
Group4Spin->SpinBox_DY->installEventFilter(this);
|
||||||
Group3Spin->buttonApply, SLOT( animateClick() ) );
|
Group4Spin->SpinBox_DZ->installEventFilter(this);
|
||||||
connect( Group3Spin->SpinBox_DZ, SIGNAL( editingFinished() ),
|
Group4Spin->SpinBox_DS->installEventFilter(this);
|
||||||
Group3Spin->buttonApply, SLOT( animateClick() ) );
|
|
||||||
connect( Group4Spin->SpinBox_DX, SIGNAL( editingFinished() ),
|
|
||||||
Group4Spin->buttonApply, SLOT( animateClick() ) );
|
|
||||||
connect( Group4Spin->SpinBox_DY, SIGNAL( editingFinished() ),
|
|
||||||
Group4Spin->buttonApply, SLOT( animateClick() ) );
|
|
||||||
connect( Group4Spin->SpinBox_DZ, SIGNAL( editingFinished() ),
|
|
||||||
Group4Spin->buttonApply, SLOT( animateClick() ) );
|
|
||||||
connect( Group4Spin->SpinBox_DS, SIGNAL( editingFinished() ),
|
|
||||||
Group4Spin->buttonApply, SLOT( animateClick() ) );
|
|
||||||
|
|
||||||
Init();
|
Init();
|
||||||
}
|
}
|
||||||
@ -252,6 +243,49 @@ EntityGUI_SketcherDlg::~EntityGUI_SketcherDlg()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : eventFilter()
|
||||||
|
// purpose : event filter for spin-boxes to provide Apply action on Return pressed
|
||||||
|
//=================================================================================
|
||||||
|
bool EntityGUI_SketcherDlg::eventFilter (QObject* object, QEvent* event)
|
||||||
|
{
|
||||||
|
if (event->type() == QEvent::KeyPress) {
|
||||||
|
QKeyEvent* ke = (QKeyEvent*)event;
|
||||||
|
if (ke->key() == Qt::Key_Return) {
|
||||||
|
if (object == Group1Spin->SpinBox_DX) {
|
||||||
|
Group1Spin->buttonApply->animateClick();
|
||||||
|
return true;
|
||||||
|
} else if (object == Group2Spin->SpinBox_DX ||
|
||||||
|
object == Group2Spin->SpinBox_DY) {
|
||||||
|
Group2Spin->buttonApply->animateClick();
|
||||||
|
return true;
|
||||||
|
} else if (object == Group3Spin->SpinBox_DX ||
|
||||||
|
object == Group3Spin->SpinBox_DY ||
|
||||||
|
object == Group3Spin->SpinBox_DZ) {
|
||||||
|
Group3Spin->buttonApply->animateClick();
|
||||||
|
return true;
|
||||||
|
} else if (object == Group4Spin->SpinBox_DX ||
|
||||||
|
object == Group4Spin->SpinBox_DY ||
|
||||||
|
object == Group4Spin->SpinBox_DZ ||
|
||||||
|
object == Group4Spin->SpinBox_DS) {
|
||||||
|
Group4Spin->buttonApply->animateClick();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event->type() == QEvent::KeyRelease) {
|
||||||
|
// NPAL16010 (Sketcher Apply non available if only one line is modified)
|
||||||
|
// To have Apply active as soon as value text changed
|
||||||
|
QDoubleSpinBox* aDoubleSpinBox = (QDoubleSpinBox*)object;
|
||||||
|
if (aDoubleSpinBox)
|
||||||
|
ValueChangedInSpinBox( aDoubleSpinBox->value() );
|
||||||
|
}
|
||||||
|
|
||||||
|
return QDialog::eventFilter(object, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : Init()
|
// function : Init()
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -1498,4 +1532,3 @@ void EntityGUI_SketcherDlg::SetDoubleSpinBoxStep( double step )
|
|||||||
Group4Spin->SpinBox_DZ->setSingleStep(step);
|
Group4Spin->SpinBox_DZ->setSingleStep(step);
|
||||||
Group4Spin->SpinBox_DS->setSingleStep(step);
|
Group4Spin->SpinBox_DS->setSingleStep(step);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,6 +63,8 @@ public:
|
|||||||
const double = 2. );
|
const double = 2. );
|
||||||
~EntityGUI_SketcherDlg();
|
~EntityGUI_SketcherDlg();
|
||||||
|
|
||||||
|
bool eventFilter (QObject* object, QEvent* event);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void initSpinBox( QDoubleSpinBox*,
|
void initSpinBox( QDoubleSpinBox*,
|
||||||
double, double, double = 0.1,
|
double, double, double = 0.1,
|
||||||
|
Loading…
Reference in New Issue
Block a user