bool isModified = myXSpin->isModified() || myYSpin->isModified();
if (isModified) {
bool isXModified = myXSpin->isModified();
- emit valuesChanged();
+ onValuesChanged();
myXSpin->clearModified();
myYSpin->clearModified();
if (isXModified)
bool XGUI_OperationMgr::onKeyReleased(QKeyEvent* theEvent)
{
- qDebug("XGUI_OperationMgr::onKeyReleased");
-
QObject* aSender = sender();
// Let the manager decide what to do with the given key combination.
switch (theEvent->key()) {
case Qt::Key_Return:
case Qt::Key_Enter: {
- qDebug("XGUI_OperationMgr::onKeyReleased: Key_Return");
ModuleBase_Operation* aOperation = currentOperation();
ModuleBase_IPropertyPanel* aPanel = aOperation->propertyPanel();
ModuleBase_ModelWidget* aActiveWgt = aPanel->activeWidget();
else
isAccepted = false;
}
- //else
- // isAccepted = false;
}
+ break;
case Qt::Key_N:
case Qt::Key_P: {
bool noModifiers = (theEvent->modifiers() == Qt::NoModifier);
void XGUI_PropertyPanel::activateWidget(ModuleBase_ModelWidget* theWidget)
{
// Avoid activation of already actve widget. It could happen on focusIn event many times
- setActiveWidget(theWidget);
-
- if (myActiveWidget) {
- emit widgetActivated(myActiveWidget);
- } else if (!isEditingMode()) {
- emit noMoreWidgets();
- setFocusOnOkButton();
+ if (setActiveWidget(theWidget)) {
+ if (myActiveWidget) {
+ emit widgetActivated(myActiveWidget);
+ } else if (!isEditingMode()) {
+ emit noMoreWidgets();
+ setFocusOnOkButton();
+ }
}
}
-void XGUI_PropertyPanel::setActiveWidget(ModuleBase_ModelWidget* theWidget)
+bool XGUI_PropertyPanel::setActiveWidget(ModuleBase_ModelWidget* theWidget)
{
// Avoid activation of already actve widget. It could happen on focusIn event many times
if (theWidget == myActiveWidget) {
- return;
+ return false;
}
if(myActiveWidget) {
myActiveWidget->deactivate();
theWidget->activate();
}
myActiveWidget = theWidget;
- setFocusOnOkButton();
+ return true;
}
void XGUI_PropertyPanel::setFocusOnOkButton()
protected:
/// Makes the widget active, deactivate the previous, activate and hightlight the given one
/// \param theWidget a widget
- void setActiveWidget(ModuleBase_ModelWidget* theWidget);
+ bool setActiveWidget(ModuleBase_ModelWidget* theWidget);
/// The parent method that processes the "Tab"/"SHIF + Tab" keyboard events
/// Emits a signal about focus change