Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 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 "qtdiag.h"
5
6#include <QtGui/QGuiApplication>
7#include <QtCore/QCommandLineParser>
8
9#include <iostream>
10#include <string>
11
13
14int main(int argc, char **argv)
15{
16 QGuiApplication app(argc, argv);
17
18 QCoreApplication::setApplicationName(QStringLiteral("qtdiag"));
19 QCoreApplication::setApplicationVersion(QLatin1String(QT_VERSION_STR));
20 QCoreApplication::setOrganizationName(QStringLiteral("QtProject"));
21 QCoreApplication::setOrganizationDomain(QStringLiteral("qt-project.org"));
22
23 QCommandLineParser commandLineParser;
24 const QCommandLineOption noGlOption(QStringLiteral("no-gl"), QStringLiteral("Do not output GL information"));
25 const QCommandLineOption glExtensionOption(QStringLiteral("gl-extensions"), QStringLiteral("List GL extensions"));
26 const QCommandLineOption fontOption(QStringLiteral("fonts"), QStringLiteral("Output list of fonts"));
27 const QCommandLineOption noVkOption(QStringLiteral("no-vulkan"), QStringLiteral("Do not output Vulkan information"));
28 const QCommandLineOption noRhiOption(QStringLiteral("no-rhi"), QStringLiteral("Do not output RHI information"));
29 commandLineParser.setApplicationDescription(QStringLiteral("Prints diagnostic output about the Qt library."));
30 commandLineParser.addOption(noGlOption);
31 commandLineParser.addOption(glExtensionOption);
32 commandLineParser.addOption(fontOption);
33 commandLineParser.addOption(noVkOption);
34 commandLineParser.addOption(noRhiOption);
35 commandLineParser.addHelpOption();
36 commandLineParser.process(app);
37 unsigned flags = commandLineParser.isSet(noGlOption) ? 0u : unsigned(QtDiagGl);
38 if (commandLineParser.isSet(glExtensionOption))
39 flags |= QtDiagGlExtensions;
40 if (commandLineParser.isSet(fontOption))
41 flags |= QtDiagFonts;
42 if (!commandLineParser.isSet(noVkOption))
43 flags |= QtDiagVk;
44 if (!commandLineParser.isSet(noRhiOption))
45 flags |= QtDiagRhi;
46
47 std::wcout << qtDiag(flags).toStdWString();
48 std::wcout.flush();
49 return 0;
50}
int main(int argc, char *argv[])
[2]
Definition buffer.cpp:77