Maya 2014 osx pyside loading ui file

39 views
Skip to first unread message

Robert Kolbeins

unread,
Dec 24, 2013, 8:23:33 PM12/24/13
to python_in...@googlegroups.com
def getMayaWindow():
    ptr = omui.MQtUtil.mainWindow() 
    if ptr is not None:
        return wrapInstance(long(ptr), QObject)

class DataTextures(QDialog):
    def __init__(self, parent=getMayaWindow()):
        super(DataTextures, self).__init__(self,parent)
        DataTextures.__init__( self, *args)
        
        # load UI
        loader = QUiLoader()        
        file = QFile('/tmp/test.ui')
        file.open(QFile.ReadOnly)
        dataTexturesWidget = loader.load(file, self)


I'm having issues on osx where the window is popping behind maya main window, seemed to be fine on linux.

Any thoughts ?

-Robert

Justin Israel

unread,
Dec 24, 2013, 8:39:14 PM12/24/13
to python_in...@googlegroups.com
Try calling myDialog.raise_() after you call the show() method.

Also, it seems like you are calling the constructor twice, but the second time should actually be a syntax error, so I assume its not exactly as you have it in your own code:

class DataTextures(QDialog):
    def __init__(self, parent=getMayaWindow()):
        super(DataTextures, self).__init__(self,parent)
        # DataTextures.__init__( self, *args)  ## Redundant and potentially missing the parent argument





--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/d8ee0ae3-e447-4bd0-81c6-63d427e27dfe%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages