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

WebView make QDialog fail if url is not set

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.8.1
    • WebEngine
    • None
    • macOS

    Description

      Hello,

      If I create a QDialog on which I put a QWebEngineView, if I do not set the url on it it fails and the QDialog::exec returns 0.

      To try it, please run the following code:

       

      #include <QApplication>
      #include <QDialog>
      #include <QWebEngineView>
      #include <QUrl>
      
      int main(int argc, char **argv) {
      
          QApplication app{argc, argv};
          
          
          QDialog dlg;
          auto view = new QWebEngineView(&dlg);
          
      #if 1
          Q_UNUSED(view);
      #else
          view->setUrl(QString(""));
      #endif
              
          qDebug() << dlg.exec();
      }
      
      

       

      You can play with if 1 to enable or disable setting the url. For me, with the url, it shows, Without it it just returns from exec with code 0.

      Attachments

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

        Activity

          People

            qt_webengine_team Qt WebEngine Team
            thierryb Thierry Bastian
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes