Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-49876

Rectangle dragged disappears on the Mac if Drag.dragType is set to Drag.Automatic

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • 5.12
    • 5.5.1
    • None
    • Mac OSX El-Capitan
    • macOS

    Description

      In the example provided below the rectangle disappears on the mac if the dragType is set to automatic. I also tested it on Windows 7 and there it behaves as expected. Please fix this!

      import QtQuick 2.5
      import QtQuick.Window 2.2
      
      Window {
        visible: true
      
        width: 100
        height: 200
      
        ListModel {
          id: testModel
          ListElement { name: "red";   value: "#f00" }
          ListElement { name: "green"; value: "#0f0" }
          ListElement { name: "blue";  value: "#00f" }
        }
      
        Component {
          id: rect
          Rectangle {
      
            Drag.active: mouseArea.drag.active
            Drag.hotSpot.x: width / 2
            Drag.hotSpot.y: height / 2
            //Drag.dragType: Drag.Automatic
      
            Drag.onActiveChanged: {
              console.log("Active changed..")
            }
      
            Drag.onDragStarted: {
              console.log("Drag started..")
            }
      
            Drag.onDragFinished: {
              console.log("Drag finished!")
            }
      
            MouseArea {
              id: mouseArea
      
              anchors.fill: parent
              hoverEnabled: true
              drag.target: parent
      
              drag.onActiveChanged: {
                console.log("Drag prop became active..")
              }
      
              onClicked: {
                colorButtonClicked(buttonName, buttonColor);
              }
            }
      
            width: 80
            height: 20
            radius: 6
            color: model.value
          }
        }
      
        Column {
          spacing: 3
          anchors.centerIn: parent
          Repeater {
            model: testModel
            delegate: rect
          }
        }
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            aalpert Alan Alpert
            nightlifelover Nils
            Votes:
            3 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes