DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
dtickeffect.h
1// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DTICKEFFECT_H
6#define DTICKEFFECT_H
7
8#include <dtkwidget_global.h>
9#include <DObject>
10
11#include <QGraphicsEffect>
12
13DWIDGET_BEGIN_NAMESPACE
14
15class DTickEffectPrivate;
16class LIBDTKWIDGETSHARED_EXPORT DTickEffect : public QGraphicsEffect, public DTK_CORE_NAMESPACE::DObject
17{
18 Q_OBJECT
19public:
20 explicit DTickEffect(QWidget *widget, QWidget *parent = 0);
21
22 enum Direction{
23 LeftToRight,
24 RightToLeft,
25 TopToBottom,
26 BottomToTop
27 };
28
29 void play();
30 void stop();
31 void pause();
32 void resume();
33
34 void setDirection(Direction direction);
35 void setFixedPixelMove(const int pixel);
36
37Q_SIGNALS:
38 void finished();
40
41protected:
42 void draw(QPainter *painter) Q_DECL_OVERRIDE;
43 bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE;
44
45private:
46 D_DECLARE_PRIVATE(DTickEffect)
47};
48
49DWIDGET_END_NAMESPACE
50
51#endif // DTICKEFFECT_H
这个类提供了跑马灯效果,可以让控件的内容滚动起来.
Definition dtickeffect.h:17