Ah that looks pretty neat. Thanks Ali, I should really learn pymel. Another question about PyQt .... when re-running the script, how can I close the previous UI if it already exists?
I tried mc.windows(QtObjectName, exists=True) this returns True if the Qt window is opened. However, mc.deleteUI(QtObjectName) this one doesn't do anything. Is there different command I should use? Thanks :) On Thu, Oct 25, 2012 at 6:34 PM, Ali Khanbabaei <[email protected]>wrote: > #you can use pymel > import pymel.core as pm > pm.uitypes.TextScrollList('listWidgetName').getSelectItem() > > On Thursday, October 25, 2012 2:39:08 PM UTC+3:30, Panupat > Chongstitwattana wrote: >> >> I'm wondering if there's a cleaner way to do this than the way I'm doing? >> >> Let's say I have "myListWidget" which is multiple-selection enabled >> QListWidget, I would then do this to print out the values of selected rows. >> >> for item in list(myListWidget.selectedItems()) >> print myListWidget.item(myListWidget.row(item)).text() >> >> I feel like I'm going through a lot of things to get to that text(). Is >> there a cleaner or shorter way to do what I'm doing? >> >> Thanks. >> > -- > 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
