Fix layout tests for GCC 5.2.x/5.3.x

GCC bug 68949 causes tst_QGraphicsGridLayout and tst_QGraphicsLinearLayout
to fail on 5.2.x/5.3.x: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68949.
This change adds aggregate initialization to QSizeF arrays to work around
the bug. The bug was discovered when compiling and running tests on ARM
with GCC 5.3.0.

Change-Id: I9ecf7b032b6ca1477c29dca3bd7d0ec8d69a0454
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Sami Nurmenniemi 2017-03-23 17:16:58 +02:00
parent 781b5a6198
commit b387257261
2 changed files with 8 additions and 4 deletions

View File

@ -150,7 +150,8 @@ public:
m_fnConstraint = fnConstraint;
}
QSizeF m_sizeHints[Qt::NSizeHints];
// Initializer {} is a workaround for gcc bug 68949
QSizeF m_sizeHints[Qt::NSizeHints] {};
QSizeF (*m_fnConstraint)(Qt::SizeHint, const QSizeF &);
};
@ -280,8 +281,10 @@ struct ItemDesc
int m_rowSpan;
int m_colSpan;
QSizePolicy m_sizePolicy;
QSizeF m_sizeHints[Qt::NSizeHints];
QSizeF m_sizes[Qt::NSizeHints];
// Initializer {} is a workaround for gcc bug 68949
QSizeF m_sizeHints[Qt::NSizeHints] {};
QSizeF m_sizes[Qt::NSizeHints] {};
Qt::Alignment m_align;
Qt::Orientation m_constraintOrientation;

View File

@ -165,7 +165,8 @@ public:
return QGraphicsWidget::sizeHint(which, constraint);
}
QSizeF m_sizeHints[Qt::NSizeHints];
// Initializer {} is a workaround for gcc bug 68949
QSizeF m_sizeHints[Qt::NSizeHints] {};
QBrush m_brush;
};