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

Struggling with QProgressBar

Scheduled Pinned Locked Moved General and Desktop
qprogressbarno showno reactionlong task
2 Posts 2 Posters 1.4k Views 2 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.
  • K Offline
    K Offline
    kiozen
    wrote on 7 Jul 2015, 14:43 last edited by
    #1

    Hi,

    another thread with the QProgressBar not showing. I read all the others carefully, but they do not solve the problem. I played a lot with the progress dialog and made two observations. My situation is: I have a task that takes very long. The counters to show progress are large. To reach the first percent it takes minutes. The code I use is the one for a modal progress dialog. This is necessary as everything must be blocked until the task terminates or is cancelled.

    My observations are:

    1. If I set my target count as maximum and use my progress count in setValue(), the progress dialog never shows up. It took me several projects with a progress dialog failing to realize that things somehow changed for QT5 and QProgressBar only seems to operate properly in the range 0..100. -> Ok, I do the calculation on my own and pass a value between 0..100. That is working with medium size tasks. The value changes, I can press the cancel button. Good.

    2. If the task is a real bastard size one QProgressDialog does not show up for a long time. And then it won't update. No cancel button, no progressbar. Nothing. Yes, I tried calling processEvents(). But that creates just many GUI glitches I would like to avoid. And it does not make the progress dialog updating properly either. And as documentation states, QProgressDialog should process events on it's own anyway. It took me some time to find out, it only processes events when the value really changes. Calling setValue() with the same progress seems not to trigger the event loop. However that would be necessary to a) show the widget properly b) operate the cancel button.

    Somehow 1) and 2) make it impossible to get the progress dialog to work as expected. Do I miss something obvious? Or is it a bug?

    Thanks for input

    Oliver

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 7 Jul 2015, 20:55 last edited by
      #2

      Hi,

      If you can reproduce that with a minimal compilable example then it's likely to be a bug.

      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

      1/2

      7 Jul 2015, 14:43

      • Login

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