On Wed, Feb 27, 2019, 07:35 Simon Hausmann <simon.hausm...@qt.io> wrote:
> I’m in favor of deprecating the static overloads. Compilers give nice > deprecating warnings these days and the non-deprecated interface remains > nice and clear. > > Just my two cents, > Simon > > > On 27. Feb 2019, at 02:56, Thiago Macieira <thiago.macie...@intel.com> > wrote: > > > > With a lot of thanks to Jörg's effort, since Qt 5.9 we have a non-static > > startDetached() method, which do honour the environment set with > > setProcessEnvironment, the current working dir with setWorkingDirectory, > etc. > > > > I think it's a far superior option. By far, it avoids the mistake that > led to > > QTBUG-74074, where someone wrote: > > > > QProcess exeB; > > QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); > > env.insert("PYTHONHOME", "NewVariable"); > > exeB.setProcessEnvironment(env); > > exeB.startDetached("AnotherProcess/AnotherProcess.exe"); > > > > Unfortunately, that startDetached is static, so the setting made in the > object > > are not relevant. The author needed to write: > > > > exeB.setProgram("AnotherProcess/AnotherProcess.exe"); > > exeB.startDetached(); > > > > Ok to deprecate it? > > > > We will not be able to recover those overloads in Qt 6, but we may be > able to > > bring them back in Qt 7. > > > > Alternative: deprecate *ALL* startDetached() overloads and instead add a > > setDetachedMode(bool enable), and allow start() to start detachedly. > Is it technically possible to start() and then detach()? QProcess process; process.setFoo(...); process.start(...); process.waitForBar(); process.read(...); process.detach(); -- J-P Nurmi >
_______________________________________________ Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development