Migration to Qt5

Coauthor: Rafal Remisiewicz