Tianchi  v0.0.2 build 20130701
C++ library for Qt with VC & mingW
tcgloweffect.h
1 // **************************************************************************
2 // Tianchi C++ library for Qt (open source)
3 // 天池共享源码库
4 // 版权所有 (C) 天池共享源码库开发组
5 // 授权协议:请阅读天池共享源码库附带的授权协议
6 // **************************************************************************
7 // 文档说明:发光效果的QGraphicsEffect
8 // ==========================================================================
9 // 开发日志:
10 // 日期 人员 说明
11 // --------------------------------------------------------------------------
12 // 2012.08.23 roywillow 原创
13 // 2013.04.22 XChinux 修改
14 //
15 // ==========================================================================
17 // ==========================================================================
26 #ifndef TIANCHI_TCGLOWEFFECT_H
27 #define TIANCHI_TCGLOWEFFECT_H
28 
29 #include <tianchi/tcglobal.h>
30 #include <QGraphicsEffect>
31 
32 class TcGlowEffectPrivate;
33 
43 class TIANCHI_API TcGlowEffect : public QGraphicsEffect
44 {
45  Q_OBJECT
46 public:
47  TcGlowEffect(QObject *parent = 0);
48  virtual ~TcGlowEffect();
49 
52  void setRadius(int radius);
55  void setGlowColor(const QColor &color);
56  virtual QRectF boundingRectFor(const QRectF &sourceRect) const;
57 protected:
58  virtual void draw(QPainter *painter);
59  virtual void sourceChanged(ChangeFlags flags);
60 
61 private:
62  Q_DISABLE_COPY(TcGlowEffect)
63  Q_DECLARE_PRIVATE(TcGlowEffect)
64  TcGlowEffectPrivate* const d_ptr;
65 };
66 
67 #endif // GLOWEFFECT_H