summaryrefslogtreecommitdiff
path: root/client/widgets/multilist.cc
diff options
context:
space:
mode:
authordeva <deva>2008-08-20 10:28:35 +0000
committerdeva <deva>2008-08-20 10:28:35 +0000
commit3eebecacd576c35605aff01324ec66ad9825b0d7 (patch)
treea4f58503967707cdc1ecab07a0b15b67d32bdab6 /client/widgets/multilist.cc
parent45702265ce206381bcb02a53b413ad987897b02b (diff)
Fixed various small bugs.
Diffstat (limited to 'client/widgets/multilist.cc')
-rw-r--r--client/widgets/multilist.cc37
1 files changed, 33 insertions, 4 deletions
diff --git a/client/widgets/multilist.cc b/client/widgets/multilist.cc
index b2ba2a2..5f795b3 100644
--- a/client/widgets/multilist.cc
+++ b/client/widgets/multilist.cc
@@ -58,6 +58,10 @@ MultiList::MultiList(QDomNode &node, MacroWindow *macrowindow)
inputbox->setLayout(layout);
}
+ if(elem.hasAttribute("help")) {
+ setToolTip(elem.attribute("help"));
+ }
+
inputbox->layout()->setContentsMargins(0,0,0,0);
QDomNodeList children = node.childNodes();
@@ -73,16 +77,16 @@ MultiList::MultiList(QDomNode &node, MacroWindow *macrowindow)
// layout->addWidget(add, 0, 1, Qt::AlignTop);
layout->addWidget(add, 1, 0, 1, 1, Qt::AlignTop);
- list = new QListWidget(this);
- // layout->addWidget(list, 1, 0, Qt::AlignTop);
- layout->addWidget(list, 2, 0, 1, 2, Qt::AlignTop);
-
QPushButton *rem = new QPushButton(this);
connect(rem, SIGNAL(clicked()), this, SLOT(remove()));
rem->setText("Fjern");
// layout->addWidget(rem, 1, 1, Qt::AlignTop);
layout->addWidget(rem, 1, 1, 1, 1, Qt::AlignTop);
+ list = new QListWidget(this);
+ // layout->addWidget(list, 1, 0, Qt::AlignTop);
+ layout->addWidget(list, 2, 0, 1, 2, Qt::AlignTop);
+
/* // This is done later
if(elem.hasAttribute("value")) {
setValue(elem.attribute("value"));
@@ -101,6 +105,21 @@ MultiList::MultiList(QDomNode &node, MacroWindow *macrowindow)
}
}
+ /*
+ QVector< Widget* >::iterator i = widgets.begin();
+ while (i != widgets.end()) {
+ for (int j = 0; j < children.count(); j++) {
+ QDomNode child = children.at(j);
+ QDomElement elem = child.toElement();
+ if(elem.attribute("name") == (*i)->getName()) {
+ printf("Set\n");
+ (*i)->setValue(elem.attribute("value"));
+ }
+ }
+ i++;
+ }
+ */
+
if(elem.hasAttribute("width")) {
setMinimumWidth(elem.attribute("width").toInt());
}
@@ -157,3 +176,13 @@ void MultiList::add()
}
list->addItem(format_parser(format, widgets));
}
+
+void MultiList::enable()
+{
+ setEnabled(true);
+}
+
+void MultiList::disable()
+{
+ setEnabled(false);
+}