QModelIndex: store quintptr instead of void*
authorMarc Mutz <marc.mutz@kdab.com>
Mon, 24 Sep 2012 13:21:19 +0000 (15:21 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 24 Sep 2012 16:01:37 +0000 (18:01 +0200)
commit3291e0a77c10a92a63173d9ece4f83661f849ba9
tree6239ef4c0a84174888bd71df38b2348b74637f05
parent44a0e972a0fc6787f1d275a457c2bb0a0d10aff8
QModelIndex: store quintptr instead of void*

Rationale:
1. Comparing pointers that don't point the same array is undefined behaviour, IIRC,
   and op== and op< did that.
2. The functions that cast to/from the storage type can't be constexpr. It makes
   more sense to have the quintptr functions be constexpr (they have a fighting
   chance to actually get passed something constant) than it is to have the void*
   functions constexpr. Thus, the storage type should be quintptr.

Also prepare op< to be constexpr-compatible.

Change-Id: I4b2d4a0ec8ca80d619d272bf07c57887cbd11c2f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
src/corelib/itemmodels/qabstractitemmodel.h