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

drag and drop outlook mail item to QT application

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Need More Info
    • Priority: Not Evaluated
    • Resolution: Incomplete
    • Affects Version/s: 5.11
    • Fix Version/s: None
    • Component/s: GUI: Drag and Drop
    • Labels:

      Description

      Hi Team,

       

      I am trying to drag n drop the mail item from outlook to my local QT application. Drag n drop of .eml extension file is working but the application is not able to detect the mail item when I drag and drop the mail directly from Outlook application installed in MAC Also, I want to fetch the mail body and attachment from the drag n drop event. Please help me with this.
      Attached below is my code snippet:

      void DropArea::dropEvent(QDropEvent *event)
      {
          const QMimeData *mimeData = event->mimeData();
      
           QList<QByteArray> bytearray=mimeData->dynamicPropertyNames();
           foreach(QByteArray by,bytearray){
               qDebug()<<"bytearrauy"<<by;
           }
        
          if (mimeData->hasImage()) {
              setPixmap(qvariant_cast<QPixmap>(mimeData->imageData()));
          } else if (mimeData->hasHtml()) {
              setText("has html"+mimeData->html());
              setTextFormat(Qt::RichText);
          } else if (mimeData->hasUrls()) {
              QList<QUrl> urlList = mimeData->urls();
              QString text;
              for (int i = 0; i < urlList.size() && i < 32; ++i)
                  text += urlList.at(i).path() + QLatin1Char('\n');
              setText("hasurl"+text);
          }
          else if(mimeData->hasFormat("message/rfc822")){
              setText(tr("msg droped"));
          }else {
              setText(tr("Cannot display data"));
          }
      
          setBackgroundRole(QPalette::Dark);
          event->acceptProposedAction();
      }
      

        Attachments

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

          Activity

            People

            Assignee:
            qt.team.quick.subscriptions Qt Quick and Widgets Team
            Reporter:
            rakm Ranju Kumari
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes