创建一个QGraphicsProxyWidget 的子类CustomProxy
class CustomProxy : public QGraphicsProxyWidget
在子类中重写事件
#ifndef CUSTOMPROXY_H
#define CUSTOMPROXY_H
#include <QTimeLine>
#include <QGraphicsProxyWidget>
class CustomProxy : public QGraphicsProxyWidget
{
Q_OBJECT
public:
explicit CustomProxy(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0);
QRectF boundingRect() const Q_DECL_OVERRIDE;
void paintWindowFrame(QPainter *painter, const QStyleOptionGraphicsItem *option,