[PyQt] Strange behaviour QStringList
Giovanni Bajo
rasky at develer.com
Wed Sep 16 12:14:31 BST 2009
On Wed, 16 Sep 2009 11:47:43 +0200, simozack <simozack at yahoo.it> wrote:
> Problably the problem is between the desk and the chair, but I have this
> case:
>
>>>> for task in TASKS:
> ... print type(task)
> ... task_list = QStringList(task)
> ...
> <type 'list'>
> Traceback (most recent call last):
> File "<stdin>", line 3, in <module>
> TypeError: argument 1 of QStringList() has an invalid type
>>>> a = QStringList(['a', 'b', 'c'])
>>>> a
> <PyQt4.QtCore.QStringList object at 0x00997BB8>
>
> Where TASKS is a list of list.
I can't see why you're surprised then... QStringList's constructor accepts
a list of strings, not a list of lists.
--
Giovanni Bajo
Develer S.r.l.
http://www.develer.com
More information about the PyQt
mailing list