@riverbankcomputing.com
Betreff: Re: [PyQt] get list of selected items in a listWidget
well, I found my self another way, similar but shorter.
only the printItem() function have been changed from the previous code.
def printItemText(self):
items = self.listWidget.selectedItems
*well, I found my self another way, similar but shorter.*
*only the printItem() function have been changed from the previous code.*
*
*
> def printItemText(self):
> items = self.listWidget.selectedItems()
> x=[]
> for i in list(items):
> x.append(str(i.text()))
> print x
On Mon, Mar 26, 2012 at
*Is there any better, more efficient way to achieve the following:*
from PyQt4.QtCore import *
> from PyQt4.QtGui import *
> import ui_list
> class Test(QDialog,ui_list.Ui_Dialog):
> def __init__(self, parent=None):
> super(Test, self).__init__(parent)
> self.setupUi(self)
> for i in range(10):
>