[Qt-interest] QProcess::start() fails with win32 paths

Stephen Collyer scollyer at netspinner.co.uk
Tue Apr 7 10:24:48 CEST 2009


2009/4/6 Marco Borm <qt-lists at retrodesignfan.eu>

> Hi Stephen,
>
> I haven't tried that but just after a look into the docs the reason is
> clear:
> void QProcess::start ( const QString & program, OpenMode mode = ReadWrite )
> "/program/ is a single string of text containing both the program name
> and its arguments."
>
> So try to start a app called "C:/Program" with arguments "Files/MDP" and
> "1.0.0/MDP_1.0.0/bin/protocol_manager_exe.exe"
> So please use quotes if you have spaces in your program name and/or
> arguments.
>
>
Marco

Well spotted - you're right. It's necessary to enclose the command in
quotes,
for win32 at least. I haven't yet tested this under Linux though.

I was confused, as I have had very similar code working for a long time,
but I clearly hadn't tested it using paths containing spaces, which is a
little surprising.

-- 
Stephen Collyer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090407/f0fa6d3e/attachment.html 


More information about the Qt-interest-old mailing list