Results 1 to 5 of 5

Thread: QTreeWidgetItem, 2+ icons

  1. #1
    Join Date
    Nov 2013
    Posts
    17
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default QTreeWidgetItem, 2+ icons

    hello
    how i can insert 2+ icons in 1 column of qtreewidgetitem?

  2. #2
    Join Date
    May 2014
    Posts
    5
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: QTreeWidgetItem, 2+ icons

    Hi Ieshir.

    One way of accomplishing this is to create a custom widget and inserting it under that column in place of the icons. You can then fill the widget with as many icons as you want.

    http://qt-project.org/doc/qt-4.8/qtr...#setItemWidget

  3. #3
    Join Date
    Nov 2013
    Posts
    17
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTreeWidgetItem, 2+ icons

    ty, but can't use this

    all itemWidgets is ugly with my QSS



    How i can do it with qstyleditemdelegate?

  4. #4
    Join Date
    May 2014
    Posts
    5
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: QTreeWidgetItem, 2+ icons

    Unless I'm mistaken, using delegates directly requires implementing a model/view rather than just using one of the pre-made widgets. There's a complete example of how to set up a delegate here:

    http://qt-project.org/doc/qt-4.8/ite...rdelegate.html

    And an introduction to model/view here:

    http://qt-project.org/doc/qt-4.8/modelview.html

    However, I would've thought that styling the widget should be entirely in your control. Are you sure you cannot work with what you have?

  5. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTreeWidgetItem, 2+ icons

    Quote Originally Posted by skauert View Post
    Unless I'm mistaken, using delegates directly requires implementing a model/view rather than just using one of the pre-made widgets.
    No, that should be OK.

    A QTreeWidget is a QTreeView, the items are basically just a different way of filling an internal model.

    Cheers,
    _

Similar Threads

  1. Replies: 2
    Last Post: 8th April 2013, 06:40
  2. Replies: 11
    Last Post: 3rd March 2012, 22:21
  3. qtreewidgetitem
    By ahmetturan in forum Newbie
    Replies: 1
    Last Post: 24th July 2011, 19:38
  4. Replies: 5
    Last Post: 23rd September 2010, 13:58
  5. :( Problems with QTreeWidgetItem icons
    By davit in forum Qt Programming
    Replies: 13
    Last Post: 18th April 2007, 13:38

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
  •  
Qt is a trademark of The Qt Company.