uic: recognize <legal> tag as an alias for <comment>

That is printed at the top of the file and we've used it for the
copyright inside Qt, so just declare an alias.

[ChangeLog][uic] The Qt UI Compiler now accepts a <legal> XML tag to
indicate the copyright of the UI file and other legal terms of use. The
text of this tag will be emitted in the generated code. This tag is an
alias to <comment>.

Change-Id: If3345151ddf84c43a4f1fffd17d15ab77412e289
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Thiago Macieira 2024-05-20 19:51:16 -05:00
parent d5dd7da3ee
commit 70dd53e3d3
3 changed files with 9 additions and 1 deletions

View File

@ -77,7 +77,8 @@ void DomUI::read(QXmlStreamReader &reader)
setElementAuthor(reader.readElementText());
continue;
}
if (!tag.compare(u"comment"_s, Qt::CaseInsensitive)) {
if (!tag.compare(u"comment"_s, Qt::CaseInsensitive)
|| !tag.compare(u"legal"_s, Qt::CaseInsensitive)) {
setElementComment(reader.readElementText());
continue;
}

View File

@ -1,4 +1,6 @@
<ui version="4.0" >
<legal>Copyright (C) 2016 The Qt Company Ltd.
SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only</legal>
<class>Form</class>
<widget class="QWidget" name="Form" >
<property name="geometry" >

View File

@ -1,3 +1,8 @@
/*
Copyright (C) 2016 The Qt Company Ltd.
SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
*/
/********************************************************************************
** Form generated from reading UI file 'Widget.ui'
**