forked from qt-creator/qt-creator
QmlDesigner: Fix project tree widget renaming
When renaming an item in the project tree widget which has concatenated filename extensions like *.ui.qml the selection in the LineEdit will reach till the last dot. * Extend FilePath suffix and completeBaseName function so they will treat the suffix *.ui.qml as one * Make use of the function in ProjectTreeWidget::editCurrentItem * Replace QFileInfo::suffix with Utils::FilePath::suffix in FlatModel::setData Task-number: QDS-2713 Change-Id: I30d0e6d87a7512d42fd3d40b2282b94e79b43684 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
committed by
Henning Gründl
parent
3930679f27
commit
a09ec2e0e9
@@ -473,8 +473,7 @@ void ProjectTreeWidget::editCurrentItem()
|
||||
if (!editor)
|
||||
return;
|
||||
|
||||
const QString text = editor->text();
|
||||
const int dotIndex = text.lastIndexOf('.');
|
||||
const int dotIndex = Utils::FilePath::fromString(editor->text()).completeBaseName().length();
|
||||
if (dotIndex > 0)
|
||||
editor->setSelection(0, dotIndex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user