Fix invisible joint value progress bars on macOS #3645
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes an issue where joint value progress bars in the Motion Planning → Joints tab of the RViz Motion Planning plugin are invisible on macOS, even though:
paint()method is called,The issue occurs when using
QStyle::CE_ProgressBarinside aQStyledItemDelegate, which is known to fail on macOS due to Qt style limitations.Problem Description
The progress bars are rendered using a custom
QStyledItemDelegatethat draws aQStyleOptionProgressBar.On macOS,
style->drawControl(QStyle::CE_ProgressBar, ...)does not visually render the progress bar when used inside an item delegate, even if the delegate is active and enabled.This results in empty cells with no visible progress indicator.
This is not purely an RViz issue, but a known Qt/macOS rendering limitation affecting progress bars drawn from delegates.
Solution
A manual progress bar rendering fallback is introduced for macOS using
QPainter:For non-macOS platforms, the existing Qt style-based rendering is preserved.
Known Qt Issues on macOS
This behavior is consistent with multiple reported Qt issues:
CE_ProgressBar does not work on macOS
https://forum.qt.io/topic/110609/ce_progressbar-does-not-work-on-macos
QStyleOptionProgressBar looks inactive on macOS
https://forum.qt.io/topic/16905/qstyleoptionprogressbar-looks-inactiva-on-osx
QTBUG-69763 – Progress bar not rendered correctly in delegates
https://qt-project.atlassian.net/browse/QTBUG-69763
Platform Verification
Notes
As an alternative approach, the manual drawing path could also be used unconditionally across platforms to avoid platform-specific Qt delegate rendering issues.