| 179 | } |
| 180 | |
| 181 | void SearchComboBox::on_keyword_changed(const QString &value) |
| 182 | { |
| 183 | if (_items.size() == 0) |
| 184 | return; |
| 185 | |
| 186 | for(auto o : _items) |
| 187 | { |
| 188 | if (value == "" |
| 189 | || o->_name.indexOf(value, 0, Qt::CaseInsensitive) >= 0 |
| 190 | || o->_id.indexOf(value, 0, Qt::CaseInsensitive) >= 0){ |
| 191 | if (o->_control->isHidden()){ |
| 192 | o->_control->show(); |
| 193 | } |
| 194 | } |
| 195 | else if (o->_control->isHidden() == false){ |
| 196 | o->_control->hide(); |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | _scroll->verticalScrollBar()->setValue(0); |
| 201 | } |