From: nds Date: Fri, 11 Mar 2016 04:32:31 +0000 (+0300) Subject: Issue #1368: Creation of a Qt panel. Code improvement. X-Git-Tag: V_2.3.0~391 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=935d92397da8acd3bc317a6318572b508c118dc3;p=modules%2Fshaper.git Issue #1368: Creation of a Qt panel. Code improvement. ModuleBase_ModelWidget does not use theParentId parameter. It is removed to avoid having this parameter in createWidgetByType method of WidgetCreator --- diff --git a/src/ModuleBase/ModuleBase_IModule.h b/src/ModuleBase/ModuleBase_IModule.h index be36fede6..016564178 100755 --- a/src/ModuleBase/ModuleBase_IModule.h +++ b/src/ModuleBase/ModuleBase_IModule.h @@ -102,7 +102,8 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject /// \param theMenu a popup menu to be shown in the viewer /// \param theStdActions a map of standard actions /// \return true if items are added and there is no necessity to provide standard menu - virtual bool addViewerMenu(QMenu* theMenu, const QMap& theStdActions) const { return false; } + virtual bool addViewerMenu(QMenu* theMenu, const QMap& theStdActions) const + { return false; } /// Add menu items for object browser into the given menu /// \param theMenu a popup menu to be shown in the object browser @@ -112,9 +113,8 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject /// \param theType a type of widget /// \param theParent the parent object /// \param theWidgetApi the widget configuration. The attribute of the model widget is obtained from - /// \param theParentId is Id of a parent of the current attribute virtual ModuleBase_ModelWidget* createWidgetByType(const std::string& theType, QWidget* theParent, - Config_WidgetAPI* theWidgetApi, std::string theParentId) + Config_WidgetAPI* theWidgetApi) { return 0; } diff --git a/src/ModuleBase/ModuleBase_IWidgetCreator.h b/src/ModuleBase/ModuleBase_IWidgetCreator.h index 91a076d44..3d0789cce 100755 --- a/src/ModuleBase/ModuleBase_IWidgetCreator.h +++ b/src/ModuleBase/ModuleBase_IWidgetCreator.h @@ -41,18 +41,18 @@ public: /// Create page by its type /// \param theType a type /// \param theParent a parent widget + /// \param theData a low-level API for reading xml definitions of widgets virtual ModuleBase_PageBase* createPageByType(const std::string& theType, QWidget* theParent, - Config_WidgetAPI* theWidgetApi, - std::string theParentId) = 0; + Config_WidgetAPI* theWidgetApi) = 0; /// Create widget by its type - /// \param theType a type - /// \param theParent a parent widget + /// \param theType a type + /// \param theParent a parent widget + /// \param theData a low-level API for reading xml definitions of widgets virtual ModuleBase_ModelWidget* createWidgetByType(const std::string& theType, QWidget* theParent, Config_WidgetAPI* theWidgetApi, - std::string theParentId, ModuleBase_IWorkshop* theWorkshop) = 0; }; diff --git a/src/ModuleBase/ModuleBase_ModelWidget.cpp b/src/ModuleBase/ModuleBase_ModelWidget.cpp index e0ac58445..d12cfbeb2 100644 --- a/src/ModuleBase/ModuleBase_ModelWidget.cpp +++ b/src/ModuleBase/ModuleBase_ModelWidget.cpp @@ -25,10 +25,8 @@ //#define DEBUG_VALUE_STATE ModuleBase_ModelWidget::ModuleBase_ModelWidget(QWidget* theParent, - const Config_WidgetAPI* theData, - const std::string& theParentId) + const Config_WidgetAPI* theData) : QWidget(theParent), - myParentId(theParentId), myIsEditing(false), myState(Stored), myIsValueStateBlocked(false) diff --git a/src/ModuleBase/ModuleBase_ModelWidget.h b/src/ModuleBase/ModuleBase_ModelWidget.h index a9f6530b9..c2859e975 100644 --- a/src/ModuleBase/ModuleBase_ModelWidget.h +++ b/src/ModuleBase/ModuleBase_ModelWidget.h @@ -39,12 +39,11 @@ Q_OBJECT ModifiedInViewer, /// modification performed by viewer events Reset }; /// the value is reset - /// Constructor + /// Constructor /// \param theParent the parent object /// \param theData the widget configuration. The attribute of the model widget is obtained from - /// \param theParentId is Id of a parent of the current attribute - ModuleBase_ModelWidget(QWidget* theParent, const Config_WidgetAPI* theData, - const std::string& theParentId); + /// \param theData a low-level API for reading xml definitions of widgets + ModuleBase_ModelWidget(QWidget* theParent, const Config_WidgetAPI* theData); /// Destructor virtual ~ModuleBase_ModelWidget() { @@ -159,13 +158,6 @@ Q_OBJECT return myAttributeID; } - /// Returns the parent of the attribute - /// \returns the string value - std::string parentID() const - { - return myParentId; - } - /// \return Current feature FeaturePtr feature() const { @@ -292,9 +284,6 @@ protected slots: /// The attribute name of the model feature std::string myAttributeID; - /// Name of parent - std::string myParentId; - /// A feature which is processing by active operation FeaturePtr myFeature; diff --git a/src/ModuleBase/ModuleBase_PagedContainer.cpp b/src/ModuleBase/ModuleBase_PagedContainer.cpp index 9f32442a5..4da74e212 100644 --- a/src/ModuleBase/ModuleBase_PagedContainer.cpp +++ b/src/ModuleBase/ModuleBase_PagedContainer.cpp @@ -17,9 +17,8 @@ #include -ModuleBase_PagedContainer::ModuleBase_PagedContainer(QWidget* theParent, const Config_WidgetAPI* theData, - const std::string& theParentId) -: ModuleBase_ModelWidget(theParent, theData, theParentId), +ModuleBase_PagedContainer::ModuleBase_PagedContainer(QWidget* theParent, const Config_WidgetAPI* theData) +: ModuleBase_ModelWidget(theParent, theData), myIsFocusOnCurrentPage(false) { // it is not obligatory to be ignored when property panel tries to activate next active widget diff --git a/src/ModuleBase/ModuleBase_PagedContainer.h b/src/ModuleBase/ModuleBase_PagedContainer.h index b98055fc9..aee2e5c75 100644 --- a/src/ModuleBase/ModuleBase_PagedContainer.h +++ b/src/ModuleBase/ModuleBase_PagedContainer.h @@ -24,9 +24,7 @@ class MODULEBASE_EXPORT ModuleBase_PagedContainer : public ModuleBase_ModelWidge /// A constructor /// \param theParent a parent widget /// \param theData a data of the widget - /// \param theParentId an Id of the parent object - ModuleBase_PagedContainer(QWidget* theParent, const Config_WidgetAPI* theData, - const std::string& theParentId); + ModuleBase_PagedContainer(QWidget* theParent, const Config_WidgetAPI* theData); virtual ~ModuleBase_PagedContainer(); /// Add a new page diff --git a/src/ModuleBase/ModuleBase_WidgetBoolValue.cpp b/src/ModuleBase/ModuleBase_WidgetBoolValue.cpp index f260939e5..074b832c0 100644 --- a/src/ModuleBase/ModuleBase_WidgetBoolValue.cpp +++ b/src/ModuleBase/ModuleBase_WidgetBoolValue.cpp @@ -21,9 +21,8 @@ #include ModuleBase_WidgetBoolValue::ModuleBase_WidgetBoolValue(QWidget* theParent, - const Config_WidgetAPI* theData, - const std::string& theParentId) - : ModuleBase_ModelWidget(theParent, theData, theParentId) + const Config_WidgetAPI* theData) +: ModuleBase_ModelWidget(theParent, theData) { QString aText = QString::fromStdString(theData->widgetLabel()); QString aToolTip = QString::fromStdString(theData->widgetTooltip()); diff --git a/src/ModuleBase/ModuleBase_WidgetBoolValue.h b/src/ModuleBase/ModuleBase_WidgetBoolValue.h index b100c4ffe..082e54eec 100644 --- a/src/ModuleBase/ModuleBase_WidgetBoolValue.h +++ b/src/ModuleBase/ModuleBase_WidgetBoolValue.h @@ -25,9 +25,7 @@ Q_OBJECT /// Constructor /// \param theParent the parent object /// \param theData the widget configuation. The attribute of the model widget is obtained from - /// \param theParentId is Id of a parent of the current attribute - ModuleBase_WidgetBoolValue(QWidget* theParent, const Config_WidgetAPI* theData, - const std::string& theParentId); + ModuleBase_WidgetBoolValue(QWidget* theParent, const Config_WidgetAPI* theData); virtual ~ModuleBase_WidgetBoolValue(); diff --git a/src/ModuleBase/ModuleBase_WidgetCheckGroupBox.cpp b/src/ModuleBase/ModuleBase_WidgetCheckGroupBox.cpp index 89d9356b9..df32f5b53 100755 --- a/src/ModuleBase/ModuleBase_WidgetCheckGroupBox.cpp +++ b/src/ModuleBase/ModuleBase_WidgetCheckGroupBox.cpp @@ -18,9 +18,8 @@ #include ModuleBase_WidgetCheckGroupBox::ModuleBase_WidgetCheckGroupBox(QWidget* theParent, - const Config_WidgetAPI* theData, - const std::string& theParentId) -: ModuleBase_ModelWidget(theParent, theData, theParentId), + const Config_WidgetAPI* theData) +: ModuleBase_ModelWidget(theParent, theData), ModuleBase_PageBase() { QString aToolTip = QString::fromStdString(theData->widgetTooltip()); diff --git a/src/ModuleBase/ModuleBase_WidgetCheckGroupBox.h b/src/ModuleBase/ModuleBase_WidgetCheckGroupBox.h index 4d8c12a41..88995430e 100755 --- a/src/ModuleBase/ModuleBase_WidgetCheckGroupBox.h +++ b/src/ModuleBase/ModuleBase_WidgetCheckGroupBox.h @@ -26,9 +26,7 @@ public: /// Constructor /// \param theParent the parent object /// \param theData the widget configuration. The attribute of the model widget is obtained from - /// \param theParentId is Id of a parent of the current attribute - ModuleBase_WidgetCheckGroupBox(QWidget* theParent, const Config_WidgetAPI* theData, - const std::string& theParentId); + ModuleBase_WidgetCheckGroupBox(QWidget* theParent, const Config_WidgetAPI* theData); virtual ~ModuleBase_WidgetCheckGroupBox(); void setTitle(const QString& theTitle); diff --git a/src/ModuleBase/ModuleBase_WidgetChoice.cpp b/src/ModuleBase/ModuleBase_WidgetChoice.cpp index d837c4f38..6c35d6627 100644 --- a/src/ModuleBase/ModuleBase_WidgetChoice.cpp +++ b/src/ModuleBase/ModuleBase_WidgetChoice.cpp @@ -22,9 +22,8 @@ ModuleBase_WidgetChoice::ModuleBase_WidgetChoice(QWidget* theParent, - const Config_WidgetAPI* theData, - const std::string& theParentId) - : ModuleBase_ModelWidget(theParent, theData, theParentId), myCombo(0), myButtons(0) + const Config_WidgetAPI* theData) +: ModuleBase_ModelWidget(theParent, theData), myCombo(0), myButtons(0) { QHBoxLayout* aLayout = new QHBoxLayout(this); ModuleBase_Tools::adjustMargins(aLayout); diff --git a/src/ModuleBase/ModuleBase_WidgetChoice.h b/src/ModuleBase/ModuleBase_WidgetChoice.h index e8db6c289..100f66f24 100644 --- a/src/ModuleBase/ModuleBase_WidgetChoice.h +++ b/src/ModuleBase/ModuleBase_WidgetChoice.h @@ -40,9 +40,7 @@ Q_OBJECT /// Constructor /// \param theParent the parent object /// \param theData the widget configuation. The attribute of the model widget is obtained from - /// \param theParentId is Id of a parent of the current attribute - ModuleBase_WidgetChoice(QWidget* theParent, const Config_WidgetAPI* theData, - const std::string& theParentId); + ModuleBase_WidgetChoice(QWidget* theParent, const Config_WidgetAPI* theData); virtual ~ModuleBase_WidgetChoice(); diff --git a/src/ModuleBase/ModuleBase_WidgetCreatorFactory.cpp b/src/ModuleBase/ModuleBase_WidgetCreatorFactory.cpp index cdf53e151..3f2ff9307 100755 --- a/src/ModuleBase/ModuleBase_WidgetCreatorFactory.cpp +++ b/src/ModuleBase/ModuleBase_WidgetCreatorFactory.cpp @@ -64,14 +64,14 @@ bool ModuleBase_WidgetCreatorFactory::hasPageWidget(const std::string& theType) } ModuleBase_PageBase* ModuleBase_WidgetCreatorFactory::createPageByType( - const std::string& theType, QWidget* theParent, - Config_WidgetAPI* theWidgetApi, std::string theParentId) + const std::string& theType, QWidget* theParent, + Config_WidgetAPI* theWidgetApi) { ModuleBase_PageBase* aPage = 0; if (myPageToCreator.contains(theType)) { WidgetCreatorPtr aCreator = myPageToCreator[theType]; - aPage = aCreator->createPageByType(theType, theParent, theWidgetApi, theParentId); + aPage = aCreator->createPageByType(theType, theParent, theWidgetApi); } return aPage; @@ -79,16 +79,15 @@ ModuleBase_PageBase* ModuleBase_WidgetCreatorFactory::createPageByType( ModuleBase_ModelWidget* ModuleBase_WidgetCreatorFactory::createWidgetByType( - const std::string& theType, QWidget* theParent, - Config_WidgetAPI* theWidgetApi, std::string theParentId, - ModuleBase_IWorkshop* theWorkshop) + const std::string& theType, QWidget* theParent, + Config_WidgetAPI* theWidgetApi, + ModuleBase_IWorkshop* theWorkshop) { ModuleBase_ModelWidget* aWidget = 0; if (myCreators.contains(theType)) { WidgetCreatorPtr aCreator = myCreators[theType]; - aWidget = aCreator->createWidgetByType(theType, theParent, theWidgetApi, theParentId, - theWorkshop); + aWidget = aCreator->createWidgetByType(theType, theParent, theWidgetApi, theWorkshop); } return aWidget; diff --git a/src/ModuleBase/ModuleBase_WidgetCreatorFactory.h b/src/ModuleBase/ModuleBase_WidgetCreatorFactory.h index 98f4d211d..1c6991a5a 100755 --- a/src/ModuleBase/ModuleBase_WidgetCreatorFactory.h +++ b/src/ModuleBase/ModuleBase_WidgetCreatorFactory.h @@ -49,8 +49,7 @@ class MODULEBASE_EXPORT ModuleBase_WidgetCreatorFactory /// \param theParent a parent widget ModuleBase_PageBase* createPageByType(const std::string& theType, QWidget* theParent, - Config_WidgetAPI* theWidgetApi, - std::string theParentId); + Config_WidgetAPI* theWidgetApi); /// Create widget by its type /// \param theType a type @@ -58,7 +57,6 @@ class MODULEBASE_EXPORT ModuleBase_WidgetCreatorFactory ModuleBase_ModelWidget* createWidgetByType(const std::string& theType, QWidget* theParent, Config_WidgetAPI* theWidgetApi, - std::string theParentId, ModuleBase_IWorkshop* theWorkshop); private: diff --git a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp index fbe80ec18..672539acb 100644 --- a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp +++ b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp @@ -32,9 +32,8 @@ #endif ModuleBase_WidgetDoubleValue::ModuleBase_WidgetDoubleValue(QWidget* theParent, - const Config_WidgetAPI* theData, - const std::string& theParentId) - : ModuleBase_ModelWidget(theParent, theData, theParentId) + const Config_WidgetAPI* theData) + : ModuleBase_ModelWidget(theParent, theData) { QFormLayout* aControlLay = new QFormLayout(this); ModuleBase_Tools::adjustMargins(aControlLay); diff --git a/src/ModuleBase/ModuleBase_WidgetDoubleValue.h b/src/ModuleBase/ModuleBase_WidgetDoubleValue.h index cfd49221c..0abf5b526 100644 --- a/src/ModuleBase/ModuleBase_WidgetDoubleValue.h +++ b/src/ModuleBase/ModuleBase_WidgetDoubleValue.h @@ -31,9 +31,7 @@ Q_OBJECT /// Constructor /// \param theParent the parent object /// \param theData the widget configuation. The attribute of the model widget is obtained from - /// \param theParentId is Id of a parent structure (widget, operation, group) - ModuleBase_WidgetDoubleValue(QWidget* theParent, const Config_WidgetAPI* theData, - const std::string& theParentId); + ModuleBase_WidgetDoubleValue(QWidget* theParent, const Config_WidgetAPI* theData); virtual ~ModuleBase_WidgetDoubleValue(); diff --git a/src/ModuleBase/ModuleBase_WidgetEditor.cpp b/src/ModuleBase/ModuleBase_WidgetEditor.cpp index 41ec508e2..b5dee0c4d 100644 --- a/src/ModuleBase/ModuleBase_WidgetEditor.cpp +++ b/src/ModuleBase/ModuleBase_WidgetEditor.cpp @@ -33,9 +33,8 @@ #include ModuleBase_WidgetEditor::ModuleBase_WidgetEditor(QWidget* theParent, - const Config_WidgetAPI* theData, - const std::string& theParentId) -: ModuleBase_WidgetDoubleValue(theParent, theData, theParentId), + const Config_WidgetAPI* theData) +: ModuleBase_WidgetDoubleValue(theParent, theData), myXPosition(-1), myYPosition(-1) { } diff --git a/src/ModuleBase/ModuleBase_WidgetEditor.h b/src/ModuleBase/ModuleBase_WidgetEditor.h index 43d9c099b..db9dd1cc4 100644 --- a/src/ModuleBase/ModuleBase_WidgetEditor.h +++ b/src/ModuleBase/ModuleBase_WidgetEditor.h @@ -27,9 +27,7 @@ Q_OBJECT /// Constructor /// \param theParent the parent object /// \param theData the widget configuation. The attribute of the model widget is obtained from - /// \param theParentId is Id of a parent of the current attribute - ModuleBase_WidgetEditor(QWidget* theParent, const Config_WidgetAPI* theData, - const std::string& theParentId); + ModuleBase_WidgetEditor(QWidget* theParent, const Config_WidgetAPI* theData); /// Constructor /// \param theParent the parent object /// \param theAttribute The attribute of the model widget diff --git a/src/ModuleBase/ModuleBase_WidgetErrorLabel.cpp b/src/ModuleBase/ModuleBase_WidgetErrorLabel.cpp index 2291bf1a0..cbcbae63f 100644 --- a/src/ModuleBase/ModuleBase_WidgetErrorLabel.cpp +++ b/src/ModuleBase/ModuleBase_WidgetErrorLabel.cpp @@ -14,9 +14,8 @@ #include ModuleBase_WidgetErrorLabel::ModuleBase_WidgetErrorLabel(QWidget* theParent, - const Config_WidgetAPI* theData, - const std::string& theParentId) - : ModuleBase_WidgetLabel(theParent, theData, theParentId) + const Config_WidgetAPI* theData) +: ModuleBase_WidgetLabel(theParent, theData) { myDefaultStyle = myLabel->styleSheet(); myLabel->setContentsMargins(0,0,0,4); diff --git a/src/ModuleBase/ModuleBase_WidgetErrorLabel.h b/src/ModuleBase/ModuleBase_WidgetErrorLabel.h index f17350901..9adee7cce 100644 --- a/src/ModuleBase/ModuleBase_WidgetErrorLabel.h +++ b/src/ModuleBase/ModuleBase_WidgetErrorLabel.h @@ -23,9 +23,7 @@ Q_OBJECT /// Constructor /// \param theParent the parent object /// \param theData the widget configuation. The attribute of the model widget is obtained from - /// \param theParentId is Id of a parent of the current attribute - ModuleBase_WidgetErrorLabel(QWidget* theParent, const Config_WidgetAPI* theData, - const std::string & theParentId); + ModuleBase_WidgetErrorLabel(QWidget* theParent, const Config_WidgetAPI* theData); virtual ~ModuleBase_WidgetErrorLabel(); diff --git a/src/ModuleBase/ModuleBase_WidgetExprEditor.cpp b/src/ModuleBase/ModuleBase_WidgetExprEditor.cpp index 1df376b2b..a47d9e367 100644 --- a/src/ModuleBase/ModuleBase_WidgetExprEditor.cpp +++ b/src/ModuleBase/ModuleBase_WidgetExprEditor.cpp @@ -208,9 +208,8 @@ void ExpressionEditor::onTextChanged() ModuleBase_WidgetExprEditor::ModuleBase_WidgetExprEditor( QWidget* theParent, const Config_WidgetAPI* theData, - const std::string& theParentId, const std::string& thePlaceHolder ) - : ModuleBase_ModelWidget(theParent, theData, theParentId) +: ModuleBase_ModelWidget(theParent, theData) { QVBoxLayout* aMainLay = new QVBoxLayout(this); ModuleBase_Tools::adjustMargins(aMainLay); diff --git a/src/ModuleBase/ModuleBase_WidgetExprEditor.h b/src/ModuleBase/ModuleBase_WidgetExprEditor.h index bbd84a89f..b3a63174b 100644 --- a/src/ModuleBase/ModuleBase_WidgetExprEditor.h +++ b/src/ModuleBase/ModuleBase_WidgetExprEditor.h @@ -104,7 +104,6 @@ class MODULEBASE_EXPORT ModuleBase_WidgetExprEditor : public ModuleBase_ModelWid /// \param thePlaceHolder a placeholder string ModuleBase_WidgetExprEditor( QWidget* theParent, const Config_WidgetAPI* theData, - const std::string& theParentId, const std::string& thePlaceHolder ); virtual ~ModuleBase_WidgetExprEditor(); diff --git a/src/ModuleBase/ModuleBase_WidgetFactory.cpp b/src/ModuleBase/ModuleBase_WidgetFactory.cpp index 267ab17b5..41709a1ba 100644 --- a/src/ModuleBase/ModuleBase_WidgetFactory.cpp +++ b/src/ModuleBase/ModuleBase_WidgetFactory.cpp @@ -71,7 +71,6 @@ ModuleBase_WidgetFactory::~ModuleBase_WidgetFactory() void ModuleBase_WidgetFactory::createWidget(ModuleBase_PageBase* thePage) { - myParentId = myWidgetApi->widgetId(); if (!myWidgetApi->toChildWidget()) return; @@ -160,7 +159,6 @@ void ModuleBase_WidgetFactory::getGreedAttribute(std::string& theAttributeId) if (!theAttributeId.empty()) return; - myParentId = myWidgetApi->widgetId(); if (!myWidgetApi->toChildWidget()) return; @@ -193,7 +191,6 @@ void ModuleBase_WidgetFactory::moveToWidgetId(const std::string& theWidgetId, bo if (theFound) return; - myParentId = myWidgetApi->widgetId(); if (!myWidgetApi->toChildWidget()) return; @@ -234,13 +231,13 @@ ModuleBase_PageBase* ModuleBase_WidgetFactory::createPageByType(const std::strin else if (theType == WDG_CHECK_GROUP) { QString aGroupName = qs(myWidgetApi->getProperty(CONTAINER_PAGE_NAME)); ModuleBase_WidgetCheckGroupBox* aPage = new ModuleBase_WidgetCheckGroupBox(theParent, - myWidgetApi, myParentId); + myWidgetApi); aPage->setTitle(aGroupName); aResult = aPage; } if (!aResult) aResult = ModuleBase_WidgetCreatorFactory::get()->createPageByType(theType, theParent, - myWidgetApi, myParentId); + myWidgetApi); ModuleBase_ModelWidget* aWidget = dynamic_cast(aResult); if (aWidget) @@ -255,44 +252,44 @@ ModuleBase_ModelWidget* ModuleBase_WidgetFactory::createWidgetByType(const std:: ModuleBase_ModelWidget* result = NULL; if (theType == WDG_INFO) { - result = new ModuleBase_WidgetLabel(theParent, myWidgetApi, myParentId); + result = new ModuleBase_WidgetLabel(theParent, myWidgetApi); } else if (theType == WDG_ERRORINFO) { - result = new ModuleBase_WidgetErrorLabel(theParent, myWidgetApi, myParentId); + result = new ModuleBase_WidgetErrorLabel(theParent, myWidgetApi); } else if (theType == WDG_DOUBLEVALUE) { - result = new ModuleBase_WidgetDoubleValue(theParent, myWidgetApi, myParentId); + result = new ModuleBase_WidgetDoubleValue(theParent, myWidgetApi); } else if (theType == WDG_INTEGERVALUE) { - result = new ModuleBase_WidgetIntValue(theParent, myWidgetApi, myParentId); + result = new ModuleBase_WidgetIntValue(theParent, myWidgetApi); } else if (theType == WDG_SHAPE_SELECTOR) { - result = new ModuleBase_WidgetShapeSelector(theParent, myWorkshop, myWidgetApi, myParentId); + result = new ModuleBase_WidgetShapeSelector(theParent, myWorkshop, myWidgetApi); } else if (theType == WDG_BOOLVALUE) { - result = new ModuleBase_WidgetBoolValue(theParent, myWidgetApi, myParentId); + result = new ModuleBase_WidgetBoolValue(theParent, myWidgetApi); //} else if (theType == WDG_DOUBLEVALUE_EDITOR) { - // result = new ModuleBase_WidgetEditor(theParent, myWidgetApi, myParentId); + // result = new ModuleBase_WidgetEditor(theParent, myWidgetApi); } else if (theType == WDG_FILE_SELECTOR) { - result = new ModuleBase_WidgetFileSelector(theParent, myWidgetApi, myParentId); + result = new ModuleBase_WidgetFileSelector(theParent, myWidgetApi); } else if (theType == WDG_CHOICE) { - result = new ModuleBase_WidgetChoice(theParent, myWidgetApi, myParentId); + result = new ModuleBase_WidgetChoice(theParent, myWidgetApi); } else if (theType == WDG_STRINGVALUE) { std::string aPlaceHolder = myWidgetApi->getProperty( WDG_PLACE_HOLDER ); - result = new ModuleBase_WidgetLineEdit( theParent, myWidgetApi, myParentId, aPlaceHolder ); + result = new ModuleBase_WidgetLineEdit( theParent, myWidgetApi, aPlaceHolder ); } else if (theType == WDG_EXPR_EDITOR) { std::string aPlaceHolder = myWidgetApi->getProperty( WDG_PLACE_HOLDER ); - result = new ModuleBase_WidgetExprEditor( theParent, myWidgetApi, myParentId, aPlaceHolder ); + result = new ModuleBase_WidgetExprEditor( theParent, myWidgetApi, aPlaceHolder ); } else if (theType == WDG_MULTISELECTOR) { - result = new ModuleBase_WidgetMultiSelector(theParent, myWorkshop, myWidgetApi, myParentId); + result = new ModuleBase_WidgetMultiSelector(theParent, myWorkshop, myWidgetApi); } else if (theType == WDG_TOOLBOX) { - result = new ModuleBase_WidgetToolbox(theParent, myWidgetApi, myParentId); + result = new ModuleBase_WidgetToolbox(theParent, myWidgetApi); } else if (theType == WDG_SWITCH) { - result = new ModuleBase_WidgetSwitch(theParent, myWidgetApi, myParentId); + result = new ModuleBase_WidgetSwitch(theParent, myWidgetApi); } else if (theType == WDG_TOOLBOX_BOX || theType == WDG_SWITCH_CASE || theType == NODE_VALIDATOR) { // Do nothing for "box" and "case" result = NULL; } else { - result = myWorkshop->module()->createWidgetByType(theType, theParent, myWidgetApi, myParentId); + result = myWorkshop->module()->createWidgetByType(theType, theParent, myWidgetApi); if (!result) result = ModuleBase_WidgetCreatorFactory::get()->createWidgetByType(theType, theParent, - myWidgetApi, myParentId, myWorkshop); + myWidgetApi, myWorkshop); #ifdef _DEBUG if (!result) { qDebug("ModuleBase_WidgetFactory::fillWidget: find bad widget type %s", theType.c_str()); diff --git a/src/ModuleBase/ModuleBase_WidgetFactory.h b/src/ModuleBase/ModuleBase_WidgetFactory.h index 5e14ad4af..cebeb0bda 100644 --- a/src/ModuleBase/ModuleBase_WidgetFactory.h +++ b/src/ModuleBase/ModuleBase_WidgetFactory.h @@ -98,9 +98,6 @@ protected: /// List of created model widgets QList myModelWidgets; - - /// Id of current parent - std::string myParentId; }; #endif /* ModuleBase_WidgetFactory_H_ */ diff --git a/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp b/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp index dbe8e8ce3..f3238f222 100644 --- a/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp @@ -31,9 +31,8 @@ #include ModuleBase_WidgetFileSelector::ModuleBase_WidgetFileSelector(QWidget* theParent, - const Config_WidgetAPI* theData, - const std::string& theParentId) - : ModuleBase_ModelWidget(theParent, theData, theParentId) + const Config_WidgetAPI* theData) +: ModuleBase_ModelWidget(theParent, theData) { myTitle = QString::fromStdString(theData->getProperty("title")); myType = (theData->getProperty("type") == "save") ? WFS_SAVE : WFS_OPEN; diff --git a/src/ModuleBase/ModuleBase_WidgetFileSelector.h b/src/ModuleBase/ModuleBase_WidgetFileSelector.h index b6f029fb0..4d6c3b1d5 100644 --- a/src/ModuleBase/ModuleBase_WidgetFileSelector.h +++ b/src/ModuleBase/ModuleBase_WidgetFileSelector.h @@ -44,10 +44,8 @@ class MODULEBASE_EXPORT ModuleBase_WidgetFileSelector : public ModuleBase_ModelW /// Constructor /// \param theParent the parent object /// \param theData the widget configuration. The attribute of the model widget is obtained from - /// \param theParentId is Id of a parent of the current attribute ModuleBase_WidgetFileSelector(QWidget* theParent, - const Config_WidgetAPI* theData, - const std::string& theParentId); + const Config_WidgetAPI* theData); virtual ~ModuleBase_WidgetFileSelector(); virtual QList getControls() const; diff --git a/src/ModuleBase/ModuleBase_WidgetIntValue.cpp b/src/ModuleBase/ModuleBase_WidgetIntValue.cpp index 6056ca2e0..95074f73a 100644 --- a/src/ModuleBase/ModuleBase_WidgetIntValue.cpp +++ b/src/ModuleBase/ModuleBase_WidgetIntValue.cpp @@ -35,9 +35,8 @@ #endif ModuleBase_WidgetIntValue::ModuleBase_WidgetIntValue(QWidget* theParent, - const Config_WidgetAPI* theData, - const std::string& theParentId) - : ModuleBase_ModelWidget(theParent, theData, theParentId) + const Config_WidgetAPI* theData) +: ModuleBase_ModelWidget(theParent, theData) { QFormLayout* aControlLay = new QFormLayout(this); ModuleBase_Tools::adjustMargins(aControlLay); diff --git a/src/ModuleBase/ModuleBase_WidgetIntValue.h b/src/ModuleBase/ModuleBase_WidgetIntValue.h index 1268a5592..d88b4d156 100644 --- a/src/ModuleBase/ModuleBase_WidgetIntValue.h +++ b/src/ModuleBase/ModuleBase_WidgetIntValue.h @@ -31,9 +31,7 @@ Q_OBJECT /// Constructor /// \param theParent the parent object /// \param theData the widget configuration. The attribute of the model widget is obtained from - /// \param theParentId is Id of a parent structure (widget, operation, group) - ModuleBase_WidgetIntValue(QWidget* theParent, const Config_WidgetAPI* theData, - const std::string& theParentId); + ModuleBase_WidgetIntValue(QWidget* theParent, const Config_WidgetAPI* theData); virtual ~ModuleBase_WidgetIntValue(); diff --git a/src/ModuleBase/ModuleBase_WidgetLabel.cpp b/src/ModuleBase/ModuleBase_WidgetLabel.cpp index 3abae6c7b..e1e41ecd1 100644 --- a/src/ModuleBase/ModuleBase_WidgetLabel.cpp +++ b/src/ModuleBase/ModuleBase_WidgetLabel.cpp @@ -14,9 +14,8 @@ ModuleBase_WidgetLabel::ModuleBase_WidgetLabel(QWidget* theParent, - const Config_WidgetAPI* theData, - const std::string& theParentId) - : ModuleBase_ModelWidget(theParent, theData, theParentId) + const Config_WidgetAPI* theData) +: ModuleBase_ModelWidget(theParent, theData) { QString aText = QString::fromStdString(theData->getProperty("title")); myLabel = new QLabel(aText, theParent); diff --git a/src/ModuleBase/ModuleBase_WidgetLabel.h b/src/ModuleBase/ModuleBase_WidgetLabel.h index 9fb8ddd76..b024b17c9 100644 --- a/src/ModuleBase/ModuleBase_WidgetLabel.h +++ b/src/ModuleBase/ModuleBase_WidgetLabel.h @@ -23,9 +23,7 @@ Q_OBJECT /// Constructor /// \param theParent the parent object /// \param theData the widget configuation. The attribute of the model widget is obtained from - /// \param theParentId is Id of a parent of the current attribute - ModuleBase_WidgetLabel(QWidget* theParent, const Config_WidgetAPI* theData, - const std::string& theParentId); + ModuleBase_WidgetLabel(QWidget* theParent, const Config_WidgetAPI* theData); virtual ~ModuleBase_WidgetLabel(); diff --git a/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp b/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp index 7f7e187b8..5b2929c4f 100644 --- a/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp +++ b/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp @@ -75,9 +75,8 @@ private: ModuleBase_WidgetLineEdit::ModuleBase_WidgetLineEdit(QWidget* theParent, const Config_WidgetAPI* theData, - const std::string& theParentId, const std::string& thePlaceHolder ) - : ModuleBase_ModelWidget(theParent, theData, theParentId) +: ModuleBase_ModelWidget(theParent, theData) { QFormLayout* aMainLay = new QFormLayout(this); ModuleBase_Tools::adjustMargins(aMainLay); diff --git a/src/ModuleBase/ModuleBase_WidgetLineEdit.h b/src/ModuleBase/ModuleBase_WidgetLineEdit.h index 5b6b22e57..3b8070af8 100644 --- a/src/ModuleBase/ModuleBase_WidgetLineEdit.h +++ b/src/ModuleBase/ModuleBase_WidgetLineEdit.h @@ -32,11 +32,9 @@ class MODULEBASE_EXPORT ModuleBase_WidgetLineEdit : public ModuleBase_ModelWidge /// Constructor /// \param theParent the parent object /// \param theData the widget configuration. - /// \param theParentId is Id of a parent of the current attribute /// \param thePlaceHolder a string of placeholder ModuleBase_WidgetLineEdit( QWidget* theParent, const Config_WidgetAPI* theData, - const std::string& theParentId, const std::string& thePlaceHolder ); virtual ~ModuleBase_WidgetLineEdit(); diff --git a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp index 40518a2ca..f5c1ef251 100755 --- a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp @@ -84,10 +84,9 @@ protected: ModuleBase_WidgetMultiSelector::ModuleBase_WidgetMultiSelector(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, - const Config_WidgetAPI* theData, - const std::string& theParentId) - : ModuleBase_WidgetSelector(theParent, theWorkshop, theData, theParentId), - mySelectionCount(0) + const Config_WidgetAPI* theData) +: ModuleBase_WidgetSelector(theParent, theWorkshop, theData), + mySelectionCount(0) { QGridLayout* aMainLay = new QGridLayout(this); ModuleBase_Tools::adjustMargins(aMainLay); diff --git a/src/ModuleBase/ModuleBase_WidgetMultiSelector.h b/src/ModuleBase/ModuleBase_WidgetMultiSelector.h index bebe4123b..81fcbed1d 100755 --- a/src/ModuleBase/ModuleBase_WidgetMultiSelector.h +++ b/src/ModuleBase/ModuleBase_WidgetMultiSelector.h @@ -54,11 +54,9 @@ class MODULEBASE_EXPORT ModuleBase_WidgetMultiSelector : public ModuleBase_Widge /// \param theParent the parent object /// \param theWorkshop instance of workshop interface /// \param theData the widget configuration. The attribute of the model widget is obtained from - /// \param theParentId is Id of a parent of the current attribute ModuleBase_WidgetMultiSelector(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, - const Config_WidgetAPI* theData, - const std::string& theParentId); + const Config_WidgetAPI* theData); virtual ~ModuleBase_WidgetMultiSelector(); /// Returns list of widget controls diff --git a/src/ModuleBase/ModuleBase_WidgetSelector.cpp b/src/ModuleBase/ModuleBase_WidgetSelector.cpp index 9471f0b8d..d2d36e446 100755 --- a/src/ModuleBase/ModuleBase_WidgetSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetSelector.cpp @@ -20,9 +20,8 @@ ModuleBase_WidgetSelector::ModuleBase_WidgetSelector(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, - const Config_WidgetAPI* theData, - const std::string& theParentId) - : ModuleBase_WidgetValidated(theParent, theWorkshop, theData, theParentId) + const Config_WidgetAPI* theData) +: ModuleBase_WidgetValidated(theParent, theWorkshop, theData) { } diff --git a/src/ModuleBase/ModuleBase_WidgetSelector.h b/src/ModuleBase/ModuleBase_WidgetSelector.h index 9756b3633..2a41f7114 100755 --- a/src/ModuleBase/ModuleBase_WidgetSelector.h +++ b/src/ModuleBase/ModuleBase_WidgetSelector.h @@ -34,9 +34,8 @@ Q_OBJECT /// \param theParent the parent object /// \param theWorkshop instance of workshop interface /// \param theData the widget configuation. The attribute of the model widget is obtained from - /// \param theParentId is Id of a parent of the current attribute ModuleBase_WidgetSelector(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, - const Config_WidgetAPI* theData, const std::string& theParentId); + const Config_WidgetAPI* theData); virtual ~ModuleBase_WidgetSelector(); diff --git a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp index b68e282b6..55b9e9dc1 100644 --- a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp @@ -66,9 +66,8 @@ ModuleBase_WidgetShapeSelector::ModuleBase_WidgetShapeSelector(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, - const Config_WidgetAPI* theData, - const std::string& theParentId) - : ModuleBase_WidgetSelector(theParent, theWorkshop, theData, theParentId) + const Config_WidgetAPI* theData) +: ModuleBase_WidgetSelector(theParent, theWorkshop, theData) { QFormLayout* aLayout = new QFormLayout(this); ModuleBase_Tools::adjustMargins(aLayout); diff --git a/src/ModuleBase/ModuleBase_WidgetShapeSelector.h b/src/ModuleBase/ModuleBase_WidgetShapeSelector.h index bcc247b0f..4c73b1765 100644 --- a/src/ModuleBase/ModuleBase_WidgetShapeSelector.h +++ b/src/ModuleBase/ModuleBase_WidgetShapeSelector.h @@ -63,9 +63,8 @@ Q_OBJECT /// \param theParent the parent object /// \param theWorkshop instance of workshop interface /// \param theData the widget configuation. The attribute of the model widget is obtained from - /// \param theParentId is Id of a parent of the current attribute ModuleBase_WidgetShapeSelector(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, - const Config_WidgetAPI* theData, const std::string& theParentId); + const Config_WidgetAPI* theData); virtual ~ModuleBase_WidgetShapeSelector(); diff --git a/src/ModuleBase/ModuleBase_WidgetSwitch.cpp b/src/ModuleBase/ModuleBase_WidgetSwitch.cpp index 00ea70046..77eff6744 100644 --- a/src/ModuleBase/ModuleBase_WidgetSwitch.cpp +++ b/src/ModuleBase/ModuleBase_WidgetSwitch.cpp @@ -18,9 +18,8 @@ #include #include -ModuleBase_WidgetSwitch::ModuleBase_WidgetSwitch(QWidget* theParent, const Config_WidgetAPI* theData, - const std::string& theParentId) -: ModuleBase_PagedContainer(theParent, theData, theParentId) +ModuleBase_WidgetSwitch::ModuleBase_WidgetSwitch(QWidget* theParent, const Config_WidgetAPI* theData) +: ModuleBase_PagedContainer(theParent, theData) { QVBoxLayout* aMainLay = new QVBoxLayout(this); //aMainLay->setContentsMargins(2, 4, 2, 2); diff --git a/src/ModuleBase/ModuleBase_WidgetSwitch.h b/src/ModuleBase/ModuleBase_WidgetSwitch.h index 1f278042b..8b127f4d2 100644 --- a/src/ModuleBase/ModuleBase_WidgetSwitch.h +++ b/src/ModuleBase/ModuleBase_WidgetSwitch.h @@ -27,10 +27,8 @@ class MODULEBASE_EXPORT ModuleBase_WidgetSwitch : public ModuleBase_PagedContain /// Constructor /// \param theParent the parent object /// \param theData the widget configuration. The attribute of the model widget is obtained from - /// \param theParentId is Id of a parent of the current attribute ModuleBase_WidgetSwitch(QWidget* theParent, - const Config_WidgetAPI* theData, - const std::string& theParentId); + const Config_WidgetAPI* theData); virtual ~ModuleBase_WidgetSwitch(); /// Defines if it is supported to set the value in this widget diff --git a/src/ModuleBase/ModuleBase_WidgetToolbox.cpp b/src/ModuleBase/ModuleBase_WidgetToolbox.cpp index 83afaa5d6..c1f35c987 100644 --- a/src/ModuleBase/ModuleBase_WidgetToolbox.cpp +++ b/src/ModuleBase/ModuleBase_WidgetToolbox.cpp @@ -18,9 +18,8 @@ #include #include -ModuleBase_WidgetToolbox::ModuleBase_WidgetToolbox(QWidget* theParent, const Config_WidgetAPI* theData, - const std::string& theParentId) -: ModuleBase_PagedContainer(theParent, theData, theParentId) +ModuleBase_WidgetToolbox::ModuleBase_WidgetToolbox(QWidget* theParent, const Config_WidgetAPI* theData) +: ModuleBase_PagedContainer(theParent, theData) { QVBoxLayout* aMainLayout = new QVBoxLayout(this); ModuleBase_Tools::zeroMargins(aMainLayout); diff --git a/src/ModuleBase/ModuleBase_WidgetToolbox.h b/src/ModuleBase/ModuleBase_WidgetToolbox.h index 28e48c0fc..08d851a14 100644 --- a/src/ModuleBase/ModuleBase_WidgetToolbox.h +++ b/src/ModuleBase/ModuleBase_WidgetToolbox.h @@ -25,9 +25,7 @@ class MODULEBASE_EXPORT ModuleBase_WidgetToolbox : public ModuleBase_PagedContai /// Constructor /// \param theParent the parent object /// \param theData the widget configuration. The attribute of the model widget is obtained from - /// \param theParentId is Id of a parent of the current attribute - ModuleBase_WidgetToolbox(QWidget* theParent, const Config_WidgetAPI* theData, - const std::string& theParentId); + ModuleBase_WidgetToolbox(QWidget* theParent, const Config_WidgetAPI* theData); virtual ~ModuleBase_WidgetToolbox(); /// Defines if it is supported to set the value in this widget diff --git a/src/ModuleBase/ModuleBase_WidgetValidated.cpp b/src/ModuleBase/ModuleBase_WidgetValidated.cpp index eedfb2b79..645f27143 100644 --- a/src/ModuleBase/ModuleBase_WidgetValidated.cpp +++ b/src/ModuleBase/ModuleBase_WidgetValidated.cpp @@ -24,9 +24,8 @@ ModuleBase_WidgetValidated::ModuleBase_WidgetValidated(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, - const Config_WidgetAPI* theData, - const std::string& theParentId) -: ModuleBase_ModelWidget(theParent, theData, theParentId), + const Config_WidgetAPI* theData) +: ModuleBase_ModelWidget(theParent, theData), myWorkshop(theWorkshop), myIsInValidate(false) { } diff --git a/src/ModuleBase/ModuleBase_WidgetValidated.h b/src/ModuleBase/ModuleBase_WidgetValidated.h index f60cd1a0e..b101e0517 100644 --- a/src/ModuleBase/ModuleBase_WidgetValidated.h +++ b/src/ModuleBase/ModuleBase_WidgetValidated.h @@ -38,11 +38,9 @@ class MODULEBASE_EXPORT ModuleBase_WidgetValidated : public ModuleBase_ModelWidg /// \param theParent the parent object /// \param theWorkshop a reference to workshop /// \param theData the widget configuation. The attribute of the model widget is obtained from - /// \param theParentId is Id of a parent of the current attribute ModuleBase_WidgetValidated(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, - const Config_WidgetAPI* theData, - const std::string& theParentId); + const Config_WidgetAPI* theData); virtual ~ModuleBase_WidgetValidated(); /// Checks whether all active viewer filters validate the presentation diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index a4e5d07a0..0849ba3e3 100755 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -564,15 +564,16 @@ void PartSet_Module::onOperationActivatedByPreselection() mySketchMgr->operationActivatedByPreselection(); } -ModuleBase_ModelWidget* PartSet_Module::createWidgetByType(const std::string& theType, QWidget* theParent, - Config_WidgetAPI* theWidgetApi, std::string theParentId) +ModuleBase_ModelWidget* PartSet_Module::createWidgetByType(const std::string& theType, + QWidget* theParent, + Config_WidgetAPI* theWidgetApi) { ModuleBase_IWorkshop* aWorkshop = workshop(); XGUI_Workshop* aXUIWorkshop = getWorkshop(); ModuleBase_ModelWidget* aWgt = NULL; if (theType == "sketch-start-label") { PartSet_WidgetSketchLabel* aLabelWgt = new PartSet_WidgetSketchLabel(theParent, aWorkshop, - theWidgetApi, theParentId, myHasConstraintShown); + theWidgetApi, myHasConstraintShown); connect(aLabelWgt, SIGNAL(planeSelected(const std::shared_ptr&)), mySketchMgr, SLOT(onPlaneSelected(const std::shared_ptr&))); connect(aLabelWgt, SIGNAL(showConstraintToggled(int, bool)), @@ -580,39 +581,39 @@ ModuleBase_ModelWidget* PartSet_Module::createWidgetByType(const std::string& th aWgt = aLabelWgt; } else if (theType == "sketch-2dpoint_selector") { PartSet_WidgetPoint2D* aPointWgt = new PartSet_WidgetPoint2D(theParent, aWorkshop, - theWidgetApi, theParentId); + theWidgetApi); aPointWgt->setSketch(mySketchMgr->activeSketch()); connect(aPointWgt, SIGNAL(vertexSelected()), sketchReentranceMgr(), SLOT(onVertexSelected())); aWgt = aPointWgt; }else if (theType == "sketch-2dpoint_flyout_selector") { PartSet_WidgetPoint2DFlyout* aPointWgt = new PartSet_WidgetPoint2DFlyout(theParent, aWorkshop, - theWidgetApi, theParentId); + theWidgetApi); aPointWgt->setSketch(mySketchMgr->activeSketch()); connect(aPointWgt, SIGNAL(vertexSelected()), sketchReentranceMgr(), SLOT(onVertexSelected())); aWgt = aPointWgt; } else if (theType == "point2ddistance") { PartSet_WidgetPoint2dDistance* aDistanceWgt = new PartSet_WidgetPoint2dDistance(theParent, - aWorkshop, theWidgetApi, theParentId); + aWorkshop, theWidgetApi); aDistanceWgt->setSketch(mySketchMgr->activeSketch()); aWgt = aDistanceWgt; } else if (theType == "sketch_shape_selector") { PartSet_WidgetShapeSelector* aShapeSelectorWgt = - new PartSet_WidgetShapeSelector(theParent, aWorkshop, theWidgetApi, theParentId); + new PartSet_WidgetShapeSelector(theParent, aWorkshop, theWidgetApi); aShapeSelectorWgt->setSketcher(mySketchMgr->activeSketch()); aWgt = aShapeSelectorWgt; } else if (theType == "sketch_multi_selector") { PartSet_WidgetMultiSelector* aShapeSelectorWgt = - new PartSet_WidgetMultiSelector(theParent, aWorkshop, theWidgetApi, theParentId); + new PartSet_WidgetMultiSelector(theParent, aWorkshop, theWidgetApi); aShapeSelectorWgt->setSketcher(mySketchMgr->activeSketch()); aWgt = aShapeSelectorWgt; } else if (theType == WDG_DOUBLEVALUE_EDITOR) { - aWgt = new PartSet_WidgetEditor(theParent, aWorkshop, theWidgetApi, theParentId); + aWgt = new PartSet_WidgetEditor(theParent, aWorkshop, theWidgetApi); } else if (theType == "export_file_selector") { - aWgt = new PartSet_WidgetFileSelector(theParent, aWorkshop, theWidgetApi, theParentId); + aWgt = new PartSet_WidgetFileSelector(theParent, aWorkshop, theWidgetApi); } else if (theType == "sketch_launcher") { - aWgt = new PartSet_WidgetSketchCreator(theParent, this, theWidgetApi, theParentId); + aWgt = new PartSet_WidgetSketchCreator(theParent, this, theWidgetApi); } else if (theType == "module_choice") { - aWgt = new PartSet_WidgetChoice(theParent, theWidgetApi, theParentId); + aWgt = new PartSet_WidgetChoice(theParent, theWidgetApi); connect(aWgt, SIGNAL(itemSelected(int)), SLOT(onBooleanOperationChange(int))); } return aWgt; diff --git a/src/PartSet/PartSet_Module.h b/src/PartSet/PartSet_Module.h index 52c677690..d3731bd8b 100755 --- a/src/PartSet/PartSet_Module.h +++ b/src/PartSet/PartSet_Module.h @@ -74,7 +74,7 @@ public: /// Creates custom widgets for property panel virtual ModuleBase_ModelWidget* createWidgetByType(const std::string& theType, QWidget* theParent, - Config_WidgetAPI* theWidgetApi, std::string theParentId); + Config_WidgetAPI* theWidgetApi); /// Returns the active widget, by default it is the property panel active widget /// If the internal edit operation is started, this is the first widget of the operation diff --git a/src/PartSet/PartSet_WidgetChoice.h b/src/PartSet/PartSet_WidgetChoice.h index 6b5e965f8..d83bc3643 100644 --- a/src/PartSet/PartSet_WidgetChoice.h +++ b/src/PartSet/PartSet_WidgetChoice.h @@ -22,10 +22,8 @@ Q_OBJECT /// Constructor /// \param theParent the parent object /// \param theData the widget configuation. The attribute of the model widget is obtained from - /// \param theParentId is Id of a parent of the current attribute - PartSet_WidgetChoice(QWidget* theParent, const Config_WidgetAPI* theData, - const std::string& theParentId) - : ModuleBase_WidgetChoice(theParent, theData, theParentId) {} + PartSet_WidgetChoice(QWidget* theParent, const Config_WidgetAPI* theData) + : ModuleBase_WidgetChoice(theParent, theData) {} }; #endif \ No newline at end of file diff --git a/src/PartSet/PartSet_WidgetEditor.cpp b/src/PartSet/PartSet_WidgetEditor.cpp index d0a129aba..54e455ceb 100644 --- a/src/PartSet/PartSet_WidgetEditor.cpp +++ b/src/PartSet/PartSet_WidgetEditor.cpp @@ -14,9 +14,8 @@ #include PartSet_WidgetEditor::PartSet_WidgetEditor(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, - const Config_WidgetAPI* theData, - const std::string& theParentId) - : ModuleBase_WidgetEditor(theParent, theData, theParentId), myWorkshop(theWorkshop) + const Config_WidgetAPI* theData) + : ModuleBase_WidgetEditor(theParent, theData), myWorkshop(theWorkshop) { } diff --git a/src/PartSet/PartSet_WidgetEditor.h b/src/PartSet/PartSet_WidgetEditor.h index 3536ebfaf..432b7d141 100644 --- a/src/PartSet/PartSet_WidgetEditor.h +++ b/src/PartSet/PartSet_WidgetEditor.h @@ -27,9 +27,8 @@ Q_OBJECT /// \param theParent the parent object /// \param theWorkshop instance of workshop interface /// \param theData the widget configuration. The attribute of the model widget is obtained from - /// \param theParentId is Id of a parent of the current attribute PartSet_WidgetEditor(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, - const Config_WidgetAPI* theData, const std::string& theParentId); + const Config_WidgetAPI* theData); virtual ~PartSet_WidgetEditor() {} diff --git a/src/PartSet/PartSet_WidgetFileSelector.cpp b/src/PartSet/PartSet_WidgetFileSelector.cpp index c9ed766b4..b493c2a86 100644 --- a/src/PartSet/PartSet_WidgetFileSelector.cpp +++ b/src/PartSet/PartSet_WidgetFileSelector.cpp @@ -15,10 +15,9 @@ PartSet_WidgetFileSelector::PartSet_WidgetFileSelector(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, - const Config_WidgetAPI* theData, - const std::string& theParentId) -: ModuleBase_WidgetFileSelector(theParent, theData, theParentId) -, myWorkshop(theWorkshop) + const Config_WidgetAPI* theData) +: ModuleBase_WidgetFileSelector(theParent, theData), + myWorkshop(theWorkshop) { } diff --git a/src/PartSet/PartSet_WidgetFileSelector.h b/src/PartSet/PartSet_WidgetFileSelector.h index 70207a0cd..632cb0571 100644 --- a/src/PartSet/PartSet_WidgetFileSelector.h +++ b/src/PartSet/PartSet_WidgetFileSelector.h @@ -29,11 +29,9 @@ public: /// \param theParent the parent object /// \param theWorkshop instance of workshop interface /// \param theData the widget configuration. The attribute of the model widget is obtained from - /// \param theParentId is Id of a parent of the current attribute PartSet_WidgetFileSelector(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, - const Config_WidgetAPI* theData, - const std::string& theParentId); + const Config_WidgetAPI* theData); virtual ~PartSet_WidgetFileSelector() {} diff --git a/src/PartSet/PartSet_WidgetMultiSelector.cpp b/src/PartSet/PartSet_WidgetMultiSelector.cpp index afb664ed0..bfa7a8d30 100755 --- a/src/PartSet/PartSet_WidgetMultiSelector.cpp +++ b/src/PartSet/PartSet_WidgetMultiSelector.cpp @@ -31,9 +31,8 @@ PartSet_WidgetMultiSelector::PartSet_WidgetMultiSelector(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, - const Config_WidgetAPI* theData, - const std::string& theParentId) -: ModuleBase_WidgetMultiSelector(theParent, theWorkshop, theData, theParentId) + const Config_WidgetAPI* theData) +: ModuleBase_WidgetMultiSelector(theParent, theWorkshop, theData) { myExternalObjectMgr = new PartSet_ExternalObjectsMgr(theData->getProperty("use_external"), false); } diff --git a/src/PartSet/PartSet_WidgetMultiSelector.h b/src/PartSet/PartSet_WidgetMultiSelector.h index 5207201cb..2f94057a7 100644 --- a/src/PartSet/PartSet_WidgetMultiSelector.h +++ b/src/PartSet/PartSet_WidgetMultiSelector.h @@ -30,9 +30,8 @@ Q_OBJECT /// \param theParent the parent object /// \param theWorkshop instance of workshop interface /// \param theData the widget configuation. The attribute of the model widget is obtained from - /// \param theParentId is Id of a parent of the current attribute PartSet_WidgetMultiSelector(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, - const Config_WidgetAPI* theData, const std::string& theParentId); + const Config_WidgetAPI* theData); virtual ~PartSet_WidgetMultiSelector(); diff --git a/src/PartSet/PartSet_WidgetPoint2DFlyout.cpp b/src/PartSet/PartSet_WidgetPoint2DFlyout.cpp index fa0b72579..bb4d54b0e 100755 --- a/src/PartSet/PartSet_WidgetPoint2DFlyout.cpp +++ b/src/PartSet/PartSet_WidgetPoint2DFlyout.cpp @@ -18,9 +18,8 @@ PartSet_WidgetPoint2DFlyout::PartSet_WidgetPoint2DFlyout(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, - const Config_WidgetAPI* theData, - const std::string& theParentId) - : PartSet_WidgetPoint2D(theParent, theWorkshop, theData, theParentId) + const Config_WidgetAPI* theData) + : PartSet_WidgetPoint2D(theParent, theWorkshop, theData) { } diff --git a/src/PartSet/PartSet_WidgetPoint2DFlyout.h b/src/PartSet/PartSet_WidgetPoint2DFlyout.h index 637d14f52..f6247b33f 100755 --- a/src/PartSet/PartSet_WidgetPoint2DFlyout.h +++ b/src/PartSet/PartSet_WidgetPoint2DFlyout.h @@ -25,10 +25,8 @@ public: /// \param theParent the parent object /// \param theWorkshop a current workshop /// \param theData the widget configuation. The attribute of the model widget is obtained from - /// \param theParentId is Id of a parent of the current attribute PartSet_WidgetPoint2DFlyout(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, - const Config_WidgetAPI* theData, - const std::string& theParentId); + const Config_WidgetAPI* theData); /// Destructor virtual ~PartSet_WidgetPoint2DFlyout() {}; diff --git a/src/PartSet/PartSet_WidgetPoint2d.cpp b/src/PartSet/PartSet_WidgetPoint2d.cpp index 49940a310..82f7683c2 100644 --- a/src/PartSet/PartSet_WidgetPoint2d.cpp +++ b/src/PartSet/PartSet_WidgetPoint2d.cpp @@ -58,9 +58,8 @@ static QStringList MyFeaturesForCoincedence; PartSet_WidgetPoint2D::PartSet_WidgetPoint2D(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, - const Config_WidgetAPI* theData, - const std::string& theParentId) -: ModuleBase_ModelWidget(theParent, theData, theParentId), myWorkshop(theWorkshop), + const Config_WidgetAPI* theData) +: ModuleBase_ModelWidget(theParent, theData), myWorkshop(theWorkshop), myValueIsCashed(false), myIsFeatureVisibleInCash(true), myXValueInCash(0), myYValueInCash(0) { diff --git a/src/PartSet/PartSet_WidgetPoint2d.h b/src/PartSet/PartSet_WidgetPoint2d.h index 4395b6eb2..e179720d3 100755 --- a/src/PartSet/PartSet_WidgetPoint2d.h +++ b/src/PartSet/PartSet_WidgetPoint2d.h @@ -42,10 +42,8 @@ Q_OBJECT /// \param theParent the parent object /// \param theWorkshop a current workshop /// \param theData the widget configuation. The attribute of the model widget is obtained from - /// \param theParentId is Id of a parent of the current attribute PartSet_WidgetPoint2D(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, - const Config_WidgetAPI* theData, - const std::string& theParentId); + const Config_WidgetAPI* theData); /// Destructor virtual ~PartSet_WidgetPoint2D(); diff --git a/src/PartSet/PartSet_WidgetPoint2dDistance.cpp b/src/PartSet/PartSet_WidgetPoint2dDistance.cpp index 9e92051b7..ed8165c23 100644 --- a/src/PartSet/PartSet_WidgetPoint2dDistance.cpp +++ b/src/PartSet/PartSet_WidgetPoint2dDistance.cpp @@ -28,9 +28,8 @@ PartSet_WidgetPoint2dDistance::PartSet_WidgetPoint2dDistance(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, - const Config_WidgetAPI* theData, - const std::string& theParentId) -: ModuleBase_WidgetDoubleValue(theParent, theData, theParentId), myWorkshop(theWorkshop), + const Config_WidgetAPI* theData) +: ModuleBase_WidgetDoubleValue(theParent, theData), myWorkshop(theWorkshop), myValueIsCashed(false), myIsFeatureVisibleInCash(true), myValueInCash(0) { myFirstPntName = theData->getProperty("first_point"); diff --git a/src/PartSet/PartSet_WidgetPoint2dDistance.h b/src/PartSet/PartSet_WidgetPoint2dDistance.h index 1cac83c89..c81a3dc82 100644 --- a/src/PartSet/PartSet_WidgetPoint2dDistance.h +++ b/src/PartSet/PartSet_WidgetPoint2dDistance.h @@ -42,10 +42,8 @@ Q_OBJECT /// \param theParent the parent object /// \param theWorkshop a current workshop /// \param theData the widget configuation. The attribute of the model widget is obtained from - /// \param theParentId is Id of a parent of the current attribute - PartSet_WidgetPoint2dDistance(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, - const Config_WidgetAPI* theData, - const std::string& theParentId); + PartSet_WidgetPoint2dDistance(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, + const Config_WidgetAPI* theData); virtual ~PartSet_WidgetPoint2dDistance(); diff --git a/src/PartSet/PartSet_WidgetShapeSelector.cpp b/src/PartSet/PartSet_WidgetShapeSelector.cpp index 6f841163a..84d5644b5 100755 --- a/src/PartSet/PartSet_WidgetShapeSelector.cpp +++ b/src/PartSet/PartSet_WidgetShapeSelector.cpp @@ -28,9 +28,8 @@ PartSet_WidgetShapeSelector::PartSet_WidgetShapeSelector(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, - const Config_WidgetAPI* theData, - const std::string& theParentId) -: ModuleBase_WidgetShapeSelector(theParent, theWorkshop, theData, theParentId) + const Config_WidgetAPI* theData) +: ModuleBase_WidgetShapeSelector(theParent, theWorkshop, theData) { myUseSketchPlane = theData->getBooleanAttribute("use_sketch_plane", true); myExternalObjectMgr = new PartSet_ExternalObjectsMgr(theData->getProperty("use_external"), true); diff --git a/src/PartSet/PartSet_WidgetShapeSelector.h b/src/PartSet/PartSet_WidgetShapeSelector.h index 93cf342d7..ddbc8ba43 100644 --- a/src/PartSet/PartSet_WidgetShapeSelector.h +++ b/src/PartSet/PartSet_WidgetShapeSelector.h @@ -29,9 +29,8 @@ Q_OBJECT /// \param theParent the parent object /// \param theWorkshop instance of workshop interface /// \param theData the widget configuation. The attribute of the model widget is obtained from - /// \param theParentId is Id of a parent of the current attribute PartSet_WidgetShapeSelector(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, - const Config_WidgetAPI* theData, const std::string& theParentId); + const Config_WidgetAPI* theData); virtual ~PartSet_WidgetShapeSelector(); diff --git a/src/PartSet/PartSet_WidgetSketchCreator.cpp b/src/PartSet/PartSet_WidgetSketchCreator.cpp index 308dd965f..b965f4348 100644 --- a/src/PartSet/PartSet_WidgetSketchCreator.cpp +++ b/src/PartSet/PartSet_WidgetSketchCreator.cpp @@ -42,9 +42,8 @@ PartSet_WidgetSketchCreator::PartSet_WidgetSketchCreator(QWidget* theParent, PartSet_Module* theModule, - const Config_WidgetAPI* theData, - const std::string& theParentId) -: ModuleBase_ModelWidget(theParent, theData, theParentId), myModule(theModule), myUseBody(true) + const Config_WidgetAPI* theData) +: ModuleBase_ModelWidget(theParent, theData), myModule(theModule), myUseBody(true) { QFormLayout* aLayout = new QFormLayout(this); ModuleBase_Tools::adjustMargins(aLayout); diff --git a/src/PartSet/PartSet_WidgetSketchCreator.h b/src/PartSet/PartSet_WidgetSketchCreator.h index f92285d37..4bb31fe94 100644 --- a/src/PartSet/PartSet_WidgetSketchCreator.h +++ b/src/PartSet/PartSet_WidgetSketchCreator.h @@ -32,9 +32,8 @@ Q_OBJECT /// \param theParent the parent object /// \param theModule a reference to a module object /// \param theData the widget configuation. The attribute of the model widget is obtained from - /// \param theParentId is Id of a parent of the current attribute - PartSet_WidgetSketchCreator(QWidget* theParent, PartSet_Module* theModule, - const Config_WidgetAPI* theData, const std::string& theParentId); + PartSet_WidgetSketchCreator(QWidget* theParent, PartSet_Module* theModule, + const Config_WidgetAPI* theData); virtual ~PartSet_WidgetSketchCreator(); diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index fa2f50750..d424aa7e7 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -57,9 +57,8 @@ PartSet_WidgetSketchLabel::PartSet_WidgetSketchLabel(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, const Config_WidgetAPI* theData, - const std::string& theParentId, const QMap& toShowConstraints) -: ModuleBase_WidgetValidated(theParent, theWorkshop, theData, theParentId), +: ModuleBase_WidgetValidated(theParent, theWorkshop, theData), myPreviewDisplayed(false) { QVBoxLayout* aLayout = new QVBoxLayout(this); diff --git a/src/PartSet/PartSet_WidgetSketchLabel.h b/src/PartSet/PartSet_WidgetSketchLabel.h index 0d1d44056..90c291bcd 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.h +++ b/src/PartSet/PartSet_WidgetSketchLabel.h @@ -48,11 +48,9 @@ public: /// \param theParent the parent object /// \param theWorkshop a reference to workshop /// \param theData the widget configuation. The attribute of the model widget is obtained from - /// \param theParentId is Id of a parent of the current attribute /// \param toShowConstraints a current show constraints state PartSet_WidgetSketchLabel(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, const Config_WidgetAPI* theData, - const std::string& theParentId, const QMap& toShowConstraints); virtual ~PartSet_WidgetSketchLabel();