summaryrefslogtreecommitdiff
authorcniehaus <cniehaus>2002-09-16 18:21:45 (UTC)
committer cniehaus <cniehaus>2002-09-16 18:21:45 (UTC)
commit5502a0dc488a96eed8105762a9183f53ef4fe50c (patch) (unidiff)
tree38f57c98ffe84a4c01d8820237042c468a816a45
parent79b8169dfefae4c3b6bfe0652270bb66a04a6b3f (diff)
downloadopie-5502a0dc488a96eed8105762a9183f53ef4fe50c.zip
opie-5502a0dc488a96eed8105762a9183f53ef4fe50c.tar.gz
opie-5502a0dc488a96eed8105762a9183f53ef4fe50c.tar.bz2
ok, fixed the stupid bugs :)) Works now (click on "Data")
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
@@ -6,47 +6,29 @@
6 <name>name</name> 6 <name>name</name>
7 <cstring>dataWidget</cstring> 7 <cstring>dataWidget</cstring>
8 </property> 8 </property>
9 <property stdset="1"> 9 <property stdset="1">
10 <name>geometry</name> 10 <name>geometry</name>
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>
18 <property stdset="1"> 18 <property stdset="1">
19 <name>caption</name> 19 <name>caption</name>
20 <string>Chemical Data</string> 20 <string>Chemical Data</string>
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>
48 <rect> 30 <rect>
49 <x>10</x> 31 <x>10</x>
50 <y>10</y> 32 <y>10</y>
51 <width>230</width> 33 <width>230</width>
52 <height>50</height> 34 <height>50</height>
@@ -65,17 +47,17 @@
65 <x>0</x> 47 <x>0</x>
66 <y>80</y> 48 <y>80</y>
67 <width>240</width> 49 <width>240</width>
68 <height>190</height> 50 <height>190</height>
69 </rect> 51 </rect>
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>
77 <number>2</number> 59 <number>2</number>
78 </property> 60 </property>
79 <property stdset="1"> 61 <property stdset="1">
80 <name>showGrid</name> 62 <name>showGrid</name>
81 <bool>false</bool> 63 <bool>false</bool>
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
@@ -7,34 +7,65 @@
7 * * 7 * *
8 **************************************************************************/ 8 **************************************************************************/
9#include "oxygen.h" 9#include "oxygen.h"
10 10
11#include <qpe/config.h> 11#include <qpe/config.h>
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
@@ -12,9 +12,15 @@
12class QTable; 12class QTable;
13 13
14class dataWidgetUI : public dataWidget 14class dataWidgetUI : public dataWidget
15{ 15{
16 Q_OBJECT 16 Q_OBJECT
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};