Qt: Fix automoc when .h and .cpp are in different directories.

Thanks Lode Leroy for the patch.
Qt: Enable running automoc test with Qt4 or Qt5.

Previously, the automoc tests required both Qt4 and Qt5.
Merge topic 'qt-automoc' into next

c979c60c Qt: Enable running automoc test with Qt4 or Qt5.
cf4a7eb0 Qt: Fix automoc when .h and .cpp are in different directories.