summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qstylesheetstyle.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-06-24 21:48:36 +0200
committerMarc Mutz <marc.mutz@kdab.com>2015-07-16 13:21:46 +0000
commit0d4711e2f52366e9cb167f5c144b1742082a3f31 (patch)
tree19c3bd86924474eeb10239a54d1a7bfb17b22041 /src/widgets/styles/qstylesheetstyle.cpp
parent54a09a41885e65fea4ca20d0e3d90d8f4e9e80c5 (diff)
QStyleSheetStyle: scope a ButtonInfo object better
Only one of the three following branches actually uses the ButtonInfo object, so create it only in that branch. Change-Id: I65c1d45d807258ed3352018c088bb4c4c66f9b84 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/widgets/styles/qstylesheetstyle.cpp')
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 235c3307da..34bc59c86f 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -746,14 +746,15 @@ QHash<QStyle::SubControl, QRect> QStyleSheetStyle::titleBarLayout(const QWidget
enum Where { Left, Right, Center, NoWhere } where = Left;
QList<ButtonInfo> infos;
for (int i = 0; i < layout.count(); i++) {
- ButtonInfo info;
- info.element = layout[i].toInt();
- if (info.element == '(') {
+ const int element = layout[i].toInt();
+ if (element == '(') {
where = Center;
- } else if (info.element == ')') {
+ } else if (element == ')') {
where = Right;
} else {
- switch (info.element) {
+ ButtonInfo info;
+ info.element = element;
+ switch (element) {
case PseudoElement_TitleBar:
if (!(tb->titleBarFlags & (Qt::WindowTitleHint | Qt::WindowSystemMenuHint)))
continue;