summaryrefslogtreecommitdiff
path: root/editor/editor.cc
diff options
context:
space:
mode:
authordeva <deva>2008-07-11 12:54:42 +0000
committerdeva <deva>2008-07-11 12:54:42 +0000
commit5a19d9218a5f3ed7d02b7fabd8f025922e9f7a13 (patch)
tree49ee6645bf55e620db824d0c95508a65d4d596e7 /editor/editor.cc
parent12bd3e7ff088b097bf4e280161aee646fbbb50dc (diff)
Now we have a nice little editor.
Diffstat (limited to 'editor/editor.cc')
-rw-r--r--editor/editor.cc47
1 files changed, 44 insertions, 3 deletions
diff --git a/editor/editor.cc b/editor/editor.cc
index b2d418f..e7d8781 100644
--- a/editor/editor.cc
+++ b/editor/editor.cc
@@ -28,17 +28,58 @@
#include "toolbox.h"
#include "macrowindow.h"
+#include "propertieseditor.h"
-#include "widgetwrapper.h"
+#include <QDomDocument>
+#include <QFile>
+
+#define OFFSET_X 300
+#define OFFSET_Y 300
+#define SPACING 10
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
- Toolbox toolbox;
- MacroWindow macrowindow(Qt::Horizontal);
+
+ //
+ // Load xml data
+ //
+ QDomDocument doc("widgets");
+ QFile file("widgets.xml");
+ if (!file.open(QIODevice::ReadOnly))
+ return 1;
+ if (!doc.setContent(&file)) {
+ file.close();
+ return 1;
+ }
+ file.close();
+
+ QDomElement docElem = doc.documentElement();
+
+ QDomNode n = docElem.firstChild();
+ QDomNode node;
+ while(!n.isNull()) {
+ QDomElement e = n.toElement();
+ if(!e.isNull()) {
+ if(e.hasAttribute("name") && e.attribute("name") == "mainwidget") node = e;
+ }
+ n = n.nextSibling();
+ }
+
+ Toolbox toolbox(docElem);
+ toolbox.move(OFFSET_X, OFFSET_Y);
+ toolbox.show();
+
+ MacroWindow macrowindow(node);
macrowindow.resize(400, 300);
+ macrowindow.move(toolbox.width() + OFFSET_X + SPACING, OFFSET_Y);
macrowindow.show();
+ propertieseditor = new PropertiesEditor();
+ propertieseditor->setProperties(&macrowindow);
+ propertieseditor->move(macrowindow.width() + toolbox.width() + OFFSET_X + 2 * SPACING, OFFSET_Y);
+ propertieseditor->show();
+
return app.exec();
}