Qt: Expand ~ to home-directory

后端 未结 2 1937
星月不相逢
星月不相逢 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:22

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

提交回复
热议问题