summaryrefslogtreecommitdiff
authorcniehaus <cniehaus>2002-09-19 20:47:36 (UTC)
committer cniehaus <cniehaus>2002-09-19 20:47:36 (UTC)
commit65ba4e3610c94ba1de71a41dd6bf69662555e206 (patch) (unidiff)
tree696c3d7317a3c5a13f14160d9281fe4e889cf5bc
parentf4162d2283ebf0327645e0ac66b539cf87565d0b (diff)
downloadopie-65ba4e3610c94ba1de71a41dd6bf69662555e206.zip
opie-65ba4e3610c94ba1de71a41dd6bf69662555e206.tar.gz
opie-65ba4e3610c94ba1de71a41dd6bf69662555e206.tar.bz2
* codecleanup
* adding some const * if you click on a "element" you will now really get the information * removed obsolete class
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/oxygen/dataTable.cpp2
-rw-r--r--noncore/apps/oxygen/dataTable.h2
-rw-r--r--noncore/apps/oxygen/datawidgetui.cpp2
-rw-r--r--noncore/apps/oxygen/oxyframe.cpp5
-rw-r--r--noncore/apps/oxygen/oxyframe.h7
-rw-r--r--noncore/apps/oxygen/oxygen.cpp14
-rw-r--r--noncore/apps/oxygen/oxygen.h9
-rw-r--r--noncore/apps/oxygen/psewidget.cpp20
-rw-r--r--noncore/apps/oxygen/psewidget.h53
9 files changed, 32 insertions, 82 deletions
diff --git a/noncore/apps/oxygen/dataTable.cpp b/noncore/apps/oxygen/dataTable.cpp
index 7516b06..870ac56 100644
--- a/noncore/apps/oxygen/dataTable.cpp
+++ b/noncore/apps/oxygen/dataTable.cpp
@@ -59,3 +59,3 @@ void OxydataWidget::setElement( int el )
59 59
60void OxydataWidget::setTable() 60void OxydataWidget::setTable() const
61{ 61{
diff --git a/noncore/apps/oxygen/dataTable.h b/noncore/apps/oxygen/dataTable.h
index bdcaa99..ccc4300 100644
--- a/noncore/apps/oxygen/dataTable.h
+++ b/noncore/apps/oxygen/dataTable.h
@@ -39,3 +39,3 @@ class OxydataWidget : public QWidget
39 OxydataTable *DataTable; 39 OxydataTable *DataTable;
40 void setTable(); 40 void setTable() const;
41 41
diff --git a/noncore/apps/oxygen/datawidgetui.cpp b/noncore/apps/oxygen/datawidgetui.cpp
index 8188515..2e99c0b 100644
--- a/noncore/apps/oxygen/datawidgetui.cpp
+++ b/noncore/apps/oxygen/datawidgetui.cpp
@@ -20,3 +20,3 @@ dataWidgetUI::dataWidgetUI() : QWidget()
20{ 20{
21 this->setCaption("Chemical Data"); 21 this->setCaption( tr( "Chemical Data" ));
22 22
diff --git a/noncore/apps/oxygen/oxyframe.cpp b/noncore/apps/oxygen/oxyframe.cpp
index d459d2b..2d7fc84 100644
--- a/noncore/apps/oxygen/oxyframe.cpp
+++ b/noncore/apps/oxygen/oxyframe.cpp
@@ -15,2 +15,3 @@ OxyFrame::OxyFrame(QWidget *parent, const char *name) : QFrame(parent,name)
15{ 15{
16 N = name;
16 this->setFrameStyle( QFrame::Panel ); 17 this->setFrameStyle( QFrame::Panel );
@@ -18,3 +19,3 @@ OxyFrame::OxyFrame(QWidget *parent, const char *name) : QFrame(parent,name)
18 this->setFrameShadow( QFrame::Raised ); 19 this->setFrameShadow( QFrame::Raised );
19 this->setBackgroundColor( QColor( cyan ) ); 20 this->setBackgroundColor( QColor( green ) );
20} 21}
@@ -22,3 +23,3 @@ OxyFrame::OxyFrame(QWidget *parent, const char *name) : QFrame(parent,name)
22void OxyFrame::mousePressEvent ( QMouseEvent * e ){ 23void OxyFrame::mousePressEvent ( QMouseEvent * e ){
23 emit clicked(); 24 emit num( N );
24}; 25};
diff --git a/noncore/apps/oxygen/oxyframe.h b/noncore/apps/oxygen/oxyframe.h
index 6ff9e27..a19f13c 100644
--- a/noncore/apps/oxygen/oxyframe.h
+++ b/noncore/apps/oxygen/oxyframe.h
@@ -24,4 +24,9 @@ class OxyFrame : public QFrame
24 24
25 QString N;
26
25 signals: 27 signals:
26 void clicked(); 28 /*
29 * this signal emits the name ( the elemen-number )
30 */
31 void num(QString);
27}; 32};
diff --git a/noncore/apps/oxygen/oxygen.cpp b/noncore/apps/oxygen/oxygen.cpp
index 2574841..4e293c7 100644
--- a/noncore/apps/oxygen/oxygen.cpp
+++ b/noncore/apps/oxygen/oxygen.cpp
@@ -22,6 +22,4 @@ Oxygen::Oxygen()
22{ 22{
23 this->setCaption( "Oxygen" ); 23 this->setCaption( tr( "Oxygen" ) );
24 vbox = new QVBox( this ); 24 vbox = new QVBox( this );
25 QPushButton *setButton = new QPushButton( "Settings", vbox );
26 connect ( setButton, SIGNAL( clicked() ), this, SLOT( slotSettings() ) );
27 QPushButton *dataButton = new QPushButton( "Data", vbox ); 25 QPushButton *dataButton = new QPushButton( "Data", vbox );
@@ -37,3 +35,3 @@ Oxygen::Oxygen()
37 35
38void Oxygen::close() 36void Oxygen::close() const
39{ 37{
@@ -44,3 +42,3 @@ void Oxygen::close()
44 42
45void Oxygen::slotCalculations(){ 43void Oxygen::slotCalculations() const{
46 calcDlgUI *CalcDlgUI = new calcDlgUI(); 44 calcDlgUI *CalcDlgUI = new calcDlgUI();
@@ -49,3 +47,3 @@ void Oxygen::slotCalculations(){
49 47
50void Oxygen::slotData(){ 48void Oxygen::slotData() const{
51 dataWidgetUI *DataWidgetUI = new dataWidgetUI(); 49 dataWidgetUI *DataWidgetUI = new dataWidgetUI();
@@ -55,5 +53,3 @@ void Oxygen::slotData(){
55 53
56void Oxygen::slotSettings(){ }; 54void Oxygen::slotPSE() const{
57
58void Oxygen::slotPSE(){
59 PSEWidget *pse = new PSEWidget(); 55 PSEWidget *pse = new PSEWidget();
diff --git a/noncore/apps/oxygen/oxygen.h b/noncore/apps/oxygen/oxygen.h
index 71914eb..2a10666 100644
--- a/noncore/apps/oxygen/oxygen.h
+++ b/noncore/apps/oxygen/oxygen.h
@@ -21,7 +21,6 @@ class Oxygen : public QMainWindow
21 private slots: 21 private slots:
22 void slotCalculations(); 22 void slotCalculations() const;
23 void slotSettings(); 23 void slotData() const;
24 void slotData(); 24 void slotPSE() const;
25 void slotPSE(); 25 void close() const;
26 void close();
27}; 26};
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
@@ -11,5 +11,3 @@
11#include <qlayout.h> 11#include <qlayout.h>
12#include <qlabel.h>
13#include <qlist.h> 12#include <qlist.h>
14#include <qvbox.h>
15#include "dataTable.h" 13#include "dataTable.h"
@@ -19,10 +17,5 @@
19 17
20/*Element::Element( const QString &name )
21{
22}*/
23
24
25PSEWidget::PSEWidget() : QWidget() 18PSEWidget::PSEWidget() : QWidget()
26{ 19{
27 this->setCaption( "Periodic System" ); 20 this->setCaption( tr( "Periodic System" ) );
28 21
@@ -36,9 +29,9 @@ PSEWidget::PSEWidget() : QWidget()
36 QList<OxyFrame> PSEframe; 29 QList<OxyFrame> PSEframe;
37 PSEframe.append( new OxyFrame( this , QString::number( n ) ) ); 30 PSEframe.append( new OxyFrame( this , QString::number(n) ) );
38 grid->addWidget( PSEframe.current() , v/40+1 , h/40 ); 31 grid->addWidget( PSEframe.current() , v/40+1 , h/40 );
39 PSEframe.current()->setMinimumHeight( 11 ); 32 PSEframe.current()->setMinimumHeight( 11 );
40 connect( PSEframe.current(), SIGNAL( clicked() ), this, SLOT( slotShowElement() )); 33 connect( PSEframe.current(), SIGNAL( num(QString) ), this, SLOT( slotShowElement(QString) ));
41 } 34 }
42 35
43 OxydataWidget *oxyDW = new OxydataWidget(this); 36 oxyDW = new OxydataWidget(this);
44 oxyDW->setElement( 1 ); 37 oxyDW->setElement( 1 );
@@ -49,3 +42,6 @@ PSEWidget::PSEWidget() : QWidget()
49 42
50void PSEWidget::slotShowElement(){ qDebug( "ja genau" );}; 43void PSEWidget::slotShowElement(QString number)
44{
45 oxyDW->setElement( number.toInt() );
46};
51 47
diff --git a/noncore/apps/oxygen/psewidget.h b/noncore/apps/oxygen/psewidget.h
index 2a1e85c..a7a8603 100644
--- a/noncore/apps/oxygen/psewidget.h
+++ b/noncore/apps/oxygen/psewidget.h
@@ -15,51 +15,3 @@
15class QGridLayout; 15class QGridLayout;
16 16class OxydataWidget;
17class Element
18{
19 public:
20 Element(const QString &elnum);
21 ~Element();
22
23 void setName( QString c){ name = c;};
24 void setWeight( QString c){ weight = c;};
25 void setDensityName( QString c){density = c;};
26 void setGroup( QString c){group = c;};
27 void setIE( QString c){ie = c;};
28 void setNum( QString c){num = c;};
29 void setAZ( QString c){az = c;};
30 void setDate( QString c){date = c;};
31 void setEN( QString c){en = c;};
32 void setMP( QString c){mp = c;};
33 void setBP( QString c){bp = c;};
34 void setAR( QString c){ar = c;};
35
36 QString elname() const{ return name; };
37 QString elweight() const{ return weight; };
38 QString eldensity() const{ return density; };
39 QString elgroup() const{ return group; };
40 QString elie() const{ return ie; };
41 QString elnum() const{ return num; };
42 QString elaz() const{ return az; };
43 QString eldate() const{ return date; };
44 QString elen() const{ return en; };
45 QString elmp() const{ return mp; };
46 QString elbp() const{ return bp; };
47 QString elar() const{ return ar; };
48
49 private:
50 QString name, // The name of the element
51 weight, // weight
52 density, // density
53 group, // group
54 ie, // ionisationenergie
55 num, // number ( e.g. Carbon is 6 )
56 az, // state of aggregation
57 date, // date of discovery
58 en, // electronegativity
59 mp, // meltingpoint
60 bp, // boilingpoint
61 ar; // atomic radius
62};
63
64class QGridLayout;
65 17
@@ -72,2 +24,3 @@ class PSEWidget : public QWidget
72 QGridLayout *bottom_grid; 24 QGridLayout *bottom_grid;
25 OxydataWidget *oxyDW;
73 26
@@ -79,3 +32,3 @@ class PSEWidget : public QWidget
79 public slots: 32 public slots:
80 void slotShowElement(); 33 void slotShowElement(QString);
81 34