[Qt-interest] QVariant conversion problem

Scott Aron Bloom Scott.Bloom at sabgroup.com
Thu Mar 18 20:42:19 CET 2010


QList< quint32 > is not a QList< QVariant >

 

 

 

From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Stephen Collyer
Sent: Thursday, March 18, 2010 12:36 PM
To: qtInterest
Subject: [Qt-interest] QVariant conversion problem

 

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/890d6026/attachment.html 


More information about the Qt-interest-old mailing list