PDA

View Full Version : QDir::separator() and QFileDialog not consistent with slash character



gmat4321
9th January 2009, 17:45
System: Win XP 32 Bit
Dev Eng: Visual Studio 2005 w/SP1

QFileDialog is returning a directory with the forward slash "/". The call I'm using is getExistingDirectory.

When I get the directory separator from QDir::separator() it is a back slash "\".

I 'expect' that these would be the same. I expect that both with match the OS platform/locale.

I am using the commercial code with a modification to make wchar_t a built in type. Thus I needed to rebuild all the Qt code.

Any ideas?

Lesiok
9th January 2009, 18:51
Read about QDir::toNativeSeparators

pherthyl
9th January 2009, 20:49
Basically it seems that any paths returned from Qt functions use / as the separator, so if I'm manipulating paths just use '/' directly instead of QDir::separator().