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

[REG 5.14.0->5.14.1] QWebEngine prevents QClipboard::dataChanged to be triggered

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • None
    • 5.14.2
    • WebEngine
    • None
    • Windows
    • daeb5ccdfaf9e57b7c2d737837ee6e6ea80cdd5b (qt/qtwebengine-chromium/80-based) 67b97269d703a84e63a2b58fbc0a00690219beab (qt/qtwebengine-chromium/83-based) c9dc924f139e541db090908ee7ff3ec396dbde3a (qt/qtwebengine-chromium/87-based)

    Description

      Here is a modified main.cpp from simplebrowser:
       

      #include "browser.h"
      #include "browserwindow.h"
      #include "tabwidget.h"
      #include <QApplication>
      #include <QWebEngineProfile>
      #include <QWebEngineSettings>
      #include <QClipboard>
      #include <QMessageBox> QUrl commandLineUrlArgument()
      {
       const QStringList args = QCoreApplication::arguments();
       for (const QString &arg : args.mid(1)) {
        if (!arg.startsWith(QLatin1Char('-')))
         return QUrl::fromUserInput(arg);
       }
       return QUrl(QStringLiteral("https://www.qt.io"));
      } int main(int argc, char **argv)
      {
       QCoreApplication::setOrganizationName("QtExamples");
       QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
       QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);  QApplication app(argc, argv);
       app.setWindowIcon(QIcon(QStringLiteral(":AppLogoColor.png")));  QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::PluginsEnabled, true);
      #if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
       QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::DnsPrefetchEnabled, true);
       QWebEngineProfile::defaultProfile()->setUseForGlobalCertificateVerification();
      #endif  QUrl url = commandLineUrlArgument();  Browser browser;
       BrowserWindow *window = browser.createWindow();  window->connect(QApplication::clipboard(), &QClipboard::dataChanged, [=]()
       {
        QMessageBox::information(window, "ClipboardChanged", QApplication::clipboard()->text());
       });  window->tabWidget()->setUrl(url);  return app.exec();
      }

      Try to fill the clipboard outside the app, the message box will never show. Something in the web engine prevents from firing dataChange but it's hocus pocus why. Any hint would be appreciated.

      Attachments

        Issue Links

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

          Activity

            People

              pvarga Peter Varga
              neosettler neosettler
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes