Results 1 to 2 of 2

Thread: Invokemethod with an argument Qhash < Qstring,Q string> error 2976

  1. #1
    Join Date
    Jul 2016
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Invokemethod with an argument Qhash < Qstring,Q string> error 2976

    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 :

    Qt Code:
    1. QMetaObject::invokeMethod(download, "CopieVarController", Qt::AutoConnection , Q_RETURN_ARG(bool, test),Q_ARG(QList<EdsDirectoryItemRef>, RAWFolders), Q_ARG( QHash <QString,QString> ,fileNamesPano1));
    To copy to clipboard, switch view to plain text mode 

    thanks for your help and time .
    Last edited by Caradryan; 25th August 2016 at 16:54.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Invokemethod with an argument Qhash < Qstring,Q string> error 2976

    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
    Qt Code:
    1. typedef QHash<QString, QString> FileNameHash;
    To copy to clipboard, switch view to plain text mode 

    Cheers,
    _

Similar Threads

  1. QHash as QMetaObject::invokeMethod argument
    By ^NyAw^ in forum Qt Programming
    Replies: 2
    Last Post: 1st October 2014, 19:04
  2. Replies: 3
    Last Post: 20th January 2012, 16:23
  3. Replies: 0
    Last Post: 19th January 2012, 16:52
  4. Replies: 2
    Last Post: 11th August 2011, 16:42
  5. std string to QString error
    By Daxos in forum Qt Programming
    Replies: 2
    Last Post: 24th May 2010, 17:38

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.