String replace content
-
wrote on 16 Sept 2011, 12:11 last edited by
Hi all
I am new to Qt. I have a question:
I'm trying to convert a string like this type path C: / Dir1/Dir2/Dir3
in a chain like this C: \ \ Dir1 \ \ dir2 \ \ dir3 as I can tell it to qprocess then that is the path from where I launch the executablewhere path has to be of this type C: \ \ Dir1 \ \ dir2 \ \ dir3 and what I get is
C: / Dir1/Dir2/Dir3processDes.setWorkingDirectory (path);
Process.Start ("msiexec.exe", QStringList () <<"/ qf" <<"/ uninstall" <<"openofficeorg31.msi");
When I launch the process Uninstaller window opens but when I close.
Someone could help me with this?
Thank you.
-
wrote on 16 Sept 2011, 12:39 last edited by
Path handling is transparent in Qt. If you want it to work across platforms with different path separator always use "/" Unix style separator. Qt will internally convert the path according to target platform.
You can simply convert "" to "/" and pass the same to QProcess. -
wrote on 16 Sept 2011, 12:55 last edited by
If you like to translate to native separators you can use "toNativeSeparators":http://doc.qt.nokia.com/4.7/qdir.html#toNativeSeparators
-
wrote on 16 Sept 2011, 13:17 last edited by
thank you for your request....
-
wrote on 16 Sept 2011, 13:19 last edited by
As I can convert / to , appreciate any example.
thanks -
wrote on 16 Sept 2011, 14:16 last edited by
If we know the scope you want to reach we can help you. The conversion what should be? a QString? A patch that Qt should manage? What ?
-
wrote on 16 Sept 2011, 15:45 last edited by
please providing some more details. or given any example..
-
wrote on 16 Sept 2011, 15:59 last edited by
@robort1989: sorry I don't understand your links in this post.
-
wrote on 16 Sept 2011, 16:29 last edited by
I deleted the spam links in the post of robort.
Eddy
-
wrote on 16 Sept 2011, 16:35 last edited by
@Eddy: thank you. It was corret to report ? I am not a puritane, but it seems really bad in this context.
-
wrote on 16 Sept 2011, 16:38 last edited by
[quote author="Alicemirror" date="1316190908"]@Eddy: thank you. It was corret to report ? I am not a puritane, but it seems really bad in this context.[/quote]
Yes, well done. They were not Qt related.
This was not the only one, so we will keep an eye on it.
2/11