[Qt-interest] QVariant conversion problem

Stephen Collyer scollyer at netspinner.co.uk
Thu Mar 18 20:35:35 CET 2010


I have some code where the relevant defns are as follows:

const QList<quint32> storytranslation_ids_by_lang

QMap<QString, QVariant>   where_data;
where_data["fk_storytranslation_id"] =
QVariant(storytranslation_ids_by_lang);

g++ is complaining about the assignment in the final line, with the
following message:

error: no matching function for call to ?QVariant::QVariant(const
QList<unsigned int>&)?
/usr/local/Trolltech/Qt-4.6.1/include/QtCore/qvariant.h:432: note:
candidates are: QVariant::QVariant(bool, int)
/usr/local/Trolltech/Qt-4.6.1/include/QtCore/qvariant.h:425:
note:                 QVariant::QVariant(void*)
/usr/local/Trolltech/Qt-4.6.1/include/QtCore/qvariant.h:222:
note:                 QVariant::QVariant(Qt::GlobalColor)

<etc>

I can't see why, as there is a QVariant ctor as follows:

*QVariant* ( const QList<QVariant> & *val* )

Can someone suggest what I'm missing ?

-- 
Stephen Collyer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100318/a2a2fd83/attachment.html 


More information about the Qt-interest-old mailing list