The following code in your example is obsolete.
/concurrent/qprocess.py:83: DeprecationWarning: QProcess.start(const QString & command, QFlags<QIODevice::OpenModeFlag> mode) is deprecated
I have checked the documentation at Qt, it also said obsolete but did not suggest replacement. Do you have an updated code?
I am running
PySide2 version 126.96.36.199 and
.start() method is overloaded so there is another form where you call it without arguments (or optionally pass the
OpenModeFlag flag). That one doesn’t look to be deprecated. To use this you will need to set the program and arguments separately using the specific methods –
p = QProcess()
Note that the arguments are passed as a list of strings.
I’ll update this in the book.
Thanks @martin. Just wondering where did you find the latest API from the documentation? I tried to search from Qt Documentation but couldn’t find anything useful. I guess Qt documentation wasn’t up to date then?
It’s there in the Qt5 documentation, just easy to miss. Since
.start() is an overloaded method it has multiple entries in the page. The links at the top of the page point to two variants –
On that same page you can see the setProgram and setArguments methods, which accept the program and arguments in the same format as the first form of
I missed that first method actually (assumed it was the old one that was deprecated). But it’s not, so it looks like you could also do the following –
p = QProcess()
…which is a bit closer to the original.