Changed all qt4 macros to qt5 macros

Replaced all instances of finding Qt4 package to Qt5 package.
Replaced all Qt4 cmake macros to Qt5 cmake macros.
macro_add_file_depends replaced by object_depends as recommended.
Qt5 obsoletes toAscii and fromAscii methods

Replaced all instances:
QString::toAscii --> QString::toLatin1
QString::fromAscii --> QString::fromLatin1
QChar::fromAscii --> QLatin1Char
QApplication::syncX() method has been removed in Qt5
Compile flags for position independent code and added Qt5Test

Qt5 is built and packaged with the -reduce-relocations configure option as
default. This causes compilations to run with the -Bsymbolic-functions option,
which makes function pointer comparison ineffective, unless the -fPIE flag is
also supplied.
Added Qt5Test as one of the dependencies.