Results 1 to 5 of 5

Thread: dynamically add rows to tableview

  1. #1
    Join Date
    Mar 2011
    Posts
    51
    Thanks
    7
    Qt products
    Qt3 Qt4 Qt/Embedded

    Default dynamically add rows to tableview

    I want to have a table view in my Qt code. It has four column and many rows (not know ) before hand in table view Qt how can I dynamically add rows as

    Qt Code:
    1. QStandardItemModel model(0,2);
    To copy to clipboard, switch view to plain text mode 

    What to do to add rows dynamically

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: dynamically add rows to tableview


  3. #3
    Join Date
    Mar 2011
    Posts
    51
    Thanks
    7
    Qt products
    Qt3 Qt4 Qt/Embedded

    Default Re: dynamically add rows to tableview

    Thank u .sir can u kindly give me lilte example or link to example not the documentation as i am new to it i am unable to understand the documentation wid out example thanks

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: dynamically add rows to tableview

    or QStandardItem::setRowCount(). Here is your example:
    Qt Code:
    1. model.setRowCount(1);
    To copy to clipboard, switch view to plain text mode 

  5. #5
    Join Date
    Nov 2010
    Location
    Budapest, Hungary
    Posts
    125
    Thanks
    17
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: dynamically add rows to tableview

    what do you mean dynamically? Do you want to add or delete rows based on some user interaction or other parameter changes? Anyway I would suggest QTableWidget, very nice class for designing a table.
    Szilvi

Similar Threads

  1. how to add tab dynamically
    By asish_cse in forum Newbie
    Replies: 2
    Last Post: 14th September 2010, 16:27
  2. Replies: 1
    Last Post: 12th October 2009, 09:33
  3. Adding rows to Tableview
    By codeman in forum Qt Programming
    Replies: 1
    Last Post: 2nd October 2009, 10:27
  4. How to map the rows to sourceModel rows.
    By kaushal_gaurav in forum Qt Programming
    Replies: 2
    Last Post: 11th February 2009, 08:40
  5. TableView + SqlQueryModel: can't insert or edit rows
    By jiveaxe in forum Qt Programming
    Replies: 3
    Last Post: 27th September 2008, 21:55

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.