[Interest] [Development] Executing PowerShell command with quotes using QProcess

Oswald Buddenhagen oswald.buddenhagen at digia.com
Thu Apr 3 10:12:27 CEST 2014


On Thu, Apr 03, 2014 at 08:34:20AM +0800, Sze Howe Koh wrote:
> On 3 April 2014 06:23, Thiago Macieira <thiago.macieira at intel.com> wrote:
> > Nor on Windows's prompt:
> > C:\>echo """hello"""
> > """hello"""
> >
> > That commit has been there since the Qt public history started. It's even
> > documented as such (I had to look it up, I didn't know):
> >         http://qt-project.org/doc/qt-5/qprocess.html#start-3
> >
> > But I don't know why it was done like that. It's highly surprising. If it
> > weren't documented, I'd be tempted to just change behaviour and go for
> > standard backslashing.
> 
> That's highly unintuitive. The fact that it's Windows-only suggests
> that it was put in to work around some issue (which may not be present
> in modern versions of Windows). Candidate for change in Qt 6?
> 
it's not windows-only.
the quoting mechanism is inspired by how *some* windows applications
interpret quoting. but it is generally speaking just stupid.
when i finally get to it, i want to deprecate this custom single-string
mode in favor of accepting native shell command lines, as qt creator's
QtcProcess does.




More information about the Interest mailing list