Ok cool, so if you are using PyQt4, here is a pretty straightforward example (at least I hope): https://gist.github.com/4384994
In that example, I create an arbitrary custom widget, which represents the same thing you could have designed as a UI file and subclassed. It just has widgets and layouts. 1. It helps to set the object names of the widgets you will be interested in later from a Maya-path point of view. Maya will use these in its path|to|a|maya|ui|widget 2. Whichever layout you want to add a Maya UI element to, you use sip to get a QObject pointer 3. Use maya.OpenMayaUI.MQtUtil.fullName(pointer) to get the Maya path 4. Set your parent to this path and create a Maya UI element. It will use the layout. Let me know if I should expand on any part of that. The example creates a hyper graph panel in your PyQt4 UI. I think that covers both your questions, right? -- justin On Dec 26, 2012, at 5:55 PM, Tuan Nguyen wrote: > Hi Justin > I do it tradition's way, convert UI to python format,inherit UI's class, then > using the self.setupUI. I had read your tutorial before, and you also mention > this way about find the dumpWidget, delete it and replace with another one. > But it was using the cmds.loadUI command so i'm a little confuse :D > > Also, this is out of topic but, can you please tell me with what widget, i > can create a window like Hypergraph that can display item and using mouse > event to zoom in, zoom out, pan.... > > Thank for reply :D > > > On Thu, Dec 27, 2012 at 2:21 AM, Justin Israel <[email protected]> wrote: > Are you actually using PyQt or just UI files from Qt Designer, and the > cmds.loadUI command? > > Either way, you would not need or want to modify the UI file (or converted > one if using pyuic). That should always stay un-edited. > No matter which way you do it, what you can do is leave a placeholder widget > in your layout design, and make sure to set the object names of everything. > These will translate to Maya paths like: "myMainWindow|myPlaceholderWidget". > Then it is just a matter of adding the Maya UI layouts that you want, using > this as the parent. > > I can give you more specific details if you let me know exactly what you are > doing (PyQt code, or Maya UI with a Designer UI file). > > > > On Wed, Dec 26, 2012 at 7:28 AM, illunara <[email protected]> wrote: > Hi everybody > I just wonder if we can insert a Maya's window (like > HyperGraph,Helpline,colorSlider.....) into PyQt's UI by changing the code in > python's UI file (after convert an UI to python format)? I had heard that we > can delete the widget and replace by another, but that only when using the > loadUI command? > > Thanks > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > > > > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > > > > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected].
