Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
None
-
5.14.2
-
None
-
-
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
- relates to
-
QTBUG-102738 WebEngine breaks QClipboard::dataChanged()
- Closed
- resulted from
-
QTBUG-51170 Windows: Investigate Sandboxing
- Closed