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
This commit is contained in:
blacksun
2016-02-28 11:02:30 +00:00
parent 52b588ea50
commit bb840a3aa9

View File

@@ -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())