本文整理汇总了C++中ProbeABI::id方法的典型用法代码示例。如果您正苦于以下问题:C++ ProbeABI::id方法的具体用法?C++ ProbeABI::id怎么用?C++ ProbeABI::id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProbeABI
的用法示例。
在下文中一共展示了ProbeABI::id方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testDetectProcess
void testDetectProcess()
{
ProbeABIDetector detector;
QVERIFY(!detector.qtCoreForProcess(QCoreApplication::applicationPid()).isEmpty());
const ProbeABI abi = detector.abiForProcess(QCoreApplication::applicationPid());
QCOMPARE(abi.id(), QStringLiteral(GAMMARAY_PROBE_ABI));
}
示例2: testToString
void testToString()
{
QFETCH(QString, id);
QFETCH(int, majorVersion);
QFETCH(int, minorVersion);
QFETCH(bool, isDebug);
QFETCH(QString, arch);
QFETCH(QString, compiler);
QFETCH(QString, compilerVersion);
ProbeABI abi;
abi.setQtVersion(majorVersion, minorVersion);
abi.setIsDebug(isDebug);
abi.setArchitecture(arch);
abi.setCompiler(compiler);
abi.setCompilerVersion(compilerVersion);
QCOMPARE(abi.id(), id);
}
示例3: main
int main(int argc, char **argv)
{
QCoreApplication::setOrganizationName(QStringLiteral("KDAB"));
QCoreApplication::setOrganizationDomain(QStringLiteral("kdab.com"));
QCoreApplication::setApplicationName(QStringLiteral("GammaRay"));
installSignalHandler();
QStringList args;
args.reserve(argc);
for (int i = 1; i < argc; ++i) {
args.push_back(QString::fromLocal8Bit(argv[i]));
}
#ifdef HAVE_QT_WIDGETS
QApplication app(argc, argv); // for style inspector
#else
QCoreApplication app(argc, argv);
#endif
Paths::setRelativeRootPath(GAMMARAY_INVERSE_BIN_DIR);
QStringList builtInArgs = QStringList() << QStringLiteral("-style")
<< QStringLiteral("-stylesheet")
<< QStringLiteral("-graphicssystem");
LaunchOptions options;
while (!args.isEmpty() && args.first().startsWith('-')) {
const QString arg = args.takeFirst();
if ((arg == QLatin1String("-i") || arg == QLatin1String("--injector")) && !args.isEmpty()) {
options.setInjectorType(args.takeFirst());
continue;
}
if ((arg == QLatin1String("-p") || arg == QLatin1String("--pid")) && !args.isEmpty()) {
options.setPid( args.takeFirst().toInt() );
continue;
}
if (arg == QLatin1String("-h") || arg == QLatin1String("--help")) {
usage(argv[0]);
return 0;
}
if (arg == QLatin1String("-v") || arg == QLatin1String("--version")) {
out << "GammaRay version " << GAMMARAY_VERSION_STRING << endl;
out << "Copyright (C) 2010-2016 Klaralvdalens Datakonsult AB, "
<< "a KDAB Group company, [email protected]" << endl;
return 0;
}
if (arg == QLatin1String("--inprocess")) {
options.setUiMode(LaunchOptions::InProcessUi);
}
if (arg == QLatin1String("--inject-only")) {
options.setUiMode(LaunchOptions::NoUi);
}
if (arg == QLatin1String("--listen") && !args.isEmpty()) {
options.setProbeSetting(QStringLiteral("ServerAddress"), urlFromUserInput(args.takeFirst()).toString());
}
if ( arg == QLatin1String("--no-listen")) {
options.setProbeSetting(QStringLiteral("RemoteAccessEnabled"), false);
options.setUiMode(LaunchOptions::InProcessUi);
}
if ( arg == QLatin1String("--list-probes")) {
foreach( const ProbeABI &abi, ProbeFinder::listProbeABIs())
out << abi.id() << " (" << abi.displayString() << ")" << endl;
return 0;
}
if ( arg == QLatin1String("--probe") && !args.isEmpty()) {
const ProbeABI abi = ProbeABI::fromString(args.takeFirst());
if (!abi.isValid()) {
out << "Invalid probe ABI specified, see --list-probes for valid ones." << endl;
return 1;
}
if (ProbeFinder::findProbe(QStringLiteral(GAMMARAY_PROBE_BASENAME), abi).isEmpty()) {
out << abi.id() << "is not a known probe, see --list-probes." << endl;
return 1;
}
options.setProbeABI(abi);
}
if ( arg == QLatin1String("--connect") && !args.isEmpty()) {
const QUrl url = urlFromUserInput(args.takeFirst());
ClientLauncher client;
client.launch(url);
client.waitForFinished();
return 0;
}
// debug/test options
if (arg == QLatin1String("-filtertest")) {
qputenv("GAMMARAY_TEST_FILTER", "1");
}
if (arg == QLatin1String("-unittest")) {
qputenv("GAMMARAY_UNITTEST", "1");
}
if (arg == QLatin1String("-modeltest")) {
qputenv("GAMMARAY_MODELTEST", "1");
}
// built-in arguments of QApp, could be meant for us if we are showing the launcher window
foreach (const QString &builtInArg, builtInArgs) {
if (arg == builtInArg && !args.isEmpty()) {
args.takeFirst();
}
}
}
示例4: main
int main(int argc, char **argv)
{
QCoreApplication::setOrganizationName(QStringLiteral("KDAB"));
QCoreApplication::setOrganizationDomain(QStringLiteral("kdab.com"));
QCoreApplication::setApplicationName(QStringLiteral("GammaRay"));
installSignalHandler();
QStringList args;
args.reserve(argc);
for (int i = 1; i < argc; ++i)
args.push_back(QString::fromLocal8Bit(argv[i]));
#ifndef GAMMARAY_CORE_ONLY_LAUNCHER
QApplication app(argc, argv); // for style inspector
#else
QCoreApplication app(argc, argv);
#endif
Paths::setRelativeRootPath(GAMMARAY_INVERSE_BIN_DIR);
QStringList builtInArgs = QStringList() << QStringLiteral("-style")
<< QStringLiteral("-stylesheet")
<< QStringLiteral("-graphicssystem");
LaunchOptions options;
while (!args.isEmpty() && args.first().startsWith('-')) {
const QString arg = args.takeFirst();
if ((arg == QLatin1String("-i") || arg == QLatin1String("--injector")) && !args.isEmpty()) {
options.setInjectorType(args.takeFirst());
continue;
}
if ((arg == QLatin1String("-o") || arg == QLatin1String("--injector-override"))
&& !args.isEmpty()) {
options.setInjectorTypeExecutableOverride(args.takeFirst());
continue;
}
if ((arg == QLatin1String("-p") || arg == QLatin1String("--pid")) && !args.isEmpty()) {
options.setPid(args.takeFirst().toInt());
continue;
}
if (arg == QLatin1String("-h") || arg == QLatin1String("--help")) {
usage(argv[0]);
return 0;
}
if (arg == QLatin1String("-v") || arg == QLatin1String("--version")) {
out << "GammaRay version " << GAMMARAY_VERSION_STRING << endl;
out << "Copyright (C) 2010-2016 Klaralvdalens Datakonsult AB, "
<< "a KDAB Group company, [email protected]" << endl;
out << "Protocol version " << Protocol::version() << endl;
out << "Broadcast version " << Protocol::broadcastFormatVersion() << endl;
return 0;
}
if (arg == QLatin1String("--inprocess"))
options.setUiMode(LaunchOptions::InProcessUi);
if (arg == QLatin1String("--inject-only"))
options.setUiMode(LaunchOptions::NoUi);
if (arg == QLatin1String("--listen") && !args.isEmpty())
options.setProbeSetting(QStringLiteral("ServerAddress"),
urlFromUserInput(args.takeFirst()).toString());
if (arg == QLatin1String("--no-listen")) {
options.setProbeSetting(QStringLiteral("RemoteAccessEnabled"), false);
options.setUiMode(LaunchOptions::InProcessUi);
}
if (arg == QLatin1String("--list-probes")) {
foreach (const ProbeABI &abi, ProbeFinder::listProbeABIs())
out << abi.id() << " (" << abi.displayString() << ")" << endl;
return 0;
}
if (arg == QLatin1String("--probe") && !args.isEmpty()) {
const ProbeABI abi = ProbeABI::fromString(args.takeFirst());
if (!abi.isValid()) {
out << "Invalid probe ABI specified, see --list-probes for valid ones." << endl;
return 1;
}
if (ProbeFinder::findProbe(abi).isEmpty()) {
out << abi.id() << "is not a known probe, see --list-probes." << endl;
return 1;
}
options.setProbeABI(abi);
}
if (arg == QLatin1String("--connect") && !args.isEmpty()) {
const QUrl url = urlFromUserInput(args.takeFirst());
ClientLauncher client;
client.launch(url);
client.waitForFinished();
return 0;
}
if (arg == QLatin1String("--self-test")) {
SelfTest selfTest;
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
QObject::connect(&selfTest, &SelfTest::information, [](const QString &msg) {
out << msg << endl;
});
QObject::connect(&selfTest, &SelfTest::error, [](const QString &msg) {
err << "Error: " << msg << endl;
});
#endif
if (args.isEmpty() || args.first().startsWith('-'))
return selfTest.checkEverything() ? 0 : 1;
const auto injectorType = args.takeFirst();
//.........这里部分代码省略.........