diff options
Diffstat (limited to 'src/tools/uic/ui4.cpp')
-rw-r--r-- | src/tools/uic/ui4.cpp | 134 |
1 files changed, 82 insertions, 52 deletions
diff --git a/src/tools/uic/ui4.cpp b/src/tools/uic/ui4.cpp index acde63d301..5a609ef42b 100644 --- a/src/tools/uic/ui4.cpp +++ b/src/tools/uic/ui4.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the tools applications of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -129,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()); @@ -777,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()); @@ -854,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()); @@ -936,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()); @@ -1018,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()); @@ -1158,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()); @@ -1263,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()); @@ -1337,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()); @@ -1583,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()); @@ -1686,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()); @@ -1832,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()); @@ -2371,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()); @@ -2537,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()); @@ -2612,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()); @@ -2777,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()); @@ -2963,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()); @@ -3300,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()); @@ -3463,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()); @@ -3767,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()); @@ -3857,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()); @@ -3986,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()); @@ -4132,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()); @@ -4312,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()); @@ -4467,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()); @@ -5307,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()); @@ -5390,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()); @@ -6047,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()); @@ -6144,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()); @@ -6252,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()); @@ -6586,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()); @@ -7255,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()); @@ -8391,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()); @@ -8497,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()); @@ -8890,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()); @@ -8960,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()); |