Results 1 to 2 of 2

Thread: Display decoration in listview delegate

  1. #1
    Join Date
    Apr 2015
    Posts
    7
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Display decoration in listview delegate

    I have a model in C++ that is used in my Qml file. Its working fine, but I have problems showing the decoration. How can I display an icon in qml? I searched the documentation and the web, no success. ImageItem wont work either.

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

    Default Re: Display decoration in listview delegate

    You mean something like Qt:ecorationRole in widget based views?

    The easiest way is to have a role that returns the image's file name and then use an Image element using that as its source.

    Cheers,
    _

Similar Threads

  1. Replies: 1
    Last Post: 5th December 2015, 12:38
  2. Replies: 11
    Last Post: 16th October 2015, 15:34
  3. Replies: 2
    Last Post: 25th August 2015, 08:42
  4. Replies: 6
    Last Post: 21st May 2015, 20:53
  5. Replies: 1
    Last Post: 23rd June 2012, 14:23

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.