-rw-r--r-- | noncore/apps/oxygen/datawidget.ui | 24 | ||||
-rw-r--r-- | noncore/apps/oxygen/datawidgetui.cpp | 59 | ||||
-rw-r--r-- | noncore/apps/oxygen/datawidgetui.h | 6 |
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 | |||
@@ -13,3 +13,3 @@ | |||
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>249</width> | 14 | <width>245</width> |
15 | <height>276</height> | 15 | <height>276</height> |
@@ -23,23 +23,5 @@ | |||
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> |
@@ -72,3 +54,3 @@ | |||
72 | <name>numRows</name> | 54 | <name>numRows</name> |
73 | <number>6</number> | 55 | <number>8</number> |
74 | </property> | 56 | </property> |
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 | |||
@@ -14,2 +14,3 @@ | |||
14 | #include <qstring.h> | 14 | #include <qstring.h> |
15 | #include <qcombobox.h> | ||
15 | 16 | ||
@@ -17,16 +18,19 @@ dataWidgetUI::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 | 35 | void dataWidgetUI::createTableLayout(){ | |
32 | dataTable->horizontalHeader()->hide(); | 36 | dataTable->horizontalHeader()->hide(); |
@@ -35,6 +39,33 @@ dataWidgetUI::dataWidgetUI() : dataWidget() | |||
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 | |||
52 | void 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 | |||
@@ -19,2 +19,8 @@ class dataWidgetUI : public dataWidget | |||
19 | dataWidgetUI(); | 19 | dataWidgetUI(); |
20 | |||
21 | private: | ||
22 | void createTableLayout(); | ||
23 | |||
24 | private slots: | ||
25 | void slotShowData(int); | ||
20 | }; | 26 | }; |