Currently Qt 5.3 is defined as minimum version in root CMakeLists.txt,
but setFlag() was introduced in Qt 5.7. Added more verbose code variants
to be used on those, can be removed when minimum dependency gets high
enough.
Based on patch by Damien Caliste to Sailfish packaging.