UI: Replace themeID and style hints with class property #11226
Merged
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.
Description
In the past we've used a custom property called themeID to apply special styling to widgets. These widgets could be targeted using attribute style CSS selectors like
QWidget[themeID="addIcon"]
. This approach was flawed in instances where we wanted to apply multiple of these adjustments on a single widget.To solve that, we adjusted to instead using a boolean value which could be targeted with
QWidget[addIcon="true"]
However, we have recently discovered that QSS has (almost completely undocumented) special handling for when widgets have a custom property named
class
, allowing the class selector like CSSmyWidget->setProperty("class", "addIcon toolButton")
QSS
Motivation and Context
Standardizes and unifies our approach for applying special appearance changes to widgets.
How Has This Been Tested?
Ensured that the appearance of specific widgets all looks correct
Types of changes
Checklist: