I have a Maya environment with a PySide window which gets generated on the fly with whatever is in that Maya scene. I’m trying to now take that to command-line and make unittests out of it.
I have everything working, minus one problem.
Most PyQt/PySide unittest documentation state to create a QApplication like this:
app = QApplication(sys.argv)
win = SomeWindow()
sys.exit(app.exec_())
This doesn’t work because there’s already a QApplication instance, built from Maya.
RuntimeError: A QApplication instance already exists.
Excluding these steps though yields this error and the tests fail:
QWidget: Cannot create a QWidget when no GUI is being used
I know that therre’s a QApplication instance in the scene, because this command yields a QApplication instance:
QApplication.instance()
So how do I associate the GUI that I want to create with that instance? You can’t exec_() Maya’s running QApplication so I’m not sure how to get my GUI to see the QApplication.