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

Crash QCoreApplication(argc,argv ) constructor

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.6.1
    • 5.6.0 RC
    • WebEngine
    • None
    • Windows
    • 78ff3973c8745d8e12a0e71bd37dea47be954741

    Description

      I have a command line tool, that depending on the arguments sent in by the user, can cause a QWebEngine based widget.

      When the args are set up for this, a QApplication is created, otherwise a QCoreApplication was created.

      This is done in a similar fashion to what is shown in the help
      http://doc.qt.io/qt-5/qapplication.html#details

      However, my GUI based flow has a dependency on QWebEngine, and is statically bound in

      The problem is, the QWebEngine initialization code, called from qt_call_pre_routines() a QOpenGLContext is created in the webengine initialize() code

      shareContext = new QOpenGLContext;
      shareContext->create();

      And the application crashes in create because QGuiApplicationPrivate::platformIntegration() returns nullptr

      The solution was to create a QGUIApplication, rather than a QCoreApplication

      QCoreApplication *app = QCoreApplication::instance();
      if (!app)

      { qFatal("QtWebEngine::initialize() must be called after the construction of the application object."); return; }

      Should really be checking to see if the app is a QGUIApplication, not just any old QCoreApplication

      Attachments

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

        Activity

          People

            jbornema Joerg Bornemann
            scottbloom Scott
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes