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 http://download.autodesk.com/global/docs/maya2014/en_us/Commands/index.html, 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:


Maybe it’ll help.