pyqt之QGraphics系列----节点编辑器(六)
2018-10-19 本文已影响0人
WoHowLearn
仓库地址 https://gitlab.com/pavel.krupala/pyqt-node-editor-tutorials.git

效果图

代码
添加的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
