Qt: Expand ~ to home-directory

牧云@^-^@ 提交于 2019-12-01 16:33:41
ChristopheD

You could probably just replace the tilde with the result of QDir::homePath()? Reference here.

Klathzazt

Look at the class QDesktopServices:

http://doc.qt.io/qt-5/qdesktopservices.html

e8johan

I think that the absolutePath (http://doc.qt.io/qt-5/qdir.html#absolutePath) is the way to do it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!