Refactor QStyle: const'ify some local variables
Task-number: QTBUG-114473 Change-Id: I49483dc9c000fac024c81a8210515c8dd5e35559 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit 022657d7d03d804c10bb20b8303a6f4f023e96cb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
4a15c6bdf5
commit
acc2cdb6c8
@ -1955,7 +1955,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
|
|||||||
case CC_SpinBox:
|
case CC_SpinBox:
|
||||||
if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
|
if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
|
||||||
QPixmap cache;
|
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)) {
|
if (!QPixmapCache::find(pixmapName, &cache)) {
|
||||||
|
|
||||||
cache = styleCachePixmap(spinBox->rect.size());
|
cache = styleCachePixmap(spinBox->rect.size());
|
||||||
@ -2921,7 +2921,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
|
|||||||
}
|
}
|
||||||
// draw handle
|
// draw handle
|
||||||
if ((option->subControls & SC_SliderHandle) ) {
|
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)) {
|
if (!QPixmapCache::find(handlePixmapName, &cache)) {
|
||||||
cache = styleCachePixmap(handle.size());
|
cache = styleCachePixmap(handle.size());
|
||||||
cache.fill(Qt::transparent);
|
cache.fill(Qt::transparent);
|
||||||
|
@ -60,9 +60,9 @@ inline QPixmap styleCachePixmap(const QSize &size)
|
|||||||
QPixmap internalPixmapCache; \
|
QPixmap internalPixmapCache; \
|
||||||
QImage imageCache; \
|
QImage imageCache; \
|
||||||
QPainter *p = painter; \
|
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(); \
|
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)); \
|
&& ((txType <= QTransform::TxTranslate) || (painter->deviceTransform().type() == QTransform::TxScale)); \
|
||||||
if (doPixmapCache && QPixmapCache::find(unique, &internalPixmapCache)) { \
|
if (doPixmapCache && QPixmapCache::find(unique, &internalPixmapCache)) { \
|
||||||
painter->drawPixmap(option->rect.topLeft(), internalPixmapCache); \
|
painter->drawPixmap(option->rect.topLeft(), internalPixmapCache); \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user