From 2dee4ccca37813b38e270bfbbe2ce1d0f33b14e8 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Fri, 24 May 2013 15:35:57 +0200 Subject: [PATCH] Use QKeySequence::Find to focus the search widget --- src/tomahawk/TomahawkWindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tomahawk/TomahawkWindow.cpp b/src/tomahawk/TomahawkWindow.cpp index 2e81f08e9..631715f6f 100644 --- a/src/tomahawk/TomahawkWindow.cpp +++ b/src/tomahawk/TomahawkWindow.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -253,7 +254,6 @@ TomahawkWindow::applyPlatformTweaks() #endif } - void TomahawkWindow::setupToolBar() { @@ -292,6 +292,9 @@ TomahawkWindow::setupToolBar() m_searchWidget->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred ); m_searchWidget->setFixedWidth( 340 ); connect( m_searchWidget, SIGNAL( returnPressed() ), this, SLOT( onFilterEdited() ) ); + // Use Ctrl+F to focus the searchWidget + QShortcut *shortcut = new QShortcut( QKeySequence( QKeySequence::Find ), this ); + QObject::connect( shortcut, SIGNAL( activated() ), m_searchWidget, SLOT( setFocus() ) ); m_toolbar->addWidget( m_searchWidget )->setProperty( "kind", QString( "search" ) );