Nominate our 2022 Qt Champions!


  • Hi
    Is it possible to find the reason that QDir::mkpath failed when it returns false


  • Lifetime Qt Champion

    @GrahamL said:


    this is the implantation
    So My best guess is sadly no since the actual mkdir
    lives in QDirPrivate.

    bool QDir::mkpath(const QString &dirPath) const
        const QDirPrivate* d = d_ptr.constData();
        if (dirPath.isEmpty()) {
            qWarning("QDir::mkpath: Empty or null file name(s)");
            return false;
        QString fn = filePath(dirPath);
        if (d->fileEngine.isNull())
            return QFileSystemEngine::createDirectory(QFileSystemEntry(fn), true);
        return d->fileEngine->mkdir(fn, true);

Log in to reply