QWIDGET: CANNOT CREATE A QWIDGET WITHOUT QAPPLICATION - Message Box
I used the Qmessage Box in the project created Qt Quick C++ template.
When I try to show an message box, I encounter the following error:
QWIDGET: CANNOT CREATE A QWIDGET WITHOUT QAPPLICATION
obj = QString::QString("Event Fired");
Thanks in advance.
Go to your
main.cppYou'll see there that a
QGuiApplicationis created. Replace it by QApplication.
As to why: there's no need for widget support when writing a Qt Quick application unless you make use of classes like QMessageBox.