What is the difference between QPointer, QSharedPointer and QWeakPointer classes in Qt?

后端 未结 2 1049
一生所求
一生所求 2021-01-31 16:11

I have read from the Qt documentations about QPointer, QSharedPointer and QWeakPointer classes. It says:

  1. QPointer<

2条回答
  •  闹比i
    闹比i (楼主)
    2021-01-31 16:22

    • QSharedPointer : std::shared_ptr
    • QWeakPointer : std::weak_ptr
    • QScopedPointer : std::unique_ptr
    • QPointer : no STL equivalent. Nulled when the QObject destructs.

提交回复
热议问题