Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Drag & Drop to systray icon
Forum Updated to NodeBB v4.3 + New Features

Drag & Drop to systray icon

Scheduled Pinned Locked Moved General and Desktop
12 Posts 4 Posters 6.2k Views 1 Watching
  • 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.
  • A Offline
    A Offline
    ahmed.helal
    wrote on last edited by
    #1

    Is it possible to get info about a file (or capture text that is) dragged and dropped on my Qt App systray icon ?

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      AFAIK you can't drop on the system tray, sorry.
      Not on Windows. Whether it works on Linux or Mac, I don't know.

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goetz
        wrote on last edited by
        #3

        "QSystemTrayIcon":http://doc.qt.nokia.com/stable/qsystemtrayicon.html inherits directly from QObject and does not accept drops at all.

        I don't know if it is possible at all to do this on any operating system.

        Do you really mean the system tray (see the screenshot in the link above). Or do you mean something like the "Dock":http://en.wikipedia.org/wiki/Dock_(computing) on "OS X":http://en.wikipedia.org/wiki/Dock_(Mac_OS_X) or the "Taskbar":http://en.wikipedia.org/wiki/Taskbar on windows?

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply
        0
        • A Offline
          A Offline
          ahmed.helal
          wrote on last edited by
          #4

          @Volker yes i mean systray icon and i saw it on mac already, and also in windows in a c# application.

          1 Reply Last reply
          0
          • G Offline
            G Offline
            goetz
            wrote on last edited by
            #5

            systray icon on the mac is in the top right corner, included in the menu bar. I do not know of an application that support a drop on this icon. You can have menus though.

            http://www.catb.org/~esr/faqs/smart-questions.html

            1 Reply Last reply
            0
            • G Offline
              G Offline
              giesbert
              wrote on last edited by
              #6

              SO, I tried with Notepad++ and it does not work. I don't know whether you can hack the system to achieve this, but I'm pretty sure, it will be system dependent programming, not Qt

              Nokia Certified Qt Specialist.
              Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

              1 Reply Last reply
              0
              • A Offline
                A Offline
                ahmed.helal
                wrote on last edited by
                #7

                is this related : http://developer.qt.nokia.com/forums/viewthread/943 ?

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  goetz
                  wrote on last edited by
                  #8

                  [quote author="ahmed.helal" date="1292951491"]is this related : http://developer.qt.nokia.com/forums/viewthread/943 ?[/quote]

                  Yes, it's the same problem in that thread.

                  http://www.catb.org/~esr/faqs/smart-questions.html

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    ahmed.helal
                    wrote on last edited by
                    #9

                    @volker any idea if the suggested solution is valid ?

                    1 Reply Last reply
                    0
                    • G Offline
                      G Offline
                      goetz
                      wrote on last edited by
                      #10

                      No chance to get drag'n'drop working with pure Qt, at least not in a platform independent manner.

                      QSystemTrayIcon is "only" a QObject, not a QWidget and therefore does not have setAccptDrops().

                      On a Mac the icon does not get any events at all (you can check by installing an event filter).

                      http://www.catb.org/~esr/faqs/smart-questions.html

                      1 Reply Last reply
                      0
                      • D Offline
                        D Offline
                        dangelog
                        wrote on last edited by
                        #11

                        [quote author="Volker" date="1292951292"]systray icon on the mac is in the top right corner, included in the menu bar. I do not know of an application that support a drop on this icon. You can have menus though.[/quote]

                        For instance droplr. Check out its 30-sec screencast. http://droplr.com/hello

                        Software Engineer
                        KDAB (UK) Ltd., a KDAB Group company

                        1 Reply Last reply
                        0
                        • G Offline
                          G Offline
                          goetz
                          wrote on last edited by
                          #12

                          Thanks for the link, Peppe. It's the first droppable systray icon I've seen. Unfortunately I still do not have a solution on how to achieve this with Qt :-(

                          http://www.catb.org/~esr/faqs/smart-questions.html

                          1 Reply Last reply
                          0

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved