I have a bit of a strange problem here. With the following code :
int rowCount = model->item( row )->rowCount();
for( int i = 0; i < rowCount; ++i ){
QList<
QStandardItem* > items
= model
->item
( row
)->takeRow
( i
);
qDeleteAll( items );
}
int rowCount = model->item( row )->rowCount();
for( int i = 0; i < rowCount; ++i ){
QList< QStandardItem* > items = model->item( row )->takeRow( i );
qDeleteAll( items );
}
To copy to clipboard, switch view to plain text mode
every SECOND row gets deleted. I'm a bit stumped, since a quick qDebug() shows that rowCount is indeed being set to the amount of rows in the QStandardItem. And since i is only being incremented by 1 every iteration, it SHOULD delete one row every time, and not skip a row. Is this a bug in Qt4? I'm running qt-copy BTW, the patched KDE4 snapshot.
Bookmarks