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.rog...@raymondcorp.com
http://www.raymondcorp.com




-----Original Message-----
From: interest-bounces+nate.rogers=raymondcorp....@qt-project.org 
[mailto:interest-bounces+nate.rogers=raymondcorp....@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@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.



_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to