QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskScrollView.h
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#ifndef QSK_SCROLL_VIEW_H
7#define QSK_SCROLL_VIEW_H
8
9#include "QskScrollBox.h"
10
11class QSK_EXPORT QskScrollView : public QskScrollBox
12{
13 Q_OBJECT
14
15 Q_PROPERTY( Qt::ScrollBarPolicy verticalScrollBarPolicy READ verticalScrollBarPolicy
16 WRITE setVerticalScrollBarPolicy NOTIFY verticalScrollBarPolicyChanged FINAL )
17
18 Q_PROPERTY( Qt::ScrollBarPolicy horizontalScrollBarPolicy READ horizontalScrollBarPolicy
19 WRITE setHorizontalScrollBarPolicy NOTIFY horizontalScrollBarPolicyChanged FINAL )
20
21 using Inherited = QskScrollBox;
22
23 public:
24 QSK_SUBCONTROLS( Panel, Viewport,
25 HorizontalScrollBar, HorizontalScrollHandle,
26 VerticalScrollBar, VerticalScrollHandle )
27
28 QSK_STATES( Pressed )
29
30 QskScrollView( QQuickItem* parent = nullptr );
31 ~QskScrollView() override;
32
33 void setVerticalScrollBarPolicy( Qt::ScrollBarPolicy );
34 Qt::ScrollBarPolicy verticalScrollBarPolicy() const;
35
36 void setHorizontalScrollBarPolicy( Qt::ScrollBarPolicy );
37 Qt::ScrollBarPolicy horizontalScrollBarPolicy() const;
38
39 Qt::Orientations scrollableOrientations() const;
40
41 bool isScrolling( Qt::Orientation ) const;
42 QskAspect::States scrollBarStates( QskAspect::Subcontrol ) const;
43
44 QRectF viewContentsRect() const override;
45 QskAnimationHint flickHint() const override;
46
47 Q_SIGNALS:
48 void verticalScrollBarPolicyChanged();
49 void horizontalScrollBarPolicyChanged();
50
51 protected:
52 void mouseMoveEvent( QMouseEvent* ) override;
53 void mousePressEvent( QMouseEvent* ) override;
54 void mouseReleaseEvent( QMouseEvent* ) override;
55 void mouseUngrabEvent() override;
56
57 void hoverEnterEvent( QHoverEvent* ) override;
58 void hoverMoveEvent( QHoverEvent* ) override;
59 void hoverLeaveEvent( QHoverEvent* ) override;
60
61#ifndef QT_NO_WHEELEVENT
62 QPointF scrollOffset( const QWheelEvent* ) const override;
63#endif
64
65 private:
66 class PrivateData;
67 std::unique_ptr< PrivateData > m_data;
68};
69
70#endif
Subcontrol
For use within the rendering or lay-outing of a specific QskSkinnable.
Definition QskAspect.h:104
void hoverLeaveEvent(QHoverEvent *) override
void hoverEnterEvent(QHoverEvent *) override
void mouseUngrabEvent() override
Definition QskItem.cpp:1044