diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index f4172ad300b..d86263048a6 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -142,6 +142,7 @@ #include #include +#include #include #include #include @@ -3340,6 +3341,16 @@ void ProjectExplorerPlugin::renameFile(Node *node, const QString &newFilePath) renameFileError); }); } + } else { + const QString renameFileError = tr("The file %1 could not be renamed %2.") + .arg(QDir::toNativeSeparators(orgFilePath)) + .arg(QDir::toNativeSeparators(newFilePath)); + + QTimer::singleShot(0, [renameFileError]() { + QMessageBox::warning(ICore::mainWindow(), + tr("Cannot Rename File"), + renameFileError); + }); } }