Results 1 to 3 of 3

Thread: Direct call to QAbstractListModel item Q_INVOKABLE from qml

  1. #1
    Join Date
    Aug 2011
    Posts
    38
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Direct call to QAbstractListModel item Q_INVOKABLE from qml

    I do have QAbstractListModel which contains object which has derived QObject. It has one INVOKABLE method which I would like call from QML side. How I do that ?

    Like:

    function makeTest ()
    {
    list.model(list.currentIndex).doINVOKABLE();
    }

    Why this isn't work ?

  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: Direct call to QAbstractListModel item Q_INVOKABLE from qml

    The code you have tries to call doINVOKABLE() on the MODEL not on its element.
    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
    Aug 2011
    Posts
    38
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Direct call to QAbstractListModel item Q_INVOKABLE from qml

    Ok, how to call doINVOKABLE() of specific element?

Similar Threads

  1. How to exclude an item from scene::itemsboundingrect() call ?
    By corrado1972 in forum Qt Programming
    Replies: 1
    Last Post: 10th January 2012, 16:09
  2. Can't make Q_INVOKABLE macro use compile
    By frankiefrank in forum Qt Programming
    Replies: 5
    Last Post: 22nd September 2011, 13:35
  3. Problem using Q_INVOKABLE on private constructor
    By graeme in forum Qt Programming
    Replies: 1
    Last Post: 29th May 2010, 21:50
  4. Replies: 0
    Last Post: 12th April 2010, 12:22
  5. Signal/slot or direct method call within a class
    By mike_the_tv in forum Newbie
    Replies: 6
    Last Post: 11th March 2010, 18:49

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.