summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-07-29 14:09:05 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-08-02 12:00:57 +0200
commit1a49f193afe1ba54339182a49d891917159f6719 (patch)
tree986cf277193c625c2f61015c7f29c6b403a5eb02 /examples
parent47d6b5ce11d1014548ba69df5d7b698381a8343e (diff)
parentfa138d4a76e9e820f01a75771c30dbced8c4e6f3 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: src/3rdparty src/core/resources/resources.gyp src/webengine/doc/src/qtwebengine-overview.qdoc src/webenginewidgets/api/qwebenginepage.cpp src/webenginewidgets/api/qwebenginescriptcollection.cpp src/webenginewidgets/api/qwebenginescriptcollection_p.h tests/auto/widgets/qwebenginepage/BLACKLIST And readded newly in 5.6 enabled tests to the BLACKLIST. Change-Id: I4ab1fc54ebfaaf940df81b0d8d6bdd15cae8b7c4
Diffstat (limited to 'examples')
-rw-r--r--examples/webenginewidgets/demobrowser/browsermainwindow.cpp22
-rw-r--r--examples/webenginewidgets/simplebrowser/browserwindow.cpp22
2 files changed, 40 insertions, 4 deletions
diff --git a/examples/webenginewidgets/demobrowser/browsermainwindow.cpp b/examples/webenginewidgets/demobrowser/browsermainwindow.cpp
index 14ed10dfc..f044219ca 100644
--- a/examples/webenginewidgets/demobrowser/browsermainwindow.cpp
+++ b/examples/webenginewidgets/demobrowser/browsermainwindow.cpp
@@ -419,13 +419,31 @@ void BrowserMainWindow::setupMenu()
m_historyBack = new QAction(tr("Back"), this);
m_tabWidget->addWebAction(m_historyBack, QWebEnginePage::Back);
- m_historyBack->setShortcuts(QKeySequence::Back);
+ QList<QKeySequence> backShortcuts = QKeySequence::keyBindings(QKeySequence::Back);
+ for (auto it = backShortcuts.begin(); it != backShortcuts.end();) {
+ // Chromium already handles navigate on backspace when appropriate.
+ if ((*it)[0] == Qt::Key_Backspace)
+ it = backShortcuts.erase(it);
+ else
+ ++it;
+ }
+ // For some reason Qt doesn't bind the dedicated Back key to Back.
+ backShortcuts.append(QKeySequence(Qt::Key_Back));
+ m_historyBack->setShortcuts(backShortcuts);
m_historyBack->setIconVisibleInMenu(false);
historyActions.append(m_historyBack);
m_historyForward = new QAction(tr("Forward"), this);
m_tabWidget->addWebAction(m_historyForward, QWebEnginePage::Forward);
- m_historyForward->setShortcuts(QKeySequence::Forward);
+ QList<QKeySequence> fwdShortcuts = QKeySequence::keyBindings(QKeySequence::Forward);
+ for (auto it = fwdShortcuts.begin(); it != fwdShortcuts.end();) {
+ if (((*it)[0] & Qt::Key_unknown) == Qt::Key_Backspace)
+ it = fwdShortcuts.erase(it);
+ else
+ ++it;
+ }
+ fwdShortcuts.append(QKeySequence(Qt::Key_Forward));
+ m_historyForward->setShortcuts(fwdShortcuts);
m_historyForward->setIconVisibleInMenu(false);
historyActions.append(m_historyForward);
diff --git a/examples/webenginewidgets/simplebrowser/browserwindow.cpp b/examples/webenginewidgets/simplebrowser/browserwindow.cpp
index e7d5fd129..c01f912d3 100644
--- a/examples/webenginewidgets/simplebrowser/browserwindow.cpp
+++ b/examples/webenginewidgets/simplebrowser/browserwindow.cpp
@@ -280,7 +280,17 @@ QToolBar *BrowserWindow::createToolBar()
navigationBar->toggleViewAction()->setEnabled(false);
m_historyBackAction = new QAction(this);
- m_historyBackAction->setShortcuts(QKeySequence::Back);
+ QList<QKeySequence> backShortcuts = QKeySequence::keyBindings(QKeySequence::Back);
+ for (auto it = backShortcuts.begin(); it != backShortcuts.end();) {
+ // Chromium already handles navigate on backspace when appropriate.
+ if ((*it)[0] == Qt::Key_Backspace)
+ it = backShortcuts.erase(it);
+ else
+ ++it;
+ }
+ // For some reason Qt doesn't bind the dedicated Back key to Back.
+ backShortcuts.append(QKeySequence(Qt::Key_Back));
+ m_historyBackAction->setShortcuts(backShortcuts);
m_historyBackAction->setIconVisibleInMenu(false);
m_historyBackAction->setIcon(QIcon(QStringLiteral(":go-previous.png")));
connect(m_historyBackAction, &QAction::triggered, [this]() {
@@ -289,7 +299,15 @@ QToolBar *BrowserWindow::createToolBar()
navigationBar->addAction(m_historyBackAction);
m_historyForwardAction = new QAction(this);
- m_historyForwardAction->setShortcuts(QKeySequence::Forward);
+ QList<QKeySequence> fwdShortcuts = QKeySequence::keyBindings(QKeySequence::Forward);
+ for (auto it = fwdShortcuts.begin(); it != fwdShortcuts.end();) {
+ if (((*it)[0] & Qt::Key_unknown) == Qt::Key_Backspace)
+ it = fwdShortcuts.erase(it);
+ else
+ ++it;
+ }
+ fwdShortcuts.append(QKeySequence(Qt::Key_Forward));
+ m_historyForwardAction->setShortcuts(fwdShortcuts);
m_historyForwardAction->setIconVisibleInMenu(false);
m_historyForwardAction->setIcon(QIcon(QStringLiteral(":go-next.png")));
connect(m_historyForwardAction, &QAction::triggered, [this]() {