Results 1 to 2 of 2

Thread: Adding a button in the header of a QTreeWidget

  1. #1
    Join Date
    Apr 2008
    Posts
    12
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Adding a button in the header of a QTreeWidget

    How is it possible to add a button in the header of a QTreeWidget?

    A minimal example is more than welcome...

  2. #2
    Join Date
    Oct 2006
    Location
    Germany
    Posts
    84
    Thanks
    5
    Thanked 5 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Adding a button in the header of a QTreeWidget

    Did you try something like:
    Qt Code:
    1. QHeaderView *header = myTreeWidget->header();
    2. QPushButton *button = new QPushButton("PushMe", header);
    3. QHBoxLayout *layout = new QHBoxLayout(header);
    4. layout->addStretch();
    5. layout->addWidget(button);
    To copy to clipboard, switch view to plain text mode 

    I don't know if this works, I'm just spitballing here

Similar Threads

  1. How to add a tool button to a qlistview header
    By kalos80 in forum Qt Programming
    Replies: 2
    Last Post: 31st July 2008, 10:13
  2. Adding 3 words to Button with specified length betwwen words
    By chikkireddi in forum Qt Programming
    Replies: 1
    Last Post: 26th October 2007, 11:08
  3. Adding strings in QTreeWidget ?
    By npc in forum Newbie
    Replies: 13
    Last Post: 30th January 2007, 09:24
  4. Two-row header for QTreeWidget
    By wetzel in forum Qt Programming
    Replies: 1
    Last Post: 27th May 2006, 12:26

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.