diff --git a/src/controls/QskBoundedInput.cpp b/src/controls/QskBoundedInput.cpp index 9f882e42..2139ff6a 100644 --- a/src/controls/QskBoundedInput.cpp +++ b/src/controls/QskBoundedInput.cpp @@ -161,6 +161,9 @@ void QskBoundedInput::setReadOnly( bool readOnly ) setWheelEnabled( !readOnly ); Q_EMIT readOnlyChanged( readOnly ); + + QEvent event( QEvent::ReadOnlyChange ); + QCoreApplication::sendEvent( this, &event ); } bool QskBoundedInput::isReadOnly() const diff --git a/src/controls/QskBoundedInput.h b/src/controls/QskBoundedInput.h index 8ccdf6d4..e1154a01 100644 --- a/src/controls/QskBoundedInput.h +++ b/src/controls/QskBoundedInput.h @@ -56,7 +56,7 @@ class QSK_EXPORT QskBoundedInput : public QskBoundedControl void readOnlyChanged( bool ); protected: - void keyPressEvent( QKeyEvent* event ) override; + void keyPressEvent( QKeyEvent* ) override; #ifndef QT_NO_WHEELEVENT void wheelEvent( QWheelEvent* ) override; diff --git a/src/controls/QskTextInput.cpp b/src/controls/QskTextInput.cpp index a00be277..6cd22859 100644 --- a/src/controls/QskTextInput.cpp +++ b/src/controls/QskTextInput.cpp @@ -19,6 +19,14 @@ QSK_SUBCONTROL( QskTextInput, TextSelected ) QSK_SYSTEM_STATE( QskTextInput, ReadOnly, QskAspect::FirstSystemState << 1 ) QSK_SYSTEM_STATE( QskTextInput, Editing, QskAspect::FirstSystemState << 2 ) +static inline void qskPropagateReadOnly( QskTextInput* input ) +{ + Q_EMIT input->readOnlyChanged( input->isReadOnly() ); + + QEvent event( QEvent::ReadOnlyChange ); + QCoreApplication::sendEvent( input, &event ); +} + static inline void qskBindSignals( const QQuickTextInput* wrappedInput, QskTextInput* input ) { @@ -37,7 +45,7 @@ static inline void qskBindSignals( input, &QskTextInput::inputMaskChanged ); QObject::connect( wrappedInput, &QQuickTextInput::readOnlyChanged, - input, &QskTextInput::readOnlyChanged ); + input, [ input ] { qskPropagateReadOnly( input ); } ); #if QT_VERSION >= QT_VERSION_CHECK( 5, 8, 0 ) QObject::connect( wrappedInput, &QQuickTextInput::overwriteModeChanged,