mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
typingEvent fix,double characters when focus
This commit is contained in:
parent
de3d7b8b19
commit
5860e81ff3
|
@ -2583,7 +2583,7 @@ bool MainWindow::eventFilter( QObject * obj, QEvent * ev )
|
|||
else
|
||||
if ( obj == wordList )
|
||||
{
|
||||
if ( ev->type() == QEvent::KeyPress )
|
||||
if (ev->type() == QEvent::KeyPress || ev->type() == QEvent::ShortcutOverride)
|
||||
{
|
||||
QKeyEvent * keyEvent = static_cast< QKeyEvent * >( ev );
|
||||
|
||||
|
@ -2634,7 +2634,7 @@ bool MainWindow::eventFilter( QObject * obj, QEvent * ev )
|
|||
}
|
||||
else
|
||||
if (obj == ui.dictsList) {
|
||||
if ( ev->type() == QEvent::KeyPress )
|
||||
if ( ev->type() == QEvent::KeyPress || ev->type() == QEvent::ShortcutOverride)
|
||||
{
|
||||
QKeyEvent * keyEvent = static_cast< QKeyEvent * >( ev );
|
||||
|
||||
|
@ -2768,10 +2768,11 @@ void MainWindow::typingEvent( QString const & t )
|
|||
|
||||
if( translateLine->isEnabled() )
|
||||
{
|
||||
//translateLine->setFocus();
|
||||
// Escaping the typed-in characters is the user's responsibility.
|
||||
setTranslateBoxTextAndClearSuffix( t, WildcardsAreAlreadyEscaped, EnablePopup );
|
||||
translateLine->setCursorPosition( t.size() );
|
||||
translateLine->clear();
|
||||
translateLine->setFocus();
|
||||
// Escaping the typed-in characters is the user's responsibility.
|
||||
// setTranslateBoxTextAndClearSuffix( t, WildcardsAreAlreadyEscaped, EnablePopup );
|
||||
// translateLine->setCursorPosition( t.size() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -856,9 +856,10 @@ void ScanPopup::typingEvent( QString const & t )
|
|||
}
|
||||
else
|
||||
{
|
||||
ui.translateBox->translateLine()->setFocus();
|
||||
ui.translateBox->setText( t, true );
|
||||
ui.translateBox->translateLine()->setCursorPosition( t.size() );
|
||||
ui.translateBox->translateLine()->clear();
|
||||
ui.translateBox->translateLine()->setFocus();
|
||||
// ui.translateBox->setText( t, true );
|
||||
// ui.translateBox->translateLine()->setCursorPosition( t.size() );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue