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

QClipboard's setMimeData fails to copy value in Android

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.15.0 RC2
    • Fix Version/s: None
    • Component/s: GUI: Drag and Drop
    • Labels:
      None
    • Platform/s:
      Android

      Description

      I have a qml application that runs both on iOS and Android and it seems like QClipboard's setMimeData fails to copy a value with "com.myapp.filesystem.myclient.wifi" as a key (an empty value is copied).

      iOS: When I copy something with "uri-list" as a key, it is copied. When I copy something with "com.myapp.filesystem.myclient.wifi" as a key, it is copied.

      Android: When I copy something with "uri-list" as a key, it is copied. When I copy something with "com.myapp.filesystem.myclient.wifi" as a key, then the value of this key is empty (when copying in to the application's clipboard).

      p.s.: p->clipboard is QApplication::clipboard()

       

        void FileSystemGlobals::copyUris(const FileSystemID &fromFileSystemID, const QStringList &uris) {
       auto data = mimeData(fromFileSystemID, uris).toMap();
      
      auto mime = new QMimeData();
      
      for (auto i = data.constBegin(); i != data.constEnd(); i++)
      
      { QByteArray bArray = i.value().toByteArray(); QString key = i.key(); mime->setData(key, bArray); qDebug() << i.key() << i.value().toByteArray(); }
      
      qDebug() << mime->data("com.myapp.filesystem.myclient.wifi");
      
      p->clipboard->setMimeData(mime);
      
      const QMimeData *mime1 = p->clipboard->mimeData();
       qDebug() << "mime1" << mime1->data("com.myapp.filesystem.myclient.wifi");
       qDebug() << "mime1" << mime1->data("text/plain");
       qDebug() << "mime1" << mime1->data("uri-list");
       }
       

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              qtandroidteam Qt Android Team
              Reporter:
              michalis Michail Oo
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes