Changeset View
Changeset View
Standalone View
Standalone View
kstyle/oxygenstyle.cpp
Context not available. | |||||
3270 | if( rect.height() < 2*Metrics::LineEdit_FrameWidth + option->fontMetrics.height() ) | 3270 | if( rect.height() < 2*Metrics::LineEdit_FrameWidth + option->fontMetrics.height() ) | ||
---|---|---|---|---|---|
3271 | { | 3271 | { | ||
3272 | 3272 | | |||
3273 | const QColor background( palette.color( QPalette::Base ) ); | 3273 | const QBrush& background( palette.brush( QPalette::Base ) ); | ||
cfeck: Why the reference? | |||||
Force of habit... supposedly it forces copy elision (although new C++ is trying to make that happen regardless). Same pattern is used for rect and palette a couple lines above here. Note: https://herbsutter.com/2008/01/01/gotw-88-a-candidate-for-the-most-important-const/ mwoehlke: Force of habit... supposedly it forces copy elision (although new C++ is trying to make that… | |||||
3274 | 3274 | | |||
3275 | painter->setPen( Qt::NoPen ); | 3275 | painter->setPen( Qt::NoPen ); | ||
3276 | painter->setBrush( background ); | 3276 | painter->setBrush( background ); | ||
Context not available. | |||||
3295 | 3295 | | |||
3296 | // fill | 3296 | // fill | ||
3297 | painter->setPen( Qt::NoPen ); | 3297 | painter->setPen( Qt::NoPen ); | ||
3298 | painter->setBrush( palette.color( QPalette::Base ) ); | 3298 | painter->setBrush( palette.brush( QPalette::Base ) ); | ||
3299 | _helper->fillHole( *painter, rect ); | 3299 | _helper->fillHole( *painter, rect ); | ||
3300 | 3300 | | |||
3301 | // render hole | 3301 | // render hole | ||
Context not available. |
Why the reference?