[Development] QAbstractItemModel::createIndex(void const*)?

Matthew Woehlke mwoehlke.floss at gmail.com
Tue Nov 27 18:31:48 CET 2018


So, I was fiddling with something of a "toy" application yesterday that
implements a tree model... long story short, I ended up trying to write
some code like:

  return createIndex(row, column, &m_foo);

...which fails to compile with 'no suitable overload for (int, int, Foo
const*)'.

But... why *isn't* there such an overload? Is there any reason not to
add one? (Should I submit a patch doing so?) I think doing so is BC and
*mostly* SC, with the SIC parts being on the list of "acceptable
breakage". (Note: This would require also adding a std::nullptr_t
overload to disambiguate the `createIndex(x, y, nullptr)` case, and
presumably adding equivalent QModelIndex ctor overloads.)

-- 
Matthew



More information about the Development mailing list