don't handle touch events, otherwise we miss the synthesized mouse event
This commit is contained in:
parent
e552788a08
commit
ec101b7d56
|
@ -157,16 +157,6 @@ bool QskInputGrabber::event( QEvent* event )
|
||||||
doBlock = isBlocking( ev->localPos() );
|
doBlock = isBlocking( ev->localPos() );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case QEvent::TouchBegin:
|
|
||||||
case QEvent::TouchUpdate:
|
|
||||||
case QEvent::TouchCancel:
|
|
||||||
{
|
|
||||||
#if 1
|
|
||||||
// TODO
|
|
||||||
doBlock = true;
|
|
||||||
#endif
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case QEvent::Wheel:
|
case QEvent::Wheel:
|
||||||
{
|
{
|
||||||
const auto ev = static_cast< QWheelEvent* > ( event );
|
const auto ev = static_cast< QWheelEvent* > ( event );
|
||||||
|
|
|
@ -65,8 +65,7 @@ namespace
|
||||||
{
|
{
|
||||||
bool ok = Inherited::event( event );
|
bool ok = Inherited::event( event );
|
||||||
|
|
||||||
if ( event->type() == QEvent::MouseButtonPress
|
if ( event->type() == QEvent::MouseButtonPress )
|
||||||
|| event->type() == QEvent::TouchBegin )
|
|
||||||
{
|
{
|
||||||
if ( auto popup = static_cast< QskPopup* >( parentItem() ) )
|
if ( auto popup = static_cast< QskPopup* >( parentItem() ) )
|
||||||
{
|
{
|
||||||
|
@ -167,7 +166,8 @@ QRectF QskPopup::overlayRect() const
|
||||||
|
|
||||||
void QskPopup::updateInputGrabber()
|
void QskPopup::updateInputGrabber()
|
||||||
{
|
{
|
||||||
if ( isVisible() && ( isModal() || testPopupFlag( CloseOnPressOutside ) ) )
|
if ( parentItem() && isVisible()
|
||||||
|
&& ( isModal() || testPopupFlag( CloseOnPressOutside ) ) )
|
||||||
{
|
{
|
||||||
if ( m_data->inputGrabber == nullptr )
|
if ( m_data->inputGrabber == nullptr )
|
||||||
{
|
{
|
||||||
|
@ -303,10 +303,6 @@ bool QskPopup::event( QEvent* event )
|
||||||
case QEvent::MouseMove:
|
case QEvent::MouseMove:
|
||||||
case QEvent::MouseButtonRelease:
|
case QEvent::MouseButtonRelease:
|
||||||
|
|
||||||
case QEvent::TouchBegin:
|
|
||||||
case QEvent::TouchCancel:
|
|
||||||
case QEvent::TouchUpdate:
|
|
||||||
|
|
||||||
case QEvent::HoverEnter:
|
case QEvent::HoverEnter:
|
||||||
case QEvent::HoverLeave:
|
case QEvent::HoverLeave:
|
||||||
{
|
{
|
||||||
|
@ -319,6 +315,14 @@ bool QskPopup::event( QEvent* event )
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
Don't accept touch events otherwise we don't receive the
|
||||||
|
synthesized mouse events and need to handle both type of
|
||||||
|
events from now on.
|
||||||
|
But by accepting the mouse event propagation of the touch
|
||||||
|
events also stops.
|
||||||
|
*/
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue