Is there anything for getting right end-of-line symbol for any platform? I mean, I can use \\n for Windows and Unix if I want to write EOL to file, but there is
\\n
Try
QString::split(QRegularExpression{R"-((\r\n?|\n))-"})
This uses a C++11 raw string literal to create a regex that matches all three possibilities:
If you can not use C++11, you will have to manually escape the regex:
"(\\r\\n?|\\n)"
That should do the trick.