thanks guys for the tips!
what i have learned so far:
it appears that maya itself does not keep track of the widget
hierarchy in my subclassed, qtDesigner generated UI.
David, i tried out your GetFullName wrapper. running this on my
QObject i still get:
# TypeError: in method 'MQtUtil_fullName', argument 1 of type 'QObject
const *' #
note that, <pointer = sip.unwrapinstance(QObject)>, is actually
returning a number of type long.
but, <mui.MQtUtil.fullName(pointer)>, seems to still be choking on it.
that concerns me a bit..
if the pointer is there, why cant the api use it to get me a pathname?
i wrote my own hacky "fullpathname" test function that returns the
full
pathname of a QWidget in question, and gave it the same QObject that i
give your wrapper. and it gives me what i would expect from your
wrapper..
accept your wrapper of course would show that maya understands widget
paths in my UI.. and my function is purely QT.
somthing like this:
def getFullQWidgetPathName(startQWidget):
pathString = ''
path = []
p = startQWidget
while type(p)!= NoneType:
path.append('%s|'%p.objectName())
p = p.parentWidget()
path.reverse()
pathString = pathString.join(path)
return pathString.rstrip('|')
i can see my tool window in maya, its parented underneath the maya
main window, but maya seems to know nothing else about it.
trying to use any maya ui commands to parent or place the floatSlider
using the resulting path string from my hacky test function, produces:
# RuntimeError: floatSlider: Object ‘MayaWindow|tabChangedSignalTest|
centralwidget|tabWidget|qt_tabwidget_stackedwidget|tab_2|
gridLayoutWidget|sliderLayout’ not found. #
(and after much to-do i did make sure that is the actual widget
hierarchy in the pyQT UI. maya does not even see my tools main window
even though it is a child.. and yet it functions properly as a child.
everything in the UI works.. like using signals from a button to
create a sphere and a static-ui slider to move the sphere in x etc...)
so after all that, i sort of feel like maya really does not know
anything about the pyQT widget hierarchies, unless you use the loadUI
command or create the interface itself with maya commands.
however, i did find a way to parent and position a maya float slider
into this purely pyQT UI running in maya.
i downloaded and installed pymel 1.0.2.
included in this update are commands like toQObject(). i use
toQobject() to get the QObject of the float slider i create, then go
on using pyQT to parent and position the slider.
it works. the only problem is that maya still does not know the
floatSlider has been parented. so when you delete the main tool
window, it does not delete the folatslider. you can however delete it
explicitly with deleteUI maya command.
this situation is functional for what i want to do, if not ideal. i
can at least use maya specific widgets along side pyQT specific
widgets. which is great. but i still cant believe that maya knows
nothing about the widget hierarchy of the pyQT ui! and yet maya still
displays it and catches signals from it just fine.
will keep you updated as i learn more.
-thanks again,
Mark therrell