Packs Qt version specific stuff

Easier to understand and maintain.

Suggested-by: Alexander Sokolov <sokoloff.a@gmail.com>
Signed-off-by: Luís Pereira <luis.artur.pereira@gmail.com>