Skip to content

Maya qt window

to correctly parent your widget to Autodesk Maya

  • keeping the widget in front when clicking on other Maya windows
  • hide the widget from alt tab apps,
    You only need to pass the window flag
    self.setWindowFlags(QtCore.Qt.Tool)
    

OPTIONAL: setWindowFlags resets the parent, so you can manually set the parent

import pymel.core as pm
mayaWindow = pm.ui.Window("MayaWindow").asQtObject()
self.setParent(mayaWindow)

other

you might want to make your window dockable in Maya: Maya dockable widget

source
outdated stackoverflow

Qt
Maya Python

ui widget