summaryrefslogtreecommitdiff
path: root/client/widgets/combobox.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/widgets/combobox.cc')
-rw-r--r--client/widgets/combobox.cc29
1 files changed, 5 insertions, 24 deletions
diff --git a/client/widgets/combobox.cc b/client/widgets/combobox.cc
index caa7683..12c1f26 100644
--- a/client/widgets/combobox.cc
+++ b/client/widgets/combobox.cc
@@ -30,33 +30,18 @@
#include <QRegExpValidator>
#include <QRegExp>
+#include "common.h"
+
ComboBox::ComboBox(QDomNode &node, MacroWindow *macrowindow)
: QComboBox(), Widget(node, macrowindow)
{
- QDomElement elem = node.toElement();
+ setCommonAttributes(this, node);
setInsertPolicy(QComboBox::InsertAlphabetically);
- if(elem.hasAttribute("width")) {
- setMinimumWidth(elem.attribute("width").toInt());
- }
-
- if(elem.hasAttribute("height")) {
- setMinimumHeight(elem.attribute("height").toInt());
- }
-
- if(elem.hasAttribute("help")) {
- setWhatsThis(elem.attribute("help"));
- }
- if(elem.hasAttribute("help")) {
- // setToolTip(elem.attribute("help"));
- }
-
QDomNodeList children = node.childNodes();
QStringList itemlist;
- setCurrentIndex(-1); // -1 is default for none selected
-
for (int i=0; i<children.count();i++) {
QDomNode child = children.at(i);
QDomElement combo_elem = child.toElement();
@@ -68,14 +53,10 @@ ComboBox::ComboBox(QDomNode &node, MacroWindow *macrowindow)
}
}
- // Hack to force currentIndexChanged event.
+ // Make empty default selection.
setCurrentIndex(-1);
- /* // This is done later
- if(elem.hasAttribute("value")) {
- setValue(elem.attribute("value"));
- }
- */
+ QDomElement elem = node.toElement();
combotype = SELECT;
if(elem.hasAttribute("type")) {