Simple fix. Just pass a WindowFlag to your window that tells it to always
stay on top

class MayaSubWindow(QtGui.QMainWindow):
    def __init__(self, parent=getMayaWindow()):
        super(MayaSubWindow, self).__init__(parent,
QtCore.Qt.WindowStaysOnTopHint)
        QtGui.QPushButton(self)

If you are saying that on other operating system, the window stays on top
by default (I havent checked or anything) then it could just be a
difference in the window systems defaults.


On Tue, Mar 27, 2012 at 8:56 AM, 宇 <1988he...@gmail.com> wrote:

> It's right to embed a pyqt window to Maya main window with this code
>>
>> import maya.OpenMayaUI as apiUI
>>
>> from PyQt4 import QtGui, QtCore
>>
>> import sip
>>
>> def getMayaWindow():
>>
>> ptr = apiUI.MQtUtil.mainWindow()
>>
>> return sip.wrapinstance(long(ptr), QtCore.QObject)
>>
>> class MayaSubWindow(QtGui.QMainWindow):
>>
>> def __init__(self, parent=getMayaWindow()):
>>
>> super(MayaSubWindow, self).__init__(parent)
>>
>> QtGui.QPushButton(self)
>>
>> myWindow = MayaSubWindow()
>>
>> myWindow.show()
>>
> But, on Snow Leopard if you click the maya main window the pyqt ui will be
> covered by maya, Please give me a hand.
>
> --
> view archives: http://groups.google.com/group/python_inside_maya
> change your subscription settings:
> http://groups.google.com/group/python_inside_maya/subscribe
>

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe

Reply via email to