[Development] Qt 4.8.6 Release Plans

Kuba Ober kuba at mareimbrium.org
Thu Nov 14 15:03:23 CET 2013

On Oct 29, 2013, at 7:58 PM, Calogero Mauceri <mauceri at actgate.com> wrote:

> The Qt documentation states that QDir::currentPath() returns "The 
> application working directory".  Shouldn't the workind directory be 
> initialized with the path the application was launched from?

No, it will be initialized with whatever was chosen by the entity that
launched the application. It is meant to be *completely arbitrary*, and
always was. In Windows you can specify arbitrary working directory in
shortcuts (.lnk files) - that’s one example that’s sufficient to break
your assumption.

When launching from the terminal on most any OS, the current working path
is where you are at the moment you launch the executable anyway - *not*
the executable’s directory.

Basically, your use of `currentPath` is wrong, there’s no problem with
Qt as far as I can see.

Cheers, Kuba

More information about the Development mailing list