diff options
Diffstat (limited to 'src/corelib/io/qprocess.cpp')
-rw-r--r-- | src/corelib/io/qprocess.cpp | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index ab2a69d054..3b78351809 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -1545,16 +1545,40 @@ void QProcess::setWorkingDirectory(const QString &dir) d->workingDirectory = dir; } + /*! + \deprecated + Use processId() instead. + Returns the native process identifier for the running process, if - available. If no process is currently running, 0 is returned. + available. If no process is currently running, \c 0 is returned. + + \note Unlike \l processId(), pid() returns an integer on Unix and a pointer on Windows. + + \sa Q_PID, processId() */ -Q_PID QProcess::pid() const +Q_PID QProcess::pid() const // ### Qt 6 remove or rename this method to processInformation() { Q_D(const QProcess); return d->pid; } +/*! + \since 5.3 + + Returns the native process identifier for the running process, if + available. If no process is currently running, \c 0 is returned. + */ +qint64 QProcess::processId() const +{ + Q_D(const QProcess); +#ifdef Q_OS_WIN + return d->pid ? d->pid->dwProcessId : 0; +#else + return d->pid; +#endif +} + /*! \reimp This function operates on the current read channel. @@ -2388,14 +2412,14 @@ int QProcess::execute(const QString &program) identifier of the started process. */ bool QProcess::startDetached(const QString &program, - const QStringList &arguments, - const QString &workingDirectory, + const QStringList &arguments, + const QString &workingDirectory, qint64 *pid) { return QProcessPrivate::startDetached(program, - arguments, - workingDirectory, - pid); + arguments, + workingDirectory, + pid); } /*! @@ -2414,7 +2438,7 @@ bool QProcess::startDetached(const QString &program, The started process will run as a regular standalone process. */ bool QProcess::startDetached(const QString &program, - const QStringList &arguments) + const QStringList &arguments) { return QProcessPrivate::startDetached(program, arguments); } |