forked from qt-creator/qt-creator
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:
committed by
Thomas Hartmann
parent
db8dbe25e0
commit
2de2a4808a
@@ -65,9 +65,11 @@ StudioControls.ComboBox {
|
|||||||
|
|
||||||
onDropped: function(drop) {
|
onDropped: function(drop) {
|
||||||
drop.accepted = root.hasActiveHoverDrag
|
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.backendValue.value = fontLoader.name
|
||||||
root.currentIndex = root.find(root.backendValue.value)
|
root.currentIndex = root.find(root.backendValue.value)
|
||||||
|
}
|
||||||
root.hasActiveHoverDrag = false
|
root.hasActiveHoverDrag = false
|
||||||
root.backendValue.commitDrop(dropArea.assetPath)
|
root.backendValue.commitDrop(dropArea.assetPath)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user