QtQuick.Dialogs: check for inheriting from QApplication

Widget-based dialogs are allowed if the application is a
QApplication, but subclassing is OK too.

(cherry-picked from qtdeclarative 76952046ceccf2cd176a3452bc908cac769f90d9)
Task-number: QTBUG-35769
Change-Id: I0b74c870488c157913a68e1a30744cd46ae82cee
Reviewed-by: Liang Qi <liang.qi@digia.com>