Indeterminate Qt progress bars don't display properly in 20.04

Bug #1906138 reported by Doug Brown
6
This bug affects 1 person
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->setMinimum(0);
ui->progressBar->setMaximum(0);

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.

Tags: bionic focal
Doug Brown (macg3)
description: updated
Norbert (nrbrtx)
tags: added: bionic focal
no longer affects: ubuntu-mate
no longer affects: mate-themes (Ubuntu)
Revision history for this message
Doug Brown (macg3) wrote :

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/qtstyleplugins.git/commit/src/plugins/styles/gtk2/gtk2.pro?id=102da7d50231fc5723dba6e72340bef3d29471aa

Removing DEFINES += QT_NO_ANIMATION from gtk2.pro fixes the problem and allows the indeterminate progress bars to animate properly.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

I don't remember why I disabled animation in that commit. Probably I had some build failure when it's enabled.

Anyway, qtstyleplugins is abandoned and no longer developed (the last commit was more than 6 years ago). I recommend to NOT include it in dependencies of any package.

Qt 6.5.0 will have a much improved GTK 3 integration support: https://code.qt.io/cgit/qt/qtbase.git/commit/?id=4ca8a6840842d5ff.

Revision history for this message
Doug Brown (macg3) wrote :

Wow, thanks for responding so quickly! That's great to hear.

FWIW, to this day, Ubuntu MATE 23.04 is still using the gtk2 style plugin (export QT_QPA_PLATFORMTHEME=gtk2 in /etc/profile.d) so indeterminate progress bars have been broken in Ubuntu MATE for years. I think there would be value in at least patching this in Ubuntu's build or something...

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Okay, I can try patching out the QT_NO_ANIMATION line in our packaging.

no longer affects: qtbase-opensource-src (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qtstyleplugins-src - 5.0.0+git23.g335dbec-5

---------------
qtstyleplugins-src (5.0.0+git23.g335dbec-5) experimental; urgency=medium

  * Add a patch to enable animation for the GTK2 plugin (LP: #1906138).
  * Build against Qt 5.15.9.
  * Use upstream git repository as Homepage URL.
  * Bump Standards-Version to 4.6.2, no changes needed.

 -- Dmitry Shachnev <email address hidden> Tue, 16 May 2023 23:52:56 +0300

Changed in qtstyleplugins-src (Ubuntu):
status: New → Fix Released
Revision history for this message
Doug Brown (macg3) wrote :

I just tested with the latest daily Ubuntu MATE 23.10 build. I can confirm the bug is now fixed (after updating because the daily build still had the previous version). Thank you very much for officially fixing this, Dmitry!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.