summaryrefslogtreecommitdiff
path: root/src/gui/styles/qcleanlooksstyle.cpp
diff options
context:
space:
mode:
authorjasplin <qt-info@nokia.com>2009-06-04 11:37:08 +0200
committerjasplin <qt-info@nokia.com>2009-06-04 11:42:50 +0200
commit59653437cbc37f9644aa540c46701c2142939198 (patch)
treef2369dc4418e28646c6e55a9ded1f89a4892229f /src/gui/styles/qcleanlooksstyle.cpp
parent0a37c9bbf9dc95e0ad422007718a7af11b046deb (diff)
downloadqt4-tools-59653437cbc37f9644aa540c46701c2142939198.tar.gz
Removed the internal UsePixmapCache flag in the style code.
In the style code, the internal UsePixmapCache flag made no sense in practice, so it was removed. A fortunate side-effect of the patch is that the code is now accepted by Sun CC 5.5. Reviewed-by: jbache
Diffstat (limited to 'src/gui/styles/qcleanlooksstyle.cpp')
-rw-r--r--src/gui/styles/qcleanlooksstyle.cpp30
1 files changed, 12 insertions, 18 deletions
diff --git a/src/gui/styles/qcleanlooksstyle.cpp b/src/gui/styles/qcleanlooksstyle.cpp
index 5c3779411a..b33dfc11e3 100644
--- a/src/gui/styles/qcleanlooksstyle.cpp
+++ b/src/gui/styles/qcleanlooksstyle.cpp
@@ -1664,7 +1664,7 @@ void QCleanlooksStyle::drawControl(ControlElement element, const QStyleOption *o
}
painter->fillRect(r, gradient);
- if (!UsePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
+ if (!QPixmapCache::find(pixmapName, cache)) {
cache = QPixmap(r.size());
cache.fill(Qt::transparent);
QRect pixmapRect(0, 0, r.width(), r.height());
@@ -1683,8 +1683,7 @@ void QCleanlooksStyle::drawControl(ControlElement element, const QStyleOption *o
cachePainter.drawLine(pixmapRect.topRight() + QPoint(-1, 3), pixmapRect.bottomRight() + QPoint(-1, -3)); cachePainter.setPen(QPen(option->palette.light().color()));
cachePainter.drawLine(pixmapRect.topRight() + QPoint(0, 3), pixmapRect.bottomRight() + QPoint(0, -3)); }
cachePainter.end();
- if (UsePixmapCache)
- QPixmapCache::insert(pixmapName, cache);
+ QPixmapCache::insert(pixmapName, cache);
}
painter->drawPixmap(r.topLeft(), cache);
}
@@ -2438,7 +2437,7 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp
if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
QPixmap cache;
QString pixmapName = QStyleHelper::uniqueName(QLatin1String("spinbox"), spinBox, spinBox->rect.size());
- if (!UsePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
+ if (!QPixmapCache::find(pixmapName, cache)) {
cache = QPixmap(spinBox->rect.size());
cache.fill(Qt::transparent);
QRect pixmapRect(0, 0, spinBox->rect.width(), spinBox->rect.height());
@@ -2655,8 +2654,7 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp
cachePainter.fillRect(downRect.adjusted(1, 0, 0, 0), disabledColor);
}
cachePainter.end();
- if (UsePixmapCache)
- QPixmapCache::insert(pixmapName, cache);
+ QPixmapCache::insert(pixmapName, cache);
}
painter->drawPixmap(spinBox->rect.topLeft(), cache);
}
@@ -3187,7 +3185,7 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp
if (isEnabled)
pixmapName += QLatin1String("-enabled");
- if (!UsePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
+ if (!QPixmapCache::find(pixmapName, cache)) {
cache = QPixmap(comboBox->rect.size());
cache.fill(Qt::transparent);
QPainter cachePainter(&cache);
@@ -3314,8 +3312,7 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp
drawPrimitive(PE_FrameFocusRect, &focus, &cachePainter, widget);
}
cachePainter.end();
- if (UsePixmapCache)
- QPixmapCache::insert(pixmapName, cache);
+ QPixmapCache::insert(pixmapName, cache);
}
painter->drawPixmap(comboBox->rect.topLeft(), cache);
}
@@ -3406,7 +3403,7 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp
QRect pixmapRect(0, 0, groove.width(), groove.height());
// draw background groove
- if (!UsePixmapCache || !QPixmapCache::find(groovePixmapName, cache)) {
+ if (!QPixmapCache::find(groovePixmapName, cache)) {
cache = QPixmap(pixmapRect.size());
cache.fill(Qt::transparent);
QPainter groovePainter(&cache);
@@ -3433,15 +3430,14 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp
groovePainter.setBrush(gradient);
groovePainter.drawRect(pixmapRect.adjusted(1, 1, -2, -2));
groovePainter.end();
- if (UsePixmapCache)
- QPixmapCache::insert(groovePixmapName, cache);
+ QPixmapCache::insert(groovePixmapName, cache);
}
painter->drawPixmap(groove.topLeft(), cache);
// draw blue groove highlight
QRect clipRect;
groovePixmapName += QLatin1String("_blue");
- if (!UsePixmapCache || !QPixmapCache::find(groovePixmapName, cache)) {
+ if (!QPixmapCache::find(groovePixmapName, cache)) {
cache = QPixmap(pixmapRect.size());
cache.fill(Qt::transparent);
QPainter groovePainter(&cache);
@@ -3460,8 +3456,7 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp
groovePainter.setBrush(gradient);
groovePainter.drawRect(pixmapRect.adjusted(1, 1, -2, -2));
groovePainter.end();
- if (UsePixmapCache)
- QPixmapCache::insert(groovePixmapName, cache);
+ QPixmapCache::insert(groovePixmapName, cache);
}
if (horizontal) {
if (slider->upsideDown)
@@ -3483,7 +3478,7 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp
// draw handle
if ((option->subControls & SC_SliderHandle) ) {
QString handlePixmapName = QStyleHelper::uniqueName(QLatin1String("slider_handle"), option, handle.size());
- if (!UsePixmapCache || !QPixmapCache::find(handlePixmapName, cache)) {
+ if (!QPixmapCache::find(handlePixmapName, cache)) {
cache = QPixmap(handle.size());
cache.fill(Qt::transparent);
QRect pixmapRect(0, 0, handle.width(), handle.height());
@@ -3564,8 +3559,7 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp
}
}
handlePainter.end();
- if (UsePixmapCache)
- QPixmapCache::insert(handlePixmapName, cache);
+ QPixmapCache::insert(handlePixmapName, cache);
}
painter->drawPixmap(handle.topLeft(), cache);