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>
This commit is contained in:
Marc Mutz 2015-06-24 21:48:36 +02:00
parent 54a09a4188
commit 0d4711e2f5

View File

@ -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;