Improve selection handling in edit icon widget.

This commit is contained in:
Florian Geyer 2012-05-10 19:08:49 +02:00
parent 3738115b6d
commit 887e4067ec

View File

@ -459,6 +459,11 @@ void EditEntryWidget::updateIndexDefaultIcons(bool check)
if (!index.isValid()) { if (!index.isValid()) {
m_iconsUi->defaultIconsView->setCurrentIndex(m_defaultIconModel->index(0, 0)); m_iconsUi->defaultIconsView->setCurrentIndex(m_defaultIconModel->index(0, 0));
} }
else {
m_iconsUi->defaultIconsView->selectionModel()->
setCurrentIndex(index, QItemSelectionModel::ClearAndSelect);
}
m_iconsUi->customIconsView->selectionModel()->clearSelection();
} }
} }
@ -469,6 +474,11 @@ void EditEntryWidget::updateIndexCustomIcons(bool check)
if (!index.isValid()) { if (!index.isValid()) {
m_iconsUi->customIconsView->setCurrentIndex(m_customIconModel->index(0, 0)); m_iconsUi->customIconsView->setCurrentIndex(m_customIconModel->index(0, 0));
} }
else {
m_iconsUi->customIconsView->selectionModel()->
setCurrentIndex(index, QItemSelectionModel::ClearAndSelect);
}
m_iconsUi->defaultIconsView->selectionModel()->clearSelection();
} }
} }