oh my god facepalm.gif
Simple realization of addChild
Qt Code:
TreeNode::addChild(boost::shared_ptr<TreeNode> p) { if (!p._parent.expired()) throw std::runtime_error("TreeNode can't have multiple parents!"); p._parent = shared_from_this(). //!!!!!!!!! _childs.push_back(p); }To copy to clipboard, switch view to plain text mode





Reply With Quote
Bookmarks