diff options
Diffstat (limited to 'smtreeitem.cpp')
-rw-r--r-- | smtreeitem.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/smtreeitem.cpp b/smtreeitem.cpp index e7f4336..a13e76a 100644 --- a/smtreeitem.cpp +++ b/smtreeitem.cpp @@ -15,6 +15,18 @@ SmTreeItem::SmTreeItem(int rows, SmTreeItem *parent) : mParent(parent){ } } +SmTreeItem::SmTreeItem(const SmTreeItem &other){ + mData = other.mData; + if(other.mParent){ + mParent = new SmTreeItem(*mParent); + }else{ + mParent = 0; + } + foreach(SmTreeItem *child, other.mChildren){ + mChildren << new SmTreeItem(*child); + } +} + SmTreeItem::~SmTreeItem(){ qDeleteAll(mChildren); } |