Add Qt5 support

Just added the necessary changes for Qt5 compliance.