diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/widgets/frame.cc | 12 | ||||
-rw-r--r-- | client/widgets/widget.cc | 6 | ||||
-rw-r--r-- | client/widgets/widget.h | 1 | ||||
-rw-r--r-- | client/widgets/window.cc | 12 |
4 files changed, 30 insertions, 1 deletions
diff --git a/client/widgets/frame.cc b/client/widgets/frame.cc index 00f1930..508541d 100644 --- a/client/widgets/frame.cc +++ b/client/widgets/frame.cc @@ -25,6 +25,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include "frame.h" +#include <QVBoxLayout> +#include <QHBoxLayout> Frame::Frame(QDomNode node) : QGroupBox(), Widget(node) @@ -46,6 +48,16 @@ Frame::Frame(QDomNode node) } else { setFlat(true); } + + if(elem.hasAttribute("layout")) { + if(elem.attribute("layout") == "hbox") { + QHBoxLayout *layout = new QHBoxLayout(); + setLayout(layout); + } else if (elem.attribute("layout") == "vbox") { + QVBoxLayout *layout = new QVBoxLayout(); + setLayout(layout); + } + } } QString Frame::getValue() diff --git a/client/widgets/widget.cc b/client/widgets/widget.cc index 910d80b..7b62f36 100644 --- a/client/widgets/widget.cc +++ b/client/widgets/widget.cc @@ -26,12 +26,16 @@ */ #include "widget.h" +//Widget::Widget(QString parent_name, QDomNode node) Widget::Widget(QDomNode node) { QDomElement elem = node.toElement(); if(elem.hasAttribute("name")) { - widget_name = elem.attribute("name"); + //if(parent_name != "") + // widget_name = parent_name + "." + elem.attribute("name"); + //else + widget_name = elem.attribute("name"); } else { printf("XML ERROR!! Unnamed widget of type: %s\n", elem.tagName().toStdString().c_str()); diff --git a/client/widgets/widget.h b/client/widgets/widget.h index d8a0b2d..ab23ebf 100644 --- a/client/widgets/widget.h +++ b/client/widgets/widget.h @@ -33,6 +33,7 @@ class Widget { public: + //Widget(QString parent_name, QDomNode node); Widget(QDomNode node); virtual ~Widget(){} virtual QString getValue() = 0; diff --git a/client/widgets/window.cc b/client/widgets/window.cc index 31f51bf..e93edca 100644 --- a/client/widgets/window.cc +++ b/client/widgets/window.cc @@ -25,6 +25,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include "window.h" +#include <QVBoxLayout> +#include <QHBoxLayout> Window::Window(QDomNode node) : QWidget(NULL), Widget(node) @@ -50,6 +52,16 @@ Window::Window(QDomNode node) } else { setWindowTitle(elem.attribute("")); } + + if(elem.hasAttribute("layout")) { + if(elem.attribute("layout") == "hbox") { + QHBoxLayout *layout = new QHBoxLayout(); + setLayout(layout); + } else if (elem.attribute("layout") == "vbox") { + QVBoxLayout *layout = new QVBoxLayout(); + setLayout(layout); + } + } } QString Window::getValue() |