diff options
author | Ariya Hidayat <ariya.hidayat@nokia.com> | 2009-06-03 14:05:54 (GMT) |
---|---|---|
committer | Ariya Hidayat <ariya.hidayat@nokia.com> | 2009-06-03 17:12:44 (GMT) |
commit | 655f64cd697f3883889d1d77f2545bec0faee8d3 (patch) | |
tree | a073fd9725bb29553049d6611c2869bb032e9c13 /examples | |
parent | 9f35183f534f04144c5498ba73ef804e9ed3fb67 (diff) | |
download | Qt-655f64cd697f3883889d1d77f2545bec0faee8d3.zip Qt-655f64cd697f3883889d1d77f2545bec0faee8d3.tar.gz Qt-655f64cd697f3883889d1d77f2545bec0faee8d3.tar.bz2 |
Simplify the examples, since effect is a QObject now.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/graphicsview/lighting/lighting.cpp | 7 | ||||
-rw-r--r-- | examples/graphicsview/lighting/lighting.h | 1 | ||||
-rw-r--r-- | examples/graphicsview/lighting/shadoweffect.cpp | 4 | ||||
-rw-r--r-- | examples/graphicsview/lighting/shadoweffect.h | 2 |
4 files changed, 4 insertions, 10 deletions
diff --git a/examples/graphicsview/lighting/lighting.cpp b/examples/graphicsview/lighting/lighting.cpp index f92e428..445d7f9 100644 --- a/examples/graphicsview/lighting/lighting.cpp +++ b/examples/graphicsview/lighting/lighting.cpp @@ -64,11 +64,6 @@ Lighting::Lighting(QWidget *parent): QGraphicsView(parent), angle(0.0) setFrameStyle(QFrame::NoFrame); } -Lighting::~Lighting() -{ - delete m_shadowEffect; -} - void Lighting::setupScene() { m_scene.setSceneRect(-300, -200, 600, 460); @@ -93,7 +88,7 @@ void Lighting::setupScene() m_lightSource = m_scene.addPixmap(pixmap); m_lightSource->setZValue(2); - m_shadowEffect = new ShadowEffect(m_lightSource); + m_shadowEffect = new ShadowEffect(m_lightSource, this); for (int i = -2; i < 3; ++i) for (int j = -2; j < 3; ++j) { diff --git a/examples/graphicsview/lighting/lighting.h b/examples/graphicsview/lighting/lighting.h index 0334d10..66237f6 100644 --- a/examples/graphicsview/lighting/lighting.h +++ b/examples/graphicsview/lighting/lighting.h @@ -53,7 +53,6 @@ class Lighting: public QGraphicsView public: Lighting(QWidget *parent = 0); - ~Lighting(); private slots: void animate(); diff --git a/examples/graphicsview/lighting/shadoweffect.cpp b/examples/graphicsview/lighting/shadoweffect.cpp index c1d384a..726cbd0 100644 --- a/examples/graphicsview/lighting/shadoweffect.cpp +++ b/examples/graphicsview/lighting/shadoweffect.cpp @@ -43,8 +43,8 @@ #include <math.h> -ShadowEffect::ShadowEffect(QGraphicsItem *source) - : QGraphicsShadowEffect() +ShadowEffect::ShadowEffect(QGraphicsItem *source, QObject *parent) + : QGraphicsShadowEffect(parent) , m_lightSource(source) { setBlurRadius(8); diff --git a/examples/graphicsview/lighting/shadoweffect.h b/examples/graphicsview/lighting/shadoweffect.h index 09b63e3..02d0bf1 100644 --- a/examples/graphicsview/lighting/shadoweffect.h +++ b/examples/graphicsview/lighting/shadoweffect.h @@ -48,7 +48,7 @@ class ShadowEffect: public QGraphicsShadowEffect { public: - ShadowEffect(QGraphicsItem *source); + ShadowEffect(QGraphicsItem *source, QObject *parent = 0); QRectF boundingRectFor(const QGraphicsItem *item); |