From 6d2e3e9af73c085580ab3b001063ddb3e74d2c3c Mon Sep 17 00:00:00 2001 From: deva Date: Mon, 14 Jul 2008 09:55:43 +0000 Subject: Fixed problem where all widgets of the same type shared their QDomNode. --- editor/tool.cc | 2 +- editor/tool.h | 2 +- editor/widget.cc | 4 ++-- editor/widget.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'editor') diff --git a/editor/tool.cc b/editor/tool.cc index c4686d2..9deaee7 100644 --- a/editor/tool.cc +++ b/editor/tool.cc @@ -34,7 +34,7 @@ #include -Tool::Tool(QDomNode &node) +Tool::Tool(QDomNode node) : QLabel() { this->node = node; diff --git a/editor/tool.h b/editor/tool.h index 8561f94..9015079 100644 --- a/editor/tool.h +++ b/editor/tool.h @@ -35,7 +35,7 @@ class Tool : public QLabel { Q_OBJECT public: - Tool(QDomNode &node); + Tool(QDomNode node); protected: void mousePressEvent(QMouseEvent *event); diff --git a/editor/widget.cc b/editor/widget.cc index cb006f9..79957bd 100644 --- a/editor/widget.cc +++ b/editor/widget.cc @@ -50,10 +50,10 @@ #include "widgetwrapper.h" #include "propertieseditor.h" -Widget::Widget(QDomNode &node) +Widget::Widget(QDomNode node) : QWidget() { - elem = node.toElement(); + elem = node.cloneNode(true).toElement(); iscontainer = false; if(elem.hasAttribute("layout")) { diff --git a/editor/widget.h b/editor/widget.h index eda50b5..48d8d99 100644 --- a/editor/widget.h +++ b/editor/widget.h @@ -36,7 +36,7 @@ class Widget : public QWidget { Q_OBJECT public: - Widget(QDomNode &node); + Widget(QDomNode node); void setValue(QString name, QString value); QString toXml(QString tabs); -- cgit v1.2.3