Convert code to Qt5 and remove superflous code