If both tests cases in the qml file dialog test are run together, there
is a warning:
file:///opt/qt5/qml/QtQuick/Controls/TextField.qml:638:28: Unable to assign [undefined] to QString
This seems to be caused by destroying the QQmlEngine. Thus this change
keeps one QQmlEngine around and also changes the memory management in
other areas. The ownership of a created component is passed to the
caller, thus it needs to be in a QScopedPointer.
Note: this test asserts on build.kde.org. I'm not able to reproduce the
assert locally, but I think it might be related to this warning.