diff options
author | deva <deva> | 2008-06-17 14:57:56 +0000 |
---|---|---|
committer | deva <deva> | 2008-06-17 14:57:56 +0000 |
commit | b681594b7e4f9a5375b555b152d661581c600a96 (patch) | |
tree | 24235bfee0ecb43bd6e43d8bf6f6835a8a699ba9 /client/widgets/multilist.cc | |
parent | 9bdb1cadd2639455a6eab5135fc6ce6955d0def0 (diff) |
Multilist is now showing as it should. No functionality yet though.
Diffstat (limited to 'client/widgets/multilist.cc')
-rw-r--r-- | client/widgets/multilist.cc | 77 |
1 files changed, 76 insertions, 1 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() |