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

auto parent widgets without parent

hannesdelbeke opened this issue · comments

devs currently need to manually parent any widget to the bqt window widget.
to ensure the qt widgets use

  • the blender stylesheet
  • and stay in front of blender, and are minimised when blender minimises

this means that any existing qt code that creates widgets needs to be changed, or the widget created needs to be parented.

A nicer way, would be to auto parent any qt widget.

proposal 1, monitor loop, auto parent top level widgets

  • an option in BQT to constantly check for widgets without parent.
  • if found parent the widget to the bqt window.

this means widgets created in bqt would just work.
no need for the dev/user to know how to parent it.
it would let the dev run pure qt code that also would work outside of blender, or inside blender without bqt.
whereas bqt parenting only works in blender if bqt is installed.

cons

some apps, e.g. Krita, have nearly every widget/menu as a top level widget.
So we can assume some devs might have done the same for their qt tools. In which case auto parenting them might break hierarchy.
No examples known currently except Krita which won't run in Blender

affects