Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.0.0 Beta 2
-
None
-
553e216d891177ee0c2cea70bbd7f21103fc7795
Description
Wouldn't it make sense to make the QCoreApplication::Type enumeration reflect the available application types in Qt 5, and propagate the getter from QApplication::type() to QCoreApplication::type()?
enum Type { Tty, GuiClient, GuiServer // # deprecated };
It could offer values like Tty(or even simply Core?),Gui,Widgets instead.
It is very confusing that currently QApplication::type() returns Tty when QGuiApplication was instantiated. As a side effect, instantiating QWidget in a GUI application throws a misleading fatal error:
#include <QtWidgets> int main( int argc, char* argv[]) { QGuiApplication a(argc,argv); QWidget w; // QWidget: Cannot create a QWidget when no GUI is being used w.show(); return a.exec(); }
Attachments
Issue Links
- relates to
-
QTBUG-28076 Cannot use QGuiApplication to create GUI app: Cannot create a QWidget when no GUI is being used
-
- Closed
-