gestures: fix build when -DFEATURE_scrollarea=OFF
Pick-to: 6.7 6.5 Change-Id: I1c6089875024b2cb4e3787bf7dcc2f7e8e441bd2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 91bfa5531a92001f48863888e40a870aaba94602) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
633751f186
commit
36e5c45071
@ -6,7 +6,9 @@
|
|||||||
#include "qgesture_p.h"
|
#include "qgesture_p.h"
|
||||||
#include "qevent.h"
|
#include "qevent.h"
|
||||||
#include "qwidget.h"
|
#include "qwidget.h"
|
||||||
|
#if QT_CONFIG(scrollarea)
|
||||||
#include "qabstractscrollarea.h"
|
#include "qabstractscrollarea.h"
|
||||||
|
#endif
|
||||||
#if QT_CONFIG(graphicsview)
|
#if QT_CONFIG(graphicsview)
|
||||||
#include <qgraphicssceneevent.h>
|
#include <qgraphicssceneevent.h>
|
||||||
#endif
|
#endif
|
||||||
@ -24,7 +26,7 @@ static const qreal kSingleStepScaleMin = 0.1;
|
|||||||
QGesture *QPanGestureRecognizer::create(QObject *target)
|
QGesture *QPanGestureRecognizer::create(QObject *target)
|
||||||
{
|
{
|
||||||
if (target && target->isWidgetType()) {
|
if (target && target->isWidgetType()) {
|
||||||
#if (defined(Q_OS_MACOS) || defined(Q_OS_WIN)) && !defined(QT_NO_NATIVE_GESTURES)
|
#if (defined(Q_OS_MACOS) || defined(Q_OS_WIN)) && !defined(QT_NO_NATIVE_GESTURES) && QT_CONFIG(scrollarea)
|
||||||
// for scroll areas on Windows and OS X we want to use native gestures instead
|
// for scroll areas on Windows and OS X we want to use native gestures instead
|
||||||
if (!qobject_cast<QAbstractScrollArea *>(target->parent()))
|
if (!qobject_cast<QAbstractScrollArea *>(target->parent()))
|
||||||
static_cast<QWidget *>(target)->setAttribute(Qt::WA_AcceptTouchEvents);
|
static_cast<QWidget *>(target)->setAttribute(Qt::WA_AcceptTouchEvents);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user