osx - SOLVED: QT: Escape slash / in saving location on a mac -
i have html input supposed extract 2 strings of, build document title string of type <string 1> / <string 2
, create pdf source on users mac desktop , name described.
i know slash in document name not such brilliant idea asked do.
problem is: forward slash interpreted folder on mac , not part of documents name means qpainter fails print pdf because interpretes string1 /
being folder doesn't exist.
btw when omitting /
code working fine.
how supposed escape /
?
here's string building logic:
qstring doctitle; doctitle.append(string1); doctitle.append(" / "); doctitle.append(string2);
on os x, name of file @ level of apis different display name shown user in finder, open , save panels, etc.
at level of apis, file names can't contain slashes. reserved separating names within path. there's no form of escaping or quoting allow it.
however, can create file name displayed slash in ui.
basically, slash (/
) , colon (:
) characters swap roles. display names of files can't include colon, because it's reserved. (this holdover of old hfs file system used in classic mac os.) so, 1 aspect of conversion names-in-the-apis display names convert colons slashes. thus, if want file display name has slash, use colon.
a file name per apis "important legal document 06:13:2015.pdf" displayed in ui "important legal document 06/13/2015.pdf". likewise, if user names file in save dialog or in finder "important legal document 06/13/2015.pdf", end name which, when observed via apis, "important legal document 06:13:2015.pdf".
Comments
Post a Comment