Hit send too fast. I neglected to mention why you were seeing that
behavior. Your super() call is incorrect:
        super(base_class, self).__init__(parent)

That is calling super on the base class instead of your own class. For
instance, if you are subclassing a QWidget, and calling super on the base
class, then you are really only calling the init of a QObject. It should be
this:
        super(PyQtUI, self).__init__(parent)

Just put the name of your own class in there.


On Friday, December 21, 2012, Justin Israel wrote:

> Passing the parent into the superclass init() should be the same thing as
> calling setParent() directly after.
>
>
> On Friday, December 21, 2012, kim bourdette wrote:
>
>> Den torsdagen den 20:e december 2012 kl. 17:35:43 UTC+1 skrev DayDreamer:
>> > Hi, i have created an Ui in PySide and passing maya's main window as
>> parent window for Ui but when i am calling the loader.load method of
>> PySide, it attaches the Ui window to maya window and the whole Ui shrinks.
>> >
>> > Kindly Help
>> >
>> > Thanks
>>
>> Hey! I might have the solution. I ran in to a similar problem when adding
>> PyQt to Motionbuilder. The problem i had was that i only parented the child
>> object when parenting to the motionbuilder window.
>>
>> #This code works because the parent is set in the super()__init__()
>> function
>> class PyQtUI(base_class, form_class):
>>     def __init__(self, parent=getMainWindow()):
>>         super(base_class, self).__init__(parent)
>>
>> #When i did something like this it didnt work because then you're not
>> setting the window parent. Only the stuff in the widget. I think that's how
>> it worked! Was a while ago :)
>> class PyQtUI(base_class, form_class):
>>     def __init__(self)):
>>         super(base_class, self).__init__()
>>         self.parent(getMainWindow())
>>
>> #Also getMainWindow() is my function, not a builtin
>>
>> --
>> 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].


Reply via email to