This repository has been archived by the owner on Apr 17, 2024. It is now read-only.
forked from ElCapor/bloxlib-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.py
68 lines (49 loc) · 2.08 KB
/
ui.py
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
from Instance import Instance
from Exploit import roblox
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QApplication, QTreeWidget, QTreeWidgetItem, QMainWindow, QWidget, QVBoxLayout,QLabel, QLineEdit, QHBoxLayout, QComboBox
from Memory import GetDataModel
def GetDescendants(apple_item, instance):
# Add the current instance to the tree widget
instance_item = QTreeWidgetItem([instance.GetName()])
apple_item.addChild(instance_item)
# Recursively add the descendants of the current instance to the tree widget
for child_instance in instance.GetChildren():
GetDescendants(instance_item, child_instance)
class MainWindow(QMainWindow):
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
self.form_widget = FormWidget(self)
_widget = QWidget()
_layout = QVBoxLayout(_widget)
_layout.addWidget(self.form_widget)
self.setCentralWidget(_widget)
class FormWidget(QWidget):
def __init__(self, parent):
super(FormWidget, self).__init__(parent)
self.datamodel()
self.__controls()
self.__layout()
def datamodel(self):
self.DataModel = Instance(GetDataModel())
def __controls(self):
self.tree_widget = QTreeWidget()
self.tree_widget.setHeaderLabels(['Fruits'])
# Create an instance of QIcon class and specify the path to the icon file
apple_icon = QIcon('icon.png')
# Create an instance of QTreeWidgetItem class and specify the text for the item
apple_item = QTreeWidgetItem(['Game'])
#GetDescendants(apple_item, DModel)
# Set the icon for the item using setIcon() method
apple_item.setIcon(0, apple_icon)
GetDescendants(apple_item,self.DataModel)
# Add the item to the QTreeWidget using addChild() method
self.tree_widget.addTopLevelItem(apple_item)
def __layout(self):
self.vbox = QVBoxLayout()
self.vbox.addWidget(self.tree_widget)
self.setLayout(self.vbox)
app = QApplication([])
win = MainWindow()
win.show()
app.exec_()