Details
-
Bug
-
Resolution: Unresolved
-
P4: Low
-
None
-
6.1.0 RC
-
Ubuntu 21.04, macOS 11.2.2
Description
#include <QApplication> #include <QTableView> enum { COLUMN_COUNT = 1, ROW_COUNT = 100000000 }; struct TestModel : QAbstractItemModel { int columnCount( const QModelIndex& in_parent ) const override { return in_parent.isValid() ? 0 : COLUMN_COUNT; } int rowCount( const QModelIndex& in_parent ) const override { return in_parent.isValid() ? 0 : ROW_COUNT; } QModelIndex index( int in_row, int in_column, const QModelIndex& in_parent ) const override { if( in_parent.isValid() ) return {}; return createIndex( in_row, in_column ); } QModelIndex parent( const QModelIndex& /*in_child*/ ) const override { return {}; } QVariant data( const QModelIndex& in_index, int in_role ) const override { switch( in_role ) { case Qt::DisplayRole: return QString( "%1:%2").arg( in_index.row() ).arg( in_index.column() ); default:; } return {}; } }; int main( int argc, char *argv[] ) { QApplication a( argc, argv ); QTableView t; t.setModel( new TestModel ); t.show(); return a.exec(); }
"Jira could not attach the file as there was a missing token. Please try attaching the file again.". So I posted example code here.