Hi,
Thank for the reply 
Mmm thats looks like a nice idea, but i already know how to create tags inside xml... (which is not my problem in this case...)
The tag for the Window geometry is being created inside a method which i've created all necesary tag with their strings data inside, except for the window Geometry one that i create am empty string (so i could later write the window geometry at close event of my application)
My problem is, how to write inside an existing tag. I don't want to recreate the tag again, since already exist. But only modify the string of that tag every time i execute the close event (and not creating the hole xml documment, only creating or replacing the string inside the needed Tag)
What i did yesterday was:
self.
file = QFile('preferences.xml') self.doc.setContent(self.file)
self.file.close()
self.docElem = self.doc.documentElement()
self.node = self.docElem.firstChild()
while (self.node.isNull() == False):
self.element = self.node.toElement()
if (self.element.isNull() == False):
if (self.element.tagName() == "windowGeometry"):
self.
text = self.
doc.
createTextNode(QVariant(self.
saveGeometry()).
toString()) self.element.appendChild(self.text)
self.node = self.node.nextSibling()
self.file.write(self.doc.toString().toAscii())
self.file.close()
self.file = QFile('preferences.xml')
self.file.open(QIODevice.ReadOnly)
self.doc = QDomDocument("OpenCoffeePreferences")
self.doc.setContent(self.file)
self.file.close()
self.docElem = self.doc.documentElement()
self.node = self.docElem.firstChild()
while (self.node.isNull() == False):
self.element = self.node.toElement()
if (self.element.isNull() == False):
if (self.element.tagName() == "windowGeometry"):
self.text = self.doc.createTextNode(QVariant(self.saveGeometry()).toString())
self.element.appendChild(self.text)
self.node = self.node.nextSibling()
self.file.open(QIODevice.WriteOnly)
self.file.write(self.doc.toString().toAscii())
self.file.close()
To copy to clipboard, switch view to plain text mode
But I dont know if this is right. What stores inside the xml is garbarge, like binary garbage.
Bookmarks