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. Qt5.1.1 drag and drop problem
Forum Updated to NodeBB v4.3 + New Features

Qt5.1.1 drag and drop problem

Scheduled Pinned Locked Moved General and Desktop
23 Posts 2 Posters 9.5k 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
    airwaywong
    wrote on last edited by
    #1

    I was trying to run the example in

    http://qt-project.org/faq/answer/how_can_i_do_drag_and_drop_in_a_widget

    The example runs properly and display the text content.

    However, if I change line 67 and 73 from
    qDebug("Contents: %s", de->mimeData()->text().toLatin1().data());
    into
    qDebug() << de->mimeData()->urls();
    and drag either a file from file explorer or a url from web browser, the program always hangs and displays about 15 lines of
    First-chance exception at 0x759DC41F (KernelBase.dll) in MyDialog.exe: 0x8007000E: Not enough storage is available to complete this operation.

    Could someone help solve this problem and display the urls in mime data properly?

    In fact, the demo "dropsite" in the Qt5.1.1 distribution does not work either. After I drag either a file from file explorer or a url from web browser and drop it to the dropsite program, it just shows "Cannot display data". Even if the "Format" column shows a long list including "text/uri-list", all "Content" columns are empty.

    For the environment, I have installed qt-windows-opensource-5.1.1-msvc2012-x86-offline.exe and qt-vs-addin-1.2.2-opensource.exe with VS 2012 Premium on Windows 7.

    Thanks.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      airwaywong
      wrote on last edited by
      #2

      Could someone help this? It is quite frustrating since the problem appears after we upgrade Qt for 4 to 5.

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

        Hi and welcome to devnet,

        Can you test it with the latest 5.2.0 ?

        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
        • A Offline
          A Offline
          airwaywong
          wrote on last edited by
          #4

          Thanks for the hint.

          I just installed 5.2.0 beta1. Still no luck and dropsite example does not work. All dropped items show empty Content column.

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

            What windows version are you on ?

            Just tested the faq example with Win7, 5.1.1 mingw edition and it's working fine. Could you also test that version to see whether it's a Visual Studio specific behavior ?

            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
            • A Offline
              A Offline
              airwaywong
              wrote on last edited by
              #6

              I am on Windows 7 x64 Enterprise SP1.

              Will try mingw edition and see how it goes. Thanks.

              1 Reply Last reply
              0
              • A Offline
                A Offline
                airwaywong
                wrote on last edited by
                #7

                Tried mingw32 version of Qt5.2.0 beta1. Same problem. The dropsite example shows empty "Content" column.

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  airwaywong
                  wrote on last edited by
                  #8

                  I noticed during installation it failed to install vc redistribute sp1, probably because I already have sp4 in system. I am not sure if that caused this problem. This happened to both vs2012 and mingw versions.

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

                    That might not help indeed. You should then build Qt with your current setup (qtbase would be enough for the test) to see if it behaves better.

                    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
                    • A Offline
                      A Offline
                      airwaywong
                      wrote on last edited by
                      #10

                      It took a few hours to build Qt 5.1.1 from source. When I loaded it into VS2012, it always complains about OpenGL problem, even if I included "include/QtANGLE".

                      error C2065: 'GL_RGBA8' : undeclared identifier c:\qt\qt5.1.1\qtbase\src\gui\opengl\qopenglframebufferobject.h
                      error C2065: 'GL_RGBA8' : undeclared identifier c:\qt\qt5.1.1\qtbase\src\gui\opengl\qopenglframebufferobject.h
                      error C2039: 'glClearDepth' : is not a member of 'global namespace'' c:\qt\qt5.1.1\qtbase\src\gui\opengl\qopenglfunctions.h error C3861: 'glClearDepth': identifier not found c:\qt\qt5.1.1\qtbase\src\gui\opengl\qopenglfunctions.h error C2039: 'glDepthRange' : is not a member of 'global namespace'' c:\qt\qt5.1.1\qtbase\src\gui\opengl\qopenglfunctions.h
                      error C3861: 'glDepthRange': identifier not found c:\qt\qt5.1.1\qtbase\src\gui\opengl\qopenglfunctions.h

                      When I built Qt from source, I used "-opengl desktop" option. And it seems outside VS2012, it did not complain OpenGL.

                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        airwaywong
                        wrote on last edited by
                        #11

                        I also reinstall VS 2012 without SP. This time qt-windows-opensource-5.1.1-msvc2012-x86-offline.exe installs without any error messages. However, dropsite still does not work.

                        Now I am wondering if drag and drop really works in 5.1.1 or not. :(

                        1 Reply Last reply
                        0
                        • A Offline
                          A Offline
                          airwaywong
                          wrote on last edited by
                          #12

                          Have to roll back to Qt 4.8.1. Everything works. Too bad.

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

                            What did you drop on the widget ? I've just tested the dropsite example again (still with MinGW) and dropped a couple of files on it and its working.

                            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
                            • A Offline
                              A Offline
                              airwaywong
                              wrote on last edited by
                              #14

                              I dropped a file from file explorer. Also multiple files worked.

                              Now I am wondering if there is some dll corrupted or incompatible with Qt in my Windows 7 system. Is there any way to ensure all dependent dlls have proper version?

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

                                You can try Dependency Walker on your executable. If it can find Qt libraries it means that there's a set of them on your system in your PATH that might be interfering

                                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
                                • A Offline
                                  A Offline
                                  airwaywong
                                  wrote on last edited by
                                  #16

                                  Thank for the tip!

                                  Finally I found out my firewall blocks some access permission of the compiled binaries. After adding the binaries into exception list, it works fine if I compiled using command line tools (qmake, jom).

                                  The version I am using now is

                                  • qt-windows-opensource-5.1.1-msvc2012_opengl-x86_64-offline.exe
                                  • qt-vs-addin-1.2.2-opensource.exe.

                                  I assume I should not use QtANGLE lib. In VS2012, I tried to remove preprocessor definition "QT_OPENGL_ES_2" and "QT_OPENGL_ES_2_ANGLE", and compile the code. Now I got error:

                                  LNK1104: cannot open file 'libEGLd.lib'

                                  Could you give some hint how I can solve this problem? I tried to search the forum, but no luck.

                                  1 Reply Last reply
                                  0
                                  • A Offline
                                    A Offline
                                    airwaywong
                                    wrote on last edited by
                                    #17

                                    Also according to makespecs/win32-msvc2012/qmake.conf, the error message means QMAKE_LIBS_OPENGL_ES2_DEBUG was used for linking. However, I would expect QMAKE_LIBS_OPENGL should be used.

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

                                      Indeed, there might be a packaging or naming issue, did you try the angle package ?

                                      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
                                      • A Offline
                                        A Offline
                                        airwaywong
                                        wrote on last edited by
                                        #19

                                        There is no include/QtANGLE directory in the installed directory. Could you let me know how I can try angle package?

                                        1 Reply Last reply
                                        0
                                        • A Offline
                                          A Offline
                                          airwaywong
                                          wrote on last edited by
                                          #20

                                          BTW, I did see GL lib files defined by QMAKE_LIBS_OPENGL under C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x86 and C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x64. Not sure how I can force to link against QMAKE_LIBS_OPENGL.

                                          QMAKE_LIBS_OPENGL = glu32.lib opengl32.lib gdi32.lib user32.lib

                                          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