summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/painting')
-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)