-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui_graphics.py
More file actions
46 lines (34 loc) · 1.44 KB
/
ui_graphics.py
File metadata and controls
46 lines (34 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
class UIGraphics(QWidget):
def __init__(self, UI, scene, parent=None):
super().__init__(parent)
self.scene = scene
self.UI = UI
self.console = self.scene.console
self.nodeTypeList = UI.nodeTypeList
self.createHorizontalLayout()
windowLayout = QVBoxLayout()
windowLayout.addWidget(self.horizontalGroupBox)
self.setLayout(windowLayout)
def createHorizontalLayout(self):
self.horizontalGroupBox = QGroupBox("Editor")
layout = QHBoxLayout()
nodeTypeComboBox = QComboBox(self)
for item in self.nodeTypeList:
nodeTypeComboBox.addItem(item)
nodeTypeComboBox.activated[str].connect(self.UI.nodeChoice)
layout.addWidget(nodeTypeComboBox)
addNode = QPushButton('Create New Node', self)
addNode.clicked.connect(self.UI.addNode)
layout.addWidget(addNode)
buttonRed = QPushButton('Interesting Button', self)
buttonRed.clicked.connect(self.on_click)
layout.addWidget(buttonRed)
buttonGreen = QPushButton('Useful Button', self)
buttonGreen.clicked.connect(self.on_click)
layout.addWidget(buttonGreen)
self.horizontalGroupBox.setLayout(layout)
def on_click(self):
print('PyQt5 button click')