Results 1 to 4 of 4

Thread: how to add buttons to a table view

  1. #1
    Join Date
    Mar 2009
    Posts
    6
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default how to add buttons to a table view

    Hi,

    I have a QTableView and a QStandardItemModel showing some columns. Now I need to a new column with a QPushButton so that each row has a button.

    But I can't figure out how to add the button, any ideas on how do it?

    regards
    Per

  2. #2
    Join Date
    Aug 2006
    Posts
    221
    Thanks
    3
    Thanked 29 Times in 19 Posts

    Default Re: how to add buttons to a table view

    Quote Originally Posted by cyclic View Post
    But I can't figure out how to add the button, any ideas on how do it?
    You have to use a delegate.

  3. #3
    Join Date
    Mar 2009
    Posts
    6
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: how to add buttons to a table view

    Quote Originally Posted by Kumosan View Post
    You have to use a delegate.
    that's what I suspected, but I still don't understand how to do it

  4. #4
    Join Date
    Aug 2006
    Posts
    221
    Thanks
    3
    Thanked 29 Times in 19 Posts

    Default Re: how to add buttons to a table view

    I am afraid I have to point you to the Qt docs:
    http://qt.nokia.com/doc/4.5/model-view-delegate.html

    I doubt I am capable of explaining it better more understandable than the stuff in there. Sorry.

Similar Threads

  1. Set height for table view
    By sasi in forum Qt Programming
    Replies: 1
    Last Post: 29th July 2009, 08:07
  2. How to set two rows in a table view Horizontal header?
    By sivollu in forum Qt Programming
    Replies: 11
    Last Post: 29th April 2009, 04:57
  3. Radio buttons in a tree view
    By notwithstanding in forum Qt Programming
    Replies: 6
    Last Post: 3rd November 2008, 22:32
  4. Table Widget Vs. Table View
    By winston2020 in forum Qt Programming
    Replies: 2
    Last Post: 19th October 2008, 09:56
  5. Table model / view editing issue
    By Caius Aérobus in forum Qt Programming
    Replies: 9
    Last Post: 7th April 2006, 11:03

Tags for this Thread

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.