Results 1 to 3 of 3

Thread: Changing the branch icon of the Qml TreeView

  1. #1
    Join Date
    Jan 2010
    Posts
    95
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Changing the branch icon of the Qml TreeView

    Hi all,

    I need to modify the branch icon of the treeview. Can you explain me how to go about the same?
    I have set a style sheet but can't figure out how to use the branchDelegate.

    Kindly advice

  2. #2
    Join Date
    Jun 2018
    Posts
    2
    Qt products
    Platforms
    Unix/X11 Windows

    Default Re: Changing the branch icon of the Qml TreeView

    Please let me know if you find the solution...

  3. #3
    Join Date
    Nov 2020
    Posts
    3
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Symbian S60

    Default Re: Changing the branch icon of the Qml TreeView

    The way I did it, example:

    TreeView {
    id: treeview
    anchors.fill: parent
    model: treemodel
    style: TreeViewStyle {
    branchDelegate: Rectangle {
    width: 15; height: 15
    Image {
    source: styleData.isExpanded ? "images/16px/ArrowDownSmall_black_16px.svg" : "images/16px/ArrowRightSmall_black_16px.svg"
    }
    }

    Simply add a branchDelegate, then in my example I checked isExpanded and put my own images like the example.

Similar Threads

  1. Replies: 2
    Last Post: 5th January 2013, 18:02
  2. Replies: 1
    Last Post: 16th November 2011, 17:53
  3. Mac compile problem on 6.0 branch
    By ghorwin in forum Qwt
    Replies: 1
    Last Post: 15th July 2011, 08:28
  4. Keep default branch image
    By wirasto in forum Qt Programming
    Replies: 0
    Last Post: 20th January 2010, 07:05
  5. Changing icon in sidebar at QFileDialog possible ?
    By skyperhh in forum Qt Programming
    Replies: 0
    Last Post: 18th November 2009, 12:15

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.