def testQGraphicsProxyWidget(self):
        scene = QGraphicsScene()

        proxy = QGraphicsProxyWidget(None, Qt.Window)
        widget = QLabel('Widget')
        proxy.setWidget(widget)
        proxy.setCacheMode(QGraphicsItem.DeviceCoordinateCache)
        scene.addItem(proxy)
        scene.setSceneRect(scene.itemsBoundingRect())

        view = QGraphicsView(scene)
        view.setRenderHints(QPainter.Antialiasing|QPainter.SmoothPixmapTransform)
        view.setViewportUpdateMode(QGraphicsView.BoundingRectViewportUpdate)
        view.show()

        timer = QTimer.singleShot(100, self.app.quit)
        self.app.exec_()
示例#2
0
    def testQGraphicsProxyWidget(self):
        scene = QGraphicsScene()

        proxy = QGraphicsProxyWidget(None, Qt.Window)
        widget = QLabel('Widget')
        proxy.setWidget(widget)
        proxy.setCacheMode(QGraphicsItem.DeviceCoordinateCache)
        scene.addItem(proxy)
        scene.setSceneRect(scene.itemsBoundingRect())

        view = QGraphicsView(scene)
        view.setRenderHints(QPainter.Antialiasing|QPainter.SmoothPixmapTransform)
        view.setViewportUpdateMode(QGraphicsView.BoundingRectViewportUpdate)
        view.show()

        timer = QTimer.singleShot(100, self.app.quit)
        self.app.exec_()
示例#3
0
 def keyPressEvent(self, arg__1):
     QGraphicsProxyWidget.keyPressEvent(self, arg__1)
     if arg__1.isAccepted():
         self.flow.ignore_key_event = True
示例#4
0
 def wheelEvent(self, event):
     QGraphicsProxyWidget.wheelEvent(self, event)
示例#5
0
 def mouseReleaseEvent(self, arg__1):
     self.flow.ignore_mouse_event = True
     QGraphicsProxyWidget.mouseReleaseEvent(self, arg__1)
示例#6
0
 def mousePressEvent(self, arg__1):
     QGraphicsProxyWidget.mousePressEvent(self, arg__1)
     if arg__1.isAccepted():
         self.flow.ignore_mouse_event = True
 def __init__(self, parent=None, wFlags=0):
     QGraphicsProxyWidget.__init__(self, parent, wFlags)
示例#8
0
def createItem(minimum, preferred, maximum, name):
    w = QGraphicsProxyWidget()

    w.setWidget(QPushButton(name))
    w.setMinimumSize(minimum)
    w.setPreferredSize(preferred)
    w.setMaximumSize(maximum)
    w.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)

    return w
 def SetModuleWidget(self, x, y, WindowModule):
     Widget = QGraphicsProxyWidget()
     Widget.setWidget(WindowModule)
     Widget.setWindowFlags(Qt.Window)
     Widget.setPos(x, y)
     Widget.setFlag(PySide2.QtWidgets.QGraphicsItem.ItemIsMovable, True)
     Widget.setFlag(PySide2.QtWidgets.QGraphicsItem.ItemIsSelectable, True)
     self.GraphicsSceneCont.addItem(Widget)
 def __init__(self, parent=None, wFlags=0):
     QGraphicsProxyWidget.__init__(self, parent, wFlags)
示例#11
0
def createItem(minimum, preferred, maximum, name):
    w = QGraphicsProxyWidget()

    w.setWidget(QPushButton(name))
    w.setMinimumSize(minimum)
    w.setPreferredSize(preferred)
    w.setMaximumSize(maximum)
    w.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)

    return w