comparison layer/TimeInstantLayer.cpp @ 11:2d5005f2b3d9

* Rework handling of layer properties in file I/O -- we now get the individual layers to load and save them rather than doing it via generic property lists in the base class, so as to ensure we read and write meaningful values rather than generic int values requiring conversion.
author Chris Cannam
date Thu, 19 Jan 2006 12:54:38 +0000
parents 8f5b812baaee
children 01849cd277e6
comparison
equal deleted inserted replaced
10:8f5b812baaee 11:2d5005f2b3d9
303 { 303 {
304 return Layer::toXmlString(indent, extraAttributes + 304 return Layer::toXmlString(indent, extraAttributes +
305 QString(" colour=\"%1\"").arg(encodeColour(m_colour))); 305 QString(" colour=\"%1\"").arg(encodeColour(m_colour)));
306 } 306 }
307 307
308 void
309 TimeInstantLayer::setProperties(const QXmlAttributes &attributes)
310 {
311 QString colourSpec = attributes.value("colour");
312 if (colourSpec != "") {
313 QColor colour(colourSpec);
314 if (colour.isValid()) {
315 setBaseColour(QColor(colourSpec));
316 }
317 }
318 }
319
308 #ifdef INCLUDE_MOCFILES 320 #ifdef INCLUDE_MOCFILES
309 #include "TimeInstantLayer.moc.cpp" 321 #include "TimeInstantLayer.moc.cpp"
310 #endif 322 #endif
311 323