summaryrefslogtreecommitdiff
path: root/noncore/apps/oxygen/datawidgetui.cpp
Unidiff
Diffstat (limited to 'noncore/apps/oxygen/datawidgetui.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/oxygen/datawidgetui.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/noncore/apps/oxygen/datawidgetui.cpp b/noncore/apps/oxygen/datawidgetui.cpp
index c8492e5..7256777 100644
--- a/noncore/apps/oxygen/datawidgetui.cpp
+++ b/noncore/apps/oxygen/datawidgetui.cpp
@@ -10,24 +10,34 @@
10 10
11#include <qpe/config.h> 11#include <qpe/config.h>
12#include "datawidgetui.h" 12#include "datawidgetui.h"
13#include <qstring.h> 13#include <qstring.h>
14#include <qcombobox.h> 14#include <qcombobox.h>
15#include <qlayout.h> 15#include <qlayout.h>
16#include <qtable.h>
17#include <qhbox.h>
18#include <qlabel.h>
16 19
17dataWidgetUI::dataWidgetUI() : QDialog() 20dataWidgetUI::dataWidgetUI() : QDialog()
18{ 21{
19 this->setCaption("Chemical Data"); 22 this->setCaption("Chemical Data");
20 23
21 QVBoxLayout *vbox = new QVBoxLayout( this ); 24 QVBoxLayout *vbox = new QVBoxLayout( this );
22 25
23 dataCombo = new QComboBox( this ); 26 dataCombo = new QComboBox( this );
24 DataTable = new OxydataTable( 7,2, this ); 27 DataTable = new OxydataTable( 8,2, this );
25 DataTable->setShowGrid( false ); 28 DataTable->setShowGrid( false );
29 DataTable->setHScrollBarMode(QScrollView::AlwaysOff);
30
31 QHBox *hbox = new QHBox( this );
32 left = new QLabel( hbox );
33 middle = new QLabel( hbox );
34 right = new QLabel( hbox );
26 35
27 vbox->addWidget( dataCombo ); 36 vbox->addWidget( dataCombo );
37 vbox->addWidget( hbox );
28 vbox->addWidget( DataTable ); 38 vbox->addWidget( DataTable );
29 39
30 DataTable->show(); 40 DataTable->show();
31 dataCombo->show(); 41 dataCombo->show();
32 42
33 connect ( dataCombo, SIGNAL( activated(int) ), this, SLOT( slotShowData(int) ) ); 43 connect ( dataCombo, SIGNAL( activated(int) ), this, SLOT( slotShowData(int) ) );
@@ -56,19 +66,30 @@ void dataWidgetUI::createTableLayout(){
56 DataTable->setText( 1,0,"Block" ); 66 DataTable->setText( 1,0,"Block" );
57 DataTable->setText( 2,0,"Group" ); 67 DataTable->setText( 2,0,"Group" );
58 DataTable->setText( 3,0,"Electronegativity" ); 68 DataTable->setText( 3,0,"Electronegativity" );
59 DataTable->setText( 4,0,"Atomic radius" ); 69 DataTable->setText( 4,0,"Atomic radius" );
60 DataTable->setText( 5,0,"Ionizationenergie" ); 70 DataTable->setText( 5,0,"Ionizationenergie" );
61 DataTable->setText( 6,0,"Density" ); 71 DataTable->setText( 6,0,"Density" );
62 DataTable->setText( 7,0,"Boilingpoint" ); 72 DataTable->setText( 7,0, tr( "Boilingpoint" ) );
73 DataTable->setText( 8,0, tr( "Meltingpoint" ) );
63} 74}
64 75
65 76
66void dataWidgetUI::slotShowData(int number){ 77void dataWidgetUI::slotShowData(int number){
67 Config test( "/home/opie/Settings/oxygendata", Config::File ); 78 Config test( "/home/opie/Settings/oxygendata", Config::File );
68 test.setGroup( QString::number( number+1 )); 79 test.setGroup( QString::number( number+1 ));
80
81 left->setText( test.readEntry( "Symbol" ) );
82 middle->setText( test.readEntry( "Name" ) );
83 right->setText( QString::number( number+1 ) );
84
85 QFont bf;
86 bf.setBold( true );
87 bf.setPointSize( bf.pointSize()+2 );
88 middle->setFont( bf );
89
69 QString weight = test.readEntry( "Weight" ); 90 QString weight = test.readEntry( "Weight" );
70 DataTable->setText( 0,1,weight ); 91 DataTable->setText( 0,1,weight );
71 QString block = test.readEntry( "Block" ); 92 QString block = test.readEntry( "Block" );
72 DataTable->setText( 1,1,block ); 93 DataTable->setText( 1,1,block );
73 QString grp = test.readEntry( "Group" ); 94 QString grp = test.readEntry( "Group" );
74 DataTable->setText( 2,1,grp ); 95 DataTable->setText( 2,1,grp );
@@ -79,7 +100,9 @@ void dataWidgetUI::slotShowData(int number){
79 QString ion = test.readEntry( "IE" ); 100 QString ion = test.readEntry( "IE" );
80 DataTable->setText( 5,1,ion ); 101 DataTable->setText( 5,1,ion );
81 QString dens = test.readEntry( "Density" ); 102 QString dens = test.readEntry( "Density" );
82 DataTable->setText( 6,1,dens ); 103 DataTable->setText( 6,1,dens );
83 QString bp = test.readEntry( "BP" ); 104 QString bp = test.readEntry( "BP" );
84 DataTable->setText( 7,1,bp ); 105 DataTable->setText( 7,1,bp );
106 QString mp = test.readEntry( "MP" );
107 DataTable->setText( 7,1,mp );
85} 108}