Skip to content

Commit 02aad63

Browse files
committed
Creates an application context as needed by fbs for successful standalone run.
1 parent 74f926c commit 02aad63

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gui_main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from fbs_runtime.application_context.PyQt5 import ApplicationContext
12
from PyQt5.QtWidgets import QApplication
23
from randomiserGUI import Randomiser
34

@@ -6,11 +7,13 @@
67
if __name__ == "__main__":
78

89
# General needs
10+
appctxt = ApplicationContext()
911
app = QApplication([])
1012
window = Randomiser()
1113

1214
window.setWindowTitle('Group Randomiser')
1315
window.show()
1416

1517
# Run
16-
sys.exit(app.exec_())
18+
exit_code = appctxt.app.exec_()
19+
sys.exit(exit_code)

0 commit comments

Comments
 (0)