Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Difference between double click and Open button in QFileDialog

    General and Desktop
    3
    8
    4047
    Loading More Posts
    • 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
      trollixx last edited by

      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 Reply Quote 0
      • F
        fluca1978 last edited by

        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 Reply Quote 0
        • T
          trollixx last edited by

          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 Reply Quote 0
          • A
            andre last edited by

            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 Reply Quote 0
            • T
              trollixx last edited by

              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 Reply Quote 0
              • F
                fluca1978 last edited by

                [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 Reply Quote 0
                • T
                  trollixx last edited by

                  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 Reply Quote 0
                  • F
                    fluca1978 last edited by

                    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 Reply Quote 0
                    • First post
                      Last post