Initial port from Qt 4 to Qt 5.

Used http://qt-project.org/wiki/Transition_from_Qt_4.x_to_Qt5 .