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 Slowness
Qt 6.11 is out! See what's new in the release blog

QFileDialog Slowness

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 2.4k Views 3 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.
  • Y Offline
    Y Offline
    yuvalg1987
    wrote on last edited by
    #1

    Hi,

    I'm trying to load a video file using the following lines of code:

    QString fileName = QFileDialog::getOpenFileName(this,
            ("Load Video or Image"), "", ("Images (*jpg *jpeg *.png *.jfif *tif *tiff);; Videos (*.mp4 *.avi *.mov *.mkv)"));
    

    Unforntunatly, the file browser takes a long time to load (1~2 seconds) for the first time (after that the behavior is fast and natural). Any advice why this is happening? How to solve this?

    Thanks
    Yuval

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

      Hi,

      Any chances you have network drives on your machine ?

      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
      1
      • Y Offline
        Y Offline
        yuvalg1987
        wrote on last edited by
        #3

        Not that I know of.

        We recently made some modifications to our Qt software (not to this section) and this behavior started to appear. I don't understand why this is happening as no processing is done by the software at this stage (no file has been loaded).

        Debugging this is quite hard as there are no indications to what is causing this behavior.

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

          One thing you can do is to roll back the changes that lead to this issue an apply them one by one until the slowness starts.

          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
          • Y Offline
            Y Offline
            yuvalg1987
            wrote on last edited by
            #5

            This what I plan to do. It would be helpful to know what to look for as there are many changes to revert.

            mrjjM 1 Reply Last reply
            0
            • Y yuvalg1987

              This what I plan to do. It would be helpful to know what to look for as there are many changes to revert.

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

              @yuvalg1987
              Hi
              Did you try a clean default GUI project and just the file open code?
              It would be a good start to test if really is something in app or something with the OS.

              1 Reply Last reply
              0
              • B Offline
                B Offline
                Bonnie
                wrote on last edited by Bonnie
                #7

                Are you talking about running in Windows?
                If I open QFileDialog when running from "start debugging" in Windows, the first time will be a bit slow because it uses Windows native dialog and needs to do some COM initialization, like loading some more dlls, which is slow in debugging.
                But when I run from just "Run" (without debugging), it will be much faster.

                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