You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
In Linux app.applicationName() contains the name passed to the QApplication constructor app = QApplication([app_name]). This is what the code above is expecting.
In Windows app.applicationName() contains the string python, 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, receive argv 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.
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: