Pages
API Documentation
On this page

KTwoFingerSwipeRecognizer Class

The recognizer for a two finger swipe gesture. More...

  • Header: #include <KTwoFingerSwipe>
  • CMake: find_package(KF6 REQUIRED COMPONENTS WidgetsAddons)
    target_link_libraries(mytarget PRIVATE KF6::WidgetsAddons)
  • Inherits: QGestureRecognizer

List of all members, including inherited members

Public Functions

Detailed Description

Provides the recognizer for a two finger swipe gesture. To adjust the maximum swipe time and the minimum swipe distance, for a valid swipe gesture:

See also setMaxSwipeTime, setSwipeDistance

Member Function Documentation

KTwoFingerSwipeRecognizer::KTwoFingerSwipeRecognizer()

The constructor.

[override virtual] QGesture *KTwoFingerSwipeRecognizer::create(QObject *target)

Reimplements: QGestureRecognizer::create(QObject *target).

Qt called this member to create a new QGesture object.

target The target for the gesture.

Returns the new QGesture object.

int KTwoFingerSwipeRecognizer::maxSwipeTime() const

Returns the maximum duration for the swipe gesture, in milliseconds.

See also setMaxSwipeTime()

int KTwoFingerSwipeRecognizer::minSswipeDistance() const

Returns the minimum distance for the swipe gesture.

[override virtual] QGestureRecognizer::Result KTwoFingerSwipeRecognizer::recognize(QGesture *gesture, QObject *watched, QEvent *event)

Reimplements: QGestureRecognizer::recognize(QGesture *gesture, QObject *watched, QEvent *event).

Handles the given event for the watched object and update the gesture object.

gesture The gesture object.

watched The watched object.

event The event.

Returns the result reflects how much of the gesture has been recognized.

void KTwoFingerSwipeRecognizer::setMaxSwipeTime(int i)

Set the maximum duration of the swipe gesture. If i is negative, it will be set to null.

i The maximum duration in milliseconds.

See also maxSwipeTime()

void KTwoFingerSwipeRecognizer::setSwipeDistance(int i)

Set the minimum distance of the swipe gesture. If i is negative, it will be set to null.

i The minimum distance.

We use cookies to personalize content and to analyze our traffic. Please decide if you are willing to accept cookies from our website.