Reduce duplicate code + add missing Q_REQUIRED_RESULT

2 jobs for master in 78 minutes and 52 seconds (queued for 10 minutes and 31 seconds)
Status Job ID Name Coverage
  Build
passed #52913
build_clazy_clang_tidy

00:56:07

passed #52912
linux kf5-qt5 qt5.12

00:43:16

37.0%