Get QSharedPointer's Reference Count
-
Re: Get QSharedPointer's Reference Count
Hi,
Can someone share the code for getting the reference count using QSharedPointer? -
Hi
There is no code to share as its not part of the public interface.
The link talks about subclassing QSharedPointer to make the info
available.Can I ask why you need this info ?
Maybe something like
http://doc.qt.io/qt-5/qshareddata.html#details
http://doc.qt.io/qt-5/qshareddatapointer.html
is better suited? -
Hi,
Thanks for your reply.
The reason I ask this is that std::shared_ptr has a API for getting the reference count..
And, for the purpose of understanding also, we need to know when the reference count was decreased, what made it decrease etc... -
@Nishant-Sharma
Well if feel for it, you can add such info to the class yourself, maybe with extra debug information.
or simply use std::shared_ptrGive it a day or two. I think other might have good idea regarding this :)