QmlDesigner: Use the trimmed value for urls

Fixes: QDS-12213
Change-Id: Id177a897849335e4cddca1af12ceca682c3f531f
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
Ali Kianian
2024-03-14 12:59:08 +02:00
parent c581576e27
commit a43b3e916c

View File

@@ -86,7 +86,7 @@ static bool getCustomUrl(const QString &value,
"){1}$" // end of Address "){1}$" // end of Address
}; };
const QRegularExpressionMatch match = urlRegex.match(value); const QRegularExpressionMatch match = urlRegex.match(value.trimmed());
if (match.hasMatch()) { if (match.hasMatch()) {
if (match.hasCaptured("Address")) { if (match.hasCaptured("Address")) {
if (match.hasCaptured("MimeType") && match.captured("MainType") == "image") if (match.hasCaptured("MimeType") && match.captured("MainType") == "image")
@@ -162,7 +162,7 @@ static CollectionDetails::DataType dataTypeFromString(const QString &value)
return DataType::Real; return DataType::Real;
DataType urlType; DataType urlType;
if (getCustomUrl(value, urlType)) if (getCustomUrl(trimmedValue, urlType))
return urlType; return urlType;
return DataType::String; return DataType::String;