Build fix related to Qt5.

Disable automoc and running moc manually. Also, adding flags to
correctly select the code to compile in the ifdef preprocessor
directives when moc is used.
Bugfix in QueryString