mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-23 05:56:36 +02:00
[ui][commands] add MoveNodeCommand
add undoable command to move a Node to a target position
This commit is contained in:
parent
e2155ba962
commit
ac4772fc57
2 changed files with 30 additions and 0 deletions
|
@ -252,6 +252,19 @@ class UIGraph(QObject):
|
|||
"""
|
||||
return self.push(commands.AddNodeCommand(self._graph, nodeType, **kwargs))
|
||||
|
||||
@Slot(Node, QPoint)
|
||||
def moveNode(self, node, position):
|
||||
"""
|
||||
Move 'node' to the given 'position'.
|
||||
|
||||
Args:
|
||||
node (Node): the node to move
|
||||
position (QPoint): the target position
|
||||
"""
|
||||
if isinstance(position, QPoint):
|
||||
position = Position(position.x(), position.y())
|
||||
self.push(commands.MoveNodeCommand(self._graph, node, position))
|
||||
|
||||
@Slot(Node)
|
||||
def removeNode(self, node):
|
||||
self.push(commands.RemoveNodeCommand(self._graph, node))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue