QskRangeControl::setReadOnly fixed

This commit is contained in:
Uwe Rathmann 2017-10-25 07:48:10 +02:00
parent 2c0733182a
commit 7322f431cc
1 changed files with 6 additions and 4 deletions

View File

@ -34,8 +34,8 @@ QskRangeControl::QskRangeControl( QQuickItem* parent ):
QskControl( parent ), QskControl( parent ),
m_data( new PrivateData() ) m_data( new PrivateData() )
{ {
setAcceptedMouseButtons( Qt::LeftButton ); m_data->readOnly = true;
setWheelEnabled( true ); setReadOnly( false );
} }
QskRangeControl::~QskRangeControl() QskRangeControl::~QskRangeControl()
@ -219,11 +219,13 @@ void QskRangeControl::setReadOnly( bool readOnly )
if ( m_data->readOnly == readOnly ) if ( m_data->readOnly == readOnly )
return; return;
m_data->readOnly = readOnly;
// we are killing user settings here !! // 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 ); setWheelEnabled( m_data->readOnly );
m_data->readOnly = readOnly;
Q_EMIT readOnlyChanged( readOnly ); Q_EMIT readOnlyChanged( readOnly );
} }