DtkWidget
DTK Widget module
|
The DLoadingIndicator class provides a widget that showing loading animation. 更多...
Public 类型 | |
enum | RotationDirection { Clockwise , Counterclockwise } |
The RotationDirection enum contains the possible rotation directions of the DLoadingIndicator widget. 更多... | |
Public 槽 | |
void | start () |
DLoadingIndicator::start starts the loading animation. | |
void | stop () |
DLoadingIndicator::stop stops the loading animation. | |
void | setLoading (bool flag) |
void | setAniDuration (int msecs) |
void | setAniEasingCurve (const QEasingCurve &easing) |
DLoadingIndicator::setAniEasingCurve sets an easing curve on the loading animation. easing | |
void | setBackgroundColor (const QColor &color) |
void | setRotate (QVariant angle) |
void | setWidgetSource (QWidget *widgetSource) |
void | setImageSource (const QPixmap &imageSource) |
void | setAniEasingType (QEasingCurve::Type aniEasingType) |
void | setSmooth (bool smooth) |
void | setDirection (RotationDirection direction) |
信号 | |
void | directionChanged (RotationDirection direction) |
void | rotateChanged (qreal rotate) |
Public 成员函数 | |
DLoadingIndicator (QWidget *parent=0) | |
DLoadingIndicator::DLoadingIndicator constructs an instance of DLoadingIndicator. parent is passed to QGraphicsView constructor. | |
QColor | backgroundColor () const |
bool | loading () const |
QWidget * | widgetSource () const |
QPixmap | imageSource () const |
int | aniDuration () const |
QEasingCurve::Type | aniEasingType () const |
QSize | sizeHint () const Q_DECL_OVERRIDE |
bool | smooth () const |
RotationDirection | direction () const |
qreal | rotate () const |
Protected 成员函数 | |
void | resizeEvent (QResizeEvent *e) Q_DECL_OVERRIDE |
属性 | |
QColor | backgroundColor |
This property holds the background color of this widget. | |
bool | loading |
This property holds the animation state. | |
bool | smooth |
This property holds whether the rendered content are antialiased or smoothly filtered. | |
QPixmap | imageSource |
This property holds the image to be rendered as the content of the loading indicator. | |
QWidget * | widgetSource |
This property holds the widget to be rendered as the content of the loading indicator. | |
int | aniDuration |
This property holds the duration of the loading animation. | |
QEasingCurve::Type | aniEasingType |
This property holds the easing type of the easing curve used by the loading animation. | |
RotationDirection | direction |
This property holds the direction used while doing the rotation animation. | |
qreal | rotate |
This property holds the current rotation of the content. | |
The DLoadingIndicator class provides a widget that showing loading animation.
\inmodule dtkwidget
The RotationDirection enum contains the possible rotation directions of the DLoadingIndicator widget.
枚举值 | |
---|---|
Clockwise | the rotation is clockwise |
Counterclockwise | the rotation is counterclockwise |
Dtk::Widget::DLoadingIndicator::DLoadingIndicator | ( | QWidget * | parent = 0 | ) |
DLoadingIndicator::DLoadingIndicator constructs an instance of DLoadingIndicator. parent is passed to QGraphicsView constructor.
DLoadingIndicator::DLoadingIndicator 函数是 DLoadingIndicator 的构造函数。 parent 指定了控件的父控件。
DLoadingIndicator::RotationDirection Dtk::Widget::DLoadingIndicator::direction | ( | ) | const |
|
slot |
DLoadingIndicator::setAniEasingCurve sets an easing curve on the loading animation. easing
This property defines the easing curve of the animation. By default, a linear easing curve is used, resulting in linear interpolation. Other curves are provided, for instance, QEasingCurve::InCirc, which provides a circular entry curve. Another example is QEasingCurve::InOutElastic, which provides an elastic effect on the values of the interpolated variant.
DLoadingIndicator::setAniEasingCurve 是对 DLoadingIndicator::setAniEasingType 的补充,使用者除了使用 QEasingCurve::Type 中提供的几种预设的动画曲线,可以自定义 QEasingCurve 来 实现更为灵巧的动画。
|
slot |
DLoadingIndicator::start starts the loading animation.
DLoadingIndicator::start 启动旋转动画。
|
slot |
DLoadingIndicator::stop stops the loading animation.
DLoadingIndicator::stop 停止旋转动画。
|
readwrite |
This property holds the duration of the loading animation.
DLoadingIndicator::aniDuration 属性用来控制旋转动画的周期。
|
readwrite |
This property holds the easing type of the easing curve used by the loading animation.
DLoadingIndicator::aniEasingType 属性用来控制旋转动画的动画曲线。
|
readwrite |
This property holds the background color of this widget.
DLoadingIndicator::backgroundColor 属性用来控制 DLoadingIndicator 控件的背景色。
|
readwrite |
This property holds the direction used while doing the rotation animation.
DLoadingIndicator::direction 用来控制旋转动画的旋转方向。
默认为顺时针方向。
|
readwrite |
This property holds the image to be rendered as the content of the loading indicator.
DLoadingIndicator::imageSource 属性用来生成旋转动画中使用的图像。
|
readwrite |
This property holds the animation state.
DLoadingIndicator::loading 属性用来控制动画是否开启。
It returns true if the animation is running, false otherwise, you can also set value on this property to run or stop the animation.
设置为 true 开始动画, false 停止动画。
|
readwrite |
This property holds the current rotation of the content.
DLoadingIndicator::rotate 属性用来控制当前控件内容旋转的角度。
This property is usually used to correct the rotation of the content after calling DLoadingIndicator::stop to stop the animation.
|
readwrite |
This property holds whether the rendered content are antialiased or smoothly filtered.
DLoadingIndicator::smooth 属性代表是否要对控件启用平滑处理。
Smooth filtering gives better visual quality, but it may be slower on some hardware.
平滑处理后,控件会被进行反锯齿或者进行遮罩以达到更好的显示效果,但是在性能较差 的机器上会比较慢。
|
readwrite |
This property holds the widget to be rendered as the content of the loading indicator.
DLoadingIndicator::widgetSource 属性用来生成旋转动画中使用的图像。