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

Replace qApp with a new cuegui.App library. #1193

Merged
merged 10 commits into from
Oct 27, 2022

Conversation

bcipriano
Copy link
Collaborator

@bcipriano bcipriano commented Sep 14, 2022

Link the Issue(s) this Pull Request is related to.
Fixes #1192.

Summarize your change.
We introduce a new App library which is used to create and access the application instance. This replaces our use of QtGui.qApp for the same purpose.

This allows us to avoid the no attribute 'qApp' error that's been a regular occurrence for a long time and has recently start causing consistent CI pipeline failures. See #1192 for more details.

Many classes now store the instance as self.app which looks a bit cleaner and in several modules allows us to avoid importing the whole QtGui module just to access the application instance.

With the new library, lint is now able to trace CueGuiApplication references back to the actual class, so we're able to remove a ton of disable=no-member rules that were everywhere in that code. Also a few disable=attribute-defined-outside-init rules. There are still some disable=no-member rules left due to lint's inability to follow PySide signals, but that will have to be handled separately.

@bcipriano
Copy link
Collaborator Author

@DiegoTavares This is ready for review but could use some more testing.

As you can see from the last few commits in this branch I found a few spots where the whole self.app approach didn't work because there was some logic that happens before the parent class was instantiated. I think I got them all. But there could be some other non-obvious issues hidden here.

@DiegoTavares
Copy link
Collaborator

Working on building a package with pyside6 internally to test this.

@bcipriano
Copy link
Collaborator Author

Awesome, thanks.

FWIW PySide6 shouldn't be required to test this, I believe. It could be tested separately. And maybe it should be, to isolate any issues and help unbreak our CI pipelines.

Copy link
Collaborator

@DiegoTavares DiegoTavares left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on our environment and it works fine

@bcipriano bcipriano merged commit 6500fe2 into AcademySoftwareFoundation:master Oct 27, 2022
@bcipriano bcipriano deleted the replace-qapp branch October 27, 2022 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[cuegui] Replace use of qApp with a more lint-friendly solution
2 participants