DtkWidget
DTK Widget module
|
DPictureSequenceView draw a serial of picture as movie. It trigger picture update by an timer. 更多...
信号 | |
void | speedChanged (int speed) const |
void | playEnd () const |
Public 成员函数 | |
DPictureSequenceView (QWidget *parent=nullptr) | |
void | setPictureSequence (const QString &srcFormat, const QPair< int, int > &range, const int fieldWidth=0, const bool autoScale=false) |
通过一个URI模板来设置图片序列. | |
void | setPictureSequence (const QStringList &sequence, const bool autoScale=false) |
通过URI列表来设置图片序列。 | |
void | setPictureSequence (const QList< QPixmap > &sequence, const bool autoScale=false) |
通过位图数据序列来初始化图片序列. | |
void | play () |
开始/恢复播放. | |
void | pause () |
暂停播放并停止在当前图片上. | |
void | stop () |
暂停播放并停止在初始图片上. | |
int | speed () const |
void | setSpeed (int speed) |
bool | singleShot () const |
void | setSingleShot (bool singleShot) |
属性 | |
int | speed |
动画更新时间间隔,单位为毫秒(ms)。 | |
bool | singleShot |
控制动画是否只播放一次。 | |
DPictureSequenceView draw a serial of picture as movie. It trigger picture update by an timer.
\inmodule dtkwidget
将图片序列绘制为动画,通过定时器刷新来实现动画效果.
void Dtk::Widget::DPictureSequenceView::pause | ( | ) |
暂停播放并停止在当前图片上.
Pause animation and stay on current picture.
void Dtk::Widget::DPictureSequenceView::play | ( | ) |
开始/恢复播放.
Start/resume update timer and show animation.
void Dtk::Widget::DPictureSequenceView::setPictureSequence | ( | const QList< QPixmap > & | sequence, |
const bool | autoScale = false |
||
) |
通过位图数据序列来初始化图片序列.
Set picture source with pixmap array.
sequence 位图数据序列。 sequence image data list. autoScale 是否自动缩放图片,默认不缩放。 autoScale auto resize source image to widget size, default to false.
void Dtk::Widget::DPictureSequenceView::setPictureSequence | ( | const QString & | srcFormat, |
const QPair< int, int > & | range, | ||
const int | fieldWidth = 0 , |
||
const bool | autoScale = false |
||
) |
通过一个URI模板来设置图片序列.
Set picture source list by a uri template an range.
srcFormat 图片源模板,例如":/images/Spinner/Spinner%1.png"。 srcFormat is the source uri template, just like ":/images/Spinner/Spinner%1.png". range 图片的序号范围,需要为一系列整数。 range for build source uris, it make an sequence of number. fieldWidth 图片的序号转化为字符串时的宽度,通过‘0’来填充. fieldWidth string width when convert number to string, fill "0" if needed. autoScale auto resize source image to widget size, default to false. autoScale 是否自动缩放图片,默认不缩放。
void Dtk::Widget::DPictureSequenceView::setPictureSequence | ( | const QStringList & | sequence, |
const bool | autoScale = false |
||
) |
通过URI列表来设置图片序列。
Set picture source list by a QStringList.
sequence 图片源路径。 sequence url list autoScale 是否自动缩放图片,默认不缩放。 autoScale auto resize source image to widget size, default to false.
void Dtk::Widget::DPictureSequenceView::stop | ( | ) |
暂停播放并停止在初始图片上.
Stop animation and rest to first picture.
|
readwrite |
控制动画是否只播放一次。
Animation is just refresh one time.
|
readwrite |
动画更新时间间隔,单位为毫秒(ms)。
Update interval of refresh timer by ms.