Jump to content

param dialog children


Houdini7

Recommended Posts

Hi,

 

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"
        break
vlbox = parmWidget.children()[0]
print vlbox.children()     #why is the count 0 ????

Hope someone can help me. Thanks!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...