From e38c518aba862e506894ba7a507fa3ae66699bb5 Mon Sep 17 00:00:00 2001 From: Martin Pfeiffer Date: Thu, 21 Jul 2005 15:34:32 +0000 Subject: [PATCH] element name in png svn path=/trunk/KDE/kdeedu/kalzium/src/spectrum.h; revision=437347 --- kalzium/src/spectrum.cpp | 2 +- kalzium/src/spectrum.h | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/kalzium/src/spectrum.cpp b/kalzium/src/spectrum.cpp index 5f5c3a3..cbc9782 100644 --- a/kalzium/src/spectrum.cpp +++ b/kalzium/src/spectrum.cpp @@ -63,7 +63,7 @@ double Spectrum::maxBand() Spectrum* Spectrum::adjustToWavelength( double min, double max ) { - Spectrum *spec = new Spectrum(); + Spectrum *spec = new Spectrum( m_parentElement ); QValueList::const_iterator it = m_bandlist.begin(); const QValueList::const_iterator itEnd = m_bandlist.end(); diff --git a/kalzium/src/spectrum.h b/kalzium/src/spectrum.h index 5902bb8..123bfca 100644 --- a/kalzium/src/spectrum.h +++ b/kalzium/src/spectrum.h @@ -48,7 +48,8 @@ class Spectrum /** * public ctor */ - Spectrum(){ + Spectrum( Element* parent ){ + m_parentElement = parent; }; /** @@ -150,6 +151,12 @@ class Spectrum */ QString BandsAsHtml(); + /** + * @return the parent element of this spectrum + */ + Element* parentElement() + { return m_parentElement; } + private: /** * @return the smallest wavelength @@ -170,6 +177,8 @@ class Spectrum * the cached values of the highest and lowest wavelength */ double m_max, m_min; + + Element* m_parentElement; }; /** -- 2.47.3