Commit 61468987 authored by Thomas Hartmann's avatar Thomas Hartmann Committed by Thomas Hartmann
Browse files

QmlDesigner: Fix for item library search filter



Without this patch the item library gets into an
invalid state if the user enters edit mode
with an ative search filter.
When going back to design mode the item library
is completely empty.

This patch clears the filter, so the item library
gets properly populated.

Change-Id: I21f823b8db820589dedd6ba4e4855678fff49e53
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent 4e06822f
......@@ -65,6 +65,7 @@ WidgetInfo ItemLibraryView::widgetInfo()
void ItemLibraryView::modelAttached(Model *model)
{
AbstractView::modelAttached(model);
m_widget->clearSearchFilter();
m_widget->setModel(model);
updateImports();
model->attachView(m_importManagerView);
......@@ -75,6 +76,7 @@ void ItemLibraryView::modelAboutToBeDetached(Model *model)
model->detachView(m_importManagerView);
AbstractView::modelAboutToBeDetached(model);
m_widget->setModel(0);
}
......
......@@ -247,6 +247,11 @@ QString ItemLibraryWidget::qmlSourcesPath()
return Core::ICore::resourcePath() + QStringLiteral("/qmldesigner/itemLibraryQmlSources");
}
void ItemLibraryWidget::clearSearchFilter()
{
m_filterLineEdit->clear();
}
void ItemLibraryWidget::reloadQmlSource()
{
QString itemLibraryQmlFilePath = qmlSourcesPath() + QStringLiteral("/ItemsView.qml");
......
......@@ -86,6 +86,8 @@ public:
void setImportsWidget(QWidget *importsWidget);
static QString qmlSourcesPath();
void clearSearchFilter();
public slots:
void setSearchFilter(const QString &searchFilter);
void delayedUpdateModel();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment