mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
Typing while focused on the word list initiates new search now.
This commit is contained in:
parent
c83b6cd5da
commit
ebec14ac7f
|
@ -1067,7 +1067,6 @@ bool MainWindow::eventFilter( QObject * obj, QEvent * ev )
|
|||
return true;
|
||||
}
|
||||
|
||||
#if QT_VERSION >= 0x040500
|
||||
if ( keyEvent->matches( QKeySequence::InsertParagraphSeparator ) &&
|
||||
ui.wordList->selectedItems().size() )
|
||||
{
|
||||
|
@ -1078,8 +1077,26 @@ bool MainWindow::eventFilter( QObject * obj, QEvent * ev )
|
|||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Handle typing events used to initiate new lookups
|
||||
|
||||
if ( keyEvent->modifiers() &
|
||||
( Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier ) )
|
||||
return false; // A non-typing modifier is pressed
|
||||
|
||||
if ( keyEvent->key() == Qt::Key_Space ||
|
||||
keyEvent->key() == Qt::Key_Backspace ||
|
||||
keyEvent->key() == Qt::Key_Tab )
|
||||
return false; // Those key have other uses than to start typing
|
||||
// or don't make sense
|
||||
|
||||
QString text = keyEvent->text();
|
||||
|
||||
if ( text.size() )
|
||||
{
|
||||
typingEvent( text );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue