From a43b3e916c80ed4c5197c617cc96eba92367dc45 Mon Sep 17 00:00:00 2001 From: Ali Kianian Date: Thu, 14 Mar 2024 12:59:08 +0200 Subject: [PATCH] QmlDesigner: Use the trimmed value for urls Fixes: QDS-12213 Change-Id: Id177a897849335e4cddca1af12ceca682c3f531f Reviewed-by: Mahmoud Badri --- .../components/collectioneditor/collectiondetails.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmldesigner/components/collectioneditor/collectiondetails.cpp b/src/plugins/qmldesigner/components/collectioneditor/collectiondetails.cpp index 80e223d2ec9..9005882813d 100644 --- a/src/plugins/qmldesigner/components/collectioneditor/collectiondetails.cpp +++ b/src/plugins/qmldesigner/components/collectioneditor/collectiondetails.cpp @@ -86,7 +86,7 @@ static bool getCustomUrl(const QString &value, "){1}$" // end of Address }; - const QRegularExpressionMatch match = urlRegex.match(value); + const QRegularExpressionMatch match = urlRegex.match(value.trimmed()); if (match.hasMatch()) { if (match.hasCaptured("Address")) { if (match.hasCaptured("MimeType") && match.captured("MainType") == "image") @@ -162,7 +162,7 @@ static CollectionDetails::DataType dataTypeFromString(const QString &value) return DataType::Real; DataType urlType; - if (getCustomUrl(value, urlType)) + if (getCustomUrl(trimmedValue, urlType)) return urlType; return DataType::String;