7#include <QtCore/qmath.h>
8#include <QtQuick/private/qquickflickable_p.h>
9#include <QtQuickTemplates2/private/qquickcontrol_p_p.h>
79 return -logicAngleRad /
M_PI * 180. + 90;
210 qreal dragDistance = 0;
213 dragArea =
width * 2;
219 const qreal normalisedDifference = dragDistance / dragArea;
235 emit q->positionChanged();
236 emit q->angleChanged();
295 if (
q->keepMouseGrab() ||
q->keepTouchGrab()) {
308 q->setKeepMouseGrab(
false);
309 q->setKeepTouchGrab(
false);
312 q->setPressed(
false);
324 q->setPressed(
false);
345template<
typename ...Real>
348 return (... && check(numbers));
369#if QT_CONFIG(quicktemplates2_multitouch)
398 d->updateAllValuesAreInteger();
426 d->updateAllValuesAreInteger();
527 d->updateAllValuesAreInteger();
547 return d->startAngle;
553 if (!
d->componentComplete) {
567 <<
") cannot be greater than or equal to endAngle (" <<
d->endAngle <<
")";
578 if (startAngle < d->
endAngle - 360.) {
580 <<
") and endAngle (" <<
d->endAngle <<
") cannot be greater than 360."
581 <<
" Changing endAngle to avoid overlaps.";
583 emit endAngleChanged();
590 emit startAngleChanged();
615 if (!
d->componentComplete) {
628 <<
") cannot be less than or equal to startAngle (" <<
d->startAngle <<
")";
634 qmlWarning(
this) <<
"endAngle (" <<
endAngle <<
") cannot be greater than or equal to 720";
640 qmlWarning(
this) <<
"Difference between startAngle (" <<
d->startAngle
641 <<
") and endAngle (" <<
endAngle <<
") cannot be greater than 360."
642 <<
" Changing startAngle to avoid overlaps.";
644 emit startAngleChanged();
651 emit endAngleChanged();
678 if (
d->snapMode ==
mode)
704 if (
d->inputMode ==
mode)
708 emit inputModeChanged();
805 if (!
d->handle.isExecuting())
810 if (
d->handle && !
d->handle->parentItem())
811 d->handle->setParentItem(
this);
812 if (!
d->handle.isExecuting())
874 const qreal oldValue =
d->value;
875 switch (
event->key()) {
923 d->handleMove(
event->position(),
event->timestamp());
927#if QT_CONFIG(quicktemplates2_multitouch)
931 switch (
event->type()) {
934 if (!
d->acceptTouch(point))
937 switch (point.state()) {
943 if (!overXDragThreshold) {
949 d->handleMove(point.position(),
event->timestamp());
966#if QT_CONFIG(wheelevent)
967void QQuickDial::wheelEvent(QWheelEvent *
event)
970 QQuickControl::wheelEvent(
event);
971 if (
d->wheelEnabled) {
972 const qreal oldValue =
d->value;
991 d->executeHandle(
true);
1009 d->updatePosition();
1012#if QT_CONFIG(accessibility)
1013void QQuickDial::accessibilityActiveChanged(
bool active)
1015 QQuickControl::accessibilityActiveChanged(active);
1022QAccessible::Role QQuickDial::accessibleRole()
const
1024 return QAccessible::Dial;
1030#include "moc_qquickdial_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.
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 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()
QQuickDeferredPointer< QQuickItem > handle
void executeHandle(bool complete=false)
bool handlePress(const QPointF &point, ulong timestamp) override
bool handleRelease(const QPointF &point, ulong timestamp) override
void maybeEmitWrapAround(qreal pos)
qreal linearPositionAt(const QPointF &point) const
void handleUngrab() override
qreal snapPosition(qreal position) const
bool isHorizontalOrVertical() const
qreal positionAt(const QPointF &point) const
bool isLargeChange(qreal proposedPosition) const
qreal positionBeforePress
qreal valueAt(qreal position) const
void setPosition(qreal position)
qreal circularPositionAt(const QPointF &point) const
void updateAllValuesAreInteger()
QQuickDial::InputMode inputMode
QQuickDial::SnapMode snapMode
bool handleMove(const QPointF &point, ulong timestamp) override
void setEndAngle(qreal endAngle)
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
void keyPressEvent(QKeyEvent *event) override
This event handler can be reimplemented in a subclass to receive key press events for an item.
void setInputMode(InputMode mode)
void decrease()
\qmlmethod void QtQuick.Controls::Dial::decrease()
void setStepSize(qreal step)
void setHandle(QQuickItem *handle)
bool isPressed() const
\qmlproperty bool QtQuick.Controls::Dial::pressed
void setSnapMode(SnapMode mode)
void increase()
\qmlmethod void QtQuick.Controls::Dial::increase()
void mirrorChange() override
void setValue(qreal value)
QQuickDial(QQuickItem *parent=nullptr)
void setPressed(bool pressed)
void setStartAngle(qreal startAngle)
void keyReleaseEvent(QKeyEvent *event) override
This event handler can be reimplemented in a subclass to receive key release events for an item.
void mousePressEvent(QMouseEvent *event) override
This event handler can be reimplemented in a subclass to receive mouse press events for an item.
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 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)
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)
constexpr T qAbs(const T &t)
n void setPosition(void) \n\
GLuint64 GLenum void * handle
GLint GLsizei GLsizei height
GLfixed GLfixed GLint GLint GLfixed points
GLdouble GLdouble GLdouble GLdouble q
GLfloat GLfloat GLfloat alpha
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
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)
static const qreal defaultStartAngle
static const qreal defaultEndAngle
static bool areRepresentableAsInteger(Real... numbers)
QT_BEGIN_NAMESPACE constexpr qreal toUserAngleDeg(qreal logicAngleRad)
Circular dial that is rotated to set a value.
static QT_BEGIN_NAMESPACE QAsn1Element wrap(quint8 type, const QAsn1Element &child)
#define QStringLiteral(str)
static QString handleName()
item setCursor(Qt::IBeamCursor)
[1]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent