workaround for Qt 5/6 QMouseEvent incompatabilities
This commit is contained in:
parent
bf4fbaa905
commit
0c37453d5f
@ -45,6 +45,24 @@ int qskFocusChainIncrement( const QEvent* event )
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QPointF qskMousePosition( const QMouseEvent* event )
|
||||||
|
{
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK( 6, 0, 0 )
|
||||||
|
return event->position();
|
||||||
|
#else
|
||||||
|
return event->localPos();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
QPointF qskMouseScenePosition( const QMouseEvent* event )
|
||||||
|
{
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK( 6, 0, 0 )
|
||||||
|
return event->scenePosition();
|
||||||
|
#else
|
||||||
|
return event->windowPos();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
QskEvent::QskEvent( QskEvent::Type type )
|
QskEvent::QskEvent( QskEvent::Type type )
|
||||||
: QEvent( static_cast< QEvent::Type >( type ) )
|
: QEvent( static_cast< QEvent::Type >( type ) )
|
||||||
{
|
{
|
||||||
|
@ -15,6 +15,7 @@ class QskGesture;
|
|||||||
class QskPopup;
|
class QskPopup;
|
||||||
class QQuickWindow;
|
class QQuickWindow;
|
||||||
class QQuickItem;
|
class QQuickItem;
|
||||||
|
class QMouseEvent;
|
||||||
|
|
||||||
class QSK_EXPORT QskEvent : public QEvent
|
class QSK_EXPORT QskEvent : public QEvent
|
||||||
{
|
{
|
||||||
@ -119,4 +120,8 @@ class QSK_EXPORT QskAnimatorEvent : public QskEvent
|
|||||||
|
|
||||||
QSK_EXPORT int qskFocusChainIncrement( const QEvent* );
|
QSK_EXPORT int qskFocusChainIncrement( const QEvent* );
|
||||||
|
|
||||||
|
// some helper to work around Qt version incompatibilities
|
||||||
|
QSK_EXPORT QPointF qskMouseScenePosition( const QMouseEvent* );
|
||||||
|
QSK_EXPORT QPointF qskMousePosition( const QMouseEvent* );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user