diff options
author | deva <deva> | 2008-08-28 14:13:48 +0000 |
---|---|---|
committer | deva <deva> | 2008-08-28 14:13:48 +0000 |
commit | 477c9fd7f038cd43207c8634d53d0949814ecb4c (patch) | |
tree | 4d4f849c281aa4402c3f7bd95546c21ebe287e55 /client/widgets/combobox.cc | |
parent | b74d14e7e8625ce1a148105f69e3406f7d88ecd6 (diff) |
Added common stuff in central file. Fixed help text reformatting.
Diffstat (limited to 'client/widgets/combobox.cc')
-rw-r--r-- | client/widgets/combobox.cc | 29 |
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")) { |