Hi I want to delete my pyqt QDialog windows, but lsUI command doesn’t show any pyqt window?
mc.lsUI(type='window')
# Result: [u'nexFloatWindow', u'MayaWindow', u'scriptEditorPanel1Window'] #
Hi I want to delete my pyqt QDialog windows, but lsUI command doesn’t show any pyqt window?
mc.lsUI(type='window')
# Result: [u'nexFloatWindow', u'MayaWindow', u'scriptEditorPanel1Window'] #
According to Maya commands, the type string parameter seems to only find things “created using ELF UI commands.”
There are other flags for Qt widgets, as you can see on the docs page.
Thanks! Do you mean this?
mc.lsUI(type='window',dw=1)
but it returns too many “widgets”(over 15,000) instead of windows,
Are you not able to iterate through the parent’s (main Maya window) children?
I tried this, it returned nothing
from PyQt4.QtGui import *
from PyQt4.QtCore import *
import maya.OpenMayaUI as apiUI
import sip
ptr = apiUI.MQtUtil.mainWindow()
mwin = sip.wrapinstance(long(ptr), QObject)
filter(lambda x: isinstance(x,QDialog), mwin.children())
mwin.findChildren(QtGui.QDialog)
Hm, that really should work, it works for me. Are you certain that your main maya window is actually the parent of your dialog?