Solve some clazy warnings
My last patch triggered me to run clazy on the project. This patch solves some of them:
- fixed qualification of return types. It's fine with doing it on return types as connects don't depend on it. It's relevant to QML though, see commit ac6bff57
- Proper iteration of some types, saving their copy.
- compile-time connects
- prefer using connects with the 3rd argument as an object when using lambdas.