8#include <QtQml/qqmlinfo.h>
9#include <QtQuick/private/qquickflickable_p.h>
10#if QT_CONFIG(accessibility)
11#include <QtQuick/private/qquickaccessibleattached_p.h>
136 qreal maximumSize = qMax<qreal>(0.0, 1.0 - visualPos);
141 visualPos = qMax<qreal>(0,qMin<qreal>(visualPos,qMax<qreal>(0, 1.0 - visualSize)));
180#if QT_CONFIG(quicktemplates2_multitouch)
181 q->setAcceptTouchEvents(
true);
188#if QT_CONFIG(quicktemplates2_multitouch)
189 q->setAcceptTouchEvents(
false);
196 emit q->interactiveChanged();
202#if QT_CONFIG(quicktemplates2_hover)
203 bool hover = hovered;
234 if (!indicatorButton ||
item != indicatorButton->indicator()) {
235 indicatorButton =
q->increaseVisual();
236 if (!indicatorButton ||
item != indicatorButton->indicator())
240 emit indicatorButton->implicitIndicatorWidthChanged();
248 if (!indicatorButton ||
item != indicatorButton->indicator()) {
249 indicatorButton =
q->increaseVisual();
250 if (!indicatorButton ||
item != indicatorButton->indicator())
254 emit indicatorButton->implicitIndicatorHeightChanged();
262 QQuickItem *decreaseArrow = indicatorButton->indicator();
263 if (decreaseArrow && decreaseArrow->contains(
q->mapToItem(decreaseArrow, point +
QPointF(0.5, 0.5)))) {
264 indicatorButton->setPressed(
true);
271 QQuickItem *increaseArrow = increaseObject->indicator();
272 if (increaseArrow && increaseArrow->contains(
q->mapToItem(increaseArrow, point +
QPointF(0.5, 0.5)))) {
273 increaseObject->setPressed(
true);
281 if (offset < 0 || offset > sz)
315 if (point.
y() <
q->topPadding() || point.
y() >= (
q->height() -
q->bottomPadding()))
318 if (point.
x() <
q->leftPadding() || point.
x() >= (
q->width() -
q->rightPadding()))
327 q->setPressed(
false);
336 q->setPressed(
false);
343 emit q->visualSizeChanged();
344 if (!
qFuzzyCompare(newVisualArea.position, oldVisualArea.position))
345 emit q->visualPositionChanged();
353 bool hovered = newHoverState.value_or(
false);
354 if (!newHoverState.has_value()) {
355 if (
QQuickItem *indicator = sbButton->indicator())
356 hovered = indicator->contains(
q->mapToItem(indicator,
pos));
358 sbButton->setHovered(hovered);
361 updateHoverOnButton(
q->decreaseVisual());
362 updateHoverOnButton(
q->increaseVisual());
374#if QT_CONFIG(quicktemplates2_multitouch)
414 const auto oldVisualArea =
d->visualArea();
416 if (
d->size +
d->position > 1.0) {
417 d->setPosition(1.0 -
d->size,
false);
423 d->visualAreaChange(
d->visualArea(), oldVisualArea);
463 if (
q->isComponentComplete())
465 emit q->positionChanged();
466 if (notifyVisualChange)
537 button->setPressed(
false);
539 button->setPressed(
false);
567 return d->orientation;
620 if (
d->snapMode ==
mode)
624 emit snapModeChanged();
640 return d->interactive;
646 d->explicitInteractive =
true;
653 d->explicitInteractive =
false;
654 d->setInteractive(
true);
695 emit policyChanged();
739 return d->minimumSize;
748 auto oldVisualArea =
d->visualArea();
752 emit minimumSizeChanged();
753 d->visualAreaChange(
d->visualArea(), oldVisualArea);
769 return d->visualArea().size;
785 return d->visualArea().position;
791 return d->decreaseVisual;
797 return d->increaseVisual;
811 bool wasActive =
d->active;
828 bool wasActive =
d->active;
838 d->handleMove(
event->position(),
event->timestamp());
841#if QT_CONFIG(quicktemplates2_hover)
842void QQuickScrollBar::hoverChange()
852 d->updateHover(
event->position());
860 d->updateHover(
event->position());
869 d->updateHover(
QPoint(),
false);
895#if QT_CONFIG(accessibility)
896void QQuickScrollBar::accessibilityActiveChanged(
bool active)
898 QQuickControl::accessibilityActiveChanged(
active);
916QAccessible::Role QQuickScrollBar::accessibleRole()
const
918 return QAccessible::ScrollBar;
968 if (
auto control = qobject_cast<QQuickControl*>(q_func()->
parent())) {
995 if (
auto control = qobject_cast<QQuickControl*>(q_func()->
parent())) {
1074 const qreal maxxextent = -
f->maxXExtent() +
f->minXExtent();
1089 const qreal maxyextent = -
f->maxYExtent() +
f->minYExtent();
1126#ifdef QT_QUICK_NEW_GEOMETRY_CHANGED_HANDLING
1135#ifdef QT_QUICK_NEW_GEOMETRY_CHANGED_HANDLING
1171 d->setFlickable(qobject_cast<QQuickFlickable *>(
parent));
1173 if (
parent && !
d->flickable && !qobject_cast<QQuickScrollView *>(
parent))
1174 qmlWarning(
parent) <<
"ScrollBar must be attached to a Flickable or ScrollView";
1180 if (
d->horizontal) {
1182 d->horizontal =
nullptr;
1186 d->vertical =
nullptr;
1188 d->setFlickable(
nullptr);
1208 return d->horizontal;
1217 if (
d->horizontal) {
1222 d->cleanupHorizontal();
1236 d->initHorizontal();
1273 d->cleanupVertical();
1295#include "moc_qquickscrollbar_p.cpp"
static constexpr Policy Preferred
static constexpr Policy Fixed
static QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
static bool disconnect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot)
QObject * parent() const
Returns a pointer to the parent object.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
\threadsafe
QVariant property(const char *name) const
Returns the value of the object's name property.
\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.
\inmodule QtCore\reentrant
The QQmlContext class defines a context within a QML engine.
static void setContextForObject(QObject *, QQmlContext *)
Sets the QQmlContext for the object to context.
static void removeBinding(const QQmlProperty &that)
The QQmlProperty class abstracts accessing properties on objects created from QML.
void itemImplicitWidthChanged(QQuickItem *item) override
static void unhideOldItem(QQuickControl *control, QQuickItem *item, UnhideVisibility visibility=UnhideVisibility::Show)
virtual bool handlePress(const QPointF &point, ulong timestamp)
QQuickDeferredPointer< QQuickItem > contentItem
static void hideOldItem(QQuickItem *item)
virtual void handleUngrab()
virtual bool handleRelease(const QPointF &point, ulong timestamp)
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 classBegin() override
Invoked after class creation, but before any properties have been set.
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
bool isMovingHorizontally() const
virtual void setContentX(qreal pos)
void movingHorizontallyChanged()
virtual void setContentY(qreal pos)
void movingVerticallyChanged()
bool isMovingVertically() const
static QQuickItemPrivate * get(QQuickItem *item)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
virtual void hoverEnterEvent(QHoverEvent *event)
This event handler can be reimplemented in a subclass to receive hover-enter events for an item.
void setSize(const QSizeF &size)
qreal x
\qmlproperty real QtQuick::Item::x \qmlproperty real QtQuick::Item::y \qmlproperty real QtQuick::Item...
void setParentItem(QQuickItem *parent)
virtual void hoverMoveEvent(QHoverEvent *event)
This event handler can be reimplemented in a subclass to receive hover-move events for an item.
qreal y
Defines the item's y position relative to its 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.
qreal width
This property holds the width of this item.
QQuickItem * parentItem() const
void stackAfter(const QQuickItem *)
Moves the specified sibling item to the index after this item within the list of children.
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.
qreal height
This property holds the height of this item.
void setPosition(const QPointF &)
friend class QQuickAccessibleAttached
virtual void hoverLeaveEvent(QHoverEvent *event)
This event handler can be reimplemented in a subclass to receive hover-leave events for an item.
\inmodule QtCore\reentrant
constexpr qreal height() const noexcept
Returns the height of the rectangle.
constexpr qreal width() const noexcept
Returns the width of the rectangle.
Combined button and popup list for selecting options.
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
bool qFuzzyIsNull(qfloat16 f) noexcept
bool qIsNaN(qfloat16 f) noexcept
int qRound(qfloat16 d) noexcept
static int area(const QSize &s)
constexpr const T & qBound(const T &min, const T &val, const T &max)
constexpr const T & qMax(const T &a, const T &b)
static Q_DECL_CONST_FUNCTION bool qt_is_finite(double d)
n void setPosition(void) \n\
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLenum GLuint GLintptr offset
GLdouble GLdouble GLdouble GLdouble q
QQmlContext * qmlContext(const QObject *obj)
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define QStringLiteral(str)
myObject disconnect()
[26]
item setCursor(Qt::IBeamCursor)
[1]