lsUI command doesn't show pyqt window?

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? :confused:

Check this page:
https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/Maya-SDK/files/GUID-66ADA1FF-3E0F-469C-84C7-74CEB36D42EC-htm.html
Maybe it’ll help.