2017-04-21 9:13 GMT+02:00 Marc Mutz <[email protected]>: > On Friday 21 April 2017 08:42:37 Filippo Cucchetto wrote: > > Is there any plan to enhance the QModelIndex interface by adding support > to > > std::weak_ptr<void? > > I know that is not necessary since we can directly store T* from > > shared_ptr<T> but being able to store a weak_ptr seems a little bit > safer. > > There is no such plan. QModelIndexes should not be stored anywhere, they > are > simply an interface type: as long as you're using ti correctly, you could > not > observe the weak_ptr being reset > > Yes and i agree, but there's a difference between a crash of an application and a warning. Futhermore since QModelIndexes have been somewhat interfaced with QML this bring a lot of indeterminism.
> If and when we change QModelIndex to become more convenient, but also more > expensive to use, it should probably get a QVariant (or std::any), not any > particular type. > > Thanks, > Marc > > -- > Marc Mutz <[email protected]> | Senior Software Engineer > KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company > Tel: +49-30-521325470 > KDAB - The Qt, C++ and OpenGL Experts > -- Filippo Cucchetto
_______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
