1 Star 0 Fork 14

yupeng/WorkXP

forked from ITVENTI科技/WorkXP 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
loader.h 1.63 KB
一键复制 编辑 原始数据 按行查看 历史
huanglingzhi 提交于 2020-06-29 18:07 . Let's roll
#ifndef LOADER_H
#define LOADER_H
#include <QGraphicsObject>
#include <QSizeF>
#include <QPixmap>
#include <QTimer>
#include "graphicsitemtype.h"
class LoaderPixmap : public QGraphicsObject
{
QSizeF m_size;
QPixmap m_loaderPixmap;
QPixmap m_pixmap;
int m_rotate;
int m_progress;
QTimer m_timer;
QGraphicsItem * m_parent;
public:
enum { Type = UserType+ GRAPHICSITEM_TYPE_LOADERPIXMAP };
int type() const override
{
// Enable the use of qgraphicsitem_cast with this item.
return Type;
}
public:
LoaderPixmap(QGraphicsItem * parent = Q_NULLPTR);
QRectF boundingRect() const override;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget) override;
//inline QSizeF size() {return m_size;} const;
void setSize(const QSizeF & value);
void start();
void stop();
void setProgress(int progress);
};
class Loader : public QGraphicsObject
{
Q_OBJECT
LoaderPixmap * m_loaderPixmap;
QGraphicsItem * m_parent;
public:
enum { Type = UserType+ GRAPHICSITEM_TYPE_LOADER };
int type() const override
{
// Enable the use of qgraphicsitem_cast with this item.
return Type;
}
public:
Loader(QGraphicsItem *parent = Q_NULLPTR);
QRectF boundingRect() const override;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget) override;
void start();
void stop();
public slots:
void setProgress(int progress);
};
#endif // LOADER_H
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/yujingpeng/workxp.git
git@gitee.com:yujingpeng/workxp.git
yujingpeng
workxp
WorkXP
master

搜索帮助