Smart Pointers

Qt

STL

QScopedPointer

—

—

std::unique_ptr

QSharedPointer

std::shared_ptr

QWeakPointer

std::weak_ptr

QSharedDataPointer

—

QExplicitlySharedDataPointer

—

// Does this function take ownership of the pointer?
QAction *QMenu::addMenu(QMenu *);
void QGraphicsScene::addItem(QGraphicsItem *item);
// Do I have to delete the returned pointer ?
QLayoutItem * QLayout::takeAt(int index)