From bb840a3aa96e5edcf80c0309cf42fbef579a9e09 Mon Sep 17 00:00:00 2001 From: blacksun Date: Sun, 28 Feb 2016 11:02:30 +0000 Subject: [PATCH] Minor change when reset the search in element collection git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4356 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- sources/ElementsCollection/elementscollectionwidget.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sources/ElementsCollection/elementscollectionwidget.cpp b/sources/ElementsCollection/elementscollectionwidget.cpp index ae8ce0b63..03c430f65 100644 --- a/sources/ElementsCollection/elementscollectionwidget.cpp +++ b/sources/ElementsCollection/elementscollectionwidget.cpp @@ -446,10 +446,11 @@ void ElementsCollectionWidget::reload() */ void ElementsCollectionWidget::search(const QString &text) { - //Reset the tree + //Reset the search if (text.isEmpty()) { QModelIndex current_index = m_tree_view->currentIndex(); + m_tree_view->reset(); if (m_showed_index.isValid()) { @@ -457,10 +458,7 @@ void ElementsCollectionWidget::search(const QString &text) showAndExpandItem(m_showed_index, true, true); } else - { - m_tree_view->reset(); expandFirstItems(); - } //Expand the tree and scroll to the last selected index if (current_index.isValid())