当前位置: 首页>>代码示例>>C++>>正文


C++ QProcess::processChannelMode方法代码示例

本文整理汇总了C++中QProcess::processChannelMode方法的典型用法代码示例。如果您正苦于以下问题:C++ QProcess::processChannelMode方法的具体用法?C++ QProcess::processChannelMode怎么用?C++ QProcess::processChannelMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QProcess的用法示例。


在下文中一共展示了QProcess::processChannelMode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main()
{
#ifndef QT_NO_PROCESS
    QProcess process;
    process.setProcessChannelMode(QProcess::ForwardedChannels);
    if (process.processChannelMode() != QProcess::ForwardedChannels)
        return -1;

    process.start("testProcessEcho/testProcessEcho");

    if (!process.waitForStarted(5000))
        return -1;

    if (process.write("forwarded\n") != 10)
        return -1;

    process.waitForReadyRead(250);
    if (process.bytesAvailable() != 0)
        return -1;

    process.closeWriteChannel();
    process.waitForFinished(5000);
#endif
    return 0;
}
开发者ID:SfietKonstantin,项目名称:radeon-qt5-qtbase-kms,代码行数:25,代码来源:main.cpp

示例2: processChannelMode

QProcess::ProcessChannelMode QProcessProto::processChannelMode() const
{
  QProcess *item = qscriptvalue_cast<QProcess*>(thisObject());
  if (item)
    return item->processChannelMode();
  return QProcess::ProcessChannelMode();
}
开发者ID:,项目名称:,代码行数:7,代码来源:

示例3: readAllChannelsIntoDialog

void SyncProcess::readAllChannelsIntoDialog(QProcess& process, ProcessProgressDialog& dialog)
{
    assert(process.processChannelMode() == QProcess::MergedChannels);
    process.setReadChannel(QProcess::StandardOutput);

    while (process.canReadLine())
    {
        const QString line = process.readLine();
        dialog.insertStdOutLine(line);
    }
}
开发者ID:alexander-manley,项目名称:scap-workbench,代码行数:11,代码来源:ProcessHelpers.cpp

示例4: main

int main(int argc, char **argv)
{
    QCoreApplication app(argc, argv);

    if (argc < 3)
        return 13;

#ifndef QT_NO_PROCESS
    QProcess process;

    QProcess::ProcessChannelMode mode = (QProcess::ProcessChannelMode)atoi(argv[1]);
    process.setProcessChannelMode(mode);
    if (process.processChannelMode() != mode)
        return 1;

    QProcess::InputChannelMode inmode = (QProcess::InputChannelMode)atoi(argv[2]);
    process.setInputChannelMode(inmode);
    if (process.inputChannelMode() != inmode)
        return 11;

    process.start("testProcessEcho2/testProcessEcho2");

    if (!process.waitForStarted(5000))
        return 2;

    if (inmode == QProcess::ManagedInputChannel && process.write("forwarded") != 9)
        return 3;

    process.closeWriteChannel();
    if (!process.waitForFinished(5000))
        return 4;

    if ((mode == QProcess::ForwardedOutputChannel || mode == QProcess::ForwardedChannels)
            && !process.readAllStandardOutput().isEmpty())
        return 5;
    if ((mode == QProcess::ForwardedErrorChannel || mode == QProcess::ForwardedChannels)
            && !process.readAllStandardError().isEmpty())
        return 6;
#endif
    return 0;
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:41,代码来源:main.cpp


注:本文中的QProcess::processChannelMode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。