From 655f64cd697f3883889d1d77f2545bec0faee8d3 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Wed, 3 Jun 2009 16:05:54 +0200 Subject: Simplify the examples, since effect is a QObject now. --- examples/graphicsview/lighting/lighting.cpp | 7 +------ examples/graphicsview/lighting/lighting.h | 1 - examples/graphicsview/lighting/shadoweffect.cpp | 4 ++-- 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 -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); -- cgit v0.12