summaryrefslogtreecommitdiffstats
path: root/examples/webenginewidgets/simplebrowser/browserwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/webenginewidgets/simplebrowser/browserwindow.cpp')
-rw-r--r--examples/webenginewidgets/simplebrowser/browserwindow.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/examples/webenginewidgets/simplebrowser/browserwindow.cpp b/examples/webenginewidgets/simplebrowser/browserwindow.cpp
index c01f912d..762d56c8 100644
--- a/examples/webenginewidgets/simplebrowser/browserwindow.cpp
+++ b/examples/webenginewidgets/simplebrowser/browserwindow.cpp
@@ -105,6 +105,13 @@ BrowserWindow::BrowserWindow(QWidget *parent, Qt::WindowFlags flags)
m_urlLineEdit->setFavIcon(QIcon(QStringLiteral(":defaulticon.png")));
+ QAction *focusUrlLineEditAction = new QAction(this);
+ addAction(focusUrlLineEditAction);
+ focusUrlLineEditAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_L));
+ connect(focusUrlLineEditAction, &QAction::triggered, this, [this] () {
+ m_urlLineEdit->setFocus(Qt::ShortcutFocusReason);
+ });
+
handleWebViewTitleChanged(tr("Qt Simple Browser"));
m_tabWidget->createTab();
}