diff --git a/src/controls/QskTextEdit.cpp b/src/controls/QskTextEdit.cpp index fd8cf3d2..8390a360 100644 --- a/src/controls/QskTextEdit.cpp +++ b/src/controls/QskTextEdit.cpp @@ -289,27 +289,6 @@ void QskTextEdit::keyPressEvent( QKeyEvent* event ) { switch ( event->key() ) { - case Qt::Key_Enter: - case Qt::Key_Return: - { - QGuiApplication::inputMethod()->commit(); - - const auto hints = inputMethodQuery( Qt::ImHints ).toInt(); - - if ( hints & Qt::ImhMultiLine ) - { - m_data->wrappedEdit->handleEvent( event ); - } - else - { - setEditing( false ); - - // When returning from a virtual keyboard - qskForceActiveFocus( this, Qt::PopupFocusReason ); - } - - break; - } #if 1 case Qt::Key_Escape: { diff --git a/src/controls/QskTextEditSkinlet.cpp b/src/controls/QskTextEditSkinlet.cpp index 92695431..020b957a 100644 --- a/src/controls/QskTextEditSkinlet.cpp +++ b/src/controls/QskTextEditSkinlet.cpp @@ -88,5 +88,3 @@ QSizeF QskTextEditSkinlet::sizeHint( const QskSkinnable* skinnable, return hint; } - -#include "moc_QskTextEditSkinlet.cpp" diff --git a/src/controls/QskTextInput.cpp b/src/controls/QskTextInput.cpp index 05181f5f..1f32c7b2 100644 --- a/src/controls/QskTextInput.cpp +++ b/src/controls/QskTextInput.cpp @@ -304,22 +304,13 @@ void QskTextInput::keyPressEvent( QKeyEvent* event ) case Qt::Key_Enter: case Qt::Key_Return: { - if ( hasAcceptableInput() || fixup() ) + const auto hints = inputMethodQuery( Qt::ImHints ).toInt(); + if ( !( hints & Qt::ImhMultiLine ) ) { - QGuiApplication::inputMethod()->commit(); - - const auto hints = inputMethodQuery( Qt::ImHints ).toInt(); - - if ( hints & Qt::ImhMultiLine ) - { - m_data->wrappedInput->handleEvent( event ); - } - else + if ( hasAcceptableInput() || fixup() ) { + QGuiApplication::inputMethod()->commit(); setEditing( false ); - - // When returning from a virtual keyboard - qskForceActiveFocus( this, Qt::PopupFocusReason ); } } @@ -329,14 +320,19 @@ void QskTextInput::keyPressEvent( QKeyEvent* event ) case Qt::Key_Escape: { setEditing( false ); - qskForceActiveFocus( this, Qt::PopupFocusReason ); break; } #endif - default: - { - m_data->wrappedInput->handleEvent( event ); - } + } + + if ( isEditing() ) + { + m_data->wrappedInput->handleEvent( event ); + } + else + { + // When returning from a virtual keyboard + qskForceActiveFocus( this, Qt::PopupFocusReason ); } return; @@ -577,6 +573,9 @@ void QskTextInput::setReadOnly( bool on ) // we are killing user settings here ? input->setFlag( QQuickItem::ItemAcceptsInputMethod, !on ); qskUpdateInputMethod( this, Qt::ImEnabled ); +#if 0 + qskUpdateInputMethod( this, Qt::ImReadOnly ); // since 6.2 +#endif setSkinStateFlag( ReadOnly, on ); }