]> Git trees. - libqmvoc.git/commitdiff
and now the xml-parser
authorCarsten Niehaus <cniehaus@gmx.de>
Wed, 13 Jul 2005 15:31:09 +0000 (15:31 +0000)
committerCarsten Niehaus <cniehaus@gmx.de>
Wed, 13 Jul 2005 15:31:09 +0000 (15:31 +0000)
svn path=/trunk/KDE/kdeedu/kalzium/src/element.cpp; revision=434279

kalzium/src/element.cpp
kalzium/src/element.h

index d9b81c88faea7cd3e890f27877e90d64783a2533..aeb6807385f602544fec534ad1946240894ce5d5 100644 (file)
@@ -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<double> 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 );
index 7b5a69c20ca69ab13f7378ca46cdd46588110eb9..f2b0ffb9101441bc0ae26b93ccef51c48240ab7e 100644 (file)
@@ -238,13 +238,21 @@ class Element{
                }
 
                QValueList<Isotope*> isotopes() const{
-                        return m_isotopeList;
-                }
+                       return m_isotopeList;
+        }
+
+               QValueList<double> spectrumList() const{
+                       return m_spectrumList;
+               }
 
                void setIsotopeList( QValueList<Isotope*> list ){
                        m_isotopeList = list;
                }
 
+               void setSpectrumList( QValueList<double> list ){
+                       m_spectrumList = list;
+               }
+
                doubleList ionisationList() const{
                        return m_ionenergies;
                }
@@ -482,6 +490,8 @@ class Element{
                int m_ElementNumber;
 
                QValueList<Isotope*> m_isotopeList;
+
+               QValueList<double> m_spectrumList;
        
                QColor m_Color;