Jump to content
Sign in to follow this  

param dialog children

Recommended Posts



i want to extend houdinis UI and I must say the whole UI Api is really a mess. pyqt, pyside, pyside2, qt, python, shiboken. really? why so complicated. and why on earth is the documentation so bad. okay, rent over.

what i want to do:

1) i want the edit box (parameter) under the cursor in the parameter window. the unique name or path of the edit box, so that i can later set the value of the edit box (parameter). the edit box should be a QLineEdit, correct? propably not, because everything in the API is really awkward. 

2) i wanted to solve problem 1) with the following attempt. get cursor position, get param window, loop over the children and check over which child the cursor is located. Okay my test code gets the param widget and then tries to get the children. it has a QVLayoutBox as a direct child. but the QVLayoutBox is empty ???? why? how can I access the childrens?

import shiboken2
import PySide2.QtWidgets as qtw
from PySide2 import QtGui as qtg
app0 = qtw.QApplication.instance()
#widget = app0.widgetAt(qtg.QCursor().pos())

allWidgets = app0.allWidgets()

for w in allWidgets:
    if w.windowTitle() == "parmdialog":
        parmWidget = w
        print "found"
vlbox = parmWidget.children()[0]
print vlbox.children()     #why is the count 0 ????

Hope someone can help me. Thanks!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this