Check whether a string is a valid filename with Qt

后端 未结 6 1487
一个人的身影
一个人的身影 2021-02-18 22:08

Is there a way with Qt 4.6 to check if a given QString is a valid filename (or directory name) on the current operating system ? I want to check for th

6条回答
  •  北恋
    北恋 (楼主)
    2021-02-18 22:46

    Difficult to do reliably on windows (some odd things such as a file named "com" still being invalid) and do you want to handle unicode, or subst tricks to allow a >260 char filename.

    There is already a good answer here How do I check if a given string is a legal / valid file name under Windows?

提交回复
热议问题