| 136 | } |
| 137 | |
| 138 | int IconPickerDialog::execWithSelection(QString selection) |
| 139 | { |
| 140 | auto list = APPLICATION->icons(); |
| 141 | auto contentsWidget = ui->iconView; |
| 142 | selectedIconKey = selection; |
| 143 | |
| 144 | int index_nr = list->getIconIndex(selection); |
| 145 | auto model_index = list->index(index_nr); |
| 146 | contentsWidget->selectionModel()->select(model_index, QItemSelectionModel::Current | QItemSelectionModel::Select); |
| 147 | |
| 148 | QMetaObject::invokeMethod(this, "delayed_scroll", Qt::QueuedConnection, Q_ARG(QModelIndex, model_index)); |
| 149 | return QDialog::exec(); |
| 150 | } |
| 151 | |
| 152 | void IconPickerDialog::delayed_scroll(QModelIndex model_index) |
| 153 | { |
no test coverage detected