text vw displayText to support text prediction
This commit is contained in:
parent
0ac9ad4387
commit
6c9cbcad62
@ -33,6 +33,9 @@ static inline void qskBindSignals(
|
|||||||
QObject::connect( wrappedInput, &QQuickTextInput::textChanged,
|
QObject::connect( wrappedInput, &QQuickTextInput::textChanged,
|
||||||
input, [ input ] { Q_EMIT input->textChanged( input->text() ); } );
|
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 )
|
#if QT_VERSION >= QT_VERSION_CHECK( 5, 9, 0 )
|
||||||
QObject::connect( wrappedInput, &QQuickTextInput::textEdited,
|
QObject::connect( wrappedInput, &QQuickTextInput::textEdited,
|
||||||
input, [ input ] { Q_EMIT input->textEdited( input->text() ); } );
|
input, [ input ] { Q_EMIT input->textEdited( input->text() ); } );
|
||||||
@ -106,7 +109,7 @@ namespace
|
|||||||
|
|
||||||
if ( d->m_validator )
|
if ( d->m_validator )
|
||||||
{
|
{
|
||||||
QString text = d->m_text;
|
QString text = displayText();
|
||||||
int pos = d->m_cursor;
|
int pos = d->m_cursor;
|
||||||
|
|
||||||
const auto state = d->m_validator->validate( text, pos );
|
const auto state = d->m_validator->validate( text, pos );
|
||||||
|
@ -161,6 +161,7 @@ class QSK_EXPORT QskTextInput : public QskControl
|
|||||||
void readOnlyChanged( bool );
|
void readOnlyChanged( bool );
|
||||||
|
|
||||||
void textChanged( const QString& );
|
void textChanged( const QString& );
|
||||||
|
void displayTextChanged( const QString& );
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 9, 0 )
|
#if QT_VERSION >= QT_VERSION_CHECK( 5, 9, 0 )
|
||||||
void textEdited( const QString& );
|
void textEdited( const QString& );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user