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.cc16
1 files changed, 6 insertions, 10 deletions
diff --git a/client/widgets/combobox.cc b/client/widgets/combobox.cc
index 81995c6..8cf2c6b 100644
--- a/client/widgets/combobox.cc
+++ b/client/widgets/combobox.cc
@@ -68,6 +68,9 @@ ComboBox::ComboBox(QDomNode &node, MacroWindow *macrowindow)
}
}
+ // Hack to force currentIndexChanged event.
+ setCurrentIndex(-1);
+
/* // This is done later
if(elem.hasAttribute("value")) {
setValue(elem.attribute("value"));
@@ -85,18 +88,12 @@ ComboBox::ComboBox(QDomNode &node, MacroWindow *macrowindow)
case SELECT:
setEditable(false);
- // Hack to force currentIndexChanged event.
- setCurrentIndex(-1);
-
connect(this, SIGNAL(currentIndexChanged(QString)), this, SLOT(changed()));
break;
case EDIT:
setEditable(true);
- // Hack to force currentIndexChanged event.
- setCurrentIndex(-1);
-
connect(this, SIGNAL(editTextChanged(QString)), this, SLOT(changed()));
//setEditText(elem.attribute("value"));
break;
@@ -107,7 +104,7 @@ ComboBox::ComboBox(QDomNode &node, MacroWindow *macrowindow)
QString rxs = "(";
for(int i = 0; i < itemlist.size(); i++) {
if(rxs != "(") rxs += "|";
- rxs += itemlist.at(i);
+ rxs += QRegExp::escape(itemlist.at(i));
}
rxs += ")";
rx = QRegExp(rxs);
@@ -120,13 +117,12 @@ ComboBox::ComboBox(QDomNode &node, MacroWindow *macrowindow)
setValidator(new QRegExpValidator(rx, this));
}
- // Hack to force currentIndexChanged event.
- setCurrentIndex(-1);
-
connect(this, SIGNAL(editTextChanged(QString)), this, SLOT(changed()));
//setEditText(elem.attribute("value"));
break;
}
+
+ changed();
}
QString ComboBox::getValue()