QProcess process; process.start("echo Hello World!"); // start an external process that echoes "Hello World!" to stdout if (process.waitForStarted() && process.waitForFinished()) { // read the output of the process QString output = process.readAllStandardOutput(); if (process.atEnd()) { qDebug() << "End of output has been reached."; } }In this example, we start an external process that echoes "Hello World!" to stdout. We then read the output of the process and check whether the end of the output stream has been reached using the atEnd() function. If it has, we print a message to the console. The package library for QProcess is the QtCore library in the Qt framework.