示例#1
0
    def reset(self):
        self.setScene(QtWidgets.QGraphicsScene())

        self.__connections = set()
        self.__nodes = {}
        self.__selection = set()

        self._manipulationMode = MANIP_MODE_NONE
        self._selectionRect = None
示例#2
0
    def __init__(self, valueController, parent=None):
        super(ColorEditor, self).__init__(valueController, parent=parent)

        hbox = QtWidgets.QHBoxLayout()
        self._editors = []

        self._qgraphcsScene = QtWidgets.QGraphicsScene(self)
        self._qgraphcsView = QtWidgets.QGraphicsView(self)
        self._qgraphcsView.setScene(self._qgraphcsScene)
        self._qgraphcsView.setFixedSize(100, 20)
        self._qgraphcsView.setSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                         QtWidgets.QSizePolicy.Fixed)
        hbox.addWidget(self._qgraphcsView, 1)

        hbox.addStretch(0)
        hbox.setContentsMargins(0, 0, 0, 0)
        self.setLayout(hbox)
        self.setSizePolicy(QtWidgets.QSizePolicy.Preferred,
                           QtWidgets.QSizePolicy.Fixed)
        self.updateEditorValue()
        self.setEditable(valueController.isEditable())
示例#3
0
 def reset(self):
     self.setScene(QtWidgets.QGraphicsScene())