added functional menus
parent
82271182ba
commit
603acb60f6
|
@ -1,5 +1,5 @@
|
||||||
from PySide6 import QtWidgets
|
from PySide6 import QtWidgets
|
||||||
import gui_helper
|
#import gui_helper
|
||||||
import util
|
import util
|
||||||
|
|
||||||
app = QtWidgets.QApplication([])
|
app = QtWidgets.QApplication([])
|
||||||
|
@ -40,12 +40,17 @@ class Window(QtWidgets.QMainWindow):
|
||||||
sub = menu_item.addMenu(inner)
|
sub = menu_item.addMenu(inner)
|
||||||
for label, func in data.items():
|
for label, func in data.items():
|
||||||
sub.addAction(label)
|
sub.addAction(label)
|
||||||
|
|
||||||
|
if func == None:
|
||||||
|
sub.triggered.connect(lambda x: None)
|
||||||
|
else:
|
||||||
|
sub.triggered.connect(func)
|
||||||
#Adding separators
|
#Adding separators
|
||||||
elif inner == None:
|
elif inner == None:
|
||||||
menu_item.addSeparator()
|
menu_item.addSeparator()
|
||||||
else:
|
else:
|
||||||
item = menu_item.addAction(inner)
|
item = menu_item.addAction(inner)
|
||||||
item.triggered.connect(gui_helper.data())
|
item.triggered.connect(data)
|
||||||
|
|
||||||
|
|
||||||
#TODO: This needs to run in a thread but Qt really doesn't want it to. There are two ways around this:
|
#TODO: This needs to run in a thread but Qt really doesn't want it to. There are two ways around this:
|
||||||
|
|
Reference in New Issue