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
@@ -1,85 +1,67 @@
1<!DOCTYPE UI><UI> 1<!DOCTYPE UI><UI>
2<class>dataWidget</class> 2<class>dataWidget</class>
3<widget> 3<widget>
4 <class>QDialog</class> 4 <class>QDialog</class>
5 <property stdset="1"> 5 <property stdset="1">
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>
53 </rect> 35 </rect>
54 </property> 36 </property>
55 </widget> 37 </widget>
56 <widget> 38 <widget>
57 <class>QTable</class> 39 <class>QTable</class>
58 <property stdset="1"> 40 <property stdset="1">
59 <name>name</name> 41 <name>name</name>
60 <cstring>dataTable</cstring> 42 <cstring>dataTable</cstring>
61 </property> 43 </property>
62 <property stdset="1"> 44 <property stdset="1">
63 <name>geometry</name> 45 <name>geometry</name>
64 <rect> 46 <rect>
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>
82 </property> 64 </property>
83 </widget> 65 </widget>
84</widget> 66</widget>
85</UI> 67</UI>
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
@@ -1,40 +1,71 @@
1/*************************************************************************** 1/***************************************************************************
2 * * 2 * *
3 * This program is free software; you can redistribute it and/or modify * 3 * This program is free software; you can redistribute it and/or modify *
4 * it under the terms of the GNU General Public License as published by * 4 * it under the terms of the GNU General Public License as published by *
5 * the Free Software Foundation; either version 2 of the License, or * 5 * the Free Software Foundation; either version 2 of the License, or *
6 * ( at your option ) any later version. * 6 * ( at your option ) any later version. *
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
@@ -1,20 +1,26 @@
1 1
2/*************************************************************************** 2/***************************************************************************
3 * * 3 * *
4 * This program is free software; you can redistribute it and/or modify * 4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by * 5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or * 6 * the Free Software Foundation; either version 2 of the License, or *
7 * ( at your option ) any later version. * 7 * ( at your option ) any later version. *
8 * * 8 * *
9 **************************************************************************/ 9 **************************************************************************/
10#include "datawidget.h" 10#include "datawidget.h"
11 11
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};