summaryrefslogtreecommitdiff
authorcniehaus <cniehaus>2002-09-19 20:47:36 (UTC)
committer cniehaus <cniehaus>2002-09-19 20:47:36 (UTC)
commit65ba4e3610c94ba1de71a41dd6bf69662555e206 (patch) (side-by-side diff)
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 )
-void OxydataWidget::setTable()
+void OxydataWidget::setTable() const
{
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
OxydataTable *DataTable;
- void setTable();
+ void setTable() const;
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()
{
- this->setCaption("Chemical Data");
+ this->setCaption( tr( "Chemical Data" ));
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)
{
+ N = name;
this->setFrameStyle( QFrame::Panel );
@@ -18,3 +19,3 @@ OxyFrame::OxyFrame(QWidget *parent, const char *name) : QFrame(parent,name)
this->setFrameShadow( QFrame::Raised );
- this->setBackgroundColor( QColor( cyan ) );
+ this->setBackgroundColor( QColor( green ) );
}
@@ -22,3 +23,3 @@ OxyFrame::OxyFrame(QWidget *parent, const char *name) : QFrame(parent,name)
void OxyFrame::mousePressEvent ( QMouseEvent * e ){
- emit clicked();
+ emit num( N );
};
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
+ QString N;
+
signals:
- void clicked();
+ /*
+ * this signal emits the name ( the elemen-number )
+ */
+ void num(QString);
};
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()
{
- this->setCaption( "Oxygen" );
+ this->setCaption( tr( "Oxygen" ) );
vbox = new QVBox( this );
- QPushButton *setButton = new QPushButton( "Settings", vbox );
- connect ( setButton, SIGNAL( clicked() ), this, SLOT( slotSettings() ) );
QPushButton *dataButton = new QPushButton( "Data", vbox );
@@ -37,3 +35,3 @@ Oxygen::Oxygen()
-void Oxygen::close()
+void Oxygen::close() const
{
@@ -44,3 +42,3 @@ void Oxygen::close()
-void Oxygen::slotCalculations(){
+void Oxygen::slotCalculations() const{
calcDlgUI *CalcDlgUI = new calcDlgUI();
@@ -49,3 +47,3 @@ void Oxygen::slotCalculations(){
-void Oxygen::slotData(){
+void Oxygen::slotData() const{
dataWidgetUI *DataWidgetUI = new dataWidgetUI();
@@ -55,5 +53,3 @@ void Oxygen::slotData(){
-void Oxygen::slotSettings(){ };
-
-void Oxygen::slotPSE(){
+void Oxygen::slotPSE() const{
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
private slots:
- void slotCalculations();
- void slotSettings();
- void slotData();
- void slotPSE();
- void close();
+ void slotCalculations() const;
+ void slotData() const;
+ void slotPSE() const;
+ void close() const;
};
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 @@
#include <qlayout.h>
-#include <qlabel.h>
#include <qlist.h>
-#include <qvbox.h>
#include "dataTable.h"
@@ -19,10 +17,5 @@
-/*Element::Element( const QString &name )
-{
-}*/
-
-
PSEWidget::PSEWidget() : QWidget()
{
- this->setCaption( "Periodic System" );
+ this->setCaption( tr( "Periodic System" ) );
@@ -36,9 +29,9 @@ PSEWidget::PSEWidget() : QWidget()
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 );
@@ -49,3 +42,6 @@ PSEWidget::PSEWidget() : QWidget()
-void PSEWidget::slotShowElement(){ qDebug( "ja genau" );};
+void PSEWidget::slotShowElement(QString number)
+{
+ oxyDW->setElement( number.toInt() );
+};
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 @@
class QGridLayout;
-
-class Element
-{
- public:
- Element(const QString &elnum);
- ~Element();
-
- void setName( QString c){ name = c;};
- void setWeight( QString c){ weight = c;};
- void setDensityName( QString c){density = c;};
- void setGroup( QString c){group = c;};
- void setIE( QString c){ie = c;};
- void setNum( QString c){num = c;};
- void setAZ( QString c){az = c;};
- void setDate( QString c){date = c;};
- void setEN( QString c){en = c;};
- void setMP( QString c){mp = c;};
- void setBP( QString c){bp = c;};
- void setAR( QString c){ar = c;};
-
- QString elname() const{ return name; };
- QString elweight() const{ return weight; };
- QString eldensity() const{ return density; };
- QString elgroup() const{ return group; };
- QString elie() const{ return ie; };
- QString elnum() const{ return num; };
- QString elaz() const{ return az; };
- QString eldate() const{ return date; };
- QString elen() const{ return en; };
- QString elmp() const{ return mp; };
- QString elbp() const{ return bp; };
- QString elar() const{ return ar; };
-
- private:
- QString name, // The name of the element
- weight, // weight
- density, // density
- group, // group
- ie, // ionisationenergie
- num, // number ( e.g. Carbon is 6 )
- az, // state of aggregation
- date, // date of discovery
- en, // electronegativity
- mp, // meltingpoint
- bp, // boilingpoint
- ar; // atomic radius
-};
-
-class QGridLayout;
+class OxydataWidget;
@@ -72,2 +24,3 @@ class PSEWidget : public QWidget
QGridLayout *bottom_grid;
+ OxydataWidget *oxyDW;
@@ -79,3 +32,3 @@ class PSEWidget : public QWidget
public slots:
- void slotShowElement();
+ void slotShowElement(QString);