Fix Travis build

Use Qt version check macro in order to fix Travis Qt 4 builds.