Skip to content
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

[cuegui] Replace use of qApp with a more lint-friendly solution #1192

Closed
bcipriano opened this issue Sep 14, 2022 · 0 comments · Fixed by #1193
Closed

[cuegui] Replace use of qApp with a more lint-friendly solution #1192

bcipriano opened this issue Sep 14, 2022 · 0 comments · Fixed by #1193
Labels
bug Something isn't working

Comments

@bcipriano
Copy link
Collaborator

bcipriano commented Sep 14, 2022

Related to #1204, but also an issue in CI environments.

Describe the enhancement
AttributeError: 'module' object has no attribute 'qApp' is a common error when attempting to run CueGUI and is currently causing failures within our CI pipelines.

This is due to how we store and access the current instance of the application.

qApp is populated on startup:

app = CueGuiApplication(argv)
QtGui.qApp = app

And referenced in many other places within the code:

self.qApp = QtGui.qApp
# pylint: disable=no-member
self.settings = QtGui.qApp.settings
# pylint: enable=no-member

As I understand it, this is kind of a non-standard use of PySide. It also creates a ton of problems for lint, as you can see in the example above, as qApp is not a known member of QtGui and we create a lot of custom event handlers in our Application instance.

We should create a better solution for this -- possibly using a new library within the CueGUI code for creating and retrieving the current application instance.

Version Number
e7c38c6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant