techartorg / bqt

A Blender add-on to support & manage Qt Widgets in Blender (PySide2)
https://github.com/techartorg/bqt/wiki
Mozilla Public License 2.0
162 stars 23 forks source link

wrapping window fails if preferences is open #65

Closed hannesdelbeke closed 1 year ago

hannesdelbeke commented 1 year ago

bqt wraps my preference window isntead of main blender window, if it opens on startup 😅

image
hannesdelbeke commented 1 year ago

second restart wrapped main window

image
hannesdelbeke commented 1 year ago

this is now handled with a hack,

i couldn't find a proper solution to find the main window. so i'm using the window size for now and wrap the biggest window.

note this could still result in undesired wrapping if e.g. you have a render window open that's bigger than the default blender main window

both windows have the same process id. os.getpid() they have a different handle, but same title & same window class. so AFAIK no way to find the main window.

hannesdelbeke commented 1 year ago

found a better solution. get parent handle is 0 for the main window. See https://blenderartists.org/t/bqt-custom-ui-for-add-ons-tool-in-blender-with-pyqt-or-pyside/1458808/7?u=h4nnes

hannesdelbeke commented 1 year ago

closed with proper fix.