-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Qt event loop does not execute the application in MS Windows #162
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected Behavior
The event loop created by
gui_qt()
should execute the QApplication if it is not already running.Current Behavior
When running the code as a python module (
python -m module_name
), it seems to work fine in my Linux environment, but in Windows the program just finishes without launching the application window.The problem lies here:
bluesky-widgets/bluesky_widgets/qt/_event_loop.py
Line 48 in 193db00
app.applicationName()
contains the name passed to the QApplication constructorapp = QApplication([app_name])
. This is what the code above is expecting.app.applicationName()
contains the stringpython
, therefore the if statement always evaluates to false.On a side note, the code of the
gui_qt()
function seems to mask command line arguments instead of passing them on to the application.Possible Solution
a. Manually set the application name with setApplicationName(). I've pushed #163 implementing this.
b. Alternatively, refactor the
gui_qt
function to receive the same parameters as QApplication. That is, receiveargv
and pass it on to QApplication, instead of only receiving a single string with the application_name. I believe this would also allow to pass command line arguments to the application, which is probably not the case at the moment.Steps to Reproduce (for bugs)
python -m bluesky_widgets.examples.qt_run_tree_view
Your Environment
Windows 10, python 3.9.7, conda 4.10.3, PyQt5 5.15.4
The text was updated successfully, but these errors were encountered: