//获取应用程序的目录
QString strCurrentApplicationDirPath=QCoreApplication::applicationDirPath();
qDebug()<<strCurrentApplicationDirPath;
/*将/转\(斜杠转反斜杠)*/
QString strPath=QDir::toNativeSeparators(strCurrentApplicationDirPath);
qDebug()<<strPath;
/*将\转/(反斜杠转斜杠)*/
QString strPath2=QDir::fromNativeSeparators(strPath);
qDebug()<<strPath2;
Qt 路径正反路径转换
最新推荐文章于 2024-09-26 10:00:00 发布