mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-02 16:28:51 +02:00
[ui] homogenize PySide imports
This commit is contained in:
parent
d4509ec20e
commit
7ddf86e6bc
1 changed files with 9 additions and 9 deletions
|
@ -1,32 +1,32 @@
|
|||
from PySide2 import QtCore
|
||||
from PySide2.QtCore import QObject, Slot, Property, Signal
|
||||
|
||||
from meshroom.core import graph
|
||||
from meshroom.ui import commands
|
||||
|
||||
|
||||
class Reconstruction(QtCore.QObject):
|
||||
class Reconstruction(QObject):
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super(Reconstruction, self).__init__(parent)
|
||||
self._graph = graph.Graph("")
|
||||
self._undoStack = commands.UndoStack(self)
|
||||
|
||||
@QtCore.Slot(str)
|
||||
@Slot(str)
|
||||
def addNode(self, nodeType):
|
||||
self._undoStack.tryAndPush(commands.AddNodeCommand(self._graph, nodeType))
|
||||
|
||||
@QtCore.Slot(graph.Node)
|
||||
@Slot(graph.Node)
|
||||
def removeNode(self, node):
|
||||
self._undoStack.tryAndPush(commands.RemoveNodeCommand(self._graph, node))
|
||||
|
||||
@QtCore.Slot(graph.Attribute, "QVariant")
|
||||
@Slot(graph.Attribute, "QVariant")
|
||||
def setAttribute(self, attribute, value):
|
||||
self._undoStack.tryAndPush(commands.SetAttributeCommand(self._graph, attribute, value))
|
||||
|
||||
@QtCore.Slot(str)
|
||||
@Slot(str)
|
||||
def load(self, filepath):
|
||||
self._graph.load(filepath)
|
||||
|
||||
undoStack = QtCore.Property(QtCore.QObject, lambda self: self._undoStack, constant=True)
|
||||
graph = QtCore.Property(QtCore.QObject, lambda self: self._graph, constant=True)
|
||||
nodes = QtCore.Property(QtCore.QObject, lambda self: self._graph.nodes, constant=True)
|
||||
undoStack = Property(QObject, lambda self: self._undoStack, constant=True)
|
||||
graph = Property(graph.Graph, lambda self: self._graph, constant=True)
|
||||
nodes = Property(QObject, lambda self: self._graph.nodes, constant=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue