maintenance of inspirations

This commit is contained in:
Trilarion
2020-09-01 10:57:33 +02:00
parent 881f0c77c5
commit a1ce1809f3
24 changed files with 1079 additions and 974 deletions

32
code/utils/osg_ui.py Normal file
View File

@ -0,0 +1,32 @@
"""
Simple UI helpers with PyQt
"""
from PyQt5 import QtCore, QtGui, QtWidgets
def run_simple_button_app(title, actions):
"""
:param title:
:param actions:
:return:
"""
# create app
app = QtWidgets.QApplication([])
# create single widget
widget = QtWidgets.QWidget()
widget.setWindowTitle(title)
widget.setMinimumSize(200, 400)
# add actions
layout = QtWidgets.QVBoxLayout(widget)
for name, action in actions:
button = QtWidgets.QPushButton(name)
button.clicked.connect(action)
layout.addWidget(button)
# execute app
widget.show()
return app.exec_()