I used Boost::shared_ptr in my previous projects and now I want to find a smart pointer in Qt that does the same / similar thing. Since there are many classes of smart pointers in Qt, I was wondering which one to use. Is this QSharedPointer ?
Boost::shared_ptr
QSharedPointer
Do you want QSharedPointer . You will find a comparison of all the pointer classes offered by Qt in the detailed description of QSharedPointer .
If you used boost::shared_ptr , continue to use it. Prefer boost::shared_ptr for any Qt 'extensions, because boost::shared_ptr accepted in the C ++ 0x standard ( std::shared_ptr ).
boost::shared_ptr
std::shared_ptr
Qt has many different smart pointers described in a blog post . QSharedPointer is most likely what you are looking for.