forked from qt-creator/qt-creator
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:
committed by
Tim Jenssen
parent
30fde73736
commit
96f615b477
@@ -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);
|
||||||
}
|
}
|
||||||
|
@@ -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;
|
||||||
|
@@ -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();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user