Qt5 support

This is based on VanNostrand's initial qt5 port; compiles and run fine on - at least - osx.
Can this block get moved to its own function? I'd like to keep `#IF` branching out of as much of the main code as possible.