Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Does QSystemTrayIcon support QDropEvent?

    General and Desktop
    3
    3
    2559
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Q
      qttrekker last edited by

      Is there any way to intercept drop events on a system tray icon? I've checked the official documentation for [url=http://doc.trolltech.com/4.7-snapshot/qsystemtrayicon.html]QSystemTrayIcon[/url] and it doesn't mention anything about drop events.

      I was hoping drag/drop events could be configured for systray icons similar to [url=http://doc.trolltech.com/4.6/qtablewidget.html#dropEvent]QTableWidget[/url]. I'd like to be able to drag files from my desktop onto a system tray icon and
      @
      void DropArea::dropEvent(QDropEvent *event)
      {
      const QMimeData *mimeData = event->mimeData();
      if (mimeData->hasUrls()) {
      QList<QUrl> urlList = mimeData->urls();
      QString text;
      for (int i = 0; i < urlList.size(); ++i) {
      QString url = urlList.at(i).path();
      text += url + QString("\n");
      }
      // do something with text
      }
      }
      @

      1 Reply Last reply Reply Quote 0
      • J
        jorj last edited by

        youre right, it doesnt mention anything about it in the docs... im going to say probably not possible...

        which is a shame... maybe someone else will know more and be able to prove me wrong...

        1 Reply Last reply Reply Quote 0
        • A
          alexander last edited by

          Yes, apparently you have to use native API.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post