comparison layer/TimeRulerLayer.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 ea6fe8cfcdd5
comparison
equal deleted inserted replaced
10:8f5b812baaee 11:2d5005f2b3d9
286 { 286 {
287 return Layer::toXmlString(indent, extraAttributes + 287 return Layer::toXmlString(indent, extraAttributes +
288 QString(" colour=\"%1\"").arg(encodeColour(m_colour))); 288 QString(" colour=\"%1\"").arg(encodeColour(m_colour)));
289 } 289 }
290 290
291 void
292 TimeRulerLayer::setProperties(const QXmlAttributes &attributes)
293 {
294 QString colourSpec = attributes.value("colour");
295 if (colourSpec != "") {
296 QColor colour(colourSpec);
297 if (colour.isValid()) {
298 setBaseColour(QColor(colourSpec));
299 }
300 }
301 }
302
291 303
292 #ifdef INCLUDE_MOCFILES 304 #ifdef INCLUDE_MOCFILES
293 #include "TimeRulerLayer.moc.cpp" 305 #include "TimeRulerLayer.moc.cpp"
294 #endif 306 #endif
295 307