diff --git a/src/plugins/resourceeditor/resourceeditorplugin.cpp b/src/plugins/resourceeditor/resourceeditorplugin.cpp index 4eefe8fb519..1c20bf1d584 100644 --- a/src/plugins/resourceeditor/resourceeditorplugin.cpp +++ b/src/plugins/resourceeditor/resourceeditorplugin.cpp @@ -236,13 +236,13 @@ void ResourceEditorPlugin::onRefresh() void ResourceEditorPlugin::addPrefixContextMenu() { + auto topLevel = static_cast(ProjectTree::currentNode()); PrefixLangDialog dialog(tr("Add Prefix"), QString(), QString(), Core::ICore::mainWindow()); if (dialog.exec() != QDialog::Accepted) return; QString prefix = dialog.prefix(); if (prefix.isEmpty()) return; - ResourceTopLevelNode *topLevel = static_cast(ProjectTree::currentNode()); topLevel->addPrefix(prefix, dialog.lang()); }