title: QTableView model out of memory
body: <p>I am getting an out of memory crash when using QTableView + QAbstractTableModel with a large number of items.</p>
  
  <p>The problem seems to come from the vertical header view. It tries to allocate a QVector with same size as the row count (150 millions).</p>
  
  <p>How can i use millions of rows in my model without crashing the table?</p>
  
  <p>Here is a sample to reproduce the issue.</p>
  
  <pre><code>class MiniModel : public QAbstractTableModel
  {
  Q_OBJECT
  
  public:
      MiniModel(QObject * parent = nullptr);
      int columnCount(QModelIndex const &amp;parent = QModelIndex()) const override;
      int rowCount(QModelIndex const &amp;parent = QModelIndex()) const override;
      QVariant data(QModelIndex const &amp;index, int role = Qt::DisplayRole) const override;
      QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
  };
  
  MiniModel::MiniModel(QObject * parent) : QAbstractTableModel(parent)
  {
  }
  
  int MiniModel::columnCount(QModelIndex const &amp; parent) const
  {
      return 1;
  }
  
  int MiniModel::rowCount(QModelIndex const &amp; parent) const
  {
      return 150000000;
  }
  
  QVariant MiniModel::data(QModelIndex const &amp; index, int role) const
  {
      if (role == Qt::DisplayRole)
          return 23; // just return 23 in all cells
      else
          return QVariant();
  }
  
  QVariant MiniModel::headerData(int section, Qt::Orientation orientation, int role) const
  {
      if (section == 0 &amp;&amp; role == Qt::DisplayRole &amp;&amp; orientation == Qt::Horizontal)
          return "Dummy";
      else
          return QVariant();
  }
  </code></pre>