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

QWebSettings::defaultSettings ignored when custom profile is in use.

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Done
    • P2: Important
    • 5.9.1
    • 5.6.2, 5.7.0
    • Documentation, WebEngine
    • None

    Description

      Installing a custom QWebEngineProfile results in the default settings getting lost for that view/page. Personally I'd expect the default settings to also act as default settings for new profiles.

      Example:

      #include <QApplication>
      #include <QWebEngineView>
      #include <QWebEngineSettings>
      #include <QWebEngineProfile>
      #include <QDebug>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          QWebEngineSettings::defaultSettings()->setFontSize(QWebEngineSettings::DefaultFontSize, 50);
      
          QWebEngineView view;
          qDebug() << view.settings()->fontSize(QWebEngineSettings::DefaultFontSize);
          view.setPage(new QWebEnginePage(new QWebEngineProfile("test", &view), &view));
          qDebug() << view.settings()->fontSize(QWebEngineSettings::DefaultFontSize);
      
          view.setHtml("<html><body>TEST</body></html>");
          view.show();
      
          return a.exec();
      }
      

      Output:

      50
      16
      

      Attachments

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

        Activity

          People

            leenam Leena Miettinen
            apollo13 Florian Apolloner
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes