But without this functional - Qt shared pointer mechanizm is no full - it's not useful!! I port small tree class from boost to Qt, some like this
class TreeNode
{
public:
void addChild(QSharedPointer<TreeNode> p);
private:
QWeakPointer _parent;
QVector<QSharedPointer<TreeNode>> _childs;
};
inside method addChild(boost realization) new child TreeNode field _parent was assigned to shared_from_this - in Qt realization i can't do this.
Besides TreeNode is parent class to other types and they can add child nodes themself. So I need to rewrite common architecture of my application - I don't want do this.
Bookmarks