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 issue
Forum Updated to NodeBB v4.3 + New Features

QFileDialog issue

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 979 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.
  • ivanicyI Offline
    ivanicyI Offline
    ivanicy
    wrote on last edited by
    #1

    Hello!

    I am using a QFileDialog to obtain a folder path. I don't know why this process take a lot of time. (about a minute). I don't know if is a QFileDialog issue of Qt or something like this. This is my code:

    QString sDirectory;
    
    sDirectory = QFileDialog::getExistingDirectory(this, tr("Open directory"), 
    QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), 
    QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
    
    ui->labelCalibrationPath->setText(sDirectory);
    

    As you can see, this is a very simple code.

    Any idea of what is happening here?

    Thank you very much!!

    mrjjM 1 Reply Last reply
    0
    • ivanicyI ivanicy

      Hello!

      I am using a QFileDialog to obtain a folder path. I don't know why this process take a lot of time. (about a minute). I don't know if is a QFileDialog issue of Qt or something like this. This is my code:

      QString sDirectory;
      
      sDirectory = QFileDialog::getExistingDirectory(this, tr("Open directory"), 
      QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), 
      QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
      
      ui->labelCalibrationPath->setText(sDirectory);
      

      As you can see, this is a very simple code.

      Any idea of what is happening here?

      Thank you very much!!

      mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @ivanicy

      Hi
      what platform ?
      I have seen this on windows with a network share that was not available.

      ivanicyI 1 Reply Last reply
      1
      • mrjjM mrjj

        @ivanicy

        Hi
        what platform ?
        I have seen this on windows with a network share that was not available.

        ivanicyI Offline
        ivanicyI Offline
        ivanicy
        wrote on last edited by
        #3

        @mrjj This is on windows

        mrjjM 1 Reply Last reply
        0
        • ivanicyI ivanicy

          @mrjj This is on windows

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @ivanicy

          Hi, and you are very sure its not inside project ?
          even clean one does it?

          Do you have had any network shares ?

          ivanicyI 1 Reply Last reply
          0
          • mrjjM mrjj

            @ivanicy

            Hi, and you are very sure its not inside project ?
            even clean one does it?

            Do you have had any network shares ?

            ivanicyI Offline
            ivanicyI Offline
            ivanicy
            wrote on last edited by
            #5

            @mrjj said in QFileDialog issue:

            Hi, and you are very sure its not inside project ?
            even clean one does it?
            Do you have had any network shares ?

            I've tried with an empty project and it works fine. So, it could be that you say but I don't know what do you mean with network shares

            jsulmJ JonBJ 2 Replies Last reply
            0
            • ivanicyI ivanicy

              @mrjj said in QFileDialog issue:

              Hi, and you are very sure its not inside project ?
              even clean one does it?
              Do you have had any network shares ?

              I've tried with an empty project and it works fine. So, it could be that you say but I don't know what do you mean with network shares

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @ivanicy If you have any network shares (network drives) it can take long for the OS to look up them.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              2
              • ivanicyI ivanicy

                @mrjj said in QFileDialog issue:

                Hi, and you are very sure its not inside project ?
                even clean one does it?
                Do you have had any network shares ?

                I've tried with an empty project and it works fine. So, it could be that you say but I don't know what do you mean with network shares

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on last edited by
                #7

                @ivanicy
                You may also be interested in reading through https://forum.qt.io/topic/95305/checking-run-time-characteristics-for-qfiledialog-getopenfilename. That is discussing a user experiencing long delays with a file dialog, though in a different situation.

                You might follow some of my suggestions there. You might also try passing DontUseNativeDialog and see whether that affects the situation (I find the docs confusing as to whether getExistingDirectory() respects this flag under Windows, but you could try.)

                1 Reply Last reply
                1

                • Login

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