text vw displayText to support text prediction

This commit is contained in:
Uwe Rathmann 2021-03-02 16:17:56 +01:00
parent 0ac9ad4387
commit 6c9cbcad62
2 changed files with 5 additions and 1 deletions

View File

@ -33,6 +33,9 @@ static inline void qskBindSignals(
QObject::connect( wrappedInput, &QQuickTextInput::textChanged,
input, [ input ] { Q_EMIT input->textChanged( input->text() ); } );
QObject::connect( wrappedInput, &QQuickTextInput::displayTextChanged,
input, [ input ] { Q_EMIT input->displayTextChanged( input->displayText() ); } );
#if QT_VERSION >= QT_VERSION_CHECK( 5, 9, 0 )
QObject::connect( wrappedInput, &QQuickTextInput::textEdited,
input, [ input ] { Q_EMIT input->textEdited( input->text() ); } );
@ -106,7 +109,7 @@ namespace
if ( d->m_validator )
{
QString text = d->m_text;
QString text = displayText();
int pos = d->m_cursor;
const auto state = d->m_validator->validate( text, pos );

View File

@ -161,6 +161,7 @@ class QSK_EXPORT QskTextInput : public QskControl
void readOnlyChanged( bool );
void textChanged( const QString& );
void displayTextChanged( const QString& );
#if QT_VERSION >= QT_VERSION_CHECK( 5, 9, 0 )
void textEdited( const QString& );