diff options
Diffstat (limited to 'sources/shiboken6/ApiExtractor/dotview.cpp')
-rw-r--r-- | sources/shiboken6/ApiExtractor/dotview.cpp | 41 |
1 files changed, 9 insertions, 32 deletions
diff --git a/sources/shiboken6/ApiExtractor/dotview.cpp b/sources/shiboken6/ApiExtractor/dotview.cpp index 0ead28f68..0bd192257 100644 --- a/sources/shiboken6/ApiExtractor/dotview.cpp +++ b/sources/shiboken6/ApiExtractor/dotview.cpp @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2021 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt for Python. -** -** $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) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "dotview.h" @@ -34,12 +9,14 @@ #include <QtCore/QProcess> #include <QtCore/QTemporaryFile> +using namespace Qt::StringLiterals; + bool showDotGraph(const QString &name, const QString &graph) { - const QString imageType = u"jpg"_qs; + constexpr auto imageType = "jpg"_L1; // Write out the graph to a temporary file - QTemporaryFile dotFile(QDir::tempPath() + u'/' + name + u"_XXXXXX.dot"_qs); + QTemporaryFile dotFile(QDir::tempPath() + u'/' + name + u"_XXXXXX.dot"_s); if (!dotFile.open()) { qWarning("Cannot open temporary file: %s", qPrintable(dotFile.errorString())); return false; @@ -51,7 +28,7 @@ bool showDotGraph(const QString &name, const QString &graph) // Convert to image using "dot" const QString imageFile = tempDotFile.left(tempDotFile.size() - 3) + imageType; QProcess process; - process.start(u"dot"_qs, {u"-T"_qs + imageType, u"-o"_qs + imageFile, tempDotFile}); + process.start(u"dot"_s, {u"-T"_s + imageType, u"-o"_s + imageFile, tempDotFile}); if (!process.waitForStarted() || !process.waitForFinished()) { qWarning("Image conversion failed: %s", qPrintable(process.errorString())); return false; @@ -66,9 +43,9 @@ bool showDotGraph(const QString &name, const QString &graph) // Launch image. Should use QDesktopServices::openUrl(), // but we don't link against QtGui #ifdef Q_OS_UNIX - const QString imageViewer = u"gwenview"_qs; + constexpr auto imageViewer = "gwenview"_L1; #else - const QString imageViewer = u"mspaint"_qs; + constexpr auto imageViewer = "mspaint"_L1; #endif if (!QProcess::startDetached(imageViewer, {imageFile})) { qWarning("Failed to launch viewer: %s", qPrintable(imageViewer)); |