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