you have to loop through and add an item at a time like this:

from PySide import QtGui, QtCore#clear it outdef refresh(self):
    self.listWidget.clear()
    items = pm.selected()
    for item in items:
        newItem = QtGui.QListWidgetItem( item.nodeName())
        self.listWidget.addItem(newItem)

try that
​

On Mon, Nov 30, 2015 at 12:05 AM, Padraig Ó Cuínn <
patchquinnanimat...@gmail.com> wrote:

> Hi Everyone,
>
> I was wondering if you can help me out with the above topic.
>
> basically what I have is a simple UI with a line edit ontop of a
> ListWidget and under that a button that refreshes the list <<<< basically
> what i am hoping to have happen..
>
> so far this:
>
> #mayas selection vioa pymel
> maya_list = pm.selected()
>
>
>
>
> #connection from button to refresh list
> button.clicked.connect(refresh)
>
>
> #the refresh function adds  the maya_list
> refresh(self):
>     self.listWidget.clear()
>     self.listWidget.addItem(maya_list)
>
>
> I havent even begun to work on the lineEdit part yet but it's supposed to
> search through all the listed items in the listWidget and display them as
> typed.
>
> Any help would be awh-Mazing.
>
> Thanks
>
> Padraig
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to python_inside_maya+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/d2e2cff9-3157-428c-bc11-05b17b7a0aa2%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/d2e2cff9-3157-428c-bc11-05b17b7a0aa2%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CABPXW4i%3D7QfwY5iX86trtxVOQceNySyU0fKxQXieYTPWRnfKjg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to