Results 1 to 2 of 2

Thread: Is it possible to emit a signal from an QML ListModel element?

  1. #1
    Join Date
    May 2012
    Posts
    5

    Default Is it possible to emit a signal from an QML ListModel element?

    My idea is to define a ListModel with some Elements, like this.

    Qt Code:
    1. ListModel {
    2. id: list
    3.  
    4. ListElement {
    5. name: "test"
    6. signal run
    7. }
    8.  
    9. ListElement {
    10. ...
    11. }
    12.  
    13. }
    To copy to clipboard, switch view to plain text mode 

    Then I want to connect the Signal run with a State and start the Signal in Javascript with (for Example)

    Qt Code:
    1. emit ListView.currentItem.signal
    To copy to clipboard, switch view to plain text mode 

    Thank you for your help.

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Is it possible to emit a signal from an QML ListModel element?

    You should do this in your own delegate, but not it a model.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

Similar Threads

  1. Emit signal outside run() in QThread
    By naturalpsychic in forum Qt Programming
    Replies: 4
    Last Post: 26th March 2012, 17:31
  2. Replies: 2
    Last Post: 3rd May 2011, 21:22
  3. emit signal from script
    By wookoon in forum Newbie
    Replies: 5
    Last Post: 6th July 2010, 15:37
  4. Emit signal from thread
    By sisco in forum Newbie
    Replies: 2
    Last Post: 26th November 2009, 14:32
  5. emit a signal
    By Morea in forum Qt Programming
    Replies: 2
    Last Post: 27th February 2006, 12:14

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.