Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
6.2.3
-
None
-
-
91ef7c19f4 (qt/qtwebengine/dev) 1d87b4c954 (qt/qtwebengine/6.2) 61c32f966f (qt/qtwebengine/6.3) 1d87b4c954 (qt/qtwebengine/6.2) 1d87b4c954 (qt/qtwebengine/6.2) 1d87b4c954 (qt/tqtc-qtwebengine/6.2) 61c32f966f (qt/qtwebengine/6.3.1)
Description
This hinders copy pasting from a webview. The bug wasn't there in 6.2.2.
To reproduce, apply the diff below to the MarkDown Editor example. Run the app, select some text from the webview on the right, copy it (Ctrl+C), then select File > New.
Observe the extra text at the start of the HTML:
Version:0.9\r\nStartHTML:0000000132\r\nEndHTML:0000000741\r\nStartFragment:0000000168\r\nEndFragment:0000000705\r\nSourceURL:qrc:/index.html\r\n
diff -ur a/mainwindow.cpp b/mainwindow.cpp --- a/mainwindow.cpp 2022-02-13 12:49:25.762492986 +1000 +++ b/mainwindow.cpp 2022-02-13 12:49:25.794492396 +1000 @@ -59,6 +59,9 @@ #include <QStatusBar> #include <QTextStream> #include <QWebChannel> +#include <QClipboard> +#include <QMimeData> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), @@ -120,6 +123,8 @@ void MainWindow::onFileNew() { + qInfo() << QGuiApplication::clipboard()->mimeData()->html(); + return; if (isModified()) { QMessageBox::StandardButton button = QMessageBox::question(this, windowTitle(), tr("You have unsaved changes. Do you want to create a new document anyway?"));
Attachments
Issue Links
- relates to
-
QTBUG-118121 QtWebEngine CFHtmlExtractMetadata does not handle case of no context properly
-
- Reported
-
- resulted from
-
QTBUG-92539 Weird behavior when pasting certain HTML into element with contentEditable attribute set
-
- Closed
-