Mercurial > hg > svgui
comparison layer/NoteLayer.cpp @ 445:4a14499fb184
* Save & reload vertical scale extents from note, time/value & colour 3d
plot layers
* Fix display of vertical scale in zoomed colour 3d plot layer
author | Chris Cannam |
---|---|
date | Wed, 12 Nov 2008 15:51:41 +0000 |
parents | 681542f0c8c5 |
children | 747a58d45d56 |
comparison
equal
deleted
inserted
replaced
444:e5800f4490c4 | 445:4a14499fb184 |
---|---|
1168 void | 1168 void |
1169 NoteLayer::toXml(QTextStream &stream, | 1169 NoteLayer::toXml(QTextStream &stream, |
1170 QString indent, QString extraAttributes) const | 1170 QString indent, QString extraAttributes) const |
1171 { | 1171 { |
1172 SingleColourLayer::toXml(stream, indent, extraAttributes + | 1172 SingleColourLayer::toXml(stream, indent, extraAttributes + |
1173 QString(" verticalScale=\"%1\"") | 1173 QString(" verticalScale=\"%1\" scaleMinimum=\"%2\" scaleMaximum=\"%3\" ") |
1174 .arg(m_verticalScale)); | 1174 .arg(m_verticalScale) |
1175 .arg(m_scaleMinimum) | |
1176 .arg(m_scaleMaximum)); | |
1175 } | 1177 } |
1176 | 1178 |
1177 void | 1179 void |
1178 NoteLayer::setProperties(const QXmlAttributes &attributes) | 1180 NoteLayer::setProperties(const QXmlAttributes &attributes) |
1179 { | 1181 { |
1180 SingleColourLayer::setProperties(attributes); | 1182 SingleColourLayer::setProperties(attributes); |
1181 | 1183 |
1182 bool ok; | 1184 bool ok, alsoOk; |
1183 VerticalScale scale = (VerticalScale) | 1185 VerticalScale scale = (VerticalScale) |
1184 attributes.value("verticalScale").toInt(&ok); | 1186 attributes.value("verticalScale").toInt(&ok); |
1185 if (ok) setVerticalScale(scale); | 1187 if (ok) setVerticalScale(scale); |
1186 } | 1188 |
1187 | 1189 float min = attributes.value("scaleMinimum").toFloat(&ok); |
1188 | 1190 float max = attributes.value("scaleMaximum").toFloat(&alsoOk); |
1191 if (ok && alsoOk) setDisplayExtents(min, max); | |
1192 } | |
1193 | |
1194 |