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. Difference between double click and Open button in QFileDialog
QtWS25 Last Chance

Difference between double click and Open button in QFileDialog

Scheduled Pinned Locked Moved General and Desktop
8 Posts 3 Posters 4.4k 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.
  • T Offline
    T Offline
    trollixx
    wrote on last edited by
    #1

    Just got a very strange bug when use QFileDialog. If I open files using double click on filename, everything works just fine. But if I select file and then press Open, the first time file is opened correctly, but the second time program hangs. Combining double click and Open doesn't lead to hang. Only two sequential opening using Open causes program hang. Debugging doesn't show any differences between those open variants. Maybe something wrong with threads, but I can't understand what exactly.

    Any ideas are highly appreciated. Thanks.

    Oleg

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

      Really strange behaviour, I don't think it is related to the open action. Could you show us some code where the problem is happening?

      1 Reply Last reply
      0
      • T Offline
        T Offline
        trollixx
        wrote on last edited by
        #3

        BTW, the problem occurs only on Windows.

        The dialog code is quite simple:
        [CODE]
        QString fileName = QFileDialog::getOpenFileName(this, tr("Open media file"), playerSettings2->prevFileDir, ::mediaDialogFilter);
        [/CODE]

        But hang occurs later in other libVLC's thread, when it tries to start playback. So, I don't know even where to dig. The only thing changes is the way I work with dialog, so I try to find how double click and pressing Open differ...

        Oleg

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          Thread? Hmmm... you are not trying to show a dialog from a different thread than the main GUI thread, are you?

          1 Reply Last reply
          0
          • T Offline
            T Offline
            trollixx
            wrote on last edited by
            #5

            I show dialog from main GUI thread, and I don't have any other threads inside application, it's libVLC stuff to create its own threads during playback.

            Oleg

            1 Reply Last reply
            0
            • F Offline
              F Offline
              fluca1978
              wrote on last edited by
              #6

              [quote author="trollixx" date="1322497618"]I show dialog from main GUI thread, and I don't have any other threads inside application, it's libVLC stuff to create its own threads during playback.[/quote]

              But your dialog should be opened again from your main gui thread.
              Is it possible to exclude a problem with libvlc about the opening? I mean, could you dry-run the application without passing the opened file name to the libvlc to see if the dialog still has the strange behavior?

              1 Reply Last reply
              0
              • T Offline
                T Offline
                trollixx
                wrote on last edited by
                #7

                Without libvlc nothing happens after dialog closes. The hang occurs inside libvlc, in one place, but it depends upon the way we use the dialog. So, of course, it seems like bug in libvlc with some depency from QFileDialog behavior. I'm trying now to rebuild app with libvlc from git to see if the bug occurs.

                Oleg

                1 Reply Last reply
                0
                • F Offline
                  F Offline
                  fluca1978
                  wrote on last edited by
                  #8

                  Could it be a problem with the timing you are opening the files? Another trial that comes into my mind is to exclude the open dialog at all and simulate the continue file selection with a cycle, to see if the libvlc cannot handle a rapid file change. Just a thought.

                  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