problem with tablewidget..
hello,
my problem is that i need to remove all the rows of the table and then add new rows..
al these work at runtime only..
so i wrote the following code...
but cant understand where the problem is..
row=table->rowCount();
for(int i=0;i<=row;i++)
table->removeRow(i);
row=0;
queryForMem();//this takes input for the new row..
one row always remains and doesnt get removed..
new instructions do not work on this table any more...
like i cannot add a new row through some other functions..
plz help me out...
Re: problem with tablewidget..
why do not simply call QTableWidget::clear?
PS. please, use tags CODE .
Re: problem with tablewidget..
Damn, you are very resistant to advices! USE THE FUCKING CODE TAGS! The last time I'll help you when you are not going to use them:
QTableWidget::clearContents(), and then reset the dimension.
Re: problem with tablewidget..
@spirit: Why are you always some seconds earlier :confused:
Re: problem with tablewidget..
Quote:
Originally Posted by
Lykurg
@spirit: Why are you always some seconds earlier :confused:
I don't know :D;)
Re: problem with tablewidget..
do u mean like dis...
Code:
row=table->rowCount();
for(int i=0;i<=row;i++)
table->removeRow(i);
row=0;
queryForMem();//this takes input for the new row..
ok.. but clear() doent remove the rows totally...it just removes the contents..
Re: problem with tablewidget..
Quote:
Originally Posted by
reshma
do u mean like dis...
Code:
row=table->rowCount();
for(int i=0;i<=row;i++)
table->removeRow(i);
row=0;
queryForMem();//this takes input for the new row..
yes
Quote:
Originally Posted by
reshma
ok.. but clear() doent remove the rows totally...it just removes the contents..
set row count to "0" after clear.