diff options
author | deva <deva> | 2008-08-25 14:04:04 +0000 |
---|---|---|
committer | deva <deva> | 2008-08-25 14:04:04 +0000 |
commit | da6e5427b1275d9bbaed9ddb3dbc15b09be99bb1 (patch) | |
tree | 4a218a0fbabeb499005e0ac51652ff54df3eea94 /client/widgets/combobox.cc | |
parent | 8e1f28fdd6908a852dd0d11ea868fef965b89790 (diff) |
Fixed regexp problem in combobox.
Diffstat (limited to 'client/widgets/combobox.cc')
-rw-r--r-- | client/widgets/combobox.cc | 16 |
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() |