diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-03-02 17:30:07 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-03-02 17:30:27 +0100 |
commit | d058d6c9df1ff866e4259ca2989ad144bb01a1e0 (patch) | |
tree | d91f8c314c20781080819d100df6a9855b30fbfd /src/webenginewidgets | |
parent | 0c6312dfba960365771c64b937579a40e02ea5f7 (diff) | |
parent | 3f1805f8569337a21b72324d5edad329d5dfe872 (diff) |
Merge remote-tracking branch 'origin/5.8' into 5.9
Change-Id: Iff6ab3c287c58d8ec84a1513460bfce5218e8a61
Diffstat (limited to 'src/webenginewidgets')
6 files changed, 19 insertions, 10 deletions
diff --git a/src/webenginewidgets/api/qwebenginedownloaditem.cpp b/src/webenginewidgets/api/qwebenginedownloaditem.cpp index 582f0308c..1950221c7 100644 --- a/src/webenginewidgets/api/qwebenginedownloaditem.cpp +++ b/src/webenginewidgets/api/qwebenginedownloaditem.cpp @@ -218,7 +218,7 @@ quint32 QWebEngineDownloadItem::id() const This signal is emitted whenever the download's \a state changes. - \sa state(), QWebEngineDownloadItem::DownloadState + \sa state(), DownloadState */ /*! @@ -327,7 +327,7 @@ quint32 QWebEngineDownloadItem::id() const /*! Returns the download item's current state. - \sa QWebEngineDownloadItem::DownloadState + \sa DownloadState */ QWebEngineDownloadItem::DownloadState QWebEngineDownloadItem::state() const diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index 2af3db414..8908af3c4 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -821,6 +821,8 @@ QWebEnginePage::QWebEnginePage(QWebEngineProfile *profile, QObject* parent) QWebEnginePage::~QWebEnginePage() { Q_D(QWebEnginePage); + if (d->adapter) + d->adapter->stopFinding(); QWebEngineViewPrivate::bind(d->view, 0); } @@ -842,7 +844,7 @@ QWebEngineSettings *QWebEnginePage::settings() const * that is exposed in the JavaScript context of this page as \c qt.webChannelTransport. * * \since 5.5 - * \sa setWebChannel + * \sa setWebChannel() */ QWebChannel *QWebEnginePage::webChannel() const { @@ -1455,7 +1457,7 @@ void QWebEnginePagePrivate::javascriptDialog(QSharedPointer<JavaScriptDialogCont controller->textProvided(promptResult); break; case UnloadDialog: - accepted = (QMessageBox::information(view, QCoreApplication::translate("QWebEnginePage", "Are you sure you want to leave this page?"), controller->message(), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes); + accepted = (QMessageBox::question(view, QCoreApplication::translate("QWebEnginePage", "Are you sure you want to leave this page?"), QCoreApplication::translate("QWebEnginePage", "Changes that you made may not be saved."), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok); break; case InternalAuthorizationDialog: accepted = (QMessageBox::question(view, controller->title(), controller->message(), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes); @@ -1632,6 +1634,8 @@ QMenu *QWebEnginePage::createStandardContextMenu() if (d->isFullScreenMode()) menu->addAction(QWebEnginePage::action(ExitFullScreen)); + menu->setAttribute(Qt::WA_DeleteOnClose, true); + return menu; } diff --git a/src/webenginewidgets/api/qwebenginescript.cpp b/src/webenginewidgets/api/qwebenginescript.cpp index 04a9d979a..d5247cde1 100644 --- a/src/webenginewidgets/api/qwebenginescript.cpp +++ b/src/webenginewidgets/api/qwebenginescript.cpp @@ -196,7 +196,7 @@ ASSERT_ENUMS_MATCH(QWebEngineScript::DocumentCreation, UserScript::DocumentEleme * Returns the point in the loading process at which the script will be executed. * The default value is QWebEngineScript::Deferred. * - * \sa setInjectionPoint + * \sa setInjectionPoint() */ QWebEngineScript::InjectionPoint QWebEngineScript::injectionPoint() const { @@ -205,7 +205,7 @@ QWebEngineScript::InjectionPoint QWebEngineScript::injectionPoint() const /*! * Sets the point at which to execute the script to be \a p. * - * \sa QWebEngineScript::InjectionPoint + * \sa InjectionPoint */ void QWebEngineScript::setInjectionPoint(QWebEngineScript::InjectionPoint p) { diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp index 58d805fcb..56948bb18 100644 --- a/src/webenginewidgets/api/qwebengineview.cpp +++ b/src/webenginewidgets/api/qwebengineview.cpp @@ -333,7 +333,6 @@ bool QWebEngineView::event(QEvent *ev) void QWebEngineView::contextMenuEvent(QContextMenuEvent *event) { QMenu *menu = page()->createStandardContextMenu(); - connect(menu, &QMenu::aboutToHide, menu, &QObject::deleteLater); menu->popup(event->globalPos()); } diff --git a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc index 58abc9fa1..7616ebcee 100644 --- a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc +++ b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc @@ -538,7 +538,7 @@ This signal is emitted whenever the page requests the web browser window to be closed, for example through the JavaScript \c{window.close()} call. - \sa QWebEnginePage::RequestClose + \sa RequestClose */ /*! @@ -729,7 +729,7 @@ /*! \fn void QWebEnginePage::featurePermissionRequested(const QUrl &securityOrigin, Feature feature) - This is signal is emitted when the web site identified by \a securityOrigin requests to make use of + This signal is emitted when the web site identified by \a securityOrigin requests to make use of the resource or device identified by \a feature. \sa featurePermissionRequestCanceled(), setFeaturePermission() @@ -738,7 +738,7 @@ /*! \fn void QWebEnginePage::featurePermissionRequestCanceled(const QUrl &securityOrigin, Feature feature) - This is signal is emitted when the web site identified by \a securityOrigin cancels a previously issued + This signal is emitted when the web site identified by \a securityOrigin cancels a previously issued request to make use of \a feature. \sa featurePermissionRequested(), setFeaturePermission() diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp index 69ecbe160..e7ad5b107 100644 --- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp +++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp @@ -64,6 +64,8 @@ public: RenderWidgetHostViewQuickItem(RenderWidgetHostViewQtDelegateClient *client) : m_client(client) { setFlag(ItemHasContents, true); + // Mark that this item should receive focus when the parent QQuickWidget receives focus. + setFocus(true); } protected: void focusInEvent(QFocusEvent *event) override @@ -180,10 +182,14 @@ void RenderWidgetHostViewQtDelegateWidget::initAsPopup(const QRect& screenRect) setAttribute(Qt::WA_ShowWithoutActivating); setFocusPolicy(Qt::NoFocus); +#ifdef Q_OS_MACOS // macOS doesn't like Qt::ToolTip when QWebEngineView is inside a modal dialog, specifically by // not forwarding click events to the popup. So we use Qt::Tool which behaves the same way, but // works on macOS too. setWindowFlags(Qt::Tool | Qt::FramelessWindowHint | Qt::WindowDoesNotAcceptFocus); +#else + setWindowFlags(Qt::ToolTip | Qt::FramelessWindowHint | Qt::WindowDoesNotAcceptFocus); +#endif setGeometry(screenRect); show(); |