Summary: | There are no line breaks in the placemark description | ||
---|---|---|---|
Product: | [Applications] marble | Reporter: | strag <strag1505> |
Component: | general | Assignee: | marble-bugs |
Status: | RESOLVED INTENTIONAL | ||
Severity: | normal | CC: | nienhueser |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
URL: | https://forum.kde.org/viewtopic.php?f=217&t=131357 | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
strag
2016-03-23 20:36:29 UTC
I seem to have solved the problem. The placemark description is displayed using HTML. To preserve the original text formatting should be added the tags <pre> and </pre>: QString text = "<pre>"; //added tag <pre> text += "string 1, \n"; text += "string 2, \n"; text += "string 3 \n"; text += "</pre>"; //added tag </pre> As I understand it, it is necessary to add a "framing" of text by tags to function setDescription(QString). I never participated in opensource projects, so maybe someone can fix it before I'll understand how it's done. See https://forum.kde.org/viewtopic.php?f=217&t=131357#p354450 The description is interpreted as html, so newlines need to be indicated using <br/> or similar html tags. We could introduce some heuristic detection of plain text versus rich text and transform plain text with '\n' into rich text with '<br/>' tags, but I don't see the need for this really. Please reopen if you have a use-case. |