1// Copyright (C) 2018 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#include "mainwindow.h"
5
6#include <QApplication>
7#include <QCommandLineParser>
8
9QT_USE_NAMESPACE
10
11int main(int argc, char **argv)
12{
13 QApplication app(argc, argv);
14 app.setOrganizationName(QStringLiteral("QtProject"));
15 app.setApplicationName(QStringLiteral("Qt Distance Field Generator"));
16 app.setApplicationVersion(QStringLiteral(QT_VERSION_STR));
17
18 QCommandLineParser parser;
19 parser.setApplicationDescription(
20 QCoreApplication::translate(context: "main",
21 key: "Allows to prepare a font cache for Qt applications."));
22 parser.addHelpOption();
23 parser.addVersionOption();
24 parser.addPositionalArgument(name: QLatin1String("file"),
25 description: QCoreApplication::translate(context: "main",
26 key: "Font file (*.ttf, *.otf)"));
27 parser.process(app);
28
29 MainWindow mainWindow;
30 if (!parser.positionalArguments().isEmpty())
31 mainWindow.open(path: parser.positionalArguments().constFirst());
32 mainWindow.show();
33
34 return app.exec();
35}
36

source code of qttools/src/distancefieldgenerator/main.cpp