Diffstat (limited to 'noncore/apps/oxygen/psewidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/oxygen/psewidget.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/noncore/apps/oxygen/psewidget.cpp b/noncore/apps/oxygen/psewidget.cpp index 506e0cb..f7725e3 100644 --- a/noncore/apps/oxygen/psewidget.cpp +++ b/noncore/apps/oxygen/psewidget.cpp @@ -1,98 +1,94 @@ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * ( at your option ) any later version. * * * **************************************************************************/ #include <qpe/config.h> #include <qlayout.h> -#include <qlabel.h> #include <qlist.h> -#include <qvbox.h> #include "dataTable.h" #include "psewidget.h" #include "oxyframe.h" -/*Element::Element( const QString &name ) -{ -}*/ - - PSEWidget::PSEWidget() : QWidget() { - this->setCaption( "Periodic System" ); + this->setCaption( tr( "Periodic System" ) ); QVBoxLayout *vlay = new QVBoxLayout( this ); QGridLayout *grid = new QGridLayout( 18,10 ); int h=0, v=0; for( int n = 0 ; n < 118 ; n++ ) { position( n+1,h,v ); QList<OxyFrame> PSEframe; - PSEframe.append( new OxyFrame( this , QString::number( n ) ) ); + PSEframe.append( new OxyFrame( this , QString::number(n) ) ); grid->addWidget( PSEframe.current() , v/40+1 , h/40 ); PSEframe.current()->setMinimumHeight( 11 ); - connect( PSEframe.current(), SIGNAL( clicked() ), this, SLOT( slotShowElement() )); + connect( PSEframe.current(), SIGNAL( num(QString) ), this, SLOT( slotShowElement(QString) )); } - OxydataWidget *oxyDW = new OxydataWidget(this); + oxyDW = new OxydataWidget(this); oxyDW->setElement( 1 ); vlay->addLayout( grid ); vlay->addWidget( oxyDW ); } -void PSEWidget::slotShowElement(){ qDebug( "ja genau" );}; +void PSEWidget::slotShowElement(QString number) +{ + oxyDW->setElement( number.toInt() ); +}; void PSEWidget::position(int n, int& h, int& v) { //Hydrogen if (n == 1) { h=0; v=0; } //Helium if (n == 2) { h=680; v=0; } //Lithium if (n == 3) { h=0; v=40; } //Beryllium if (n == 4) { h=40; v=40; } //Boron-->Neon or Aluminum --> Argon if ((n >= 5 && n <= 10) || (n >= 13 && n <= 18)) for (int i = 1; i <= (6-(10-n)); i++) { h=((i*40)+440); v = 40; if (n >= 13) { v=80; h=(h-320); } } //Sodium if (n == 11) { |