8#include <QtQuick/private/qquickwindow_p.h>
90 QQuickDeferredPointer<QQuickItem>
handle;
113 const qreal extent =
q->availableWidth() - hw;
116 pos = (
q->width() - point.
x() -
q->rightPadding() -
offset) / extent;
118 pos = (point.
x() -
q->leftPadding() -
offset) / extent;
123 const qreal extent =
q->availableHeight() - hh;
125 pos = (
q->height() - point.
y() -
q->bottomPadding() -
offset) / extent;
127 return qBound<qreal>(0.0,
pos, 1.0);
133 pos = qBound<qreal>(0.0,
pos, 1.0);
138 emit q->positionChanged();
139 emit q->visualPositionChanged();
168 q->setValue(
q->valueAt(
pos));
192 q->setKeepMouseGrab(
false);
193 q->setKeepTouchGrab(
false);
194 q->setPressed(
false);
203 q->setPressed(
false);
229 emit q->implicitHandleWidthChanged();
237 emit q->implicitHandleHeightChanged();
246 emit q->handleChanged();
262#if QT_CONFIG(quicktemplates2_multitouch)
273 d->removeImplicitSizeListener(
d->handle);
392 return 1.0 -
d->position;
455 if (
d->snapMode ==
mode)
529 return d->orientation;
570 if (!
d->handle.isExecuting())
576 d->removeImplicitSizeListener(
d->handle);
581 if (!
handle->parentItem())
583 d->addImplicitSizeListener(
handle);
587 emit implicitHandleWidthChanged();
589 emit implicitHandleHeightChanged();
590 if (!
d->handle.isExecuting())
679 return d->touchDragThreshold;
689 emit touchDragThresholdChanged();
716 return d->handle->implicitWidth();
738 return d->handle->implicitHeight();
746 const qreal oldValue =
d->value;
788 d->handleMove(
event->position(),
event->timestamp());
792#if QT_CONFIG(quicktemplates2_multitouch)
796 switch (
event->type()) {
799 if (!
d->acceptTouch(point))
802 switch (point.state()) {
804 d->handlePress(point.position(),
event->timestamp());
814 d->handleMove(point.position(),
event->timestamp());
817 d->handleRelease(point.position(),
event->timestamp());
832#if QT_CONFIG(wheelevent)
833void QQuickSlider::wheelEvent(QWheelEvent *
event)
836 QQuickControl::wheelEvent(
event);
837 if (
d->wheelEnabled) {
838 const qreal oldValue =
d->value;
859 d->executeHandle(
true);
865#if QT_CONFIG(accessibility)
866void QQuickSlider::accessibilityActiveChanged(
bool active)
868 QQuickControl::accessibilityActiveChanged(active);
875QAccessible::Role QQuickSlider::accessibleRole()
const
877 return QAccessible::Slider;
883#include "moc_qquickslider_p.cpp"
The QEventPoint class provides information about a point in a QPointerEvent.
The QKeyEvent class describes a key event.
static constexpr Policy Preferred
static constexpr Policy Fixed
\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)
void itemDestroyed(QQuickItem *item) override
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 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 setFocusPolicy(Qt::FocusPolicy policy)
Sets the focus policy of this item to policy.
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 itemDestroyed(QQuickItem *item) override
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]