[PyKDE] python lists of QStrings

Phil Thompson phil at riverbankcomputing.co.uk
Thu Apr 14 13:51:31 BST 2005


> Hello,
>
> I have a problem. I find it useful to build lists of strings in Python and
> pass them to methods like QListBox.insertStrList. The problem is that if I
> use Qt's i18n support, I end up with Python lists of QStrings, such as:
>
> items = [ self.tr("Foo"), self.tr("Bar"), self.tr("FooBar") ]
>
> There is no easy way to pass this thing to a QListBox/QComboBox withou an
> explicit iteration.
>
> I believe that we could use an implicit conversion from the above to
> QStringList. Either to that, or to QStrList, but I think the former maps
> better: QStrList is a list of char* in C++, after all.

I'll add it to the TODO list.

Phil




More information about the PyQt mailing list