summaryrefslogtreecommitdiffstats
path: root/tools/dumpcpp/moc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/dumpcpp/moc.cpp')
-rw-r--r--tools/dumpcpp/moc.cpp40
1 files changed, 7 insertions, 33 deletions
diff --git a/tools/dumpcpp/moc.cpp b/tools/dumpcpp/moc.cpp
index e405b0a..99f41c2 100644
--- a/tools/dumpcpp/moc.cpp
+++ b/tools/dumpcpp/moc.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 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: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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** 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$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "moc.h"
@@ -35,6 +10,8 @@
#include <QTemporaryFile>
#include <QTextStream>
+#include <private/qtools_p.h>
+
QT_BEGIN_NAMESPACE
QByteArray setterName(const QByteArray &propertyName)
@@ -43,7 +20,7 @@ QByteArray setterName(const QByteArray &propertyName)
if (isupper(setter.at(0))) {
setter = "Set" + setter;
} else {
- setter[0] = char(toupper(setter[0]));
+ setter[0] = QtMiscUtils::toAsciiUpper(setter[0]);
setter = "set" + setter;
}
return setter;
@@ -262,16 +239,13 @@ static QString cleanCode(QString code, const QString &className, const QString &
}
QString mocCode(const QMetaObject *mo, const QString &qualifiedClassName,
- QString baseClass, QString *errorString)
+ QString *errorString)
{
QStringList name = qualifiedClassName.split(QLatin1String("::"));
if (name.isEmpty())
name.append(QLatin1String(mo->className()));
- if (baseClass.isEmpty()) {
- if (const auto sc = mo->superClass())
- baseClass = QLatin1String(sc->className());
- }
+ const QString baseClass = QLatin1String(mo->superClass()->className());
const QString tempPattern = QDir::tempPath() + QLatin1Char('/')
+ name.constLast().toLower() + QLatin1String("_XXXXXX.h");