implement a QDir prototype so it can be used from scripts

Change-Id: I990cbc42383c668345e65561e2eec3a135b16f60
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>