Diffstat (limited to 'noncore/apps/oxygen/datawidgetui.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/oxygen/datawidgetui.cpp | 59 |
1 files changed, 45 insertions, 14 deletions
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 | |||
@@ -13,28 +13,59 @@ | |||
13 | #include <qtable.h> | 13 | #include <qtable.h> |
14 | #include <qstring.h> | 14 | #include <qstring.h> |
15 | #include <qcombobox.h> | ||
15 | 16 | ||
16 | dataWidgetUI::dataWidgetUI() : dataWidget() | 17 | 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(); |
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 | |||
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 | } |