From 887e4067ec2141f94d7b02c2f005697abc85e670 Mon Sep 17 00:00:00 2001 From: Florian Geyer Date: Thu, 10 May 2012 19:08:49 +0200 Subject: [PATCH] Improve selection handling in edit icon widget. --- src/gui/EditEntryWidget.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gui/EditEntryWidget.cpp b/src/gui/EditEntryWidget.cpp index 26c0d9d0c..fe09b1549 100644 --- a/src/gui/EditEntryWidget.cpp +++ b/src/gui/EditEntryWidget.cpp @@ -459,6 +459,11 @@ void EditEntryWidget::updateIndexDefaultIcons(bool check) if (!index.isValid()) { 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()) { m_iconsUi->customIconsView->setCurrentIndex(m_customIconModel->index(0, 0)); } + else { + m_iconsUi->customIconsView->selectionModel()-> + setCurrentIndex(index, QItemSelectionModel::ClearAndSelect); + } + m_iconsUi->defaultIconsView->selectionModel()->clearSelection(); } }