summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Hilsheimer <[email protected]>2023-06-30 21:36:52 +0200
committerVolker Hilsheimer <[email protected]>2023-07-11 14:31:17 +0200
commit022657d7d03d804c10bb20b8303a6f4f023e96cb (patch)
tree72da17c8895f186c0610ce2274f79b992f2d8ba8
parent813bbc515bdd8af843ef56115711691e926d0bcb (diff)
Refactor QStyle: const'ify some local variables
Task-number: QTBUG-114473 Pick-to: 6.6 Change-Id: I49483dc9c000fac024c81a8210515c8dd5e35559 Reviewed-by: Axel Spoerl <[email protected]>
-rw-r--r--src/widgets/styles/qfusionstyle.cpp4
-rw-r--r--src/widgets/styles/qstyle_p.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp
index 723549f3d10..df06205f23a 100644
--- a/src/widgets/styles/qfusionstyle.cpp
+++ b/src/widgets/styles/qfusionstyle.cpp
@@ -1955,7 +1955,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
case CC_SpinBox:
if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
QPixmap cache;
- QString pixmapName = QStyleHelper::uniqueName("spinbox"_L1, spinBox, spinBox->rect.size());
+ const QString pixmapName = QStyleHelper::uniqueName("spinbox"_L1, spinBox, spinBox->rect.size());
if (!QPixmapCache::find(pixmapName, &cache)) {
cache = styleCachePixmap(spinBox->rect.size());
@@ -2921,7 +2921,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
}
// draw handle
if ((option->subControls & SC_SliderHandle) ) {
- QString handlePixmapName = QStyleHelper::uniqueName("slider_handle"_L1, option, handle.size());
+ const QString handlePixmapName = QStyleHelper::uniqueName("slider_handle"_L1, option, handle.size());
if (!QPixmapCache::find(handlePixmapName, &cache)) {
cache = styleCachePixmap(handle.size());
cache.fill(Qt::transparent);
diff --git a/src/widgets/styles/qstyle_p.h b/src/widgets/styles/qstyle_p.h
index 5c1fd17130c..c4daa09c11e 100644
--- a/src/widgets/styles/qstyle_p.h
+++ b/src/widgets/styles/qstyle_p.h
@@ -60,9 +60,9 @@ inline QPixmap styleCachePixmap(const QSize &size)
QPixmap internalPixmapCache; \
QImage imageCache; \
QPainter *p = painter; \
- QString unique = QStyleHelper::uniqueName((a), option, option->rect.size()); \
+ const QString unique = QStyleHelper::uniqueName((a), option, option->rect.size()); \
int txType = painter->deviceTransform().type() | painter->worldTransform().type(); \
- bool doPixmapCache = (!option->rect.isEmpty()) \
+ const bool doPixmapCache = (!option->rect.isEmpty()) \
&& ((txType <= QTransform::TxTranslate) || (painter->deviceTransform().type() == QTransform::TxScale)); \
if (doPixmapCache && QPixmapCache::find(unique, &internalPixmapCache)) { \
painter->drawPixmap(option->rect.topLeft(), internalPixmapCache); \