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

QWebEngineUrlSchemeHandler::requestStarted crashed app

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.6.0 RC
    • 5.6.0 Alpha
    • WebEngine
    • None
    • vs2013; Qt5.6
    • 7c7ee9a94bd566bd94e1548fb4bb6b5ec774c0d1

    Description

      I have inherited from QWebEngineUrlSchemeHandler. Redefined method requestStarted(QWebEngineUrlRequestJob *request)
      After I try to call QWebEngineUrlRequestJob::reply

      for example

      void CustomUrlSchemeHandler::requestStarted(QWebEngineUrlRequestJob *request)
      {
          qDebug() << "CustomUrlSchemeHandler::requestStarted   " << request->requestUrl();
          QMimeDatabase HelpViewer;
          QMimeType mt = HelpViewer.mimeTypeForUrl(request->requestUrl());
          const QString mimeType = mt.name();
          QByteArray arr = QString::fromStdString("<html><body>Hello world</body></html>").toUtf8();
          QBuffer *buffer = new QBuffer(&arr, this);
          buffer->open(QIODevice::ReadOnly);
          request->reply(mimeType.toLatin1(), buffer);
          return;
      }
      

      But the program crashes. see log - http://stackoverflow.com/questions/33933958/qt-5-6-beta-qtwebengine-how-work-with-qwebengineurlrequestjob

      Attachments

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

        Activity

          People

            jbornema Joerg Bornemann
            teremo4ek Bely Yury
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes