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
4#ifndef QQUICKSCROLLVIEW_P_H
5#define QQUICKSCROLLVIEW_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQuickTemplates2/private/qquickpane_p.h>
19#include <QtQml/qqmllist.h>
20
21QT_BEGIN_NAMESPACE
22
23class QQuickScrollViewPrivate;
24
25class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickScrollView : public QQuickPane
26{
27 Q_OBJECT
28 QML_NAMED_ELEMENT(ScrollView)
29 QML_ADDED_IN_VERSION(2, 2)
30 Q_PROPERTY(qreal effectiveScrollBarWidth READ effectiveScrollBarWidth NOTIFY effectiveScrollBarWidthChanged FINAL REVISION(6, 6))
31 Q_PROPERTY(qreal effectiveScrollBarHeight READ effectiveScrollBarHeight NOTIFY effectiveScrollBarHeightChanged FINAL REVISION(6, 6))
32
33public:
34 explicit QQuickScrollView(QQuickItem *parent = nullptr);
35 ~QQuickScrollView();
36 qreal effectiveScrollBarWidth();
37 qreal effectiveScrollBarHeight();
38
39protected:
40 bool childMouseEventFilter(QQuickItem *item, QEvent *event) override;
41 bool eventFilter(QObject *object, QEvent *event) override;
42 void keyPressEvent(QKeyEvent *event) override;
43
44 void componentComplete() override;
45 void contentItemChange(QQuickItem *newItem, QQuickItem *oldItem) override;
46 void contentSizeChange(const QSizeF &newSize, const QSizeF &oldSize) override;
47
48#if QT_CONFIG(accessibility)
49 QAccessible::Role accessibleRole() const override;
50#endif
51
52Q_SIGNALS:
53 Q_REVISION(6, 6) void effectiveScrollBarWidthChanged();
54 Q_REVISION(6, 6) void effectiveScrollBarHeightChanged();
55
56private:
57 Q_DISABLE_COPY(QQuickScrollView)
58 Q_DECLARE_PRIVATE(QQuickScrollView)
59};
60
61QT_END_NAMESPACE
62
63QML_DECLARE_TYPE(QQuickScrollView)
64
65#endif // QQUICKSCROLLVIEW_P_H
66

source code of qtdeclarative/src/quicktemplates/qquickscrollview_p.h