diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2017-06-15 15:56:03 +0200 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2017-06-27 10:26:15 +0000 |
commit | ac098eef427e20b35f14b0b3f84483e7828d07d4 (patch) | |
tree | 5dede72bbed1427a5328ef762fff64a10ebc3783 /src | |
parent | 88e56d0932a3615231adf40d5ae033e742d72c33 (diff) |
uic: Ignore deprecated elements instead of raising an error
[ChangeLog][QtCore][uic] Ignore old images embedded in ui files,
which were imported from Qt 3. uic will now behave consistently
with Qt Designer - both will ignore them.
Change-Id: Ib2dfd0bb28c0532463fdee2d46a8f0979c28c80c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/tools/uic/ui4.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/tools/uic/ui4.cpp b/src/tools/uic/ui4.cpp index 57400c1e3c..bc1039871e 100644 --- a/src/tools/uic/ui4.cpp +++ b/src/tools/uic/ui4.cpp @@ -39,6 +39,7 @@ using namespace QFormInternal; /******************************************************************************* ** Implementations */ + DomUI::~DomUI() { delete m_widget; @@ -136,6 +137,11 @@ void DomUI::read(QXmlStreamReader &reader) setElementTabStops(v); continue; } + if (!tag.compare(QLatin1String("images"), Qt::CaseInsensitive)) { + qWarning("Omitting deprecated element <images>."); + reader.skipCurrentElement(); + continue; + } if (!tag.compare(QLatin1String("includes"), Qt::CaseInsensitive)) { DomIncludes *v = new DomIncludes(); v->read(reader); @@ -1236,10 +1242,25 @@ void DomCustomWidget::read(QXmlStreamReader &reader) setElementContainer(reader.readElementText().toInt()); continue; } + if (!tag.compare(QLatin1String("sizepolicy"), Qt::CaseInsensitive)) { + qWarning("Omitting deprecated element <sizepolicy>."); + reader.skipCurrentElement(); + continue; + } if (!tag.compare(QLatin1String("pixmap"), Qt::CaseInsensitive)) { setElementPixmap(reader.readElementText()); continue; } + if (!tag.compare(QLatin1String("script"), Qt::CaseInsensitive)) { + qWarning("Omitting deprecated element <script>."); + reader.skipCurrentElement(); + continue; + } + if (!tag.compare(QLatin1String("properties"), Qt::CaseInsensitive)) { + qWarning("Omitting deprecated element <properties>."); + reader.skipCurrentElement(); + continue; + } if (!tag.compare(QLatin1String("slots"), Qt::CaseInsensitive)) { DomSlots *v = new DomSlots(); v->read(reader); @@ -2111,6 +2132,16 @@ void DomWidget::read(QXmlStreamReader &reader) m_property.append(v); continue; } + if (!tag.compare(QLatin1String("script"), Qt::CaseInsensitive)) { + qWarning("Omitting deprecated element <script>."); + reader.skipCurrentElement(); + continue; + } + if (!tag.compare(QLatin1String("widgetdata"), Qt::CaseInsensitive)) { + qWarning("Omitting deprecated element <widgetdata>."); + reader.skipCurrentElement(); + continue; + } if (!tag.compare(QLatin1String("attribute"), Qt::CaseInsensitive)) { DomProperty *v = new DomProperty(); v->read(reader); |