i have been trying to use MQtUtil.findLayout() or MQtUtil.findControl(), then feed the return value of that to MQtUtil.fullName()..
but to no avail, there is something i am not understanding about the object that MQtUtil.findLayout() returns. the docs say it is a QWidget, which is a QObject, and should allow me to find the full "maya" full pathname of that QObject by giving it to MQtUtil.fullName(). but MQtUtil.fullName() chokes on the return value from MQtUtil.findLayout(). type() says that the return value is a <type 'PySwigObject'>: _10f8bc3b00000000_p_QWidget so again, i am a bit stuck.. i need to find the maya style full path name of this QLayout's widget so that i can add my float slider to it. i am missing something about how to use MQtUtil.findLayout(), and MQtUtil.fullName() and general lost at the moment as to how to make my floatSlider appear in the QTDesigner generated layout. thanks for any light anyone may be able to shed.. seems like it would be a fairly common scenario! -mark therrell -thanks for any help. On Nov 7, 11:57 am, mtherrell <[email protected]> wrote: > thanks David.. > > yes, the fullname/fullpathname to the layout is the problem im having > right now. > i am trying to discover what that fullpathname looks like to maya. > > i have tried simply using a fullpathname using the maya UI convention > like: > > "mayaMainWindow|myMainWindow|centralWidget|tabWidget|tab_2|gridLayout" > > which is how the ui hierarchy appears in QTDesigner.. but this does > not work.. maya does not see it like that apparently (or i am > formulating it wrong somehow). > > (also, would be nice if i could discover the name directly via maya > some how like some kind of "widget under mouse fullname" script.. > but cannot find one anywhere.. the closest i can find is > getPanel(underPointer=True) and this does not work because my layout > is not a panel. > cannot get lsUI to work because it does not recognize the qt interface > types like "QGridLayout".) > > do you know anything about pymel 1.0.2? it looks like there is > 'UI.asQtObject()' but i can see no examples as to how it might be used > in my case. > (have not downloaded and installed it yet.. one problem at a time > until i know more about 1.0.2.. > > looks like Nathan Horne knows something about what im trying to do.. > but can find no examples of his that do what im trying to do.. > > thanks for any further insights or help.. > > On Nov 6, 1:48 pm, David Moulder <[email protected]> wrote: > > > hmm, should be possible in 2011. > > > As long as you know the fullName of the parent layout then can you not use > > the setParent() cmd and then add the floatSlider. > > Then get the float slider back as a QObject see the api MQtUtil i think. I > > think pymel has toQObject, not documented tho. > > > I suppose you can then use signal as slots with that QObject. > > > It's an interesting mix as it's all Qt but the implementation in both are > > different. > > > -Dave > > > On Sat, Nov 6, 2010 at 7:04 PM, mtherrell <[email protected]> wrote: > > > i should probably restate the problem and be a bit more clear.. > > > > my goal is to generate a maya float slider using the pymel > > > floatSlider() command, in a subclass of an interface created in qt > > > designer (and then pyuic4.. not using "loadUI"). > > > i want to be able to treat this slider like any other QObject.. > > > placing and attaching it into a QGridLayout in my QT interface, and > > > connecting its signals to > > > functions within my subclass. (whether by signals and slots or by the > > > callback functions of the floatslider() command itself..not sure) > > > > my problem is that i do not know how to get the QObject that > > > represents the maya floatSlider so that i can do all these things to > > > it. > > > the object that is returned by pymel does not seem to allow QObject > > > functions. (not a QObject?) > > > > am i missing something simple? > > > i am very new to qt and pymel.. > > > its likely just newb-ism. > > > just needed a little help. > > > > thanks. > > > > On Nov 5, 5:02 pm, mtherrell <[email protected]> wrote: > > > > i am using pymel 1.0 in maya 2011. > > > > i am using QTDesigner to create my interface base class. > > > > > unfortunately, (and surprisingly) QT does not have a float slider. so > > > > i need to make my float slider in my subclass of my qt interface using > > > > pymel. ( prefer not to make an intslider powers of ten bigger than my > > > > desired float range in order to approximate a float slider in QT.) > > > > > (i am using pyuic4 to emit my interface as a .py then i subclass > > > > that .py) > > > > > 1. are there any examples of creating a floatSlider using pymel, and > > > > then laying it out in an already existing qt layout? > > > > > 2. how do i get the QObject that results from creating a floatSlider > > > > so that I can connect its signals using qt? > > > > > 3. is it better to use qt signals to connect the floatSlider to my > > > > functions or better to use the mel 'dragCommand' conventional callback > > > > system somehow? > > > > > thanks for any help on using pymel floatSlider inside a qt layout.. > > > > > -mark therrell > > > > -- > > >http://groups.google.com/group/python_inside_maya > > > -- > > David Moulderhttp://www.google.com/profiles/squish3d > > -- http://groups.google.com/group/python_inside_maya
