- Status Closed
- Percent Complete
- Task Type Suggestion
- Category QCAD (main)
-
Assigned To
andrew - Operating System All
- Severity Low
- Priority Very Low
- Reported Version n/a
- Due in Version Undecided
-
Due Date
Undecided
- Votes
- Private
FS#2603 - Support for hatch pattern files with EOL = /r or CR or Carriage Return
Andrew,
Related topic with example file.
Basically it is that Qt doesn’t break the text stream on only /r.
Perhaps there is a way around this reading it byte-wise replacing /r and /r/n by /n
Ifso, I am interested in a code example to custom handle *.pat files ... See: How to ...
Regards,
CVH
Loading...
Available keyboard shortcuts
- Alt + ⇧ Shift + l Login Dialog / Logout
- Alt + ⇧ Shift + a Add new task
- Alt + ⇧ Shift + m My searches
- Alt + ⇧ Shift + t focus taskid search
Tasklist
- o open selected task
- j move cursor down
- k move cursor up
Task Details
- n Next task
- p Previous task
- Alt + ⇧ Shift + e ↵ Enter Edit this task
- Alt + ⇧ Shift + w watch task
- Alt + ⇧ Shift + y Close Task
Task Editing
- Alt + ⇧ Shift + s save task
Windows uses \r\n
Unices / MacOS use \n
Qt supports both.
As far as I know \r was only used on very old ("classic") MacOS systems up to about 2001. Since neither Qt nor QCAD ever ran on such a system, it's not feasible to support this obsolete file format. File converters are available online and offline.
It is not to run on such systems ... It is to read pattern files with that format.
At least the user should be warned that there is something not quite right.
At least I can catch it now and warn about a bad text data format:
file = new QFile(fileName); flags = new QIODevice.OpenMode(QIODevice.ReadOnly); if (file.open(flags)) { var content = file.readAll(); var pos1 = content.indexOf("\r"); var pos2 = content.indexOf("\n"); if (pos1>0 && pos1+1 !== pos2) { debugger; // Warn user that EOL = CR } } file.close();