Indeterminate Qt progress bars don't display properly in 20.04
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
qtstyleplugins-src (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
In Ubuntu MATE 20.04, a Qt program with an indeterminate progress bar (meaning its minimum and maximum values have both been set to zero) does not display properly. It is supposed to animate in a way that shows that something is happening with an unknown time remaining. Instead, it sits still with its progress bar showing approximately 25 to 30% progress.
To test this, make a simple Qt program with a QProgressBar in the main window, and add these lines to the constructor of the main window:
ui->progressBar
ui->progressBar
This problem is not present in standard Ubuntu 20.04. Standard Ubuntu correctly animates the indeterminate progress bar. It's unclear to me which package is at fault, but it seems to be something specific to Ubuntu MATE because standard Ubuntu 20.04 doesn't have this problem.
Ubuntu MATE 18.04 also has this problem with Qt 5. With Qt 4 it doesn't have this problem.
description: | updated |
tags: | added: bionic focal |
no longer affects: | ubuntu-mate |
no longer affects: | mate-themes (Ubuntu) |
I finally found some time to look further into this, it appears to be an upstream problem with qtstyleplugins.
The logic in the gtk2 plugin (used by Ubuntu MATE by default) doesn't animate indeterminate progress bars if QT_NO_ANIMATION is defined, yet it seems to be intentionally defined to disable animation for some reason:
https:/ /code.qt. io/cgit/ qt/qtstyleplugi ns.git/ commit/ src/plugins/ styles/ gtk2/gtk2. pro?id= 102da7d50231fc5 723dba6e72340be f3d29471aa
Removing DEFINES += QT_NO_ANIMATION from gtk2.pro fixes the problem and allows the indeterminate progress bars to animate properly.