diff options
author | Florian Bruhin <git@the-compiler.org> | 2017-03-09 07:56:17 +0100 |
---|---|---|
committer | Florian Bruhin <qt-project.org@the-compiler.org> | 2017-03-28 14:29:50 +0000 |
commit | 57fee86eb2756a2f102e2bbeb16a443b84a17e01 (patch) | |
tree | f9b9c37285b4853d16a7f583381bc433285f321b /src/webenginewidgets/api | |
parent | c69bceeb40ce7d8fb3f8bc12332a3eb3c96887d1 (diff) |
Call javaScriptConfirm for unload dialogs
This unfortunately means we lose the ability to customize the title with the
default implementation, but it's still better than having a QMessageBox
hardcoded without being able to customize this behavior at all.
[ChangeLog][Qt WebEngineWidgets][QWebEnginePage] The javaScriptConfirm method is
now also called for unload dialogs (onbeforeunload handlers).
Task-number: QTBUG-58673
Change-Id: I82393da2593dc84e94d577ff28f5d6d8988df552
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/webenginewidgets/api')
-rw-r--r-- | src/webenginewidgets/api/qwebenginepage.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index 8908af3c4..b4605ea85 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -1457,7 +1457,7 @@ void QWebEnginePagePrivate::javascriptDialog(QSharedPointer<JavaScriptDialogCont controller->textProvided(promptResult); break; case UnloadDialog: - 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); + accepted = q->javaScriptConfirm(controller->securityOrigin(), QCoreApplication::translate("QWebEnginePage", "Are you sure you want to leave this page? Changes that you made may not be saved.")); break; case InternalAuthorizationDialog: accepted = (QMessageBox::question(view, controller->title(), controller->message(), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes); |