QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskSwipeView.h
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#ifndef QSK_SWIPE_VIEW_H
7#define QSK_SWIPE_VIEW_H
8
9#include "QskStackBox.h"
10
11class QSK_EXPORT QskSwipeView : public QskStackBox
12{
13 Q_OBJECT
14
15 Q_PROPERTY( int duration READ duration
16 WRITE setDuration RESET resetDuration NOTIFY durationChanged )
17
18 Q_PROPERTY( int swipeDistance READ swipeDistance
19 WRITE setSwipeDistance RESET resetSwipeDistance NOTIFY swipeDistanceChanged )
20
21 Q_PROPERTY( Qt::Orientation orientation READ orientation
22 WRITE setOrientation NOTIFY orientationChanged )
23
24 using Inherited = QskStackBox;
25
26 public:
27 QSK_SUBCONTROLS( Panel )
28
29 QskSwipeView( QQuickItem* parent = nullptr );
30 ~QskSwipeView() override;
31
32 void setOrientation( Qt::Orientation );
33 Qt::Orientation orientation() const;
34
35 // Duration is the time ( in ms ) used for changing between pages
36
37 int duration() const;
38 void setDuration( int );
39 void resetDuration();
40
41 /*
42 Even if called "swipe view" we use a pan - no swipe - gesture.
43 ( = pages are moved before the gesture has been confirmed )
44
45 The swipe distance is the minimum distance in pixels of the pan gesture
46 */
47
48 int swipeDistance() const;
49 void setSwipeDistance( int );
50 void resetSwipeDistance();
51
53
54 Q_SIGNALS:
55 void orientationChanged( Qt::Orientation );
56 void durationChanged( int );
57 void swipeDistanceChanged( int );
58
59 protected:
60 void gestureEvent( QskGestureEvent* ) override;
61
62 private:
63 void setAnimator( QskStackBoxAnimator* ) = delete;
64
65 class PrivateData;
66 std::unique_ptr< PrivateData > m_data;
67};
68
69#endif
Subcontrol
For use within the rendering or lay-outing of a specific QskSkinnable.
Definition QskAspect.h:104
QskAspect::Subcontrol effectiveSubcontrol(QskAspect::Subcontrol) const