Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-28093

QCoreApplication::Type vs. QApplication::type()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.0.0 RC 1
    • 5.0.0 Beta 2
    • Core: Other
    • None
    • 553e216d891177ee0c2cea70bbd7f21103fc7795

      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();
      }
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Unassigned Unassigned
            jpnurmi J-P Nurmi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes