comparison layer/NoteLayer.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 cd2492c5fe45
children 984c1975f1ff
comparison
equal deleted inserted replaced
315:c30a7cd29f4a 316:c0b9eec70639
30 #include "SpectrogramLayer.h" // for optional frequency alignment 30 #include "SpectrogramLayer.h" // for optional frequency alignment
31 31
32 #include <QPainter> 32 #include <QPainter>
33 #include <QPainterPath> 33 #include <QPainterPath>
34 #include <QMouseEvent> 34 #include <QMouseEvent>
35 #include <QTextStream>
35 36
36 #include <iostream> 37 #include <iostream>
37 #include <cmath> 38 #include <cmath>
38 39
39 NoteLayer::NoteLayer() : 40 NoteLayer::NoteLayer() :
946 impose = false; 947 impose = false;
947 return ColourDatabase::getInstance()->getColourIndex 948 return ColourDatabase::getInstance()->getColourIndex
948 (QString(darkbg ? "White" : "Black")); 949 (QString(darkbg ? "White" : "Black"));
949 } 950 }
950 951
951 QString 952 void
952 NoteLayer::toXmlString(QString indent, QString extraAttributes) const 953 NoteLayer::toXml(QTextStream &stream,
953 { 954 QString indent, QString extraAttributes) const
954 return SingleColourLayer::toXmlString(indent, extraAttributes + 955 {
955 QString(" verticalScale=\"%1\"") 956 SingleColourLayer::toXml(stream, indent, extraAttributes +
956 .arg(m_verticalScale)); 957 QString(" verticalScale=\"%1\"")
958 .arg(m_verticalScale));
957 } 959 }
958 960
959 void 961 void
960 NoteLayer::setProperties(const QXmlAttributes &attributes) 962 NoteLayer::setProperties(const QXmlAttributes &attributes)
961 { 963 {