Skip to content

Commit

Permalink
Fix the scope of getAllSubtypeOf when using the instance api (#10536)
Browse files Browse the repository at this point in the history
Fixes #10273
  • Loading branch information
adeas31 committed Apr 12, 2023
1 parent 930eb48 commit cd44e8d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
12 changes: 11 additions & 1 deletion OMEdit/OMEditLIB/Element/ElementProperties.cpp
Expand Up @@ -597,7 +597,7 @@ void Parameter::createValueWidget()
}
}
choices = mpModelInstanceElement->getAnnotation()->getChoices().getChoices();
parentClassName = mpModelInstanceElement->getParentModel()->getName();
parentClassName = mpElementParameters->getElementParentClassName();
if (mpModelInstanceElement->getModel()) {
restriction = mpModelInstanceElement->getModel()->getRestriction();
} else {
Expand Down Expand Up @@ -1102,6 +1102,16 @@ ElementParameters::~ElementParameters()
mParametersList.clear();
}

/*!
* \brief ElementParameters::getElementParentClassName
* Returns the class name where the component is defined.
* \return
*/
QString ElementParameters::getElementParentClassName() const
{
return mpElement->getParentModel()->getName();
}

/*!
* \brief ElementParameters::applyStartFixedAndDisplayUnitModifiers
* \param pParameter
Expand Down
1 change: 1 addition & 0 deletions OMEdit/OMEditLIB/Element/ElementProperties.h
Expand Up @@ -188,6 +188,7 @@ class ElementParameters : public QDialog
public:
ElementParameters(ModelInstance::Element *pElement, GraphicsView *pGraphicsView, bool inherited, bool nested, QWidget *pParent = 0);
~ElementParameters();
QString getElementParentClassName() const;
GraphicsView *getGraphicsView() const {return mpGraphicsView;}
bool isInherited() const {return mInherited;}
QString getModification() const {return mModification;}
Expand Down
2 changes: 1 addition & 1 deletion OMEdit/OMEditLIB/Modeling/Model.h
Expand Up @@ -702,7 +702,7 @@ namespace ModelInstance
virtual QString getName() const override {return mName;}
virtual QString getQualifiedName() const override;
virtual QString getRootType() const override {return mName;}
virtual QString getType() const override {return mName;}
virtual QString getType() const override {return mBaseClass;}
virtual bool isShortClassDefinition() const override {return mIsShortClassDefinition;}
virtual bool isComponent() const override {return false;}
virtual bool isExtend() const override {return false;}
Expand Down

0 comments on commit cd44e8d

Please sign in to comment.