From 6c25a7cdea912f212ce00f43c7cfc862c1ecdd50 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 22 Jul 2009 14:08:07 +0200 Subject: Designer: Fixed bug in setting QUrl property values from resources. Setting a file from a resource would result in 'qrc::/file' as the resource browser returns ':/file'. Reviewed-by: Jarek Kobus Initial-patch-by: andy --- .../src/components/propertyeditor/designerpropertymanager.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/designer/src/components/propertyeditor/designerpropertymanager.cpp b/tools/designer/src/components/propertyeditor/designerpropertymanager.cpp index 2f6a51e..1092b92 100644 --- a/tools/designer/src/components/propertyeditor/designerpropertymanager.cpp +++ b/tools/designer/src/components/propertyeditor/designerpropertymanager.cpp @@ -254,8 +254,11 @@ void TextEditor::resourceActionActivated() { QString oldPath = m_editor->text(); if (oldPath.startsWith(QLatin1String("qrc:"))) - oldPath = oldPath.mid(4); - const QString newPath = IconSelector::choosePixmapResource(m_core, m_core->resourceModel(), oldPath, this); + oldPath.remove(0, 4); + // returns ':/file' + QString newPath = IconSelector::choosePixmapResource(m_core, m_core->resourceModel(), oldPath, this); + if (newPath.startsWith(QLatin1Char(':'))) + newPath.remove(0, 1); if (newPath.isEmpty() || newPath == oldPath) return; const QString newText = QLatin1String("qrc:") + newPath; -- cgit v0.12