DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
dpageindicator.h
1// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DPAGEINDICATOR_H
6#define DPAGEINDICATOR_H
7
8#include <dtkwidget_global.h>
9#include <DObject>
10
11#include <QWidget>
12
13DWIDGET_BEGIN_NAMESPACE
14
15class DPageIndicatorPrivate;
16class LIBDTKWIDGETSHARED_EXPORT DPageIndicator : public QWidget, public DTK_CORE_NAMESPACE::DObject
17{
18 Q_OBJECT
19 Q_DISABLE_COPY(DPageIndicator)
20 D_DECLARE_PRIVATE(DPageIndicator)
21 Q_PROPERTY(QColor pointColor READ pointColor WRITE setPointColor DESIGNABLE true)
22 Q_PROPERTY(QColor secondaryPointColor READ secondaryPointColor WRITE setSecondaryPointColor DESIGNABLE true)
23 Q_PROPERTY(int pointRadius READ pointRadius WRITE setPointRadius)
24 Q_PROPERTY(int secondaryPointRadius READ secondaryPointRadius WRITE setSecondaryPointRadius)
25 Q_PROPERTY(int pageCount READ pageCount WRITE setPageCount)
26 Q_PROPERTY(int currentPage READ currentPageIndex WRITE setCurrentPage)
27 Q_PROPERTY(int pointDistance READ pointDistance WRITE setPointDistance)
28
29public:
30 explicit DPageIndicator(QWidget *parent = 0);
31
32 int pageCount() const;
33 void setPageCount(const int count);
34
35 void nextPage();
36 void previousPage();
37 void setCurrentPage(const int index);
38 int currentPageIndex() const;
39
40 QColor pointColor() const;
41 void setPointColor(QColor color);
42
43 QColor secondaryPointColor() const;
44 void setSecondaryPointColor(QColor color);
45
46 int pointRadius() const;
47 void setPointRadius(int size);
48
49 int secondaryPointRadius() const;
50 void setSecondaryPointRadius(int size);
51
52 int pointDistance() const;
53 void setPointDistance(int distance);
54
55protected:
56 void paintEvent(QPaintEvent *e) override;
57};
58
59DWIDGET_END_NAMESPACE
60
61#endif // DPAGEINDICATOR_H
The DPageIndicator class provides indicator of which page is currently showing.
Definition dpageindicator.h:17