From 48f92d13fa3a42007a068baf1d63f418b22a2b3e Mon Sep 17 00:00:00 2001 From: deva Date: Mon, 14 Jul 2008 09:32:45 +0000 Subject: Made the setValue actually set the values in the GUI. Fixed resize problem when labels got text filled into them. Added a simple toXml method to dunp xml from the contructed gui to stdout. --- editor/toolbox.cc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'editor/toolbox.cc') diff --git a/editor/toolbox.cc b/editor/toolbox.cc index 57c2ad1..e1983f1 100644 --- a/editor/toolbox.cc +++ b/editor/toolbox.cc @@ -28,12 +28,21 @@ #include #include "tool.h" +#include "widget.h" +#include -Toolbox::Toolbox(QDomNode &node) +Toolbox::Toolbox(QDomNode &node, MacroWindow *macrowindow) : QDialog() { setLayout(new QVBoxLayout()); + this->macrowindow = macrowindow; + + QPushButton *btn_toxml = new QPushButton("save"); + connect(btn_toxml, SIGNAL(clicked()), this, SLOT(toXml())); + + layout()->addWidget(btn_toxml); + QDomNode n = node.firstChild(); while(!n.isNull()) { QDomElement e = n.toElement(); @@ -44,3 +53,9 @@ Toolbox::Toolbox(QDomNode &node) n = n.nextSibling(); } } + +void Toolbox::toXml() +{ + Widget *w = macrowindow; + printf("XML:\n%s\n", w->toXml("").toStdString().c_str()); +} -- cgit v1.2.3