uic: eradicate all Q_FOREACH loops [generated code]

... by replacing them with C++11 range-for loops.

Change-Id: I0561174d9981ee2171c23644b5e7aebeb8c25665
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
This commit is contained in:
Marc Mutz 2016-01-26 11:41:39 +01:00
parent 364e3eb680
commit b8fb0ee999

View File

@ -124,7 +124,8 @@ DomUI::~DomUI()
void DomUI::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("version")) {
setAttributeVersion(attribute.value().toString());
@ -772,7 +773,8 @@ DomInclude::~DomInclude()
void DomInclude::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("location")) {
setAttributeLocation(attribute.value().toString());
@ -849,7 +851,8 @@ DomResources::~DomResources()
void DomResources::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
@ -931,7 +934,8 @@ DomResource::~DomResource()
void DomResource::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("location")) {
setAttributeLocation(attribute.value().toString());
@ -1013,7 +1017,8 @@ DomActionGroup::~DomActionGroup()
void DomActionGroup::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
@ -1153,7 +1158,8 @@ DomAction::~DomAction()
void DomAction::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
@ -1258,7 +1264,8 @@ DomActionRef::~DomActionRef()
void DomActionRef::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
@ -1332,7 +1339,8 @@ DomButtonGroup::~DomButtonGroup()
void DomButtonGroup::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
@ -1578,7 +1586,8 @@ DomImage::~DomImage()
void DomImage::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
@ -1681,7 +1690,8 @@ DomImageData::~DomImageData()
void DomImageData::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("format")) {
setAttributeFormat(attribute.value().toString());
@ -1827,7 +1837,8 @@ DomHeader::~DomHeader()
void DomHeader::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("location")) {
setAttributeLocation(attribute.value().toString());
@ -2366,7 +2377,8 @@ DomPropertyData::~DomPropertyData()
void DomPropertyData::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("type")) {
setAttributeType(attribute.value().toString());
@ -2532,7 +2544,8 @@ DomLayoutDefault::~DomLayoutDefault()
void DomLayoutDefault::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("spacing")) {
setAttributeSpacing(attribute.value().toInt());
@ -2607,7 +2620,8 @@ DomLayoutFunction::~DomLayoutFunction()
void DomLayoutFunction::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("spacing")) {
setAttributeSpacing(attribute.value().toString());
@ -2772,7 +2786,8 @@ DomLayout::~DomLayout()
void DomLayout::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("class")) {
setAttributeClass(attribute.value().toString());
@ -2958,7 +2973,8 @@ DomLayoutItem::~DomLayoutItem()
void DomLayoutItem::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("row")) {
setAttributeRow(attribute.value().toInt());
@ -3295,7 +3311,8 @@ DomItem::~DomItem()
void DomItem::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("row")) {
setAttributeRow(attribute.value().toInt());
@ -3458,7 +3475,8 @@ DomWidget::~DomWidget()
void DomWidget::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("class")) {
setAttributeClass(attribute.value().toString());
@ -3762,7 +3780,8 @@ DomSpacer::~DomSpacer()
void DomSpacer::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
@ -3852,7 +3871,8 @@ DomColor::~DomColor()
void DomColor::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("alpha")) {
setAttributeAlpha(attribute.value().toInt());
@ -3981,7 +4001,8 @@ DomGradientStop::~DomGradientStop()
void DomGradientStop::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("position")) {
setAttributePosition(attribute.value().toDouble());
@ -4127,7 +4148,8 @@ DomGradient::~DomGradient()
void DomGradient::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("startx")) {
setAttributeStartX(attribute.value().toDouble());
@ -4307,7 +4329,8 @@ DomBrush::~DomBrush()
void DomBrush::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("brushstyle")) {
setAttributeBrushStyle(attribute.value().toString());
@ -4462,7 +4485,8 @@ DomColorRole::~DomColorRole()
void DomColorRole::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("role")) {
setAttributeRole(attribute.value().toString());
@ -5302,7 +5326,8 @@ DomLocale::~DomLocale()
void DomLocale::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("language")) {
setAttributeLanguage(attribute.value().toString());
@ -5385,7 +5410,8 @@ DomSizePolicy::~DomSizePolicy()
void DomSizePolicy::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("hsizetype")) {
setAttributeHSizeType(attribute.value().toString());
@ -6042,7 +6068,8 @@ DomStringList::~DomStringList()
void DomStringList::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("notr")) {
setAttributeNotr(attribute.value().toString());
@ -6139,7 +6166,8 @@ DomResourcePixmap::~DomResourcePixmap()
void DomResourcePixmap::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("resource")) {
setAttributeResource(attribute.value().toString());
@ -6247,7 +6275,8 @@ DomResourceIcon::~DomResourceIcon()
void DomResourceIcon::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("theme")) {
setAttributeTheme(attribute.value().toString());
@ -6581,7 +6610,8 @@ DomString::~DomString()
void DomString::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("notr")) {
setAttributeNotr(attribute.value().toString());
@ -7250,7 +7280,8 @@ DomProperty::~DomProperty()
void DomProperty::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
@ -8386,7 +8417,8 @@ DomConnectionHint::~DomConnectionHint()
void DomConnectionHint::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("type")) {
setAttributeType(attribute.value().toString());
@ -8492,7 +8524,8 @@ DomScript::~DomScript()
void DomScript::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("source")) {
setAttributeSource(attribute.value().toString());
@ -8885,7 +8918,8 @@ DomPropertyToolTip::~DomPropertyToolTip()
void DomPropertyToolTip::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
@ -8955,7 +8989,8 @@ DomStringPropertySpecification::~DomStringPropertySpecification()
void DomStringPropertySpecification::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
const QXmlStreamAttributes attributes = reader.attributes();
for (const QXmlStreamAttribute &attribute : attributes) {
QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());