DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
Dtk::Widget::DPageIndicator类 参考

The DPageIndicator class provides indicator of which page is currently showing. 更多...

类 Dtk::Widget::DPageIndicator 继承关系图:

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 ), 当前显示的元素所对应的点会被高亮以告知用户元素左右(或者上下)还有多少元素可以切换。

例如下图中控制中心首页插件区域底部的指示器:

注解
此控件只用来显示当前元素位置以及层叠关系,并不能用来实际操纵元素的显示行为。
The design of this control is that it's just used to display, not to control which page is currently visible.

构造及析构函数说明

◆ DPageIndicator()

Dtk::Widget::DPageIndicator::DPageIndicator ( QWidget *  parent = 0)
explicit

DPageIndicator::DPageIndicator constructs an instance of DPageIndicator. parent is passed to QWidget constructor.

DPageIndicator::DPageIndicatorDPageIndicator 类的构造函数。 parent 指定了控件的父控件。

成员函数说明

◆ nextPage()

void Dtk::Widget::DPageIndicator::nextPage ( )

DPageIndicator::nextPage highlights the next dot.

DPageIndicator::nextPage 将高亮位置移至下一个点。

参见
currentPage.

◆ previousPage()

void Dtk::Widget::DPageIndicator::previousPage ( )

DPageIndicator::previousPage hightlights the previous dot.

DPageIndicator::previousPage 将高亮位置移至前一个点。

参见
currentPage.

属性说明

◆ currentPage

Dtk::Widget::DPageIndicator::currentPage
readwrite

This property holds the index of currently highlighted dot.

DPageIndicator::currentPage 属性代表了当前高亮的点在所有点中的索引。

◆ pageCount

Dtk::Widget::DPageIndicator::pageCount
readwrite

This property holds the number of pages that are represented by this widget.

DPageIndicator::pageCount 属性代表了控件显示的点的数量。

◆ pointColor

Dtk::Widget::DPageIndicator::pointColor
readwrite

This property holds the color used to draw the highlighted dot.

DPageIndicator::pointColor 属性用来控制高亮点的颜色。

◆ pointDistance

Dtk::Widget::DPageIndicator::pointDistance
readwrite

This property holds the distance between two dots.

DPageIndicator::pointDistance 属性用来控制两个点之间的距离。

◆ pointRadius

Dtk::Widget::DPageIndicator::pointRadius
readwrite

This property holds the radius of the highlighted dot.

DPageIndicator::pointRadius 属性用来控制高亮点的大小(半径)。

◆ secondaryPointColor

Dtk::Widget::DPageIndicator::secondaryPointColor
readwrite

This property holds the color used to draw the noraml dots.

DPageIndicator::secondaryPointColor 属性用来控制默认点的颜色。

◆ secondaryPointRadius

Dtk::Widget::DPageIndicator::secondaryPointRadius
readwrite

This property holds the radius of the normal dot.

DPageIndicator::secondaryPointRadius 属性用来控制普通点的大小(半径)。


该类的文档由以下文件生成: