78 return (pressPos >= 0.0 && pressPos <= 1.0) || (movePos >= 0.0 && movePos <= 1.0);
85 if (
q->keepMouseGrab() ||
q->keepTouchGrab())
94 q->setKeepMouseGrab(
false);
95 q->setKeepTouchGrab(
false);
103 d->keepPressed =
true;
141 return 1.0 -
d->position;
149 const QPointF movePoint =
event->position();
150 if (
d->canDrag(movePoint))
156#if QT_CONFIG(quicktemplates2_multitouch)
164 if (
d->canDrag(point.position()))
187 d->toggle(
d->position > 0.5);
207#include "moc_qquickswitchdelegate_p.cpp"
The QEventPoint class provides information about a point in a QPointerEvent.
The QPalette class contains color groups for each widget state.
\inmodule QtCore\reentrant
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
bool isMirrored() const
\qmlproperty bool QtQuick.Controls::Control::mirrored \readonly
virtual void mirrorChange()
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
void setKeepTouchGrab(bool)
Sets whether the touch points grabbed by this item should remain exclusively with this item.
Q_INVOKABLE QPointF mapFromItem(const QQuickItem *item, const QPointF &point) const
Maps the given point in item's coordinate system to the equivalent point within this item's coordinat...
bool keepTouchGrab() const
Returns whether the touch points grabbed by this item should exclusively remain with this item.
qreal width
This property holds the width of this item.
bool keepMouseGrab() const
Returns whether mouse input should exclusively remain with this item.
void setKeepMouseGrab(bool)
Sets whether the mouse input should remain exclusively with this item.
virtual void touchEvent(QTouchEvent *event)
This event handler can be reimplemented in a subclass to receive touch events for an item.
virtual void mouseMoveEvent(QMouseEvent *event)
This event handler can be reimplemented in a subclass to receive mouse move events for an item.
Item delegate with a switch indicator that can be toggled on or off.
QPalette defaultPalette() const override
bool handleRelease(const QPointF &point, ulong timestamp) override
bool handleMove(const QPointF &point, ulong timestamp) override
bool canDrag(const QPointF &movePoint) const
qreal positionAt(const QPointF &point) const
void mouseMoveEvent(QMouseEvent *event) override
This event handler can be reimplemented in a subclass to receive mouse move events for an item.
void nextCheckState() override
void mirrorChange() override
void buttonChange(ButtonChange change) override
void setPosition(qreal position)
void visualPositionChanged()
QFont defaultFont() const override
QQuickSwitchDelegate(QQuickItem *parent=nullptr)
static QPalette palette(Scope scope)
static QFont font(Scope scope)
static bool dragOverThreshold(qreal d, Qt::Axis axis, const QEventPoint *tp, int startDragThreshold=-1)
The QTouchEvent class contains parameters that describe a touch event.
Combined button and popup list for selecting options.
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
n void setPosition(void) \n\
GLfixed GLfixed GLint GLint GLfixed points
GLdouble GLdouble GLdouble GLdouble q
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent