diff --git a/src/plugins/qmldesigner/components/itemlibrary/customfilesystemmodel.cpp b/src/plugins/qmldesigner/components/itemlibrary/customfilesystemmodel.cpp index 1371ec8d9a8..c9fb697d981 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/customfilesystemmodel.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/customfilesystemmodel.cpp @@ -83,7 +83,6 @@ CustomFileSystemModel::CustomFileSystemModel(QObject *parent) : QAbstractListMod connect(m_fileSystemWatcher, &Utils::FileSystemWatcher::directoryChanged, [this] { setRootPath(m_fileSystemModel->rootPath()); }); - } void CustomFileSystemModel::setFilter(QDir::Filters) @@ -152,7 +151,7 @@ int CustomFileSystemModel::columnCount(const QModelIndex &) const return 1; } -QModelIndex CustomFileSystemModel::index(const QString &path, int /*column*/) const +QModelIndex CustomFileSystemModel::indexForPath(const QString &path, int /*column*/) const { return QAbstractListModel::index(m_files.indexOf(path), 0); } diff --git a/src/plugins/qmldesigner/components/itemlibrary/customfilesystemmodel.h b/src/plugins/qmldesigner/components/itemlibrary/customfilesystemmodel.h index 98928486684..31cd9fcb984 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/customfilesystemmodel.h +++ b/src/plugins/qmldesigner/components/itemlibrary/customfilesystemmodel.h @@ -51,7 +51,7 @@ public: int rowCount(const QModelIndex & parent = QModelIndex()) const override; int columnCount(const QModelIndex & parent = QModelIndex()) const override; - QModelIndex index(const QString & path, int column = 0) const; + QModelIndex indexForPath(const QString & path, int column = 0) const; QIcon fileIcon(const QModelIndex & index) const; QString fileName(const QModelIndex & index) const; diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp index 4ec968284ca..3aa5a0a216b 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp @@ -261,7 +261,7 @@ void ItemLibraryWidget::setResourcePath(const QString &resourcePath) { if (m_resourcesView->model() == m_resourcesFileSystemModel.data()) { m_resourcesFileSystemModel->setRootPath(resourcePath); - m_resourcesView->setRootIndex(m_resourcesFileSystemModel->index(resourcePath)); + m_resourcesView->setRootIndex(m_resourcesFileSystemModel->indexForPath(resourcePath)); } updateSearch(); }