Those wrappers are really sweet - thanks for sharing!!
Utilizing what is already there, I added a method to find any element
derived from QWidget within the given target UI by passing the string name
of the element.
Found that if you have made the window dockable in Maya, you have to pass
the string name of the dock control and if not, you can pass the window name
string as target....

Previously I used self.findChild(QPushButton(or whatever class),
QString('stringName')), but this utility method eliminates the need to keep
track of class you are looking for....
Not quite sure how pastebin works (tried to make a revision on what is
already there but I think it made a new link - http://pastebin.com/kNSeTMmX
).

/Christian


On Wed, Nov 10, 2010 at 11:14 AM, mtherrell <[email protected]> wrote:

> BTW, David thanks for the wrappers!
> i did not know how to use sip wrap and unwrap in order to send the
> pointers to and from QT
>
> guss i need to learn more about sip.
> im and old-school maya guy from way back.. and i used pyqt, after
> that, in a proprietary pipeline for a long time..
> but im very new to combining the two!
>
> cheers and thanks for the help!
> -mt
>
> On Nov 9, 3:18 pm, John Creson <[email protected]> wrote:
> > another bit to try.
> >
> > give the layout a unique name and set parent to that unique name
> >
> > or, dumpwidgets and weed through the dump...
> >
> > for widge in cmds.lsUI(dumpWidgets=True):
> >     if widge.startswith('mywindow'):
> >        print widge
> >
> > MQtUtil is also a great place to start digging.
> >
> > On Tue, Nov 9, 2010 at 4:39 AM, David Moulder <[email protected]>
> wrote:
> > > I think you'll find this useful... some basic wraps of MQtUtil I did.
> > >  I originally got the idea for this from http://nathanhorne.com/?p=183
> > > It's well worth bookmarking these TD's and using Google Reader.  I'm
> forever
> > > stealing and learning from these guys!
> > >http://pastebin.com/rE6uhtm4
> > > I've not tried to do what your attempting yet but I hope to when I get
> 5
> > > minutes at work...
> > > -Dave
> >
> > > On Mon, Nov 8, 2010 at 6:45 PM, mtherrell <[email protected]>
> wrote:
> >
> > >> thanks David.
> >
> > >> in a function of my subclassed qtDesigner ui, i have access to the
> > >> QGridLayoutitself  and/ or the QTabWidget that has that grid layout
> > >> within it.
> > >> like this: self.sliderLayout ..
> >
> > >> i am trying to get the maya fullname of that widget using
> > >> MQtUtil.fullName().
> >
> > >> my problem is MQtUtil.fullName().. and its c++ ducumentaion vs. python
> > >> documentation.
> > >> MQtUtil.fullName() supposedly returns the fullname as an MString or
> > >> the control, given it's QObject.
> >
> > >> but i do not know how to represent the QObject pointer in python. the
> > >> docs say fullName() requires a pointer to the QObject.
> > >> even after reading up on how python handles pointers.. i still cannot
> > >> get MQtUtil.fullName() to work in python..
> >
> > >> any help or examples on how to represent the QObject as a pointer in
> > >> python.. ort how to translate the c++ docs into python in general
> > >> would be a great help!
> >
> > >> thanks
> > >> -mt
> > >> On Nov 6, 12: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
> >
> > > --
> > > David Moulder
> > >http://www.google.com/profiles/squish3d
> >
> > > --
> > >http://groups.google.com/group/python_inside_maya
> >
> >
>
> --
> http://groups.google.com/group/python_inside_maya
>

-- 
http://groups.google.com/group/python_inside_maya

Reply via email to