Results 1 to 5 of 5

Thread: adding rows to tablewidget

  1. #1
    Join Date
    Mar 2009
    Posts
    18
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Question adding rows to tablewidget

    hiii,

    can anyone help me out in adding rows to table widget at runtime??

    plzz..

  2. #2
    Join Date
    Aug 2008
    Posts
    134
    Thanks
    10
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: adding rows to tablewidget

    Use insertRow() function. The argument is where u need to insert.
    For ex: if u need to append the row then user insertRow(tableWidget->rowCount() - 1).

  3. The following user says thank you to navi1084 for this useful post:

    reshma (12th March 2009)

  4. #3
    Join Date
    Mar 2009
    Posts
    18
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Question Re: adding rows to tablewidget

    hii
    thnks..

    next i need to insert data into dat row...

    so how can i do dat??
    i used setItem() but nothing is being displayed just a row is being added??

  5. #4
    Join Date
    Aug 2008
    Posts
    134
    Thanks
    10
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: adding rows to tablewidget

    Data you can insert interms of QTableWidgetItem. So create the object of that and set the data using setText(). and use tableWidget->setItem(row, column, item)

  6. #5
    Join Date
    Mar 2009
    Posts
    18
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: adding rows to tablewidget

    thnks a lot......



    i was fixed in dis problem since soo many days.....thnks..

Similar Threads

  1. QSqlTableModel inserts empty rows
    By Nesbitt in forum Qt Programming
    Replies: 2
    Last Post: 6th August 2008, 12:47
  2. horizontal header over two rows in tablewidget
    By Nippler in forum Qt Programming
    Replies: 2
    Last Post: 28th April 2008, 10:33
  3. Adding a toolbar to a TableWidget
    By Walter in forum Qt Programming
    Replies: 2
    Last Post: 1st July 2007, 21:13
  4. Replies: 2
    Last Post: 12th June 2007, 17:23
  5. Resize rows and cols in a Tablewidget
    By zorro68 in forum Qt Programming
    Replies: 2
    Last Post: 11th February 2007, 12:32

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.