[Interest] strange character '&#xd' appended by QTextEdit

Rogers Nate nate.rogers at raymondcorp.com
Fri Oct 18 13:56:36 CEST 2013


You need to have double quotes around your color values

Nate Rogers
Software Engineer 
Control Systems 

The Raymond Corporation
20 South Canal Street
Greene, New York 13778-0130
Phone: 607-656-2855
Fax: 607-656-4845
nate.rogers at raymondcorp.com
http://www.raymondcorp.com




-----Original Message-----
From: interest-bounces+nate.rogers=raymondcorp.com at qt-project.org [mailto:interest-bounces+nate.rogers=raymondcorp.com at qt-project.org] On Behalf Of baneyue
Sent: Friday, October 18, 2013 5:38 AM
To: qt-interest
Subject: [Interest] strange character '&#xd' appended by QTextEdit

Hi guys:

	I use a QTextEdit to edit the style string stored in a xml file like
	this: 
		
		<styles>
			<style id="style_1">
				Road {
					stroke: #c1c566;
					stroke-width: 2;
					...
				}
			</style>
			<style id="style_2">
				River {
					stroke: #22aecc;
					stroke-width: 3;
					...
				}
			</style>
			...
		</styles>

	I retrieved the style text with QDom and put it into a QTextEdit
	using explicitly __QTextEdit.setPlainText()__. Then I change the
	string in QTextEdit, and write back to the style file using the
	string got by __QTextEdit.toPlainText()__.

	But when i change the style string with `id="style_1"` and write
	back to file, all the RESTS style nodes in the xml get one or more
	`additional` characters at the end, which is the strange '&#xd;',
	just like this:
		
		<styles>
			<style id="style_1">
				Road {
					stroke: #c1c566;
					stroke-width: 2;
					...
				}
			</style>
			<style id="style_2">&#xd;
				River {&#xd;
					stroke: #22aecc;&#xd;
					stroke-width: 3;&#xd;
					...
				}&#xd;
			</style>
			...
		</styles>

	I've found some similiar situation on the stackoverflow[1], the
	answer marked with `Correct` suggested that the xml node should keep
	all characters in **one** line, but i really need to store it in a
	__stuctured__ way **WITHOUT** the `&#xd;`.

	So, what should I do to achieve this.

	[1]:
	stackoverflow.com/questions/848841/c-sharp-xslt-transform-adding-xa-and-xd-to-the-output/849617#849617

	Regards,
		baneyue
_______________________________________________
Interest mailing list
Interest at qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Confidentiality Notice:

The preceding e-mail message (including any attachments) contains information that may be confidential, protected by applicable legal privileges, or constitute non-public information. It is intended to be conveyed only to the designated recipient(s). If you are not an intended recipient of this message, please notify the sender by replying to this message and then delete it from your system. Use, dissemination, distribution or reproduction of this message by unintended recipients is 
not authorized and may be unlawful.






More information about the Interest mailing list