Qt: Expand ~ to home-directory

后端 未结 2 1932
星月不相逢
星月不相逢 2021-01-17 17:43

Does Qt have any platform-independent functionality to accept paths like \"~/myfile\"?

I know about wordexp, but it would be nice with a platform-independent wrapper

2条回答
  •  情歌与酒
    2021-01-17 18:32

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

提交回复
热议问题