comparison layer/SingleColourLayer.cpp @ 316:c0b9eec70639

* Make XmlExportable::toXml the function that is universally overridden (and pure virtual) instead of toXmlString. Tidies up some classes, notably the model classes, significantly. Closes #1794561.
author Chris Cannam
date Thu, 18 Oct 2007 10:15:07 +0000
parents 5c59c433b358
children a55affd7ab6c 0895517bb2d1
comparison
equal deleted inserted replaced
315:c30a7cd29f4a 316:c0b9eec70639
17 #include "base/ColourDatabase.h" 17 #include "base/ColourDatabase.h"
18 #include "view/View.h" 18 #include "view/View.h"
19 19
20 #include <iostream> 20 #include <iostream>
21 21
22 #include <QTextStream>
22 #include <QApplication> 23 #include <QApplication>
23 24
24 SingleColourLayer::ColourRefCount 25 SingleColourLayer::ColourRefCount
25 SingleColourLayer::m_colourRefCount; 26 SingleColourLayer::m_colourRefCount;
26 27
252 s.push_back(QColor(red, green, blue)); 253 s.push_back(QColor(red, green, blue));
253 } 254 }
254 return s; 255 return s;
255 } 256 }
256 257
257 QString 258 void
258 SingleColourLayer::toXmlString(QString indent, QString extraAttributes) const 259 SingleColourLayer::toXml(QTextStream &stream,
260 QString indent, QString extraAttributes) const
259 { 261 {
260 QString s; 262 QString s;
261 263
262 QString colourName, colourSpec, darkbg; 264 QString colourName, colourSpec, darkbg;
263 ColourDatabase::getInstance()->getStringValues 265 ColourDatabase::getInstance()->getStringValues
268 "darkBackground=\"%3\" ") 270 "darkBackground=\"%3\" ")
269 .arg(colourName) 271 .arg(colourName)
270 .arg(colourSpec) 272 .arg(colourSpec)
271 .arg(darkbg); 273 .arg(darkbg);
272 274
273 return Layer::toXmlString(indent, extraAttributes + " " + s); 275 Layer::toXml(stream, indent, extraAttributes + " " + s);
274 } 276 }
275 277
276 void 278 void
277 SingleColourLayer::setProperties(const QXmlAttributes &attributes) 279 SingleColourLayer::setProperties(const QXmlAttributes &attributes)
278 { 280 {