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

QClipboard's setMimeData fails to copy value in Android

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.15.0 RC2
    • GUI: Drag and Drop
    • None
    • 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

              qtandroidteam Qt Android Team
              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