美文网首页
pyqt之QGraphics系列----节点编辑器(六)

pyqt之QGraphics系列----节点编辑器(六)

作者: WoHowLearn | 来源:发表于2018-10-19 15:41 被阅读0次

仓库地址 https://gitlab.com/pavel.krupala/pyqt-node-editor-tutorials.git

image.png

效果图

node的变化

代码

添加的qss暂时不讲;
添加qwidget控件进qgraphics

  • node_content_widget.py
from PyQt5.QtWidgets import *

class QDMNodeContentWidget(QWidget):
    def __init__(self, parent=None):
        super().__init__(parent)

        self.initUI()

    def initUI(self):
        self.layout = QVBoxLayout()
        self.layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(self.layout)

        self.wdg_label = QLabel("Some Title")
        self.layout.addWidget(self.wdg_label)
        self.layout.addWidget(QTextEdit("foo"))

如何把widget窗体 放入 qgraphics , 用 QGraphicsProxyWidget

调用

相关文章

网友评论

      本文标题:pyqt之QGraphics系列----节点编辑器(六)

      本文链接:https://www.haomeiwen.com/subject/fjoyzftx.html