刷新qgraphicscene pyqt奇数结果

2024-09-30 01:22:22 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图在pyqt中构建一个简单的节点图。我有一些问题与一个自定义小部件离开工件,并没有正确绘制时,鼠标移动。见下图:

Before I move the node with the mouse 在我用鼠标移动节点之前。在

After I move the mode with the mouse 在我用鼠标移动模式之后

我想可能是我的自定义小部件nodefx上的绑定方法:

def boundingRect(self):
        """Bounding."""
        return QtCore.QRectF(self.pos().x(),
                             self.pos().y(),
                             self.width,
                             self.height)

有什么想法吗?完成下面的py文件。在

^{pr2}$

Tags: 方法posselfreturn节点部件def模式

热门问题