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. Runtime "No disk in drive" errors
QtWS25 Last Chance

Runtime "No disk in drive" errors

Scheduled Pinned Locked Moved Unsolved General and Desktop
11 Posts 2 Posters 3.3k Views
  • 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 Offline
    R Offline
    Rory_1
    wrote on last edited by
    #1

    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
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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
      0
      • SGaistS SGaist

        Hi,

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

        R Offline
        R Offline
        Rory_1
        wrote on last edited by Rory_1
        #3

        @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
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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
          0
          • R Offline
            R Offline
            Rory_1
            wrote on last edited by Rory_1
            #5

            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
            0
            • R 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 Offline
              R Offline
              Rory_1
              wrote on last edited by
              #6

              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
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                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
                0
                • SGaistS SGaist

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

                  R Offline
                  R Offline
                  Rory_1
                  wrote on last edited by Rory_1
                  #8

                  @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
                  0
                  • R Offline
                    R Offline
                    Rory_1
                    wrote on last edited by Rory_1
                    #9

                    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
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by SGaist
                      #10

                      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
                      0
                      • SGaistS SGaist

                        Did you test the code provided in the same answer ?

                        R Offline
                        R Offline
                        Rory_1
                        wrote on last edited by
                        #11

                        @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
                        0

                        • Login

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