QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskPageIndicator.h
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#ifndef QSK_PAGE_INDICATOR_H
7#define QSK_PAGE_INDICATOR_H
8
9#include "QskControl.h"
10
11class QSK_EXPORT QskPageIndicator : public QskControl
12{
13 Q_OBJECT
14
15 Q_PROPERTY( int count READ count
16 WRITE setCount NOTIFY countChanged FINAL )
17
18 Q_PROPERTY( qreal currentIndex READ currentIndex
19 WRITE setCurrentIndex NOTIFY currentIndexChanged FINAL )
20
21 Q_PROPERTY( Qt::Orientation orientation READ orientation
22 WRITE setOrientation NOTIFY orientationChanged FINAL )
23
24 using Inherited = QskControl;
25
26 public:
27 QSK_SUBCONTROLS( Panel, Bullet )
28 QSK_STATES( Selected )
29
30 QskPageIndicator( QQuickItem* parent = nullptr );
31 QskPageIndicator( int count, QQuickItem* parent = nullptr );
32
33 ~QskPageIndicator() override;
34
35 int count() const;
36 qreal currentIndex() const;
37
38 Qt::Orientation orientation() const;
39 void setOrientation( Qt::Orientation );
40
41 qreal valueRatioAt( int index ) const;
42 QRectF bulletRect( int index ) const;
43 int indexAtPosition( const QPointF& ) const;
44
46
47 Q_SIGNALS:
48 void countChanged( int );
49 void currentIndexChanged( qreal );
50 void orientationChanged( Qt::Orientation );
51 void pageRequested( int index );
52
53 public Q_SLOTS:
54 void setCount( int count );
55 void setCurrentIndex( qreal index );
56
57 protected:
58 void mousePressEvent( QMouseEvent* e ) override;
59 void mouseUngrabEvent() override;
60 void mouseReleaseEvent( QMouseEvent* e ) override;
61
62 void keyPressEvent( QKeyEvent* ) override;
63
64#ifndef QT_NO_WHEELEVENT
65 void wheelEvent( QWheelEvent* ) override;
66#endif
67
68 private:
69 void incrementRequested( int );
70
71 class PrivateData;
72 std::unique_ptr< PrivateData > m_data;
73};
74
75#endif
Variation
Some sort of variation.
Definition QskAspect.h:82
Base class of all controls.
Definition QskControl.h:23
void mouseUngrabEvent() override
Definition QskItem.cpp:1044
virtual QskAspect::Variation effectiveVariation() const