MouseUngrab added
This commit is contained in:
parent
73610cdb61
commit
2a2793422f
@ -207,12 +207,22 @@ void QskRadioBox::mousePressEvent( QMouseEvent* event )
|
||||
update();
|
||||
}
|
||||
|
||||
void QskRadioBox::mouseUngrabEvent()
|
||||
{
|
||||
if ( m_data->pressedIndex >= 0 )
|
||||
{
|
||||
m_data->pressedIndex = -1;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void QskRadioBox::mouseReleaseEvent( QMouseEvent* event )
|
||||
{
|
||||
const auto index = indexAt( qskMousePosition( event ) );
|
||||
if( index == m_data->pressedIndex )
|
||||
setSelectedIndex( index );
|
||||
|
||||
m_data->pressedIndex = -1;
|
||||
update();
|
||||
}
|
||||
|
||||
@ -247,6 +257,9 @@ int QskRadioBox::indexAt( const QPointF& pos ) const
|
||||
|
||||
void QskRadioBox::setFocusedIndex( int index )
|
||||
{
|
||||
if ( m_data->focusedIndex == index )
|
||||
return;
|
||||
|
||||
m_data->focusedIndex = index;
|
||||
setPositionHint( Ripple, index );
|
||||
|
||||
|
@ -53,6 +53,7 @@ class QSK_EXPORT QskRadioBox : public QskControl
|
||||
|
||||
void mousePressEvent( QMouseEvent* ) override;
|
||||
void mouseReleaseEvent( QMouseEvent* ) override;
|
||||
void mouseUngrabEvent() override;
|
||||
|
||||
void focusInEvent( QFocusEvent* ) override;
|
||||
void focusOutEvent( QFocusEvent* ) override;
|
||||
|
Loading…
x
Reference in New Issue
Block a user