diff options
Diffstat (limited to 'src/pixeltool/main.cpp')
-rw-r--r-- | src/pixeltool/main.cpp | 45 |
1 files changed, 11 insertions, 34 deletions
diff --git a/src/pixeltool/main.cpp b/src/pixeltool/main.cpp index c4250d367..c8010d4e4 100644 --- a/src/pixeltool/main.cpp +++ b/src/pixeltool/main.cpp @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 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) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "qpixeltool.h" @@ -35,18 +10,20 @@ QT_USE_NAMESPACE +using namespace Qt::StringLiterals; + int main(int argc, char **argv) { QApplication app(argc, argv); - QCoreApplication::setApplicationName(QLatin1String("PixelTool")); - QCoreApplication::setApplicationVersion(QLatin1String(QT_VERSION_STR)); - QCoreApplication::setOrganizationName(QLatin1String("QtProject")); + QCoreApplication::setApplicationName("PixelTool"_L1); + QCoreApplication::setApplicationVersion(QLatin1StringView(qVersion())); + QCoreApplication::setOrganizationName("QtProject"_L1); QCommandLineParser parser; parser.addHelpOption(); parser.addVersionOption(); - parser.addPositionalArgument(QLatin1String("preview"), - QLatin1String("The preview image to show.")); + parser.addPositionalArgument("preview"_L1, + "The preview image to show."_L1); parser.process(app); @@ -54,7 +31,7 @@ int main(int argc, char **argv) if (!parser.positionalArguments().isEmpty()) { const QString previewImageFileName = parser.positionalArguments().constFirst(); - if (QFileInfo(previewImageFileName).exists()) { + if (QFileInfo::exists(previewImageFileName)) { QImage previewImage(previewImageFileName); if (!previewImage.size().isEmpty()) pixelTool.setPreviewImage(previewImage); @@ -66,5 +43,5 @@ int main(int argc, char **argv) QObject::connect(&app, &QApplication::lastWindowClosed, &app, &QCoreApplication::quit); - return app.exec(); + return QCoreApplication::exec(); } |