I have used Boost::shared_ptr in my previous projects and now I want to find a smart-pointer in Qt which does the same/similar thing.
Since there are many smart-pointer classes in Qt I was wondering which one to use.
Is it QSharedPointer?
If you used boost::shared_ptr, continue using it. Prefer boost::shared_ptr to any Qt 'extensions' because boost::shared_ptr is accepted into the C++0x standard (std::shared_ptr).
You want QSharedPointer. You'll find a comparison of all the pointer classes offered by Qt in the detailed description of QSharedPointer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With