diff --git a/src/plugins/projectexplorer/foldernavigationwidget.cpp b/src/plugins/projectexplorer/foldernavigationwidget.cpp index 45c35ea881e3f782e8afd7a5ac4b179e0f9ec8c0..e8b2b7d222d07e2b5f569043b4b815123f771335 100644 --- a/src/plugins/projectexplorer/foldernavigationwidget.cpp +++ b/src/plugins/projectexplorer/foldernavigationwidget.cpp @@ -90,6 +90,26 @@ bool DotRemovalFilter::filterAcceptsRow(int source_row, const QModelIndex &paren return fileName != m_dot; } +class FolderNavigationModel : public QFileSystemModel +{ +public: + explicit FolderNavigationModel(QObject *parent = 0); + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; +}; + +FolderNavigationModel::FolderNavigationModel(QObject *parent) : + QFileSystemModel(parent) +{ +} + +QVariant FolderNavigationModel::data(const QModelIndex &index, int role) const +{ + if (role == Qt::ToolTipRole) + return QDir::toNativeSeparators(QDir::cleanPath(filePath(index))); + else + return QFileSystemModel::data(index, role); +} + /*! /class FolderNavigationWidget @@ -98,7 +118,7 @@ bool DotRemovalFilter::filterAcceptsRow(int source_row, const QModelIndex &paren FolderNavigationWidget::FolderNavigationWidget(QWidget *parent) : QWidget(parent), m_listView(new QListView(this)), - m_fileSystemModel(new QFileSystemModel(this)), + m_fileSystemModel(new FolderNavigationModel(this)), m_filterModel(new DotRemovalFilter(this)), m_title(new QLabel(this)), m_autoSync(false)