Qt创建指定路径的文件夹

        QString str = "E:/hh/kk/bb";

        QStringList sl = str.split("/");
        QString path = "";
        for (int i = 0; i < (int)sl.size(); i++){
        if(i>0){
            path += "/";
        }
        path += sl.at(i);

        QDir *dir = new QDir(path);

        if(dir->exists() == false){
             dir->mkdir(path);
        }
        delete dir;
    }

你可能感兴趣的:(qt,c++)