qt/LedOK/program/etext.h

40 lines
911 B
C
Raw Normal View History

2023-04-18 14:14:46 +08:00
#ifndef ETEXT_H
#define ETEXT_H
#include "ebase.h"
class EText : public EBase {
Q_OBJECT
public:
2024-08-07 18:18:37 +08:00
explicit EText(EBase *multiWin = 0);
explicit EText(const JObj &json, EBase *multiWin = 0);
2023-04-18 14:14:46 +08:00
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
int type() const override { return EBase::Text; }
QWidget* attrWgt() override;
bool save(const QString &pRoot) override;
2023-10-23 14:58:29 +08:00
JObj attrJson() const override;
2023-04-18 14:14:46 +08:00
2024-02-21 18:08:50 +08:00
QString text;
Qt::Alignment align;
2024-08-07 18:18:37 +08:00
QColor backColor = Qt::transparent;
2024-02-21 18:08:50 +08:00
QString playMode = "Flip";
QString direction = "left";
int speed = 60;
2024-08-07 18:18:37 +08:00
int headTailSpacing = 10;
2024-02-21 18:08:50 +08:00
2023-04-18 14:14:46 +08:00
public slots:
void updImg();
signals:
void updPageCnt();
private:
void alignV(QImage &, int h=0);
QImage copy(QImage &img, int x, int y, int w, int h);
QList<QImage> mImgs;
int curIdx{0};
};
#endif // ETEXT_H