Beispiel #1
0
 def addContainer(self):
     container = QGraphicsWidget()
     container.setObjectName('{0}PinContainerWidget'.format(self.name))
     container.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Maximum)
     container.sizeHint(QtCore.Qt.MinimumSize, QtCore.QSizeF(50.0, 10.0))
     lyt = QGraphicsLinearLayout()
     lyt.setSizePolicy(QSizePolicy.Maximum, QSizePolicy.Maximum)
     lyt.setContentsMargins(1, 1, 1, 1)
     container.setLayout(lyt)
     return container
Beispiel #2
0
    def addContainer(self, portType, head=False):
        container = QGraphicsWidget()
        container.setObjectName('{0}PinContainerWidget'.format(self.name))
        container.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Maximum)
        container.sizeHint(QtCore.Qt.MinimumSize, QtCore.QSizeF(50.0, 10.0))

        lyt = QGraphicsLinearLayout()
        lyt.setSizePolicy(QSizePolicy.Maximum, QSizePolicy.Maximum)
        lyt.setContentsMargins(1, 1, 1, 1)
        container.setLayout(lyt)
        if portType == PinDirection.Input:
            self.inputsLayout.addItem(container)
        else:
            self.outputsLayout.addItem(container)
        return container
Beispiel #3
0
 def sizeHint(self, which, constraint):
     try:
         return QtCore.QSizeF(self.pinSize, self.height)
     except:
         return QGraphicsWidget.sizeHint(self, which, constraint)