fix: don't attempt to scale windows opted out of scaling #5400
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.
I wanted to get rid of the duplicate scaling we do, but I noticed that the settings dialog still receives scaling events even though it opted out of custom scaling. This is because of our widget-tree, where the settings window is a descendant of the main window, causing
setScale
to be called on it (~> and its children). That's not desired.So instead of using Qt's
findChildren
, we're now using a custom recursive loop over all children. Its general structure is similar to Qt's, except that we don't keep a list. This might bite us if any objects are added/removed while iterating (in that case we can dump them into a vector first). If anyBaseWindow
is encountered that has custom scaling disabled, we won't go into it (that's the main fix).I also found a misleading call to
scale
in the settings dialog I missed in #4868 (the scale is always 1).