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

Warning about application/x-color in QtQuick Drag

XMLWordPrintable

    • Linux/Wayland
    • ebf542072 (dev), 06acc2021 (6.9), c85ac8ea3 (6.8)

      Setting application/x-color with a color as mimetype in QtQuick Drag does not work properly

      Don't know how to encode variant of type QMetaType(QColor) as mime type "application/x-color"
      

      The QMimeData that arrives on the end has application/x-color through the fallback set as a QByteArray but it still produces a warning.

      Example:

      import QtQuick
      
      Rectangle {
          id: rect
          width: 640
          height: 480
          color: "#f0f"
      
          MouseArea {
              anchors.fill: parent
      
              drag.target: rect
              Drag.dragType: Drag.Automatic
              Drag.active: drag.active
              Drag.mimeData: {
                  "application/x-color": rect.color,
              }
          }
      }
      

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            broulik Kai Uwe Broulik
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes