frontend: Use qobject_cast when casting QObjects
Description
When casting between QObjects, qobject_cast should always be used. This increases performance as there is no RTTI (Run Time Type Information) with qobject_cast, like there is with dynamic_cast.
Using reinterpret_cast is bad practice, as you should use it only in very specific cases.
Motivation and Context
Better code
How Has This Been Tested?
compiled and ran OBS
Types of changes
- Bug fix (non-breaking change which fixes an issue) -->
- Performance enhancement (non-breaking change which improves efficiency)
Checklist:
- [x] My code has been run through clang-format.
- [x] I have read the contributing document.
- [x] My code is not on the master branch.
- [x] The code has been tested.
- [x] All commit messages are properly formatted and commits squashed where appropriate.
- [x] I have included updates to all appropriate documentation.
Converting to draft, as #11785 needs to be merged first.
This PR now builds correctly
Overall I'm fine with this change, though it obviously touches a whole lot casts in the code that touch a whole lot of aspects of our frontend code, so this might be too late for the next version but should possibly merged after the next version is stabilised to give it some time to exist on the master branch.
@RytoEX WDYT?
I think this should be merged for 32.1, merge timing TBD. It does have a merge conflict though.
I've rebased this PR