本文整理汇总了C++中QProcess::arguments方法的典型用法代码示例。如果您正苦于以下问题:C++ QProcess::arguments方法的具体用法?C++ QProcess::arguments怎么用?C++ QProcess::arguments使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QProcess
的用法示例。
在下文中一共展示了QProcess::arguments方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: makeSGSFactory
//---------------------------------------------------------------
QString Gridifier::makeSGSFactory(const QString &container,
const QString &topLevelRegistry,
const QString &className){
QString result;
QProcess *makeSGSFactoryProcess = new QProcess(QString("./make_" +
className +
"_factory.pl"));
makeSGSFactoryProcess->setWorkingDirectory(mScriptsDir);
makeSGSFactoryProcess->addArgument(container);
makeSGSFactoryProcess->addArgument(topLevelRegistry);
cout << makeSGSFactoryProcess->arguments().join(" ") << endl;
makeSGSFactoryProcess->start();
while (makeSGSFactoryProcess->isRunning()){
usleep(10000);
mApplication->processEvents();
}
// this functionality is left in a seperate slot since it could be better
// to allow the standard qt events to handle it, rather than sitting in the
// above loop
result = QString(makeSGSFactoryProcess->readStdout()).stripWhiteSpace();
return result;
}
示例2: launchArgonneViz
/** Special case to launch a viz on Argonne's cluster
* this will always render to multicast
*/
void Gridifier::launchArgonneViz(const LauncherConfig &config){
QProcess *launchArgonneVizProcess = new QProcess(QString("./argonneVis.sh"));
launchArgonneVizProcess->setWorkingDirectory(mScriptsDir);
launchArgonneVizProcess->addArgument(config.visualizationGSH.mEPR);
launchArgonneVizProcess->addArgument(QString::number(config.mTimeToRun));
launchArgonneVizProcess->addArgument(config.multicastAddress);
QString vizTypeStr = "";
if (config.vizType == isosurface){
vizTypeStr = "iso";
}
else if (config.vizType == volumeRender){
vizTypeStr = "vol";
}
if (config.vizType == hedgehog){
vizTypeStr = "hog";
}
else if (config.vizType == cutPlane){
vizTypeStr = "cut";
}
launchArgonneVizProcess->addArgument(vizTypeStr);
cout << launchArgonneVizProcess->arguments().join(" ") << endl;
launchArgonneVizProcess->start();
while (launchArgonneVizProcess->isRunning()){
usleep(10000);
mApplication->processEvents();
}
cout << "Stdout:" << endl << launchArgonneVizProcess->readStdout() << endl;
if (launchArgonneVizProcess->canReadLineStderr())
cout << "Stderr:" << endl << launchArgonneVizProcess->readStderr() << endl;
}
示例3: msgProcessError
static const QString msgProcessError(const QProcess &process, const QString &what)
{
QString result;
QTextStream(&result) << what << ": \"" << process.program() << ' '
<< process.arguments().join(QLatin1Char(' ')) << "\": " << process.errorString();
return result;
}
示例4: assemble
//.........这里部分代码省略.........
foreach (const QInstallerTools::PackageInfo &info, input.packages) {
QInstaller::ResourceCollection collection;
collection.setName(info.name.toUtf8());
qDebug() << "Creating resource archive for" << info.name;
foreach (const QString &file, info.copiedFiles) {
const QSharedPointer<Resource> resource(new Resource(file));
qDebug().nospace() << "Appending " << file << " (" << humanReadableSize(resource->size()) << ")";
collection.appendResource(resource);
}
input.manager.insertCollection(collection);
}
const QList<QInstaller::OperationBlob> operations;
BinaryContent::writeBinaryContent(&out, operations, input.manager,
BinaryContent::MagicInstallerMarker, BinaryContent::MagicCookie);
} catch (const Error &e) {
qCritical("Error occurred while assembling the installer: %s", qPrintable(e.message()));
QFile::remove(tempFile);
return EXIT_FAILURE;
}
if (!out.rename(targetName)) {
qCritical("Cannot write installer to %s: %s", targetName.toUtf8().constData(),
out.errorString().toUtf8().constData());
QFile::remove(tempFile);
return EXIT_FAILURE;
}
out.setAutoRemove(false);
#ifndef Q_OS_WIN
chmod755(out.fileName());
#endif
QFile::remove(tempFile);
#ifdef Q_OS_OSX
if (isBundle && !signingIdentity.isEmpty()) {
qDebug() << "Signing .app bundle...";
QProcess p;
p.start(QLatin1String("codesign"),
QStringList() << QLatin1String("--force")
<< QLatin1String("--deep")
<< QLatin1String("--sign") << signingIdentity
<< bundle);
if (!p.waitForFinished(-1)) {
qCritical("Failed to sign app bundle: error while running '%s %s': %s",
p.program().toUtf8().constData(),
p.arguments().join(QLatin1Char(' ')).toUtf8().constData(),
p.errorString().toUtf8().constData());
return EXIT_FAILURE;
}
if (p.exitStatus() == QProcess::NormalExit) {
if (p.exitCode() != 0) {
qCritical("Failed to sign app bundle: running codesign failed "
"with exit code %d: %s", p.exitCode(),
p.readAllStandardError().constData());
return EXIT_FAILURE;
}
}
qDebug() << "done.";
}
bundleBackup.release();
if (createDMG) {
qDebug() << "creating a DMG disk image...";
const QString volumeName = QFileInfo(input.outputPath).fileName();
const QString imagePath = QString::fromLatin1("%1/%2.dmg")
.arg(QFileInfo(bundle).path())
.arg(volumeName);
// no error handling as this is not fatal
QProcess p;
p.start(QLatin1String("/usr/bin/hdiutil"),
QStringList() << QLatin1String("create")
<< imagePath
<< QLatin1String("-srcfolder")
<< bundle
<< QLatin1String("-ov")
<< QLatin1String("-volname")
<< volumeName
<< QLatin1String("-fs")
<< QLatin1String("HFS+"));
qDebug() << "running " << p.program() << p.arguments();
p.waitForFinished(-1);
qDebug() << "removing" << bundle;
QDir(bundle).removeRecursively();
qDebug() << "done.";
}
#else
Q_UNUSED(signingIdentity)
#endif
return EXIT_SUCCESS;
}