From e5b88e908ebe4c4250942bebd1ee010d0192e9fe Mon Sep 17 00:00:00 2001 From: Carsten Niehaus Date: Wed, 13 Jul 2005 15:31:09 +0000 Subject: [PATCH] and now the xml-parser svn path=/trunk/KDE/kdeedu/kalzium/src/element.cpp; revision=434279 --- kalzium/src/element.cpp | 11 +++++++++++ kalzium/src/element.h | 14 ++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/kalzium/src/element.cpp b/kalzium/src/element.cpp index d9b81c8..aeb6807 100644 --- a/kalzium/src/element.cpp +++ b/kalzium/src/element.cpp @@ -634,8 +634,19 @@ EList KalziumDataObject::readData( QDomDocument &dataDocument ) Isotope *isotope = new Isotope( neutrons, percentage, weight, halflife, format, alphadecay, betaplusdecay, betaminusdecay, ecdecay ); isolist.append( isotope ); } + + QDomNodeList spectrumList = domElement.elementsByTagName( "spectra" ); + QValueList speclist; + for( uint i = 0; i < spectrumList.length(); i++ ) + { + QDomElement spec = spectrumList.item( i ).toElement(); + double wavelenght = spec.text().toDouble(); + kdDebug() << "double ist: " << wavelenght << " Length: " << spectrumList.length() << endl; + speclist.append( wavelenght ); + } Element *e = new Element(); + e->setSpectrumList( speclist ); e->setDate(date); e->setBiologicalMeaning(bio); e->setNumber( number ); diff --git a/kalzium/src/element.h b/kalzium/src/element.h index 7b5a69c..f2b0ffb 100644 --- a/kalzium/src/element.h +++ b/kalzium/src/element.h @@ -238,13 +238,21 @@ class Element{ } QValueList isotopes() const{ - return m_isotopeList; - } + return m_isotopeList; + } + + QValueList spectrumList() const{ + return m_spectrumList; + } void setIsotopeList( QValueList list ){ m_isotopeList = list; } + void setSpectrumList( QValueList list ){ + m_spectrumList = list; + } + doubleList ionisationList() const{ return m_ionenergies; } @@ -482,6 +490,8 @@ class Element{ int m_ElementNumber; QValueList m_isotopeList; + + QValueList m_spectrumList; QColor m_Color; -- 2.47.3