summaryrefslogtreecommitdiffstats
path: root/smtreeitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'smtreeitem.cpp')
-rw-r--r--smtreeitem.cpp27
1 files changed, 1 insertions, 26 deletions
diff --git a/smtreeitem.cpp b/smtreeitem.cpp
index 4548655..a8e183c 100644
--- a/smtreeitem.cpp
+++ b/smtreeitem.cpp
@@ -21,32 +21,7 @@ SmTreeItem::SmTreeItem(int rows, SmTreeItem *parent) : mParent(parent){
SmTreeItem::SmTreeItem(const SmTreeItem &other){
mParent = 0;
mData = other.mData;
- QVector<SmTreeItem*> remaining;
- QHash<const SmTreeItem*, SmTreeItem*> parents;
- parents.insert(&other, this);
- const SmTreeItem *cur = &other;
- for(int i = 0; i < cur->childCount(); ++i){
- remaining << cur->child(i);
- }
- while(cur){
- cur = remaining.last();
- remaining.pop_back();
- for(int i = 0; i < cur->childCount(); ++i){
- remaining << cur->child(i);
- }
- if(remaining.isEmpty()){
- break;
- }
- SmTreeItem *newItem = new SmTreeItem(mData.size());
- for(int i = 0; i < cur->columnCount(); ++i){
- newItem->setData(i, cur->data(i));
- }
- SmTreeItem *newParent = parents.value(cur->parent());
- newParent->appendChild(newItem);
- newItem->setParent(newParent);
- parents.insert(cur, newItem);
-
- }
+ mForegroundColor = other.mForegroundColor;
}
SmTreeItem::~SmTreeItem(){