From 7322f431cc088075a6c0380f54866323824279de Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Wed, 25 Oct 2017 07:48:10 +0200 Subject: [PATCH] QskRangeControl::setReadOnly fixed --- src/controls/QskRangeControl.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/controls/QskRangeControl.cpp b/src/controls/QskRangeControl.cpp index 4c08dbc7..efd3fb11 100644 --- a/src/controls/QskRangeControl.cpp +++ b/src/controls/QskRangeControl.cpp @@ -34,8 +34,8 @@ QskRangeControl::QskRangeControl( QQuickItem* parent ): QskControl( parent ), m_data( new PrivateData() ) { - setAcceptedMouseButtons( Qt::LeftButton ); - setWheelEnabled( true ); + m_data->readOnly = true; + setReadOnly( false ); } QskRangeControl::~QskRangeControl() @@ -219,11 +219,13 @@ void QskRangeControl::setReadOnly( bool readOnly ) if ( m_data->readOnly == readOnly ) return; + m_data->readOnly = readOnly; + // we are killing user settings here !! - setFocusPolicy( m_data->readOnly ? Qt::NoFocus : Qt::StrongFocus ); + setFocusPolicy( readOnly ? Qt::NoFocus : Qt::StrongFocus ); + setAcceptedMouseButtons( readOnly ? Qt::NoButton : Qt::LeftButton ); setWheelEnabled( m_data->readOnly ); - m_data->readOnly = readOnly; Q_EMIT readOnlyChanged( readOnly ); }