Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquickwheelhandler_p.h
Go to the documentation of this file.
1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QQUICKWHEELHANDLER_H
5#define QQUICKWHEELHANDLER_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtGui/qevent.h>
19#include <QtQuick/qquickitem.h>
20
22
24
27
28class Q_QUICK_EXPORT QQuickWheelHandler : public QQuickSinglePointHandler
29{
31 Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged)
32 Q_PROPERTY(bool invertible READ isInvertible WRITE setInvertible NOTIFY invertibleChanged)
33 Q_PROPERTY(qreal activeTimeout READ activeTimeout WRITE setActiveTimeout NOTIFY activeTimeoutChanged)
34 Q_PROPERTY(qreal rotation READ rotation WRITE setRotation NOTIFY rotationChanged)
35 Q_PROPERTY(qreal rotationScale READ rotationScale WRITE setRotationScale NOTIFY rotationScaleChanged)
36 Q_PROPERTY(QString property READ property WRITE setProperty NOTIFY propertyChanged)
37 Q_PROPERTY(qreal targetScaleMultiplier READ targetScaleMultiplier WRITE setTargetScaleMultiplier NOTIFY targetScaleMultiplierChanged)
38 Q_PROPERTY(bool targetTransformAroundCursor READ isTargetTransformAroundCursor WRITE setTargetTransformAroundCursor NOTIFY targetTransformAroundCursorChanged)
39 Q_PROPERTY(bool blocking READ isBlocking WRITE setBlocking NOTIFY blockingChanged REVISION(6, 3))
40
41 QML_NAMED_ELEMENT(WheelHandler)
43
44public:
45 explicit QQuickWheelHandler(QQuickItem *parent = nullptr);
46
47 Qt::Orientation orientation() const;
48 void setOrientation(Qt::Orientation orientation);
49
50 bool isInvertible() const;
51 void setInvertible(bool invertible);
52
53 qreal activeTimeout() const;
54 void setActiveTimeout(qreal timeout);
55
56 qreal rotation() const;
57 void setRotation(qreal rotation);
58
59 qreal rotationScale() const;
60 void setRotationScale(qreal rotationScale);
61
62 QString property() const;
63 void setProperty(const QString &name);
64
65 qreal targetScaleMultiplier() const;
66 void setTargetScaleMultiplier(qreal targetScaleMultiplier);
67
68 bool isTargetTransformAroundCursor() const;
69 void setTargetTransformAroundCursor(bool ttac);
70
71 bool isBlocking() const;
72 void setBlocking(bool blocking);
73
75 void wheel(QQuickWheelEvent *event);
76
77 void orientationChanged();
78 void invertibleChanged();
79 void activeTimeoutChanged();
80 void rotationChanged();
81 void rotationScaleChanged();
82 void propertyChanged();
83 void targetScaleMultiplierChanged();
84 void targetTransformAroundCursorChanged();
85 Q_REVISION(6, 3) void blockingChanged();
86
87protected:
88 bool wantsPointerEvent(QPointerEvent *event) override;
89 void handleEventPoint(QPointerEvent *event, QEventPoint &point) override;
90 void onTargetChanged(QQuickItem *oldTarget) override;
91 void onActiveChanged() override;
92 void timerEvent(QTimerEvent *event) override;
93
94 Q_DECLARE_PRIVATE(QQuickWheelHandler)
95};
96
98
99#endif // QQUICKWHEELHANDLER_H
The QEventPoint class provides information about a point in a QPointerEvent.
Definition qeventpoint.h:20
A base class for pointer events.
Definition qevent.h:73
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
\qmlproperty real QtQuick::MouseEvent::x \qmlproperty real QtQuick::MouseEvent::y
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qcoreevent.h:366
Combined button and popup list for selecting options.
Definition qcompare.h:63
Orientation
Definition qnamespace.h:98
GLbitfield GLuint64 timeout
[4]
GLuint name
struct _cl_event * event
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_REVISION(...)
#define Q_SIGNALS
double qreal
Definition qtypes.h:187
const char property[13]
Definition qwizard.cpp:101
#define explicit
args<< 1<< 2;QJSValue threeAgain=fun.call(args);QString fileName="helloworld.qs";QFile scriptFile(fileName);if(!scriptFile.open(QIODevice::ReadOnly)) QTextStream stream(&scriptFile);QString contents=stream.readAll();scriptFile.close();myEngine.evaluate(contents, fileName);myEngine.globalObject().setProperty("myNumber", 123);...QJSValue myNumberPlusOne=myEngine.evaluate("myNumber + 1");QJSValue result=myEngine.evaluate(...);if(result.isError()) qDebug()<< "Uncaught exception at line"<< result.property("lineNumber").toInt()<< ":"<< result.toString();QPushButton *button=new QPushButton;QJSValue scriptButton=myEngine.newQObject(button);myEngine.globalObject().setProperty("button", scriptButton);myEngine.evaluate("button.checkable = true");qDebug()<< scriptButton.property("checkable").toBool();scriptButton.property("show").call();QJSEngine engine;QObject *myQObject=new QObject();myQObject- setProperty)("dynamicProperty", 3)