From af41da73910b8b5261374ce227edb56cb2d7bc46 Mon Sep 17 00:00:00 2001 From: nds Date: Wed, 9 Sep 2015 15:02:34 +0300 Subject: [PATCH] Issue #905 Update of invalid feature representation in property panel Widget should not be in pink also. --- src/XGUI/XGUI_ErrorMgr.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/XGUI/XGUI_ErrorMgr.cpp b/src/XGUI/XGUI_ErrorMgr.cpp index 190f9c1ed..1cf0d45b9 100644 --- a/src/XGUI/XGUI_ErrorMgr.cpp +++ b/src/XGUI/XGUI_ErrorMgr.cpp @@ -75,19 +75,21 @@ void XGUI_ErrorMgr::updateActionState(QAction* theAction, const FeaturePtr& theF const bool theEnabled) { bool isActionEnabled = theAction->data() != INVALID_VALUE; - if (theEnabled == isActionEnabled) - return; + if (theEnabled != isActionEnabled) { + // update enable state of the button + theAction->setIcon(theEnabled ? QIcon(":pictures/button_ok.png"): QIcon(":pictures/button_ok_error.png")); + if (theEnabled) + theAction->setData(""); + else + theAction->setData(INVALID_VALUE); + } - theAction->setIcon(theEnabled ? QIcon(":pictures/button_ok.png"): QIcon(":pictures/button_ok_error.png")); + // update controls error information QWidget* aWidget = myPropertyPanel->headerWidget(); - if (theEnabled) { - theAction->setData(""); + if (theEnabled) aWidget->setToolTip(""); - } - else { - theAction->setData(INVALID_VALUE); + else aWidget->setToolTip(getFeatureError(theFeature)); - } } const char* toString(ModelAPI_ExecState theExecState) -- 2.39.2