Results 1 to 3 of 3

Thread: Line Decoration in QListView

  1. #1
    Join Date
    Dec 2007
    Posts
    119
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Line Decoration in QListView

    Hi,
    I want to insert at the beginning of a row of my QListView a little styled line as decoartion instead of the classic colored icon...is there a simple trick to complete this task or I've to use QItemDelegate approch?

  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: Line Decoration in QListView

    You can either provide a custom delegate or make your styled line an icon and set it as decoration so that the default delegate can render it.
    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
    Dec 2007
    Posts
    119
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Line Decoration in QListView

    Quote Originally Posted by wysota View Post
    You can either provide a custom delegate or make your styled line an icon and set it as decoration so that the default delegate can render it.
    The line style is editable by the user so it's impossible to create an icon for each line color/width/style combination...I think its better to create dynamically a decoration instead the standard icon decoration inserted through Qt:ecorationRole, or an item representing the style line...both using a custom delegate.

Similar Threads

  1. Replies: 0
    Last Post: 4th August 2011, 11:11
  2. Custom Window Decoration?
    By BadKnees in forum Qt Programming
    Replies: 5
    Last Post: 28th April 2011, 18:49
  3. QTreeWidgetItem decoration
    By ^NyAw^ in forum Qt Programming
    Replies: 6
    Last Post: 27th October 2009, 15:01
  4. QListView Line Color
    By fruzzo in forum Qt Programming
    Replies: 1
    Last Post: 9th May 2008, 09:42
  5. Mdi Window decoration
    By kalpa in forum Qt Programming
    Replies: 1
    Last Post: 7th May 2007, 09:19

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.