summaryrefslogtreecommitdiff
path: root/client/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'client/widgets')
-rw-r--r--client/widgets/multilist.cc77
-rw-r--r--client/widgets/multilist.h11
2 files changed, 85 insertions, 3 deletions
diff --git a/client/widgets/multilist.cc b/client/widgets/multilist.cc
index 7b08394..73a9747 100644
--- a/client/widgets/multilist.cc
+++ b/client/widgets/multilist.cc
@@ -26,9 +26,84 @@
*/
#include "multilist.h"
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QGridLayout>
+#include <QPushButton>
+
MultiList::MultiList(QDomNode &node, MacroWindow *macrowindow)
- : QWidget(), Widget(node, macrowindow)
+ : QFrame(), Widget(node, macrowindow)
{
+ /*
+ QDomElement elem = node.toElement();
+
+ if(elem.hasAttribute("width")) {
+ //resize(elem.attribute("width").toInt(), height());
+ setMinimumWidth(elem.attribute("width").toInt());
+ }
+
+ if(elem.hasAttribute("height")) {
+ //resize(width(), elem.attribute("height").toInt());
+ setMinimumHeight(elem.attribute("height").toInt());
+ }
+ */
+
+ QGridLayout *layout = new QGridLayout();
+ setLayout(layout);
+
+ QWidget *inputbox = new QWidget(this);
+ inputbox->setContentsMargins(0,0,0,0);
+ inputbox->setLayout(new QHBoxLayout());
+ inputbox->layout()->setContentsMargins(0,0,0,0);
+ layout->addWidget(inputbox, 0, 0, Qt::AlignTop);
+
+ QPushButton *add = new QPushButton(this);
+ add->setText("Add");
+ layout->addWidget(add, 0, 1, Qt::AlignTop);
+
+ // QFrame *listbox = new QFrame(this);
+ // listbox->setLayout(new QHBoxLayout());
+ // layout()->addWidget(listbox);
+
+ list = new QListWidget(this);
+ layout->addWidget(list, 1, 0, Qt::AlignTop);
+
+ QPushButton *rem = new QPushButton(this);
+ rem->setText("Remove");
+ layout->addWidget(rem, 1, 1, Qt::AlignTop);
+
+ inputcontainer = inputbox;
+
+ /*
+ 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);
+ }
+ }
+
+ QDomNodeList children = node.childNodes();
+
+ for (int i=0; i<children.count();i++) {
+ QDomNode child = children.at(i);
+ QDomElement radio_elem = child.toElement();
+ bool radio_bool = false;
+ if(elem.hasAttribute("value")) {
+ if(elem.attribute("value") == radio_elem.attribute("value")) {
+ radio_bool = true;
+ }
+ }
+ RadioButton *radiobutton = new RadioButton(child, radio_bool);
+
+ // Create radiobutton from child, insert in this
+ layout()->addWidget(radiobutton);
+ radiobutton_list.push_back(radiobutton);
+ }
+ */
+
}
void MultiList::changed()
diff --git a/client/widgets/multilist.h b/client/widgets/multilist.h
index 832e4c8..6057677 100644
--- a/client/widgets/multilist.h
+++ b/client/widgets/multilist.h
@@ -28,19 +28,26 @@
#define __PRACRO_MULTILIST_H__
#include "widget.h"
-#include <QWidget>
+#include <QFrame>
#include <QDomNode>
-class MultiList : public QWidget, public Widget
+#include <QListWidget>
+
+class MultiList : public QFrame, public Widget
{
Q_OBJECT
public:
MultiList(QDomNode &node, MacroWindow *macrowindow);
+ QWidget *inputcontainer;
+
public slots:
void changed();
QString getValue();
void setValue(QString value);
+
+private:
+ QListWidget *list;
};
#endif/*__PRACRO_MULTILIST_H__*/