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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.0.0 Beta 2
    • Fix Version/s: 5.0.0 RC 1
    • Component/s: Core: Other
    • Labels:
      None
    • Commits:
      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

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

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes