![]() |
Qt 6.x
The Qt SDK
|
#include <qquickwheelhandler_p.h>
Public Member Functions | |
QQuickWheelHandler (QQuickItem *parent=nullptr) | |
\qmltype WheelHandler \instantiates QQuickWheelHandler \inherits SinglePointHandler \inqmlmodule QtQuick | |
Qt::Orientation | orientation () const |
\qmlproperty enumeration QtQuick::WheelHandler::orientation | |
void | setOrientation (Qt::Orientation orientation) |
bool | isInvertible () const |
\qmlproperty bool QtQuick::WheelHandler::invertible | |
void | setInvertible (bool invertible) |
qreal | activeTimeout () const |
\qmlproperty real QtQuick::WheelHandler::activeTimeout | |
void | setActiveTimeout (qreal timeout) |
qreal | rotation () const |
\qmlproperty real QtQuick::WheelHandler::rotation | |
void | setRotation (qreal rotation) |
qreal | rotationScale () const |
\qmlproperty real QtQuick::WheelHandler::rotationScale | |
void | setRotationScale (qreal rotationScale) |
QString | property () const |
\qmlproperty string QtQuick::WheelHandler::property | |
void | setProperty (const QString &name) |
qreal | targetScaleMultiplier () const |
\qmlproperty real QtQuick::WheelHandler::targetScaleMultiplier | |
void | setTargetScaleMultiplier (qreal targetScaleMultiplier) |
bool | isTargetTransformAroundCursor () const |
\qmlproperty bool QtQuick::WheelHandler::targetTransformAroundCursor | |
void | setTargetTransformAroundCursor (bool ttac) |
bool | isBlocking () const |
\qmlproperty bool QtQuick::WheelHandler::blocking | |
void | setBlocking (bool blocking) |
![]() | |
QQuickSinglePointHandler (QQuickItem *parent=nullptr) | |
\qmltype SinglePointHandler \qmlabstract \preliminary \instantiates QQuickSinglePointHandler \inherits PointerDeviceHandler \inqmlmodule QtQuick | |
QQuickHandlerPoint | point () const |
![]() | |
QQuickPointerDeviceHandler (QQuickItem *parent=nullptr) | |
\qmltype PointerDeviceHandler \qmlabstract | |
QInputDevice::DeviceTypes | acceptedDevices () const |
QPointingDevice::PointerTypes | acceptedPointerTypes () const |
Qt::MouseButtons | acceptedButtons () const |
\qmlproperty flags QtQuick::PointerDeviceHandler::acceptedButtons | |
Qt::KeyboardModifiers | acceptedModifiers () const |
![]() | |
QQuickPointerHandler (QQuickItem *parent=nullptr) | |
\qmltype PointerHandler \qmlabstract | |
~QQuickPointerHandler () | |
bool | enabled () const |
\qmlproperty bool QtQuick::PointerHandler::enabled | |
void | setEnabled (bool enabled) |
bool | active () const |
\readonly \qmlproperty bool QtQuick::PointerHandler::active | |
QQuickItem * | target () const |
\qmlproperty Item QtQuick::PointerHandler::target | |
void | setTarget (QQuickItem *target) |
QQuickItem * | parentItem () const |
\qmlproperty Item QtQuick::PointerHandler::parent | |
void | setParentItem (QQuickItem *p) |
void | handlePointerEvent (QPointerEvent *event) |
GrabPermissions | grabPermissions () const |
\qmlproperty flags QtQuick::PointerHandler::grabPermissions | |
void | setGrabPermissions (GrabPermissions grabPermissions) |
qreal | margin () const |
\qmlproperty real PointerHandler::margin | |
void | setMargin (qreal pointDistanceThreshold) |
int | dragThreshold () const |
\qmlproperty int PointerHandler::dragThreshold | |
void | setDragThreshold (int t) |
void | resetDragThreshold () |
![]() | |
Q_INVOKABLE | QObject (QObject *parent=nullptr) |
Constructs an object with parent object parent. | |
virtual | ~QObject () |
Destroys the object, deleting all its child objects. | |
virtual bool | event (QEvent *event) |
This virtual function receives events to an object and should return true if the event e was recognized and processed. | |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
Filters events if this object has been installed as an event filter for the watched object. | |
QString | objectName () const |
Q_WEAK_OVERLOAD void | setObjectName (const QString &name) |
Sets the object's name to name. | |
void | setObjectName (QAnyStringView name) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
QBindable< QString > | bindableObjectName () |
bool | isWidgetType () const |
Returns true if the object is a widget; otherwise returns false . | |
bool | isWindowType () const |
Returns true if the object is a window; otherwise returns false . | |
bool | isQuickItemType () const |
Returns true if the object is a QQuickItem; otherwise returns false . | |
bool | signalsBlocked () const noexcept |
Returns true if signals are blocked; otherwise returns false . | |
bool | blockSignals (bool b) noexcept |
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). | |
QThread * | thread () const |
Returns the thread in which the object lives. | |
void | moveToThread (QThread *thread) |
Changes the thread affinity for this object and its children. | |
int | startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer) |
This is an overloaded function that will start a timer of type timerType and a timeout of interval milliseconds. | |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType=Qt::CoarseTimer) |
void | killTimer (int id) |
Kills the timer with timer identifier, id. | |
template<typename T > | |
T | findChild (const QString &aName=QString(), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
Returns the child of this object that can be cast into type T and that is called name, or \nullptr if there is no such object. | |
template<typename T > | |
QList< T > | findChildren (const QString &aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. | |
template<typename T > | |
QList< T > | findChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
const QObjectList & | children () const |
Returns a list of child objects. | |
void | setParent (QObject *parent) |
Makes the object a child of parent. | |
void | installEventFilter (QObject *filterObj) |
Installs an event filter filterObj on this object. | |
void | removeEventFilter (QObject *obj) |
Removes an event filter object obj from this object. | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const |
bool | disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const |
bool | disconnect (const QObject *receiver, const char *member=nullptr) const |
void | dumpObjectTree () const |
Dumps a tree of children to the debug output. | |
void | dumpObjectInfo () const |
Dumps information about signal connections, etc. | |
bool | setProperty (const char *name, const QVariant &value) |
Sets the value of the object's name property to value. | |
bool | setProperty (const char *name, QVariant &&value) |
QVariant | property (const char *name) const |
Returns the value of the object's name property. | |
QList< QByteArray > | dynamicPropertyNames () const |
QBindingStorage * | bindingStorage () |
const QBindingStorage * | bindingStorage () const |
QObject * | parent () const |
Returns a pointer to the parent object. | |
bool | inherits (const char *classname) const |
Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false . | |
![]() | |
QQmlParserStatus () | |
virtual | ~QQmlParserStatus () |
virtual void | classBegin ()=0 |
Invoked after class creation, but before any properties have been set. | |
virtual void | componentComplete ()=0 |
Invoked after the root component that caused this instantiation has completed construction. | |
Protected Member Functions | |
bool | wantsPointerEvent (QPointerEvent *event) override |
It is the responsibility of this function to decide whether the event could be relevant at all to this handler, as a preliminary check. | |
void | handleEventPoint (QPointerEvent *event, QEventPoint &point) override |
void | onTargetChanged (QQuickItem *oldTarget) override |
void | onActiveChanged () override |
void | timerEvent (QTimerEvent *event) override |
This event handler can be reimplemented in a subclass to receive timer events for the object. | |
![]() | |
QQuickSinglePointHandler (QQuickSinglePointHandlerPrivate &dd, QQuickItem *parent) | |
bool | wantsPointerEvent (QPointerEvent *event) override |
It is the responsibility of this function to decide whether the event could be relevant at all to this handler, as a preliminary check. | |
void | handlePointerEventImpl (QPointerEvent *event) override |
This function can be overridden to implement whatever behavior a specific subclass is intended to have: | |
virtual void | handleEventPoint (QPointerEvent *event, QEventPoint &point) |
QEventPoint & | currentPoint (QPointerEvent *ev) |
void | onGrabChanged (QQuickPointerHandler *grabber, QPointingDevice::GrabTransition transition, QPointerEvent *event, QEventPoint &point) override |
Notification that the grab has changed in some way which is relevant to this handler. | |
void | setIgnoreAdditionalPoints (bool v=true) |
void | moveTarget (QPointF pos, QEventPoint &point) |
void | setPointId (int id) |
![]() | |
QQuickPointerDeviceHandler (QQuickPointerDeviceHandlerPrivate &dd, QQuickItem *parent=nullptr) | |
bool | wantsPointerEvent (QPointerEvent *event) override |
It is the responsibility of this function to decide whether the event could be relevant at all to this handler, as a preliminary check. | |
![]() | |
QQuickPointerHandler (QQuickPointerHandlerPrivate &dd, QQuickItem *parent) | |
void | classBegin () override |
Overridden only because QQmlParserStatus requires it. | |
void | componentComplete () override |
Overridden from QQmlParserStatus to ensure that parentItem() sets its cursor if this handler's \l cursorShape property has been set. | |
bool | event (QEvent *) override |
QPointerEvent * | currentEvent () |
virtual bool | wantsPointerEvent (QPointerEvent *event) |
It is the responsibility of this function to decide whether the event could be relevant at all to this handler, as a preliminary check. | |
virtual bool | wantsEventPoint (const QPointerEvent *event, const QEventPoint &point) |
Returns true if the given point (as part of event) could be relevant at all to this handler, as a preliminary check. | |
virtual void | handlePointerEventImpl (QPointerEvent *event) |
This function can be overridden to implement whatever behavior a specific subclass is intended to have: | |
void | setActive (bool active) |
virtual void | onTargetChanged (QQuickItem *oldTarget) |
virtual void | onActiveChanged () |
virtual void | onGrabChanged (QQuickPointerHandler *grabber, QPointingDevice::GrabTransition transition, QPointerEvent *event, QEventPoint &point) |
Notification that the grab has changed in some way which is relevant to this handler. | |
virtual bool | canGrab (QPointerEvent *event, const QEventPoint &point) |
Check whether it's OK to take an exclusive grab of the point. | |
virtual bool | approveGrabTransition (QPointerEvent *event, const QEventPoint &point, QObject *proposedGrabber) |
Check this handler's rules to see if \l proposedGrabber will be allowed to take the exclusive grab. | |
void | setPassiveGrab (QPointerEvent *event, const QEventPoint &point, bool grab=true) |
Acquire or give up a passive grab of the given point, according to the grab state. | |
bool | setExclusiveGrab (QPointerEvent *ev, const QEventPoint &point, bool grab=true) |
Acquire or give up the exclusive grab of the given point, according to the grab state, and subject to the rules: canGrab(), and the rule not to relinquish another handler's grab. | |
void | cancelAllGrabs (QPointerEvent *event, QEventPoint &point) |
Cancel any existing grab of the given point. | |
QPointF | eventPos (const QEventPoint &point) const |
bool | parentContains (const QEventPoint &point) const |
Returns true if margin() > 0 and point is within the margin beyond QQuickItem::boundingRect(), or else returns QQuickItem::contains() QEventPoint::position() effectively (because parentContains(scenePosition) calls QQuickItem::mapFromScene()). | |
bool | parentContains (const QPointF &scenePosition) const |
Returns true if scenePosition is within the margin() beyond QQuickItem::boundingRect() (if margin > 0), or parentItem() contains scenePosition according to QQuickItem::contains(). | |
![]() | |
QObject * | sender () const |
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns \nullptr. | |
int | senderSignalIndex () const |
int | receivers (const char *signal) const |
Returns the number of receivers connected to the signal. | |
bool | isSignalConnected (const QMetaMethod &signal) const |
virtual void | timerEvent (QTimerEvent *event) |
This event handler can be reimplemented in a subclass to receive timer events for the object. | |
virtual void | childEvent (QChildEvent *event) |
This event handler can be reimplemented in a subclass to receive child events. | |
virtual void | customEvent (QEvent *event) |
This event handler can be reimplemented in a subclass to receive custom events. | |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
QObject (QObjectPrivate &dd, QObject *parent=nullptr) | |
Properties | |
Qt::Orientation | orientation |
bool | invertible |
qreal | activeTimeout |
qreal | rotation |
qreal | rotationScale |
QString | property |
qreal | targetScaleMultiplier |
bool | targetTransformAroundCursor |
bool | blocking |
![]() | |
QQuickHandlerPoint | point |
![]() | |
QInputDevice::DeviceTypes | acceptedDevices |
QPointingDevice::PointerTypes | acceptedPointerTypes |
Qt::MouseButtons | acceptedButtons |
Qt::KeyboardModifiers | acceptedModifiers |
![]() | |
bool | enabled |
bool | active |
QQuickItem * | target |
QQuickItem * | parent |
GrabPermissions | grabPermissions |
qreal | margin |
int | dragThreshold |
![]() | |
QString | objectName |
the name of this object | |
Additional Inherited Members | |
![]() | |
enum | GrabPermission { TakeOverForbidden = 0x0 , CanTakeOverFromHandlersOfSameType = 0x01 , CanTakeOverFromHandlersOfDifferentType = 0x02 , CanTakeOverFromItems = 0x04 , CanTakeOverFromAnything = 0x0F , ApprovesTakeOverByHandlersOfSameType = 0x10 , ApprovesTakeOverByHandlersOfDifferentType = 0x20 , ApprovesTakeOverByItems = 0x40 , ApprovesCancellation = 0x80 , ApprovesTakeOverByAnything = 0xF0 } |
![]() | |
void | setAcceptedDevices (QInputDevice::DeviceTypes acceptedDevices) |
\qmlproperty flags PointerDeviceHandler::acceptedDevices | |
void | setAcceptedPointerTypes (QPointingDevice::PointerTypes acceptedPointerTypes) |
\qmlproperty flags PointerDeviceHandler::acceptedPointerTypes | |
void | setAcceptedButtons (Qt::MouseButtons buttons) |
void | setAcceptedModifiers (Qt::KeyboardModifiers acceptedModifiers) |
\qmlproperty flags PointerDeviceHandler::acceptedModifiers | |
![]() | |
void | deleteLater () |
\threadsafe | |
![]() | |
static QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection) |
\threadsafe | |
static QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1 , typename Func2 > | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::ContextTypeForFunctor< Func2 >::ContextType *context, Func2 &&slot, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1 , typename Func2 > | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 &&slot) |
static bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member) |
\threadsafe | |
static bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member) |
static bool | disconnect (const QMetaObject::Connection &) |
Disconnect a connection. | |
template<typename Func1 , typename Func2 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot) |
template<typename Func1 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero) |
![]() | |
QScopedPointer< QObjectData > | d_ptr |
![]() | |
template< class T > T | qobject_cast (const QObject *object) |
Returns the given object cast to type T if the object is of type T (or of a subclass); otherwise returns \nullptr. | |
template< typename T > T | qFindChildqFindChildren (const QObject *obj, const QString &name)() |
template< typename T > QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QString &name)() |
QObjectList | |
\macro Q_CLASSINFO(Name, Value) | |
Definition at line 28 of file qquickwheelhandler_p.h.
|
explicit |
\qmltype WheelHandler \instantiates QQuickWheelHandler \inherits SinglePointHandler \inqmlmodule QtQuick
Handler for the mouse wheel.
WheelHandler is a handler that is used to interactively manipulate some numeric property of an Item as the user rotates the mouse wheel. Like other Input Handlers, by default it manipulates its \l {PointerHandler::target} {target}. Declare \l property to control which target property will be manipulated:
\l BoundaryRule is quite useful in combination with WheelHandler (as well as with other Input Handlers) to declare the allowed range of values that the target property can have. For example it is possible to implement scrolling using a combination of WheelHandler and \l DragHandler to manipulate the scrollable Item's \l{QQuickItem::y}{y} property when the user rotates the wheel or drags the item on a touchscreen, and \l BoundaryRule to limit the range of motion from the top to the bottom:
Alternatively, if \l property is not set or \l target is null, WheelHandler will not automatically manipulate anything; but the \l rotation property can be used in a binding to manipulate another property, or you can implement onWheel
and handle the wheel event directly.
WheelHandler handles only a rotating mouse wheel by default; this can be changed by setting acceptedDevices.
Definition at line 52 of file qquickwheelhandler.cpp.
References QInputDevice::Mouse.
qreal QQuickWheelHandler::activeTimeout | ( | ) | const |
\qmlproperty real QtQuick::WheelHandler::activeTimeout
The amount of time in seconds after which the \l active property will revert to false
if no more wheel events are received. The default is 0.1
(100 ms).
When WheelHandler handles events that contain \l {Qt::ScrollPhase}{scroll phase} information, such as events from some touchpads, the \l active property will become false
as soon as an event with phase \l Qt::ScrollEnd is received; in that case the timeout is not necessary. But a conventional mouse with a wheel does not provide a scroll phase: the mouse cannot detect when the user has decided to stop scrolling, so the \l active property transitions to false
after this much time has elapsed.
Definition at line 130 of file qquickwheelhandler.cpp.
References d.
|
signal |
|
overrideprotectedvirtual |
Reimplemented from QQuickSinglePointHandler.
Definition at line 375 of file qquickwheelhandler.cpp.
References QQuickItemPrivate::adjustedPosForTransform(), d, emit, QQuickItemPrivate::get(), QQuickSinglePointHandler::handleEventPoint(), Qt::Horizontal, Qt::NoScrollPhase, QObject::objectName, ok, orientation, QQuickSinglePointHandler::point, QQuickHandlerPoint::position, qCDebug, qPow(), qRound(), qWarning, rotationChanged(), QQuickHandlerPoint::scenePosition, Qt::ScrollBegin, Qt::ScrollEnd, Qt::ScrollMomentum, Qt::ScrollUpdate, QQuickPointerHandler::setActive(), QQuickPointerHandler::target, QEvent::type(), QEvent::Wheel, and wheel().
|
signal |
bool QQuickWheelHandler::isBlocking | ( | ) | const |
\qmlproperty bool QtQuick::WheelHandler::blocking
Whether this handler prevents other items or handlers behind it from handling the same wheel event. This property is true
by default.
Definition at line 329 of file qquickwheelhandler.cpp.
References d.
bool QQuickWheelHandler::isInvertible | ( | ) | const |
\qmlproperty bool QtQuick::WheelHandler::invertible
Whether or not to reverse the direction of property change if \l QWheelEvent::inverted is true
. The default is true
.
If the operating system has a "natural scrolling" setting that causes scrolling to be in the same direction as the finger movement, then if this property is set to true
, and WheelHandler is directly setting a property on \l target, the direction of movement will correspond to the system setting. If this property is set to false
, it will invert the \l rotation so that the direction of motion is always the same as the direction of finger movement.
Definition at line 96 of file qquickwheelhandler.cpp.
References d.
bool QQuickWheelHandler::isTargetTransformAroundCursor | ( | ) | const |
\qmlproperty bool QtQuick::WheelHandler::targetTransformAroundCursor
Whether the \l target should automatically be repositioned in such a way that it is transformed around the mouse cursor position while the \l property is adjusted. The default is true
.
If \l property is set to "rotation"
and \l targetTransformAroundCursor is true
, then as the wheel is rotated, the \l target item will rotate in place around the mouse cursor position. If targetTransformAroundCursor
is false
, it will rotate around its \l{QQuickItem::transformOrigin}{transformOrigin} instead.
Definition at line 306 of file qquickwheelhandler.cpp.
References d.
|
overrideprotectedvirtual |
Reimplemented from QQuickPointerHandler.
Definition at line 477 of file qquickwheelhandler.cpp.
References QQuickPointerHandler::active, and d.
|
overrideprotectedvirtual |
Reimplemented from QQuickPointerHandler.
Definition at line 470 of file qquickwheelhandler.cpp.
Qt::Orientation QQuickWheelHandler::orientation | ( | ) | const |
\qmlproperty enumeration QtQuick::WheelHandler::orientation
Which wheel to react to. The default is Qt.Vertical
.
Not every mouse has a Horizontal
wheel; sometimes it is emulated by tilting the wheel sideways. A touchpad can usually generate both vertical and horizontal wheel events.
Definition at line 67 of file qquickwheelhandler.cpp.
References d.
|
signal |
QString QQuickWheelHandler::property | ( | ) | const |
\qmlproperty string QtQuick::WheelHandler::property
The property to be modified on the \l target when the mouse wheel is rotated.
The default is no property (empty string). When no target property is being automatically modified, you can use bindings to react to mouse wheel rotation in arbitrary ways.
You can use the mouse wheel to adjust any numeric property. For example if property
is set to x
, the \l target will move horizontally as the wheel is rotated. The following properties have special behavior:
\value scale \l{QQuickItem::scale}{scale} will be modified in a non-linear fashion as described under \l targetScaleMultiplier. If \l targetTransformAroundCursor is true
, the \l{QQuickItem::x}{x} and \l{QQuickItem::y}{y} properties will be simultaneously adjusted so that the user will effectively zoom into or out of the point under the mouse cursor. \value rotation \l{QQuickItem::rotation}{rotation} will be set to \l rotation. If \l targetTransformAroundCursor is true
, the l{QQuickItem::x}{x} and \l{QQuickItem::y}{y} properties will be simultaneously adjusted so that the user will effectively rotate the item around the point under the mouse cursor.
The adjustment of the given target property is always scaled by \l rotationScale.
Definition at line 242 of file qquickwheelhandler.cpp.
References d.
|
signal |
|
signal |
qreal QQuickWheelHandler::rotation | ( | ) | const |
\qmlproperty real QtQuick::WheelHandler::rotation
The angle through which the mouse wheel has been rotated since the last time this property was set, in wheel degrees.
A positive value indicates that the wheel was rotated up/right; a negative value indicates that the wheel was rotated down/left.
A basic mouse click-wheel works in steps of 15 degrees.
The default is 0
at startup. It can be programmatically set to any value at any time. The value will be adjusted from there as the user rotates the mouse wheel.
Definition at line 168 of file qquickwheelhandler.cpp.
References d.
|
signal |
qreal QQuickWheelHandler::rotationScale | ( | ) | const |
\qmlproperty real QtQuick::WheelHandler::rotationScale
The scaling to be applied to the \l rotation property, and to the \l property on the \l target item, if any. The default is 1, such that \l rotation will be in units of degrees of rotation. It can be set to a negative number to invert the effect of the direction of mouse wheel rotation.
Definition at line 193 of file qquickwheelhandler.cpp.
References d.
|
signal |
Definition at line 136 of file qquickwheelhandler.cpp.
References activeTimeoutChanged(), d, emit, qFuzzyCompare(), and qWarning.
void QQuickWheelHandler::setBlocking | ( | bool | blocking | ) |
Definition at line 335 of file qquickwheelhandler.cpp.
void QQuickWheelHandler::setInvertible | ( | bool | invertible | ) |
Definition at line 102 of file qquickwheelhandler.cpp.
References d, emit, invertible, and invertibleChanged().
void QQuickWheelHandler::setOrientation | ( | Qt::Orientation | orientation | ) |
Definition at line 73 of file qquickwheelhandler.cpp.
References d, emit, orientation, and orientationChanged().
Definition at line 248 of file qquickwheelhandler.cpp.
References d, emit, and propertyChanged().
Definition at line 174 of file qquickwheelhandler.cpp.
References d, emit, qFuzzyCompare(), rotation, and rotationChanged().
Definition at line 199 of file qquickwheelhandler.cpp.
References d, emit, qFuzzyCompare(), qFuzzyIsNull(), qWarning, rotationScale, and rotationScaleChanged().
Definition at line 283 of file qquickwheelhandler.cpp.
References d, emit, qFuzzyCompare(), targetScaleMultiplier, and targetScaleMultiplierChanged().
void QQuickWheelHandler::setTargetTransformAroundCursor | ( | bool | ttac | ) |
Definition at line 312 of file qquickwheelhandler.cpp.
References d, emit, and targetTransformAroundCursorChanged().
qreal QQuickWheelHandler::targetScaleMultiplier | ( | ) | const |
\qmlproperty real QtQuick::WheelHandler::targetScaleMultiplier
The amount by which the \l target \l{QQuickItem::scale}{scale} is to be multiplied whenever the \l rotation changes by 15 degrees. This is relevant only when \l property is "scale"
.
The scale
will be multiplied by targetScaleMultiplier
\sup {angleDelta * rotationScale / 15}. The default is 2
\sup {1/3}, which means that if \l rotationScale is left at its default value, and the mouse wheel is rotated by one "click" (15 degrees), the \l target will be scaled by approximately 1.25; after three "clicks" its size will be doubled or halved, depending on the direction that the wheel is rotated. If you want to make it double or halve with every 2 clicks of the wheel, set this to 2
\sup {1/2} (1.4142). If you want to make it scale the opposite way as the wheel is rotated, set rotationScale
to a negative value.
Definition at line 277 of file qquickwheelhandler.cpp.
References d.
|
signal |
|
signal |
|
overrideprotectedvirtual |
This event handler can be reimplemented in a subclass to receive timer events for the object.
QTimer provides a higher-level interface to the timer functionality, and also more general information about timers. The timer event is passed in the event parameter.
Reimplemented from QObject.
Definition at line 484 of file qquickwheelhandler.cpp.
References d, QObject::objectName, qCDebug, and QQuickPointerHandler::setActive().
|
overrideprotectedvirtual |
It is the responsibility of this function to decide whether the event could be relevant at all to this handler, as a preliminary check.
Returns true
if this handler would like handlePointerEventImpl() to be called. If it returns false
, the handler will be deactivated: setActive(false)
will be called, and any remaining exclusive grab will be relinquished, as a fail-safe.
If you override this function, you should call the immediate parent class implementation (and return false
if it returns false
); that in turn calls its parent class implementation, and so on. QQuickSinglePointHandler::wantsPointerEvent() and QQuickMultiPointHandler::wantsPointerEvent() call wantsEventPoint(), which is also virtual. You usually can get the behavior you want by subclassing the appropriate handler type, overriding QQuickSinglePointHandler::handleEventPoint() or handlePointerEventImpl(), and perhaps overriding wantsEventPoint() if needed.
Reimplemented from QQuickSinglePointHandler.
Definition at line 345 of file qquickwheelhandler.cpp.
References QQuickPointerDeviceHandler::acceptedDevices, QQuickPointerHandler::active, Qt::Horizontal, QQuickHandlerPoint::id, Qt::MouseEventNotSynthesized, orientation, QQuickPointerHandler::parentContains(), QQuickSinglePointHandler::point, QQuickSinglePointHandler::setPointId(), QInputDevice::TouchPad, Qt::Vertical, QQuickPointerHandler::wantsEventPoint(), QQuickPointerDeviceHandler::wantsPointerEvent(), and QEvent::Wheel.
|
signal |
|
readwrite |
Definition at line 97 of file qquickwheelhandler_p.h.
|
readwrite |
Definition at line 97 of file qquickwheelhandler_p.h.
Referenced by setBlocking().
|
readwrite |
Definition at line 97 of file qquickwheelhandler_p.h.
Referenced by setInvertible().
|
readwrite |
Definition at line 97 of file qquickwheelhandler_p.h.
Referenced by handleEventPoint(), setOrientation(), and wantsPointerEvent().
|
readwrite |
Definition at line 97 of file qquickwheelhandler_p.h.
|
readwrite |
Definition at line 97 of file qquickwheelhandler_p.h.
Referenced by setRotation().
|
readwrite |
Definition at line 97 of file qquickwheelhandler_p.h.
Referenced by setRotationScale().
|
readwrite |
Definition at line 97 of file qquickwheelhandler_p.h.
Referenced by setTargetScaleMultiplier().
|
readwrite |
Definition at line 97 of file qquickwheelhandler_p.h.