author | cniehaus <cniehaus> | 2002-09-21 13:43:51 (UTC) |
---|---|---|
committer | cniehaus <cniehaus> | 2002-09-21 13:43:51 (UTC) |
commit | 65cf44292ac6abfb1a60be5f582cab26333cfb0a (patch) (side-by-side diff) | |
tree | 8fec45b6ca9302055dd497fc7857015cf571665d /noncore/apps/oxygen/dataTable.cpp | |
parent | 99d546ce72f40e28b04f09201d92d58294401591 (diff) | |
download | opie-65cf44292ac6abfb1a60be5f582cab26333cfb0a.zip opie-65cf44292ac6abfb1a60be5f582cab26333cfb0a.tar.gz opie-65cf44292ac6abfb1a60be5f582cab26333cfb0a.tar.bz2 |
* moving oxygendata and kmolweights
* fixing the datafile-problems (thanks to Max)
Diffstat (limited to 'noncore/apps/oxygen/dataTable.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/oxygen/dataTable.cpp | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/noncore/apps/oxygen/dataTable.cpp b/noncore/apps/oxygen/dataTable.cpp index f034c45..45c2ffd 100644 --- a/noncore/apps/oxygen/dataTable.cpp +++ b/noncore/apps/oxygen/dataTable.cpp @@ -24,17 +24,18 @@ #include <qfont.h> #include <qlayout.h> +#include <qpe/qpeapplication.h> OxydataWidget::OxydataWidget(QWidget *parent) : QWidget(parent) { QGridLayout *qgrid = new QGridLayout( this, 2,1 ); - + QHBox *hbox = new QHBox( this ); left = new QLabel( hbox ); middle = new QLabel( hbox ); right = new QLabel( hbox ); - + right->setAlignment( AlignRight ); middle->setAlignment( AlignHCenter ); - + QFont bf; bf.setBold( true ); @@ -47,13 +48,14 @@ OxydataWidget::OxydataWidget(QWidget *parent) : QWidget(parent) setTable(); - qgrid->addWidget( hbox,0,0 ); - qgrid->addWidget( DataTable,1,0 ); + qgrid->addWidget( hbox,0,0 ); + qgrid->addWidget( DataTable,1,0 ); } void OxydataWidget::setElement( int el ) { - Config configobj( "oxygendata" ); + Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File ); + configobj.setGroup( QString::number( el+1 )); - + left->setText( configobj.readEntry( "Symbol" ) ); middle->setText( configobj.readEntry( "Name" ) ); @@ -61,14 +63,14 @@ void OxydataWidget::setElement( int el ) - DataTable->setText( 0,1,configobj.readEntry( "Weight" ) ); - DataTable->setText( 1,1,configobj.readEntry( "Block" ) ); - DataTable->setText( 2,1,configobj.readEntry( "Group" ) ); - DataTable->setText( 3,1,configobj.readEntry( "EN" ) ); - DataTable->setText( 4,1,configobj.readEntry( "AR" ) ) ; - DataTable->setText( 5,1,configobj.readEntry( "IE" ) ); - DataTable->setText( 6,1,configobj.readEntry( "Density" ) ); - DataTable->setText( 7,1,configobj.readEntry( "BP" ) ); - DataTable->setText( 8,1,configobj.readEntry( "MP" ) ); - + DataTable->setText( 0,1,configobj.readEntry( "Weight" ) ); + DataTable->setText( 1,1,configobj.readEntry( "Block" ) ); + DataTable->setText( 2,1,configobj.readEntry( "Group" ) ); + DataTable->setText( 3,1,configobj.readEntry( "EN" ) ); + DataTable->setText( 4,1,configobj.readEntry( "AR" ) ) ; + DataTable->setText( 5,1,configobj.readEntry( "IE" ) ); + DataTable->setText( 6,1,configobj.readEntry( "Density" ) ); + DataTable->setText( 7,1,configobj.readEntry( "BP" ) ); + DataTable->setText( 8,1,configobj.readEntry( "MP" ) ); + } @@ -84,5 +86,5 @@ void OxydataWidget::setTable() const DataTable->setText( 7,0, tr( "Boilingpoint" ) ); DataTable->setText( 8,0, tr( "Meltingpoint" ) ); - + } @@ -115,5 +117,5 @@ void OxydataTable::paintCell( QPainter *p, int row, int col, const QRect &cr, b QTableItem *itm = item( row, col ); QColorGroup colgrp = colorGroup(); - if ( itm ) + if ( itm ) { if ( row%2 ) @@ -134,7 +136,7 @@ OxydataQTI::OxydataQTI(QTable * table, EditType et, const QString & text ) int OxydataQTI::alignment() const { - if ( col()%2 ) + if ( col()%2 ) { - return AlignRight | AlignVCenter; + return AlignRight | AlignVCenter; }else return AlignLeft | AlignVCenter; }; |