This forum has been archived. All content is frozen. Please use KDE Discuss instead.

PlaceMark Description

Tags: None
(comma "," separated)
strag
Registered Member
Posts
11
Karma
0
OS

PlaceMark Description

Thu Mar 03, 2016 7:07 am
Hello!

There is a problem with displaying information about the placemark. I wrote this code:

Code: Select all
QString text = "string 1, \n";
text += "string 2, \n";
text += "string 3, \n";
text += "string 4, \n";
text += "string 5. \n";

qDebug() << "text =" << text;

GeoDataPlacemark* place = new GeoDataPlacemark;
place->setDescription(text);


Using qDebug() the text displaying correctly:

text = "string 1,
string 2,
string 3,
string 4,
string 5.
"

But in the placemark description it looks like this:
Image

How to make line breaks in the description?

Thanks in advance for your help.
User avatar
tackat
KDE Developer
Posts
131
Karma
0
OS

Re: PlaceMark Description

Fri Mar 18, 2016 11:56 am
That looks indeed like a bug to me - could you file a bug report (or maybe even a patch) ? :)
strag
Registered Member
Posts
11
Karma
0
OS

Re: PlaceMark Description

Wed Mar 23, 2016 8:38 pm
Thanks for your answer! I have filed a bug report: https://bugs.kde.org/show_bug.cgi?id=360918

Last edited by strag on Tue Mar 29, 2016 8:51 pm, edited 1 time in total.
strag
Registered Member
Posts
11
Karma
0
OS

Re: PlaceMark Description  Topic is solved

Tue Mar 29, 2016 7:50 am
Hello!
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>. That is, in my example:

Code: Select all
QString text = "<pre>";     //added tag <pre>
text += "string 1, \n";
text += "string 2, \n";
text += "string 3, \n";
text += "string 4, \n";
text += "string 5. \n";
text += "</pre>";             //added tag </pre>

qDebug() << "text =" << text;

GeoDataPlacemark* place = new GeoDataPlacemark;
place->setDescription(text);


Then the text is displayed as I wanted:

Image

Probably wise to make the correction in the marble?
User avatar
tackat
KDE Developer
Posts
131
Karma
0
OS

Re: PlaceMark Description

Fri Apr 01, 2016 2:33 pm
Ah, sorry. No idea what mislead me into assuming that using \n here would work.

The description in the popup is indeed supposed to be done in Rich text / HTML.

Sorry, for the confusion :)


Bookmarks



Who is online

Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], mesutakcan, Sogou [Bot]