-
Bug
-
Resolution: Incomplete
-
P2: Important
-
4.4.0
-
None
This was reported on the Qt Jambi interest mailing list and reproduced with 4.4.0 and 4.4 depot build mid august.
import com.trolltech.qt.gui.*;
import com.trolltech.qt.core.*;
public class ItemModel extends QAbstractTableModel {
public ItemModel()
{ timer = new QTimer(); timer.timeout.connect(this, "addData()"); timer.start(2000); }public int rowCount(QModelIndex parent)
{ return rows; }public int columnCount(QModelIndex parent)
{ return 4; } public Object data(QModelIndex index, int role) {
if (role == Qt.ItemDataRole.DisplayRole)
return null;
}
public void addData() {
if (decision)
else
{ beginRemoveRows(null, rows - 1, rows -1); --rows; endRemoveRows(); } decision = !decision;
}
private int rows = 4;
private QTimer timer;
private boolean decision;
public static void main(String args[])
{ QApplication.initialize(args); QTableView view = new QTableView(); ItemModel model = new ItemModel(); view.setModel(model); view.show(); QApplication.exec(); }}