DtkWidget
DTK Widget module
|
The DPageIndicator class provides indicator of which page is currently showing. 更多...
Public 成员函数 | |
DPageIndicator (QWidget *parent=0) | |
DPageIndicator::DPageIndicator constructs an instance of DPageIndicator. parent is passed to QWidget constructor. | |
int | pageCount () const |
void | setPageCount (const int count) |
void | nextPage () |
DPageIndicator::nextPage highlights the next dot. | |
void | previousPage () |
DPageIndicator::previousPage hightlights the previous dot. | |
void | setCurrentPage (const int index) |
int | currentPageIndex () const |
QColor | pointColor () const |
void | setPointColor (QColor color) |
QColor | secondaryPointColor () const |
void | setSecondaryPointColor (QColor color) |
int | pointRadius () const |
void | setPointRadius (int size) |
int | secondaryPointRadius () const |
void | setSecondaryPointRadius (int size) |
int | pointDistance () const |
void | setPointDistance (int distance) |
Protected 成员函数 | |
void | paintEvent (QPaintEvent *e) override |
属性 | |
QColor | pointColor |
This property holds the color used to draw the highlighted dot. | |
QColor | secondaryPointColor |
This property holds the color used to draw the noraml dots. | |
int | pointRadius |
This property holds the radius of the highlighted dot. | |
int | secondaryPointRadius |
This property holds the radius of the normal dot. | |
int | pageCount |
This property holds the number of pages that are represented by this widget. | |
int | currentPage |
This property holds the index of currently highlighted dot. | |
int | pointDistance |
This property holds the distance between two dots. | |
The DPageIndicator class provides indicator of which page is currently showing.
\inmodule dtkwidget
DPageIndicator 类提供了一种用来指示一组元素中当前可见元素索引的控件.
DPageIndicator is control that displays a horizontal series of dots, each of which corresponds to a page/widget may appear on top of it.
It's inspired by UIPageControl of Apple. See \l {https://developer.apple.com/documentation/uikit/uipagecontrol}.
控件会显示了一系列的点,代表一组元素。其中每一个点固定对应于元素组中 的一个元素,元素组中的元素在一个时间点只能显示其中的一个( 如 QStackedLayout ), 当前显示的元素所对应的点会被高亮以告知用户元素左右(或者上下)还有多少元素可以切换。
例如下图中控制中心首页插件区域底部的指示器:
|
explicit |
DPageIndicator::DPageIndicator constructs an instance of DPageIndicator. parent is passed to QWidget constructor.
DPageIndicator::DPageIndicator 是 DPageIndicator 类的构造函数。 parent 指定了控件的父控件。
void Dtk::Widget::DPageIndicator::nextPage | ( | ) |
DPageIndicator::nextPage highlights the next dot.
DPageIndicator::nextPage 将高亮位置移至下一个点。
void Dtk::Widget::DPageIndicator::previousPage | ( | ) |
DPageIndicator::previousPage hightlights the previous dot.
DPageIndicator::previousPage 将高亮位置移至前一个点。
|
readwrite |
This property holds the index of currently highlighted dot.
DPageIndicator::currentPage 属性代表了当前高亮的点在所有点中的索引。
|
readwrite |
This property holds the number of pages that are represented by this widget.
DPageIndicator::pageCount 属性代表了控件显示的点的数量。
|
readwrite |
This property holds the color used to draw the highlighted dot.
DPageIndicator::pointColor 属性用来控制高亮点的颜色。
|
readwrite |
This property holds the distance between two dots.
DPageIndicator::pointDistance 属性用来控制两个点之间的距离。
|
readwrite |
This property holds the radius of the highlighted dot.
DPageIndicator::pointRadius 属性用来控制高亮点的大小(半径)。
|
readwrite |
This property holds the color used to draw the noraml dots.
DPageIndicator::secondaryPointColor 属性用来控制默认点的颜色。
|
readwrite |
This property holds the radius of the normal dot.
DPageIndicator::secondaryPointRadius 属性用来控制普通点的大小(半径)。