-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
49 lines (39 loc) · 1.51 KB
/
Copy pathmain.py
File metadata and controls
49 lines (39 loc) · 1.51 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
47
48
49
from PySide6 import QtWidgets
from PySide6.QtWidgets import QApplication, QWidget, QMainWindow
import sys
#Internal Imports
from MainScreen import*
class MainWindow(QtWidgets.QMainWindow,Ui_MainWindow):
def __init__(self):
super().__init__()
self.setupUi(self)
self.deleteButton_list.clicked.connect(self.delete_cond_to_add)
self.addConButton.clicked.connect(self.add_condition)
self.deleteButton_tree.clicked.connect(self.tree_delete)
def tree_delete(self):
try:
root = self.treeWidget_log_op.invisibleRootItem()
for item in self.treeWidget_log_op.selectedItems():
(item.parent() or root).removeChild(item)
except:
print("ERROR: Unable to Delete Tree Object")
print("SOLUTION: Unknown")
#index = self.treeWidget_log_op.indexFromItem(object_to_del).text()
#print(index)
# self.treeWidget_log_op.removeItemWidget(object_to_del,0)
def delete_cond_to_add(self):
index = self.listWidget_condition.currentRow()
self.listWidget_condition.takeItem(index)
def add_condition(self):
#takeItem(row)
print("add tehe")
string_val = ""
for i in range(( self.listWidget_condition.count())):
list_object = self.listWidget_condition.item(i)
string_val += " " + list_object.text()
if __name__ == "__main__":
app = QApplication(sys.argv)
window = MainWindow()
window.show()
# Start the event loop.
app.exec()