Is it legal to write a list model which returns large data set for listview ?
Say a c++ model like:
int TestModel::rowCount(const QModelIndex &parent) const
{
return 50000000;
}
QVariant TestModel::data(const QModelIndex &index, int role) const
{
int row = index.row();
if (role == 0x100) return row;
if (role == Qt::SizeHintRole) return QSize(300,30);
return QString("hello %1").arg(row);
}
QHash<int, QByteArray> TestModel::roleNames() const
{
return QHash<int, QByteArray>({
{0x100, "line"},
{0x101, "log"}
});
}
Qml:
Item {
Component {
id: simple
Rectangle{
height: 10
width: 10
color: 'blue'
}
}
ListView {
id: viewer
anchors.fill: parent
model: testmodel
delegate: simple
ScrollBar.vertical: ScrollBar{
}
}
}
The memory, cpu, rendering...everything goes fine:
But, when scroll to about 3500000 lines:
Some space appear between few lines.
Is there a Qt bug, or I'm making some mistakes ?

