| 82 | } |
| 83 | |
| 84 | void ElaMultiSelectComboBox::setCurrentSelection(const QString& selection) |
| 85 | { |
| 86 | Q_D(ElaMultiSelectComboBox); |
| 87 | d->_itemSelection.fill(false); |
| 88 | d->_comboView->selectionModel()->clearSelection(); |
| 89 | for (int i = 0; i < this->count(); i++) |
| 90 | { |
| 91 | if (selection == itemText(i)) |
| 92 | { |
| 93 | QModelIndex index = model()->index(i, 0); |
| 94 | d->_comboView->selectionModel()->select(index, QItemSelectionModel::Select | QItemSelectionModel::Rows); |
| 95 | d->_itemSelection[index.row()] = true; |
| 96 | } |
| 97 | } |
| 98 | d->_refreshCurrentIndexs(); |
| 99 | } |
| 100 | |
| 101 | void ElaMultiSelectComboBox::setCurrentSelection(const QStringList& selection) |
| 102 | { |
no test coverage detected