
Originally Posted by
darpan
(1) When i am inserting items in QTableWidget then rowcount is also appearing with each row. I don't want to show rowcount with each row. How i can hide this rowcount.
Are you talking about the vertical header? If so, try QTableView::verticalHeader() and QWidget::hide().
tableWidget->verticalHeader()->hide();
tableWidget->verticalHeader()->hide();
To copy to clipboard, switch view to plain text mode
By the way,

Originally Posted by
darpan
tableWidget->clear();
while(tableWidget->rowCount())
{
int row=tableWidget->rowCount();
tableWidget->setRowCount(row-1); // delete one row at a time
}
tableWidget->clear();
while(tableWidget->rowCount())
{
int row=tableWidget->rowCount();
tableWidget->setRowCount(row-1); // delete one row at a time
}
To copy to clipboard, switch view to plain text mode
is equivalent of
tableWidget->clear();
tableWidget->setRowCount(0);
tableWidget->clear();
tableWidget->setRowCount(0);
To copy to clipboard, switch view to plain text mode
with much less hassle. Removing rows one by one causes several repaints (which Qt might actually merge for you, but still...)
I somehow have a feeling that a QTreeWidget with multiple columns and root decoration disabled would be more appropriate for you. But anyway, could you please use [ code ]-tags around your code postings to make them more readable.
Bookmarks