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. QFileDialog returns "C:\...\... that refers to a location is not available"

QFileDialog returns "C:\...\... that refers to a location is not available"

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 1.5k 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.
  • C Offline
    C Offline
    ChanchoCiego
    wrote on last edited by
    #1

    QFileDialog returns "C:\Users\Dar¡o That Refers to a location is not available"**

    I can not find a way to correct this message, the code is this:

    @QString file = QFileDialog :: GetOpenFileName (this,
                                                 tr ("Abrir un archivo"),
                                                 QDir::HomePath ()
                                                 tr ("Todos los archivos (.)"));@

    the QDir::HomePath() output is "C:\Users\Darío" (Darío with emphasis on i)

    the project.pro file has

    @CODECFORTR = UTF-8
    CODECFORSRC = UTF-8@

    the system is Windows 7, language is Spanish

    Thank you very much,

    regards,

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Francknos
      wrote on last edited by
      #2

      This Works at me :
      @
      QString file = QFileDialog::getOpenFileName (this,
      tr ("Abrir un archivo"),
      QDir::homePath() ,
      tr ("Todos los archivos (.)"));
      @

      Have you make
      @
      #include <QFileDialog>
      #include <QDir>
      @

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

        You need to check the home path setting:
        @
        qDebug() << QDir::homePath();
        @
        If it is wrong you can find under "QDir::homePath":http://doc.qt.io/qt-5/qdir.html#homePath the conditions applied to find the homePath. This may lead you to a wrong setting in your OS.

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply
        0
        • C Offline
          C Offline
          ChanchoCiego
          wrote on last edited by
          #4

          [quote author="Francknos" date="1424162077"]Have you make
          @
          #include <QFileDialog>
          #include <QDir>
          @
          [/quote]

          yes, I included those files

          [quote author="koahnig" date="1424164007"]You need to check the home path setting:
          @
          qDebug() << QDir::homePath();
          @
          If it is wrong you can find under "QDir::homePath":http://doc.qt.io/qt-5/qdir.html#homePath the conditions applied to find the homePath. This may lead you to a wrong setting in your OS.
          [/quote]

          @USERPROFILE=C:\Users\Darío
          HOMEDRIVE=C:
          HOMEPATH=\Users\Darío@

          look at this picture:

          !http://dysd.com.ar/imgforoqt/captura.jpg(Captura)!

          the problem is trying to open the desktop

          thank you very much,

          greetings,

          1 Reply Last reply
          0
          • K Offline
            K Offline
            koahnig
            wrote on last edited by
            #5

            The question is if there is the folder "C:/Users/Dario/Desktop" available?

            This could be named different because of Spanish version. However, I really doubt that this is the origin of the problem.

            Another thing may be your first name. The fourth letter does not look in the screen shots like a plain ASCII 'i'. It looks like a special Spanish character. IMHO that might be the cause.
            "QLocale":http://doc.qt.io/qt-5/qlocale.html may be of help. Unfortunately, I have not used QLocale before.

            Vote the answer(s) that helped you to solve your issue(s)

            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