Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to delete an empty row in QTableWidget?
Forum Updated to NodeBB v4.3 + New Features

How to delete an empty row in QTableWidget?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 4.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Revu
    wrote on last edited by
    #1

    I have loaded the TableWidget with the numbers from database by dynamically adding rows to it.Now I need to separate the CallHistory as missed,dialed and received call.But empty space is filled in every table.How to remove blank rows??Am clueless.Please help.

    Thanks in advance

    Every fall is to raise higher than Before.

    1 Reply Last reply
    0
    • L Offline
      L Offline
      leon.anavi
      wrote on last edited by
      #2

      You can delete a row from QTableWidget using "removeRow":http://doc.qt.nokia.com/4.7/qtablewidget.html#removeRow.

      http://anavi.org/

      1 Reply Last reply
      0
      • R Offline
        R Offline
        Revu
        wrote on last edited by
        #3

        there is no effect using removeRow in my code.Is there any other option?

        Every fall is to raise higher than Before.

        1 Reply Last reply
        0
        • L Offline
          L Offline
          leon.anavi
          wrote on last edited by
          #4

          [quote author="Revu" date="1314768331"]there is no effect using removeRow in my code.Is there any other option?[/quote]

          That is strange, please share your source code.

          http://anavi.org/

          1 Reply Last reply
          0
          • O Offline
            O Offline
            octal
            wrote on last edited by
            #5

            Indeed, it should work.

            This snippet perfectly works for me :

            @
            QTableWidget *table = new QTableWidget(2, 3, this);
            Q_ASSERT(table->rowCount() == 2);

            table->removeRow(1);
            Q_ASSERT(table->rowCount() == 1);

            @

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved