From 70dd53e3d30dc85b6963bb2412535d037f4edf04 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 20 May 2024 19:51:16 -0500 Subject: [PATCH] uic: recognize tag as an alias for 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 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 . Change-Id: If3345151ddf84c43a4f1fffd17d15ab77412e289 Reviewed-by: Volker Hilsheimer --- src/tools/uic/ui4.cpp | 3 ++- tests/auto/tools/uic/baseline/Widget.ui | 2 ++ tests/auto/tools/uic/baseline/Widget.ui.h | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/tools/uic/ui4.cpp b/src/tools/uic/ui4.cpp index d65fc4a8c3a..b6a8f4eb4bf 100644 --- a/src/tools/uic/ui4.cpp +++ b/src/tools/uic/ui4.cpp @@ -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; } diff --git a/tests/auto/tools/uic/baseline/Widget.ui b/tests/auto/tools/uic/baseline/Widget.ui index ab94733dcc1..285d95eb883 100644 --- a/tests/auto/tools/uic/baseline/Widget.ui +++ b/tests/auto/tools/uic/baseline/Widget.ui @@ -1,4 +1,6 @@ + Copyright (C) 2016 The Qt Company Ltd. +SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only Form diff --git a/tests/auto/tools/uic/baseline/Widget.ui.h b/tests/auto/tools/uic/baseline/Widget.ui.h index 4d4846e6c5e..a7fa74c4470 100644 --- a/tests/auto/tools/uic/baseline/Widget.ui.h +++ b/tests/auto/tools/uic/baseline/Widget.ui.h @@ -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' **