diff -r bfacef6f29c1 -r 0fad394bc330 findwidget.cpp --- a/findwidget.cpp Tue Mar 09 13:09:05 2010 +0000 +++ b/findwidget.cpp Wed Mar 10 15:36:19 2010 +0000 @@ -46,13 +46,17 @@ nextbutton = new QPushButton; nextbutton->setText (tr("Next","Find widget")); - nextbutton->setDefault (true); - nextbutton->setShortcut (Qt::Key_Return); connect ( nextbutton, SIGNAL( clicked() ), this, SLOT( nextPressed() ) ); + // QAction needed to only activate shortcut while FindWidget has focus + QAction *a=new QAction (nextbutton->text(),this); + a->setShortcut (Qt::Key_Return); + a->setShortcutContext (Qt::WidgetWithChildrenShortcut); + connect ( a, SIGNAL( triggered() ), this, SLOT( nextPressed() ) ); + addAction (a); + showAllButton = new QPushButton; showAllButton->setText (tr("Show all","Find widget")); - //connect ( showAllButton, SIGNAL( clicked() ), this, SLOT( showAllPressed() ) ); connect ( showAllButton, SIGNAL( clicked() ), mainWindow, SLOT( editOpenFindWidget() ) ); row2Layout->addWidget (cancelbutton);