8#include <QtQuick/private/qquickwindow_p.h>
112 const qreal extent =
q->availableWidth() - hw;
115 pos = (
q->width() - point.
x() -
q->rightPadding() -
offset) / extent;
117 pos = (point.
x() -
q->leftPadding() -
offset) / extent;
122 const qreal extent =
q->availableHeight() - hh;
124 pos = (
q->height() - point.
y() -
q->bottomPadding() -
offset) / extent;
126 return qBound<qreal>(0.0,
pos, 1.0);
132 pos = qBound<qreal>(0.0,
pos, 1.0);
137 emit q->positionChanged();
138 emit q->visualPositionChanged();
167 q->setValue(
q->valueAt(
pos));
191 q->setKeepMouseGrab(
false);
192 q->setKeepTouchGrab(
false);
193 q->setPressed(
false);
202 q->setPressed(
false);
228 emit q->implicitHandleWidthChanged();
236 emit q->implicitHandleHeightChanged();
249#if QT_CONFIG(quicktemplates2_multitouch)
260 d->removeImplicitSizeListener(
d->handle);
379 return 1.0 -
d->position;
442 if (
d->snapMode ==
mode)
516 return d->orientation;
552 if (!
d->handle.isExecuting())
558 d->removeImplicitSizeListener(
d->handle);
563 if (!
handle->parentItem())
565 d->addImplicitSizeListener(
handle);
569 emit implicitHandleWidthChanged();
571 emit implicitHandleHeightChanged();
572 if (!
d->handle.isExecuting())
661 return d->touchDragThreshold;
671 emit touchDragThresholdChanged();
698 return d->handle->implicitWidth();
720 return d->handle->implicitHeight();
728 const qreal oldValue =
d->value;
770 d->handleMove(
event->position(),
event->timestamp());
774#if QT_CONFIG(quicktemplates2_multitouch)
778 switch (
event->type()) {
781 if (!
d->acceptTouch(point))
784 switch (point.state()) {
786 d->handlePress(point.position(),
event->timestamp());
796 d->handleMove(point.position(),
event->timestamp());
799 d->handleRelease(point.position(),
event->timestamp());
814#if QT_CONFIG(wheelevent)
815void QQuickSlider::wheelEvent(QWheelEvent *
event)
818 QQuickControl::wheelEvent(
event);
819 if (
d->wheelEnabled) {
820 const qreal oldValue =
d->value;
841 d->executeHandle(
true);
847#if QT_CONFIG(accessibility)
848void QQuickSlider::accessibilityActiveChanged(
bool active)
850 QQuickControl::accessibilityActiveChanged(active);
857QAccessible::Role QQuickSlider::accessibleRole()
const
859 return QAccessible::Slider;
865#include "moc_qquickslider_p.cpp"
The QEventPoint class provides information about a point in a QPointerEvent.
The QKeyEvent class describes a key event.
\inmodule QtCore\reentrant
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
void itemImplicitWidthChanged(QQuickItem *item) override
virtual bool handlePress(const QPointF &point, ulong timestamp)
static void hideOldItem(QQuickItem *item)
virtual void handleUngrab()
virtual bool handleRelease(const QPointF &point, ulong timestamp)
static void warnIfCustomizationNotSupported(QObject *control, QQuickItem *item, const QString &propertyName)
virtual bool handleMove(const QPointF &point, ulong timestamp)
void itemImplicitHeightChanged(QQuickItem *item) override
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
void setFocusPolicy(Qt::FocusPolicy policy)
void mousePressEvent(QMouseEvent *event) override
This event handler can be reimplemented in a subclass to receive mouse press events for an item.
bool setAccessibleProperty(const char *propertyName, const QVariant &value)
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.
virtual void keyPressEvent(QKeyEvent *event)
This event handler can be reimplemented in a subclass to receive key press events for an item.
void setParentItem(QQuickItem *parent)
void setAcceptTouchEvents(bool accept)
If enabled is true, this sets the item to accept touch events; otherwise, touch events are not accept...
void setAcceptedMouseButtons(Qt::MouseButtons buttons)
Sets the mouse buttons accepted by this item to buttons.
bool keepTouchGrab() const
Returns whether the touch points grabbed by this item should exclusively remain with this item.
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
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 keyReleaseEvent(QKeyEvent *event)
This event handler can be reimplemented in a subclass to receive key release events for an item.
void setActiveFocusOnTab(bool)
Used to select a value by sliding a handle along a track.
bool handleRelease(const QPointF &point, ulong timestamp) override
qreal snapPosition(qreal position) const
void itemImplicitWidthChanged(QQuickItem *item) override
void setPosition(qreal position)
bool handleMove(const QPointF &point, ulong timestamp) override
void itemImplicitHeightChanged(QQuickItem *item) override
QQuickSlider::SnapMode snapMode
Qt::Orientation orientation
void handleUngrab() override
qreal positionAt(const QPointF &point) const
bool handlePress(const QPointF &point, ulong timestamp) override
QQuickDeferredPointer< QQuickItem > handle
void executeHandle(bool complete=false)
void setOrientation(Qt::Orientation orientation)
qreal implicitHandleHeight
void decrease()
\qmlmethod void QtQuick.Controls::Slider::decrease()
void increase()
\qmlmethod void QtQuick.Controls::Slider::increase()
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
void setHandle(QQuickItem *handle)
void setStepSize(qreal step)
void setTouchDragThreshold(qreal touchDragThreshold)
void resetTouchDragThreshold()
void setPressed(bool pressed)
bool isHorizontal() const
void setSnapMode(SnapMode mode)
void visualPositionChanged()
void keyReleaseEvent(QKeyEvent *event) override
This event handler can be reimplemented in a subclass to receive key release events for an item.
QQuickSlider(QQuickItem *parent=nullptr)
void orientationChanged()
qreal implicitHandleWidth
void keyPressEvent(QKeyEvent *event) override
This event handler can be reimplemented in a subclass to receive key press events for an item.
void setValue(qreal value)
void mirrorChange() override
bool isPressed() const
\qmlproperty bool QtQuick.Controls::Slider::pressed
Qt::Orientation orientation
void mousePressEvent(QMouseEvent *event) override
This event handler can be reimplemented in a subclass to receive mouse press events for an item.
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.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
bool qFuzzyIsNull(qfloat16 f) noexcept
int qRound(qfloat16 d) noexcept
constexpr const T & qBound(const T &min, const T &val, const T &max)
n void setPosition(void) \n\
GLuint64 GLenum void * handle
GLenum GLuint GLintptr offset
GLfixed GLfixed GLint GLint GLfixed points
GLdouble GLdouble GLdouble GLdouble q
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
void quickCancelDeferred(QObject *object, const QString &property)
void quickCompleteDeferred(QObject *object, const QString &property, QQuickDeferredPointer< T > &delegate)
void quickBeginDeferred(QObject *object, const QString &property, QQuickDeferredPointer< T > &delegate)
#define QStringLiteral(str)
static QString handleName()
item setCursor(Qt::IBeamCursor)
[1]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent