14int main(
int argc,
char **argv)
16 QGuiApplication app(argc, argv);
18 QCoreApplication::setApplicationName(QStringLiteral(
"qtdiag"));
19 QCoreApplication::setApplicationVersion(QLatin1String(QT_VERSION_STR));
20 QCoreApplication::setOrganizationName(QStringLiteral(
"QtProject"));
21 QCoreApplication::setOrganizationDomain(QStringLiteral(
"qt-project.org"));
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))
42 if (!commandLineParser.isSet(noVkOption))
44 if (!commandLineParser.isSet(noRhiOption))
47 std::wcout << qtDiag(flags).toStdWString();