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. Is external drag and drop broken in Qt 5.7.0 on Windows 8.1?
Forum Updated to NodeBB v4.3 + New Features

Is external drag and drop broken in Qt 5.7.0 on Windows 8.1?

Scheduled Pinned Locked Moved Solved General and Desktop
qt5.7.0windows 8.1drag&drop
5 Posts 2 Posters 3.0k 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.
  • K Offline
    K Offline
    Kirinyale
    wrote on last edited by
    #1

    I have recently upgraded my application from 5.5 to 5.7 (for VS2015) and, after a while, noticed that dropping files from Windows explorer stopped working. I am quite sure that I did not change anything related for a long time in these specific parts of my application. I have setAcceptDrops(true) calls on all necessary widgets, and it looks like dragEnterEvent simply never arrives now.

    I have also just tried compiling the dropsite sample from my Qt distribution, and guess what - it doesn't work either!
    In-application drag&drop functionality (like draggableicons sample) is still working fine, though.

    So.... what happened?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      You may have found a regression. Can you check whether it's also the case with the latest 5.6 ? It'll help pinpoint when it started to happen.

      In any case, you should take a look at the bug report system to see if it's something known. If not please consider opening a new report after having tested with 5.6

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • K Offline
        K Offline
        Kirinyale
        wrote on last edited by
        #3

        Ok, this took a while to find out, but now it looks like the problem may not be with Qt itself after all (or maybe it is, but in a different way). Dropping files only does not work when the application is launched directly from under Visual Studio (2015 or 2013 - haven't tried downgrading to 2010 yet). However, it does work when exe is launched "freely".

        I guess I didn't test this feature for quite a while from under the IDE. :( Happens when you develop something big all alone on your spare time... Had to try 5 different versions of Qt down to 5.5.0 (for which I happen to have an old working build to test) before I realized what's the difference.

        Now I'm confused and not sure where to look next to find the original root cause. :) But thanks anyway.

        1 Reply Last reply
        2
        • K Offline
          K Offline
          Kirinyale
          wrote on last edited by
          #4

          Turns out the cause is that Visual Studio runs elevated, and drag & drop is blocked by default between elevated and non-elevated apps. Funny, this is even older than I thought:
          https://helgeklein.com/blog/2010/03/how-to-enable-drag-and-drop-for-an-elevated-mfc-application-on-vistawindows-7/

          Although the solution published there does not work for me with Qt (probably there are some more messages), but at least I can confirm that it's elevation that causes it (tried running "free" executable as admin).

          So, sorry for the false alarm. :)

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Glad you found out and thanks for sharing !

            No need to be sorry, it's something that other people might hit some days and this thread will help them :)

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            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