techartorg / bqt

A Blender add-on to support & manage Qt Widgets in Blender (PySide2)

Home Page:https://github.com/techartorg/bqt/wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

demo code not working because QApplication is None

hzwus opened this issue · comments

Hi there, I followed the instructions to install bqt from pip as a module. I can succesfully import bqt, however when I run any of the demos, I get the following error message because there is no QApplication instance defined.

AttributeError: 'NoneType' object has no attribute 'blender_widget'

I see that this same error was posted in the past, but the solution seems to be outdated (the bqt_startup.py script has since been removed)? I tried running setup.py as well as the old bqt_startup.py, hoping that they would help register and instantiate the QApplication instance, but both scripts cause Blender to crash immediately.

I also tried installing bqt as an add-on instead, but have the same error.

This is happening on Blender 3.6 as well as 3.5! Anyone know what might be happening?

That error implies that QApplication.instance() is None, which means bqt didn't run it's startup code.
It's really weird that it doesn't work when you have the addon installed. Since the addon should automatically take care of this startup code.

  • Have you ensured the addon is enabled in Blender-preferences?
  • Can you toggle your console, and see if any errors print on startup. A script error could prevent the startup from running. console instructions

setup.py confusingly doesn't setup bqt, it instead contains the packaging info for PyPI & pip install.

Also note that the demo code has been moved out of bqt
So this from bqt import hello_world won't work anymore.
You now have to manually install the demo code.

closing since this requires more info, feel free to reopen this issue when you have more information