Skip to content

Commit

Permalink
Start using c++ base clases in model designer
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Mar 2, 2020
1 parent d9cc2ae commit 72d7305
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 77 deletions.
Expand Up @@ -10,6 +10,7 @@




class QgsModelComponentGraphicItem : QGraphicsObject
{
%Docstring
Expand All @@ -32,6 +33,11 @@ Base class for graphic items representing model components in the model designer
Constructor for QgsModelComponentGraphicItem for the specified ``component``, with the specified ``parent`` item.

Ownership of ``component`` is transferred to the item.
%End

QgsProcessingModelComponent *component();
%Docstring
Returns the model component associated with this item.
%End

};
Expand Down
6 changes: 3 additions & 3 deletions python/plugins/processing/modeler/ModelerArrowItem.py
Expand Up @@ -83,14 +83,14 @@ def updatePath(self):
self.endPoints = []
controlPoints = []
endPt = self.endItem.getLinkPointForParameter(self.endIndex)
if isinstance(self.startItem.element, QgsProcessingModelParameter):
if isinstance(self.startItem.component(), QgsProcessingModelParameter):
startPt = self.startItem.getLinkPointForParameter(self.startIndex)
else:
startPt = self.startItem.getLinkPointForOutput(self.startIndex)
if isinstance(self.endItem.element, QgsProcessingModelParameter):
if isinstance(self.endItem.component(), QgsProcessingModelParameter):
endPt = self.endItem.getLinkPointForParameter(self.startIndex)

if isinstance(self.startItem.element, QgsProcessingModelChildAlgorithm):
if isinstance(self.startItem.component(), QgsProcessingModelChildAlgorithm):
if self.startIndex != -1:
controlPoints.append(self.startItem.pos() + startPt)
controlPoints.append(self.startItem.pos() + startPt +
Expand Down

0 comments on commit 72d7305

Please sign in to comment.