comparison layer/SpectrumLayer.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 3101c68a00c1
children 29fcf125f98b
comparison
equal deleted inserted replaced
315:c30a7cd29f4a 316:c0b9eec70639
22 #include "base/RangeMapper.h" 22 #include "base/RangeMapper.h"
23 #include "base/Pitch.h" 23 #include "base/Pitch.h"
24 #include "base/ColourMapper.h" 24 #include "base/ColourMapper.h"
25 25
26 #include <QPainter> 26 #include <QPainter>
27 #include <QTextStream>
28
27 29
28 SpectrumLayer::SpectrumLayer() : 30 SpectrumLayer::SpectrumLayer() :
29 m_originModel(0), 31 m_originModel(0),
30 m_channel(-1), 32 m_channel(-1),
31 m_channelSet(false), 33 m_channelSet(false),
793 SpectrumLayer::getBiasCurve(BiasCurve &curve) const 795 SpectrumLayer::getBiasCurve(BiasCurve &curve) const
794 { 796 {
795 curve = m_biasCurve; 797 curve = m_biasCurve;
796 } 798 }
797 799
798 QString 800 void
799 SpectrumLayer::toXmlString(QString indent, QString extraAttributes) const 801 SpectrumLayer::toXml(QTextStream &stream,
800 { 802 QString indent, QString extraAttributes) const
801 QString s; 803 {
802 804 QString s = QString("windowSize=\"%1\" "
803 s += QString("windowSize=\"%1\" " 805 "windowHopLevel=\"%2\"")
804 "windowHopLevel=\"%2\"")
805 .arg(m_windowSize) 806 .arg(m_windowSize)
806 .arg(m_windowHopLevel); 807 .arg(m_windowHopLevel);
807 808
808 return SliceLayer::toXmlString(indent, extraAttributes + " " + s); 809 SliceLayer::toXml(stream, indent, extraAttributes + " " + s);
809 } 810 }
810 811
811 void 812 void
812 SpectrumLayer::setProperties(const QXmlAttributes &attributes) 813 SpectrumLayer::setProperties(const QXmlAttributes &attributes)
813 { 814 {