diff options
author | Henning Gruendl <henning.gruendl@qt.io> | 2022-06-21 00:21:50 +0200 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2022-06-21 12:22:56 +0000 |
commit | 2de2a4808ac3bfc17c6f51d03050afd7909ba120 (patch) | |
tree | a55262a4ea208d43ad7d707cf8dc8f0eaa35d8bb | |
parent | db8dbe25e0528d5e845be5c5f1ca44ec0a923f14 (diff) |
QmlDesigner: Fix FontComboBox drag'n'drop
* Fix URL schema to also work under macOS
* Avoid setting font name and further processing if error during font
loading occurred
Change-Id: I9d07a3daad8f7c8c464422b0cf3f94d61e4b231d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r-- | share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontComboBox.qml | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontComboBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontComboBox.qml index 8c05fa2f87..2f087c3b29 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontComboBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontComboBox.qml @@ -65,9 +65,11 @@ StudioControls.ComboBox { onDropped: function(drop) { drop.accepted = root.hasActiveHoverDrag - var fontLoader = root.createFontLoader("file:///" + dropArea.assetPath) - root.backendValue.value = fontLoader.name - root.currentIndex = root.find(root.backendValue.value) + var fontLoader = root.createFontLoader("file:" + dropArea.assetPath) + if (fontLoader.status === FontLoader.Ready) { + root.backendValue.value = fontLoader.name + root.currentIndex = root.find(root.backendValue.value) + } root.hasActiveHoverDrag = false root.backendValue.commitDrop(dropArea.assetPath) } |