Fix compilation on Ubuntu. Improve integration with Qt5.