title: Should QAbstractItemModel::index(row, column, parent) check for invalid inputs?
body: <p>Subclassing QAbstractItemModel, I have implemented my own index() method as required. I currently check for valid inputs, but I'm wondering if that's correct. I'm wondering if it's ever valid to create an index for a non-existent piece of data? Perhaps while inserting a row or column?</p>
  
  <p>Code:</p>
  
  <pre><code>QModelIndex LicenseDataModel::index(int row, int column, const QModelIndex &amp; /*parent*/) const
  {
      /// TODO: Is this necessary? Should we avoid creating invalid indexes? Or could this
      /// be a bug?
      if (validRowColumn(row, column))
          return createIndex(row, column);
      return QModelIndex();
  }
  </code></pre>