How to delete an empty row in QTableWidget?
-
wrote on 31 Aug 2011, 04:58 last edited by
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
-
wrote on 31 Aug 2011, 05:10 last edited by
You can delete a row from QTableWidget using "removeRow":http://doc.qt.nokia.com/4.7/qtablewidget.html#removeRow.
-
wrote on 31 Aug 2011, 05:29 last edited by
[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.
-
wrote on 31 Aug 2011, 07:00 last edited by
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);@
5/5