QCAD Bugtracker

  • Status Closed
  • Percent Complete
    100%
  • 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
Attached to Project: QCAD Bugtracker
Opened by CVH - 19.09.2024
Last edited by andrew - 19.09.2024

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

Closed by  andrew
19.09.2024 09:39
Reason for closing:  Won't implement
Admin

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.

CVH commented on 19.09.2024 14:27

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();

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing