PDA

View Full Version : Invokemethod with an argument Qhash < Qstring,Q string> error 2976



Caradryan
25th August 2016, 15:46
Good morning,

I'm trying yo use an invokemethoh, which has three arguments, a QList and two QHash < Qstring,Qstring>.

When i call the first one i have no problem it works properly, but when i'm trying to do the same with the two others arguments i got an error 2976 :' QHash has too few template arguments' .
How can i resolve the problem because i declared the invokemethod properly ? Is it due to the fact that iuset a argument Qhash with two qstring ?

Here my code :


QMetaObject::invokeMethod(download, "CopieVarController", Qt::AutoConnection , Q_RETURN_ARG(bool, test),Q_ARG(QList<EdsDirectoryItemRef>, RAWFolders), Q_ARG( QHash <QString,QString> ,fileNamesPano1));

thanks for your help and time .

anda_skoa
25th August 2016, 16:24
That vould caused by the Q_ARG macro, macros are bascially "stupid" text replacements.
Try a typedef to the hash and use that as the argument type.

Something like


typedef QHash<QString, QString> FileNameHash;


Cheers,
_