summaryrefslogtreecommitdiffstats
path: root/src/distancefieldgenerator/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/distancefieldgenerator/mainwindow.cpp')
-rw-r--r--src/distancefieldgenerator/mainwindow.cpp47
1 files changed, 11 insertions, 36 deletions
diff --git a/src/distancefieldgenerator/mainwindow.cpp b/src/distancefieldgenerator/mainwindow.cpp
index 41516bd49..703e73857 100644
--- a/src/distancefieldgenerator/mainwindow.cpp
+++ b/src/distancefieldgenerator/mainwindow.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 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) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "mainwindow.h"
#include "ui_mainwindow.h"
@@ -316,7 +291,7 @@ void MainWindow::save()
outBuffer.write(reinterpret_cast<char *>(&fontDirectoryHeader),
sizeof(FontDirectoryHeader));
- QVarLengthArray<QPair<quint32, quint32>> offsetLengthPairs;
+ QVarLengthArray<std::pair<quint32, quint32>> offsetLengthPairs;
offsetLengthPairs.reserve(numTables - 1);
// Copy the offset table, updating offsets
@@ -327,8 +302,8 @@ void MainWindow::save()
quint32 originalOffset = qFromBigEndian(offsetTable->offset);
quint32 length = qFromBigEndian(offsetTable->length);
- offsetLengthPairs.append(qMakePair(originalOffset, length));
- if (offsetTable->tag == qToBigEndian(MAKE_TAG('h', 'e', 'a', 'd')))
+ offsetLengthPairs.append({originalOffset, length});
+ if (offsetTable->tag == qFromBigEndian(QFont::Tag("head").value()))
headOffset = currentOffset;
TableRecord newTableRecord;
@@ -357,11 +332,11 @@ void MainWindow::save()
TableRecord qtdfRecord;
qtdfRecord.offset = qToBigEndian(currentOffset);
- qtdfRecord.length = qToBigEndian(qtdf.length());
- qtdfRecord.tag = qToBigEndian(MAKE_TAG('q', 't', 'd', 'f'));
+ qtdfRecord.length = qToBigEndian(qtdf.size());
+ qtdfRecord.tag = qFromBigEndian(QFont::Tag("qtdf").value());
quint32 checkSum = 0;
const quint32 *start = reinterpret_cast<const quint32 *>(qtdf.constData());
- const quint32 *end = reinterpret_cast<const quint32 *>(qtdf.constData() + qtdf.length());
+ const quint32 *end = reinterpret_cast<const quint32 *>(qtdf.constData() + qtdf.size());
while (start < end)
checkSum += *(start++);
qtdfRecord.checkSum = qToBigEndian(checkSum);
@@ -371,7 +346,7 @@ void MainWindow::save()
}
// Copy all font tables
- for (const QPair<quint32, quint32> &offsetLengthPair : offsetLengthPairs) {
+ for (const std::pair<quint32, quint32> &offsetLengthPair : offsetLengthPairs) {
PAD_BUFFER(outBuffer, output.size())
outBuffer.write(reinterpret_cast<char *>(inData + offsetLengthPair.first),
offsetLengthPair.second);
@@ -387,7 +362,7 @@ void MainWindow::save()
quint32 checkSum = 0;
const quint32 *start = reinterpret_cast<const quint32 *>(output.constData());
- const quint32 *end = reinterpret_cast<const quint32 *>(output.constData() + output.length());
+ const quint32 *end = reinterpret_cast<const quint32 *>(output.constData() + output.size());
while (start < end)
checkSum += *(start++);
@@ -771,7 +746,7 @@ void MainWindow::about()
"to prepare a font cache for Qt applications.</p>"
"<p>Copyright (C) %2 The Qt Company Ltd.</p>")
.arg(QLatin1String(QT_VERSION_STR))
- .arg(QLatin1String("2019")));
+ .arg(QString()));
msgBox->show();
}