CCIMXDesktop
Loading...
Searching...
No Matches
ScrollingLabel.h
1
#ifndef SCROLLINGLABEL_H
2
#define SCROLLINGLABEL_H
3
#include <QTimer>
4
#include <QWidget>
5
class
QPropertyAnimation;
6
namespace
Ui {
7
class
ScrollingLabel
;
8
}
9
15
class
ScrollingLabel
:
public
QWidget {
16
Q_OBJECT
17
18
public
:
22
static
constexpr
const
int
ANIMATION_INTERVAL
= 100;
28
static
constexpr
const
short
STEP_SHORT
= 2;
34
explicit
ScrollingLabel
(QWidget* parent =
nullptr
);
35
40
void
setText
(
const
QString& text);
41
~ScrollingLabel
();
42
43
protected
:
48
void
resizeEvent
(QResizeEvent*)
override
{
49
updateScroll();
50
}
51
private
slots:
52
void
scrollText();
53
void
updateScroll();
54
55
private
:
56
Ui::ScrollingLabel* ui;
57
QTimer timer;
58
int
offset { 0 };
59
};
60
61
#endif
// SCROLLINGLABEL_H
ScrollingLabel
The ScrollingLabel class provides the scrolling label.
Definition
ScrollingLabel.h:15
ScrollingLabel::STEP_SHORT
static constexpr const short STEP_SHORT
STEP_SHORT the step short everytime the animations make the text scroll in pix level so,...
Definition
ScrollingLabel.h:28
ScrollingLabel::setText
void setText(const QString &text)
setText set the text of the label
Definition
ScrollingLabel.cpp:13
ScrollingLabel::resizeEvent
void resizeEvent(QResizeEvent *) override
resize hooks
Definition
ScrollingLabel.h:48
ScrollingLabel::ANIMATION_INTERVAL
static constexpr const int ANIMATION_INTERVAL
ANIMATION_INTERVAL the animation interval.
Definition
ScrollingLabel.h:22
extern_app
MediaPlayer
ui
ScrollingLabel.h
Generated by
1.9.8