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>
This commit is contained in:
Henning Gruendl
2022-06-21 00:21:50 +02:00
committed by Thomas Hartmann
parent db8dbe25e0
commit 2de2a4808a

View File

@@ -65,9 +65,11 @@ StudioControls.ComboBox {
onDropped: function(drop) {
drop.accepted = root.hasActiveHoverDrag
var fontLoader = root.createFontLoader("file:///" + dropArea.assetPath)
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)
}