summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/oxygen/datawidget.ui24
-rw-r--r--noncore/apps/oxygen/datawidgetui.cpp59
-rw-r--r--noncore/apps/oxygen/datawidgetui.h6
3 files changed, 54 insertions, 35 deletions
diff --git a/noncore/apps/oxygen/datawidget.ui b/noncore/apps/oxygen/datawidget.ui
index a4dcab2..4dc91ea 100644
--- a/noncore/apps/oxygen/datawidget.ui
+++ b/noncore/apps/oxygen/datawidget.ui
@@ -11,7 +11,7 @@
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>249</width> 14 <width>245</width>
15 <height>276</height> 15 <height>276</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
@@ -21,27 +21,9 @@
21 </property> 21 </property>
22 <widget> 22 <widget>
23 <class>QComboBox</class> 23 <class>QComboBox</class>
24 <item>
25 <property>
26 <name>text</name>
27 <string>Helium</string>
28 </property>
29 </item>
30 <item>
31 <property>
32 <name>text</name>
33 <string>Carbon</string>
34 </property>
35 </item>
36 <item>
37 <property>
38 <name>text</name>
39 <string>Oxygen</string>
40 </property>
41 </item>
42 <property stdset="1"> 24 <property stdset="1">
43 <name>name</name> 25 <name>name</name>
44 <cstring>ComboBox2</cstring> 26 <cstring>dataCombo</cstring>
45 </property> 27 </property>
46 <property stdset="1"> 28 <property stdset="1">
47 <name>geometry</name> 29 <name>geometry</name>
@@ -70,7 +52,7 @@
70 </property> 52 </property>
71 <property stdset="1"> 53 <property stdset="1">
72 <name>numRows</name> 54 <name>numRows</name>
73 <number>6</number> 55 <number>8</number>
74 </property> 56 </property>
75 <property stdset="1"> 57 <property stdset="1">
76 <name>numCols</name> 58 <name>numCols</name>
diff --git a/noncore/apps/oxygen/datawidgetui.cpp b/noncore/apps/oxygen/datawidgetui.cpp
index 5b34cf5..67f59d9 100644
--- a/noncore/apps/oxygen/datawidgetui.cpp
+++ b/noncore/apps/oxygen/datawidgetui.cpp
@@ -12,29 +12,60 @@
12#include "datawidgetui.h" 12#include "datawidgetui.h"
13#include <qtable.h> 13#include <qtable.h>
14#include <qstring.h> 14#include <qstring.h>
15#include <qcombobox.h>
15 16
16dataWidgetUI::dataWidgetUI() : dataWidget() 17dataWidgetUI::dataWidgetUI() : dataWidget()
17{ 18{
18 Config test( "oxygendata" ); 19 connect ( dataCombo, SIGNAL( activated(int) ), this, SLOT( slotShowData(int) ) );
19 test.setGroup( "1" ); 20 Config test( "/home/opie/Settings/oxygendata", Config::File );
20 21
21 if ( test.hasKey( "Name" ) ) 22 //read in all names of the 118 elements
23 for ( int i = 1 ; i < 119 ; i++ )
22 { 24 {
23 qDebug ( "geht" ); 25 test.setGroup( QString::number( i ) );
24 }else qDebug( "geht nicht" ); 26 QString foo = test.readEntry( "Name" );
27 dataCombo->insertItem( foo );
28 }
25 29
26 QString foo = test.readEntry( "Name" ); 30 createTableLayout();
27 //test.writeEntry( "Name", "test123" ); 31 slotShowData( 1 ); //this way we do always get data here
28 32
29 qDebug( "hier sollte was kommen" ); 33}
30 qDebug( foo ); 34
31 35void dataWidgetUI::createTableLayout(){
32 dataTable->horizontalHeader()->hide(); 36 dataTable->horizontalHeader()->hide();
33 dataTable->verticalHeader()->hide(); 37 dataTable->verticalHeader()->hide();
34 dataTable->setTopMargin( 0 ); 38 dataTable->setTopMargin( 0 );
35 dataTable->setLeftMargin( 0 ); 39 dataTable->setLeftMargin( 0 );
36 dataTable->setText( 0,0,"Atomic Radius" ); 40
37 dataTable->setText( 0,1,"17 nm" ); 41 dataTable->setText( 0,0,"Weight:" );
38 dataTable->setText( 1,0,"Elec. neg." ); 42 dataTable->setText( 1,0,"Block" );
39 dataTable->setText( 1,1,"234 Joule" ); 43 dataTable->setText( 2,0,"Group" );
44 dataTable->setText( 3,0,"Electronegativity" );
45 dataTable->setText( 4,0,"Atomic radius" );
46 dataTable->setText( 5,0,"Ionizationenergie" );
47 dataTable->setText( 6,0,"Density" );
48 dataTable->setText( 7,0,"Boilingpoint" );
49}
50
51
52void dataWidgetUI::slotShowData(int number){
53 Config test( "/home/opie/Settings/oxygendata", Config::File );
54 test.setGroup( QString::number( number+1 ));
55 QString weight = test.readEntry( "Weight" );
56 dataTable->setText( 0,1,weight );
57 QString block = test.readEntry( "Block" );
58 dataTable->setText( 1,1,block );
59 QString grp = test.readEntry( "Group" );
60 dataTable->setText( 2,1,grp );
61 QString en = test.readEntry( "EN" );
62 dataTable->setText( 3,1,en );
63 QString ar = test.readEntry( "AR" );
64 dataTable->setText( 4,1,ar ) ;
65 QString ion = test.readEntry( "IE" );
66 dataTable->setText( 5,1,ion );
67 QString dens = test.readEntry( "Density" );
68 dataTable->setText( 6,1,dens );
69 QString bp = test.readEntry( "BP" );
70 dataTable->setText( 7,1,bp );
40} 71}
diff --git a/noncore/apps/oxygen/datawidgetui.h b/noncore/apps/oxygen/datawidgetui.h
index 47d9698..582bc19 100644
--- a/noncore/apps/oxygen/datawidgetui.h
+++ b/noncore/apps/oxygen/datawidgetui.h
@@ -17,4 +17,10 @@ class dataWidgetUI : public dataWidget
17 17
18 public: 18 public:
19 dataWidgetUI(); 19 dataWidgetUI();
20
21 private:
22 void createTableLayout();
23
24 private slots:
25 void slotShowData(int);
20}; 26};