Compare commits

...

2 Commits

Author SHA1 Message Date
BodgeMaster 39a5da7716 idea for fixing the threading problem 2022-03-19 12:17:12 +01:00
BodgeMaster e1fd26aa0f removed unused code 2022-03-19 12:16:38 +01:00
1 changed files with 3 additions and 1 deletions

View File

@ -1,7 +1,6 @@
from PySide6 import QtWidgets
import util
gui_handler_communication = util.Communication()
app = QtWidgets.QApplication([])
class Window:
@ -36,5 +35,8 @@ class Window:
# There are some issues with these workarounds though; mainly that QT isn't thread safe.
# I really want to keep QT running in its own thread because I want to retain the ability to arbitrarily spawn and manipulate windows while other windows are running.
# Another issue that is probably easily worked around / fixed is that app.exec() will return once all running windows are closed.
# Idea for a workaround for both:
# Maybe Qt has scheduled events in which case a scheduled polling event could run a function inside the Qt thread that fetches commands and executes them.
# This could work by passing (lambda) functions through a Communication object.
def fixme_window_mainloop_workaround_to_just_get_a_window_started_really_should_not_be_implemented_this_way_for_reasons_stated_in_the_comment_above_the_definition_of_this_function():
app.exec()