我正在尝试创建一个这样的组织结构图:
但我现在陷入困境:
我尝试将Flexbox与Svg连接起来,但没有得到我希望的结果。
我的代码到目前为止: 在App.vue中
paintEvent()
DisplayNode.vue中的
from PyQt5 import Qt
from PyQt5.QtGui import QPainter, QPen,QBrush,QColor
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication, QMainWindow, QWidget, QHBoxLayout,QPushButton
import sys
class MyWidget(QWidget):
def __init__(self, parent=None):
QMainWindow.__init__(self, parent)
self.btn = QPushButton('Hello World')
self.layout = QHBoxLayout()
self.layout.addWidget(self.btn)
self.setLayout(self.layout)
def paintEvent(self, event):
painter = QPainter(self)
painter.setPen(QPen(Qt.green))
brush = QBrush(QColor(0,0,255,255))
painter.setBrush(brush)
painter.drawRect(0,0,50,50)
if __name__ == "__main__":
app = QApplication(sys.argv)
mainscreen = MyWidget()
mainscreen.show()
app.exec_()