summaryrefslogtreecommitdiffstats
path: root/examples/graphicsview
diff options
context:
space:
mode:
Diffstat (limited to 'examples/graphicsview')
-rw-r--r--examples/graphicsview/lighting/lighting.cpp7
-rw-r--r--examples/graphicsview/lighting/lighting.h1
-rw-r--r--examples/graphicsview/lighting/shadoweffect.cpp4
-rw-r--r--examples/graphicsview/lighting/shadoweffect.h2
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);