Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquickscrollbar_p_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QQUICKSCROLLBAR_P_P_H
6#define QQUICKSCROLLBAR_P_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtQuickTemplates2/private/qquickscrollbar_p.h>
20#include <QtQuickTemplates2/private/qquickcontrol_p_p.h>
21#include <QtQuick/private/qquickitemchangelistener_p.h>
22
24
25class QQuickFlickable;
26class QQuickIndicatorButton;
27
29{
30 Q_DECLARE_PUBLIC(QQuickScrollBar)
31
32public:
34 {
35 return bar->d_func();
36 }
37
45 VisualArea visualArea() const;
46
47 qreal logicalPosition(qreal position) const;
48
49 void setPosition(qreal position, bool notifyVisualChange = true);
50 void setPositionFromDrag(qreal position, const QPointF &point);
51 void updatePosition(qreal position, bool notifyVisualChange);
52 void reanchorDragOffset(qreal position);
53 qreal snapPosition(qreal position) const;
54 qreal positionAt(const QPointF &point) const;
55 void setInteractive(bool interactive);
56 void updateActive();
58 void itemImplicitWidthChanged(QQuickItem *item) override;
59 void itemImplicitHeightChanged(QQuickItem *item) override;
60
61 bool handlePress(const QPointF &point, ulong timestamp) override;
62 bool handleMove(const QPointF &point, ulong timestamp) override;
63 bool handleRelease(const QPointF &point, ulong timestamp) override;
65
66 void visualAreaChange(const VisualArea &newVisualArea, const VisualArea &oldVisualArea);
67
68 void updateHover(const QPointF &pos, std::optional<bool> newHoverState = {});
69
70 QQuickIndicatorButton *decreaseVisual = nullptr;
71 QQuickIndicatorButton *increaseVisual = nullptr;
78 bool active = false;
79 bool pressed = false;
80 bool moving = false;
81 bool interactive = true;
82 bool explicitInteractive = false;
86};
87
90{
91public:
92 static QQuickScrollBarAttachedPrivate *get(QQuickScrollBarAttached *attached)
93 {
94 return attached->d_func();
95 }
96
97 void setFlickable(QQuickFlickable *flickable);
98
99 void initHorizontal();
100 void initVertical();
101 void cleanupHorizontal();
102 void cleanupVertical();
103 void activateHorizontal();
104 void activateVertical();
105 void scrollHorizontal();
106 void scrollVertical();
107 void mirrorVertical();
108
109 void layoutHorizontal(bool move = true);
110 void layoutVertical(bool move = true);
111
112 void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &diff) override;
113 void itemImplicitWidthChanged(QQuickItem *item) override;
114 void itemImplicitHeightChanged(QQuickItem *item) override;
115 void itemDestroyed(QQuickItem *item) override;
116
117 QQuickFlickable *flickable = nullptr;
120};
121
122QT_END_NAMESPACE
123
124#endif // QQUICKSCROLLBAR_P_P_H
void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &diff) override
void setFlickable(QQuickFlickable *flickable)
void layoutHorizontal(bool move=true)
void itemImplicitHeightChanged(QQuickItem *item) override
void itemDestroyed(QQuickItem *item) override
static QQuickScrollBarAttachedPrivate * get(QQuickScrollBarAttached *attached)
void itemImplicitWidthChanged(QQuickItem *item) override
void itemImplicitHeightChanged(QQuickItem *item) override
bool handlePress(const QPointF &point, ulong timestamp) override
QQuickIndicatorButton * increaseVisual
qreal snapPosition(qreal position) const
QQuickIndicatorButton * decreaseVisual
void reanchorDragOffset(qreal position)
void itemImplicitWidthChanged(QQuickItem *item) override
void updateHover(const QPointF &pos, std::optional< bool > newHoverState={})
bool handleRelease(const QPointF &point, ulong timestamp) override
bool handleMove(const QPointF &point, ulong timestamp) override
void visualAreaChange(const VisualArea &newVisualArea, const VisualArea &oldVisualArea)
qreal positionAt(const QPointF &point) const
void setPosition(qreal position, bool notifyVisualChange=true)
void setInteractive(bool interactive)
void resizeContent() override
void setPositionFromDrag(qreal position, const QPointF &point)
qreal logicalPosition(qreal position) const
void updatePosition(qreal position, bool notifyVisualChange)
VisualArea visualArea() const
Combined button and popup list for selecting options.
static QT_BEGIN_NAMESPACE const QQuickItemPrivate::ChangeTypes QsbChangeTypes
Vertical or horizontal interactive scroll bar.
static const QQuickItemPrivate::ChangeTypes QsbVerticalChangeTypes
static const QQuickItemPrivate::ChangeTypes QsbHorizontalChangeTypes