summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorHarald Fernengel <harald@trolltech.com>2009-08-24 08:29:45 (GMT)
committerHarald Fernengel <harald@trolltech.com>2009-08-24 08:31:31 (GMT)
commit84081ce91c56168edd686a404b405dcad5f74106 (patch)
treed87584eafc3fef2079e20253db56529caba275be /src/gui
parent94c444e71e6a36cfbd3782416200ff20bdd1cea9 (diff)
downloadQt-84081ce91c56168edd686a404b405dcad5f74106.zip
Qt-84081ce91c56168edd686a404b405dcad5f74106.tar.gz
Qt-84081ce91c56168edd686a404b405dcad5f74106.tar.bz2
Remove QScopedCustomPointer
Use QScopedPointer with a custom deleter instead, so we can remove the awful QScopedCustomPointer once and for all :) Reviewed-by: Thiago
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/painting/qbrush.cpp14
-rw-r--r--src/gui/painting/qbrush.h6
2 files changed, 10 insertions, 10 deletions
diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp
index b005842..a52a270 100644
--- a/src/gui/painting/qbrush.cpp
+++ b/src/gui/painting/qbrush.cpp
@@ -389,20 +389,20 @@ void QBrush::init(const QColor &color, Qt::BrushStyle style)
{
switch(style) {
case Qt::NoBrush:
- d.data_ptr() = nullBrushInstance();
+ d.reset(nullBrushInstance());
d->ref.ref();
if (d->color != color) setColor(color);
return;
case Qt::TexturePattern:
- d.data_ptr() = new QTexturedBrushData;
+ d.reset(new QTexturedBrushData);
break;
case Qt::LinearGradientPattern:
case Qt::RadialGradientPattern:
case Qt::ConicalGradientPattern:
- d.data_ptr() = new QGradientBrushData;
+ d.reset(new QGradientBrushData);
break;
default:
- d.data_ptr() = new QBrushData;
+ d.reset(new QBrushData);
break;
}
d->ref = 1;
@@ -460,7 +460,7 @@ QBrush::QBrush(Qt::BrushStyle style)
if (qbrush_check_type(style))
init(Qt::black, style);
else {
- d.data_ptr() = nullBrushInstance();
+ d.reset(nullBrushInstance());
d->ref.ref();
}
}
@@ -476,7 +476,7 @@ QBrush::QBrush(const QColor &color, Qt::BrushStyle style)
if (qbrush_check_type(style))
init(color, style);
else {
- d.data_ptr() = nullBrushInstance();
+ d.reset(nullBrushInstance());
d->ref.ref();
}
}
@@ -493,7 +493,7 @@ QBrush::QBrush(Qt::GlobalColor color, Qt::BrushStyle style)
if (qbrush_check_type(style))
init(color, style);
else {
- d.data_ptr() = nullBrushInstance();
+ d.reset(nullBrushInstance());
d->ref.ref();
}
}
diff --git a/src/gui/painting/qbrush.h b/src/gui/painting/qbrush.h
index 51b108e..9f9819c 100644
--- a/src/gui/painting/qbrush.h
+++ b/src/gui/painting/qbrush.h
@@ -137,13 +137,13 @@ private:
friend bool Q_GUI_EXPORT qHasPixmapTexture(const QBrush& brush);
void detach(Qt::BrushStyle newStyle);
void init(const QColor &color, Qt::BrushStyle bs);
- QCustomScopedPointer<QBrushData, QBrushDataPointerDeleter> d;
+ QScopedPointer<QBrushData, QBrushDataPointerDeleter> d;
void cleanUp(QBrushData *x);
public:
inline bool isDetached() const;
- typedef QBrushData * DataPtr;
- inline DataPtr &data_ptr() { return d.data_ptr(); }
+ typedef QScopedPointer<QBrushData, QBrushDataPointerDeleter> DataPtr;
+ inline DataPtr &data_ptr() { return d; }
};
inline void QBrush::setColor(Qt::GlobalColor acolor)