[PyKDE] howto handle QVariant.toList()?

Phil Thompson phil at riverbankcomputing.co.uk
Thu Jun 29 08:50:35 BST 2006


On Wednesday 28 June 2006 11:49 pm, Andreas Pakulat wrote:
> Hi,
>
> I'm facing an issue here where I have a QStringList stored in a
> QVariant, which means I have a QVariant whose toList function returns a
> list of QVariants with all wrap QStrings.
>
> The question is: How can I easily pass this list to a function which
> expects a QStringList? I don't really think that
>
> combobox.addItems([QVariant(item) for item in variant.toList()])
>
> is the nicest way, even if it looks quite "cool".

variant.toStringList() ???

Phil




More information about the PyQt mailing list