I have extracted the code from Qt sources. As you can see, this information is stored in user scoped QSettings. On Windows, it is under the registry key: HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults\Qt
. And here is the code to use:
QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
settings.beginGroup(QLatin1String("Qt"));
QByteArray p = settings.value(QLatin1String("filedialog")).toByteArray();
QDataStream stream(&p, QIODevice::ReadOnly);
QByteArray splitterState;
QList<QUrl> bookmarks;
QStringList history;
QString currentDirectory;
qint32 marker;
qint32 v;
stream >> marker
>> v
>> splitterState
>> bookmarks
>> history
>> currentDirectory; // <-- The recent path.
Please note, that this can be changed in the next Qt versions.