From e78cae2ecef2b184023279581dc77021860367cc Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 15 Jan 2018 12:22:48 +0300 Subject: [PATCH] Issue #2388: Restore remembering of user choice in property panel --- src/XGUI/XGUI_PropertyPanel.cpp | 5 +++++ src/XGUI/XGUI_PropertyPanel.h | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/XGUI/XGUI_PropertyPanel.cpp b/src/XGUI/XGUI_PropertyPanel.cpp index 33288b465..14baecee4 100755 --- a/src/XGUI/XGUI_PropertyPanel.cpp +++ b/src/XGUI/XGUI_PropertyPanel.cpp @@ -565,6 +565,11 @@ void XGUI_PropertyPanel::setupActions(XGUI_ActionsMgr* theMgr) QAction* anAct = theMgr->operationStateAction(aActionIds.at(i)); aBtn->setDefaultAction(anAct); } + // This code is necessary for remembering of user choice in property panel + QToolButton* aBtn = findButton(PROP_PANEL_OK); + connect(aBtn->defaultAction(), SIGNAL(triggered(bool)), this, SLOT(onAcceptData())); + aBtn = findButton(PROP_PANEL_OK_PLUS); + connect(aBtn->defaultAction(), SIGNAL(triggered(bool)), this, SLOT(onAcceptData())); } void XGUI_PropertyPanel::onAcceptData() diff --git a/src/XGUI/XGUI_PropertyPanel.h b/src/XGUI/XGUI_PropertyPanel.h index 00d5ab8d8..4b9ac059a 100644 --- a/src/XGUI/XGUI_PropertyPanel.h +++ b/src/XGUI/XGUI_PropertyPanel.h @@ -133,9 +133,6 @@ Q_OBJECT /// \param theIsNext true, if Tab(to the next widget) or false(moving to the previous) bool setFocusNextPrevChild(bool theIsNext); - /// The method is called on accepting of operation - void onAcceptData(); - public slots: /// \brief Update all widgets in property panel with values from the given feature /// \param theFeature a Feature to update values in widgets @@ -163,6 +160,9 @@ public slots: /// \param theWidget the current widget void onActivateNextWidget(ModuleBase_ModelWidget* theWidget); + /// The method is called on accepting of operation + void onAcceptData(); + signals: /// The signal is emitted if the enter is clicked in the control of the widget /// \param theObject a sender of the event -- 2.39.2