OpenCue icon indicating copy to clipboard operation
OpenCue copied to clipboard

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

Open bcipriano opened this issue 3 years ago • 0 comments

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:

https://github.com/AcademySoftwareFoundation/OpenCue/blob/409c2a7ca2f84aed092f5d713a62e4864394efa1/cuegui/cuegui/Main.py#L74-L75

And referenced in many other places within the code:

https://github.com/AcademySoftwareFoundation/OpenCue/blob/409c2a7ca2f84aed092f5d713a62e4864394efa1/cuegui/cuegui/MainWindow.py#L62-L65

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 e7c38c6bf5a39eec650a1f7a3851dabcc10d6f48

bcipriano avatar Sep 14 '22 18:09 bcipriano