aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorMahmoud Badri <mahmoud.badri@qt.io>2022-06-27 14:31:59 +0300
committerMahmoud Badri <mahmoud.badri@qt.io>2022-06-29 10:32:03 +0000
commit234958a47a6edcd17bae255411a5b0f0bbaea6c7 (patch)
tree0a0a92ea46125545e032437267d7d7700918a71b /share
parentee40ed19e55a47dd109d1b7f4faf9a44ed97fc0f (diff)
QmlDesigner: Enable drag-n-drop a material to a model in Navigator
Fixes: QDS-6694 Change-Id: I2fb32052559b1d459cc8025e9f30368b0189e8ab Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'share')
-rw-r--r--share/qtcreator/qmldesigner/materialBrowserQmlSource/MaterialItem.qml7
1 files changed, 5 insertions, 2 deletions
diff --git a/share/qtcreator/qmldesigner/materialBrowserQmlSource/MaterialItem.qml b/share/qtcreator/qmldesigner/materialBrowserQmlSource/MaterialItem.qml
index 4eeb120b27c..640383d4e18 100644
--- a/share/qtcreator/qmldesigner/materialBrowserQmlSource/MaterialItem.qml
+++ b/share/qtcreator/qmldesigner/materialBrowserQmlSource/MaterialItem.qml
@@ -72,9 +72,12 @@ Rectangle {
anchors.fill: parent
acceptedButtons: Qt.LeftButton | Qt.RightButton
- onClicked: (mouse) => {
+ onPressed: (mouse) => {
materialBrowserModel.selectMaterial(index)
- if (mouse.button === Qt.RightButton)
+
+ if (mouse.button === Qt.LeftButton)
+ rootView.startDragMaterial(index, mapToGlobal(mouse.x, mouse.y))
+ else if (mouse.button === Qt.RightButton)
root.showContextMenu()
}