virtual ~ModuleBase_WidgetBoolValue();
+ virtual bool canSetValue() const { return false; };
+
virtual QList<QWidget*> getControls() const;
virtual void setHighlighted(bool isHighlighted);
if (theWidgets.empty()) return;
foreach (ModuleBase_ModelWidget* aWidget, theWidgets) {
connect(aWidget, SIGNAL(focusInWidget(ModuleBase_ModelWidget*)),
- this, SLOT(activateWidget(ModuleBase_ModelWidget*)));
+ this, SLOT(onFocusInWidget(ModuleBase_ModelWidget*)));
connect(aWidget, SIGNAL(focusOutWidget(ModuleBase_ModelWidget*)),
this, SLOT(onActivateNextWidget(ModuleBase_ModelWidget*)));
connect(aWidget, SIGNAL(keyReleased(QObject*, QKeyEvent*)),
activateNextWidget(theWidget, false);
}
+void XGUI_PropertyPanel::onFocusInWidget(ModuleBase_ModelWidget* theWidget)
+{
+ if (theWidget->canSetValue())
+ activateWidget(theWidget);
+}
+
void XGUI_PropertyPanel::onActivateNextWidget(ModuleBase_ModelWidget* theWidget)
{
// this slot happens when some widget lost focus, the next widget which accepts the focus
*/
virtual void activateWidget(ModuleBase_ModelWidget* theWidget, const bool theEmitSignal = true);
+ /// Activates the parameter widget if it can accept focus
+ /// \param theWidget a widget where focus in event happened
+ void onFocusInWidget(ModuleBase_ModelWidget* theWidget);
+
void onActivateNextWidget(ModuleBase_ModelWidget* theWidget);
signals: