QmlDesigner: Fix warning

Change-Id: Ifbf626a484c0acb65d3d980c81e8d2ab535cab19
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Thomas Hartmann
2017-02-28 17:16:07 +01:00
committed by Tim Jenssen
parent 30fde73736
commit 96f615b477
3 changed files with 3 additions and 4 deletions

View File

@@ -83,7 +83,6 @@ CustomFileSystemModel::CustomFileSystemModel(QObject *parent) : QAbstractListMod
connect(m_fileSystemWatcher, &Utils::FileSystemWatcher::directoryChanged, [this] { connect(m_fileSystemWatcher, &Utils::FileSystemWatcher::directoryChanged, [this] {
setRootPath(m_fileSystemModel->rootPath()); setRootPath(m_fileSystemModel->rootPath());
}); });
} }
void CustomFileSystemModel::setFilter(QDir::Filters) void CustomFileSystemModel::setFilter(QDir::Filters)
@@ -152,7 +151,7 @@ int CustomFileSystemModel::columnCount(const QModelIndex &) const
return 1; 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); return QAbstractListModel::index(m_files.indexOf(path), 0);
} }

View File

@@ -51,7 +51,7 @@ public:
int rowCount(const QModelIndex & parent = QModelIndex()) const override; int rowCount(const QModelIndex & parent = QModelIndex()) const override;
int columnCount(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; QIcon fileIcon(const QModelIndex & index) const;
QString fileName(const QModelIndex & index) const; QString fileName(const QModelIndex & index) const;

View File

@@ -261,7 +261,7 @@ void ItemLibraryWidget::setResourcePath(const QString &resourcePath)
{ {
if (m_resourcesView->model() == m_resourcesFileSystemModel.data()) { if (m_resourcesView->model() == m_resourcesFileSystemModel.data()) {
m_resourcesFileSystemModel->setRootPath(resourcePath); m_resourcesFileSystemModel->setRootPath(resourcePath);
m_resourcesView->setRootIndex(m_resourcesFileSystemModel->index(resourcePath)); m_resourcesView->setRootIndex(m_resourcesFileSystemModel->indexForPath(resourcePath));
} }
updateSearch(); updateSearch();
} }