Support building against either Qt 4 or Qt 5

The USE_QT5 option controls which version is used at build time.