Task-number: QTBUG-28076
Change-Id: Ica9713894c18bb43ae817a6dd42be087b23fa8c2
Reviewed-by: Jing Bai <jing.bai@digia.com>
void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f)
{
Q_Q(QWidget);
- if (QApplication::type() == QApplication::Tty)
- qFatal("QWidget: Cannot create a QWidget when no GUI is being used");
+ if (!qobject_cast<QApplication *>(QCoreApplication::instance()))
+ qFatal("QWidget: Cannot create a QWidget without QApplication");
Q_ASSERT(allWidgets);
if (allWidgets)