Qt Forum

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

    Unsolved Runtime "No disk in drive" errors

    General and Desktop
    2
    11
    2900
    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.
    • R
      Rory_1 last edited by

      My app has a QTreeview using QFileSystemModel. My computer has a number of USB drives with no media inserted. When I run the app from within Qt Creator, either in debug or release mode, all is good. However, when I run the executable outside Creator I get multiple "No disk in drive" errors. I can replicate this behavior with the Dir View example.

      I am running Qt 5.5.1 and MSVC2013_64bit on a Windows 10 PC.

      Any advice on how to work around this behavior would be greatly appreciated.

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        When you ran your application outside Qt Creator, did you deploy it properly ?

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

        R 1 Reply Last reply Reply Quote 0
        • R
          Rory_1 @SGaist last edited by Rory_1

          @SGaist

          I just made sure the necessary dll were added to the folder with myapp.exe.

          Qt5Core.dll
          QtGui.dll
          QtWidgets.dll

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            3 DLLs only ? Looks suspicious because you should not be able to run your application because of the missing platform plugin. You should run windeployqt, that will grab all necessary Qt dependencies.

            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 Reply Quote 0
            • R
              Rory_1 last edited by Rory_1

              I ran windeployqt and it added Qt5Svg.dll. However, this did not solve my problem.

              C:\Qt\Qt5.5.1\5.5\msvc2013_64\bin>windeployqt "C:\Program Files\Winnow"
              C:\Program Files\Winnow\winnow.exe 64 bit, release executable
              Adding Qt5Svg for qsvgicon.dll
              Direct dependencies: Qt5Core Qt5Gui Qt5Widgets
              All dependencies : Qt5Core Qt5Gui Qt5Widgets
              To be deployed : Qt5Core Qt5Gui Qt5Svg Qt5Widgets
              Warning: Cannot find Visual Studio installation directory, VCINSTALLDIR is not set.
              Qt5Core.dll is up to date.
              Qt5Gui.dll is up to date.
              Updating Qt5Svg.dll.

              R 1 Reply Last reply Reply Quote 0
              • R
                Rory_1 @Rory_1 last edited by

                I also tried copying my exe file "Winnow.exe" to the Qt bin folder, where all the dll's reside. I still get the same error. If I work past the error messages for each "No disk in drive" error then my app works just fine with just the original 3 dll's I listed.

                1 Reply Last reply Reply Quote 0
                • SGaist
                  SGaist Lifetime Qt Champion last edited by

                  Are you doing anything special or simply setting the QFileSystemModel on the QTreeView is enough to trigger that ?

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

                  R 1 Reply Last reply Reply Quote 0
                  • R
                    Rory_1 @SGaist last edited by Rory_1

                    @SGaist

                    Nothing special. As I mentioned, I get the same result with the Dir View example. However, I am continuing to explore your suggestion about deployment. I am working on figuring out what VCINSTALLDIR should be set to. I do not have a license for Visual Studio. I forget what I ended up downloading to get the VC compiler, but as a result I do have Microsoft Visual Studio 12.0. I'm guessing if I set VCINSTALLDIR correctly then windeployqt may install something I need.

                    Okay, this worked I think. I set VCINSTALLDIR = C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC and windeployqt ran without errors or warnings. My app seems to be working now.

                    Thanks very much for getting me pointed in the right direction!!

                    1 Reply Last reply Reply Quote 0
                    • R
                      Rory_1 last edited by Rory_1

                      It turns out this topic is not solved. I found another reference to the problem: "I'm using QDir().isReadable to check if a drive is readable. In the Qt Creator it runs fine, but when I run the exe it keeps giving me errors" here.

                      The temporary solution to set HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Windows\ErrorMode = 2 is working.

                      Is there a known work around in Qt?

                      1 Reply Last reply Reply Quote 0
                      • SGaist
                        SGaist Lifetime Qt Champion last edited by SGaist

                        Did you test the code provided in the same answer ?

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

                        R 1 Reply Last reply Reply Quote 0
                        • R
                          Rory_1 @SGaist last edited by

                          @SGaist

                          If you are asking whether I used the code, I did not. I did make the change to the registry, which works for now.

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