PDA

View Full Version : qstring replace backslash by forward-slashes



ruben.rodrigues
8th November 2011, 08:32
Hi all!

I am trying to replace backslashes '\' by forward-slashes as a lineEdit is being changed.
On the _textEdit event I have this code:

ui.TempClientForlder->text().replace(QString("\\"),QString("/"));

I tried many other ways but I can't figure it out.

Any help? thanks!

totem
8th November 2011, 09:13
QLineEdit::text() returns a copy of the string. You will have to modify that copy, and put this copy back to the QLineEdit.

pauli
5th January 2012, 12:07
.replace('\\','/')