Results 1 to 3 of 3

Thread: Usage of QMetaMethod::invoke(...)

  1. #1
    Join Date
    Feb 2013
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default Usage of QMetaMethod::invoke(...)

    Hi guys,
    it's pretty tough to implement a generic interface to invoke different methods, since those methods have different parameter lists. Maybe I misunderstood the QMetaMethod::invoke() interface ... Actually, I do something as follows:

    QList parameters;
    ...
    bool success = method.invoke(receiver, Qt::AutoConnection, Q_RETURN_ARG(...), parameters.at(0), parameters.at(1), ...);


    What I want to do is:
    ...
    bool success = method.invoke(..., parameters);


    Is something comparable possible?


    Thanks for your time,
    Falko.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Usage of QMetaMethod::invoke(...)

    Does the method accept a list or do you want to simply pass a series of separate arguments as a list?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Feb 2013
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Usage of QMetaMethod::invoke(...)

    Hmm, I assume, I got it ... it isn't so tough, as it seemed before.

    First of all I initialized the above mentioned parameter list. After that, I can call QMetaMethod::invoke(...) only once in my code with the maximal number of arguments. Most of it are normally initialized with 0. It works that way.

    Sorry,
    Falko.
    Last edited by falko.wiese; 5th February 2013 at 19:38.

Similar Threads

  1. Can we invoke other lang. scripts through QT
    By yogeshkarpate in forum Newbie
    Replies: 1
    Last Post: 14th August 2009, 10:43
  2. How to invoke a running application
    By srikanthch in forum Qt Programming
    Replies: 2
    Last Post: 18th December 2008, 15:42
  3. QMetaMethod::Method
    By magland in forum Qt Programming
    Replies: 1
    Last Post: 14th June 2007, 10:22
  4. signal from QMetaMethod
    By magland in forum Qt Programming
    Replies: 1
    Last Post: 14th June 2007, 09:07
  5. Question about QMetaMethod
    By jlbrd in forum Qt Programming
    Replies: 6
    Last Post: 5th August 2006, 23:16

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.