Closes: #22370
for more information, see https://pre-commit.ci
* Create QuickMeasure in C++ instead of Python to avoid that it will be garbage collected * Handle exceptions in case of invalid selections * Refactor QuickMeasure class * Fix linter warnings