Results 1 to 2 of 2

Thread: QTreeWidgetItem one icon + one icon button

  1. #1
    Join Date
    May 2013
    Thanked 7 Times in 7 Posts
    Qt products
    MacOS X Unix/X11 Windows

    Default QTreeWidgetItem one icon + one icon button

    I have a QTreeWidget with each element has an icon.
    I have an option to set visible or not the data each element of tree widget item has.
    The goal is to have the visible button then the icon then the name.
    I tried to add a column and set a widget using QToolButton but I got problem :
    The eye icon is the visible button.
    How achieve that correctly ?
    Thanks for the help

  2. #2
    Join Date
    May 2012
    Thanked 27 Times in 24 Posts
    Qt products
    Qt3 Qt4 Qt5
    Unix/X11 Windows

    Default Re: QTreeWidgetItem one icon + one icon button

    I don't know if it is possible with a QTreeWidget (i only use QTreeView with a self made TreeModel)

    If you use a QTreeView with a self made model you can attach a QStyledItemDelegate to the view that adds a button in a cell

    If you don't want to make a column in your model just for a view item you can attach a modified proxymodel that adds a virtual column just for the button (I did this for a table view

Similar Threads

  1. Replies: 2
    Last Post: 26th April 2011, 11:44
  2. QTreeWidgetItem animated icon
    By ^NyAw^ in forum Qt Programming
    Replies: 1
    Last Post: 10th February 2010, 18:09
  3. icon out of button
    By mattia in forum Newbie
    Replies: 17
    Last Post: 28th March 2008, 14:56
  4. Couple of questions: main window icon + toolbar icon
    By bpackard in forum Qt Programming
    Replies: 0
    Last Post: 20th March 2008, 19:03
  5. Icon only button
    By bruccutler in forum Newbie
    Replies: 9
    Last Post: 19th January 2007, 19:20


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.