author | cniehaus <cniehaus> | 2002-09-19 19:34:26 (UTC) |
---|---|---|
committer | cniehaus <cniehaus> | 2002-09-19 19:34:26 (UTC) |
commit | aef34909dcfb2ffb637c9d3693e395c15b255cb2 (patch) (side-by-side diff) | |
tree | 24790ee542408f594b1e6b018dd0013435f75d84 | |
parent | 04fd73b51c766027f2168ed8220f7cbb7ca1486c (diff) | |
download | opie-aef34909dcfb2ffb637c9d3693e395c15b255cb2.zip opie-aef34909dcfb2ffb637c9d3693e395c15b255cb2.tar.gz opie-aef34909dcfb2ffb637c9d3693e395c15b255cb2.tar.bz2 |
wow, this works now :)) Elemental: ich hab' dich!
-rw-r--r-- | noncore/apps/oxygen/oxyframe.cpp | 3 | ||||
-rw-r--r-- | noncore/apps/oxygen/oxyframe.h | 5 | ||||
-rw-r--r-- | noncore/apps/oxygen/psewidget.cpp | 18 | ||||
-rw-r--r-- | noncore/apps/oxygen/psewidget.h | 3 |
4 files changed, 26 insertions, 3 deletions
diff --git a/noncore/apps/oxygen/oxyframe.cpp b/noncore/apps/oxygen/oxyframe.cpp index a7833be..d459d2b 100644 --- a/noncore/apps/oxygen/oxyframe.cpp +++ b/noncore/apps/oxygen/oxyframe.cpp @@ -19,3 +19,6 @@ OxyFrame::OxyFrame(QWidget *parent, const char *name) : QFrame(parent,name) this->setBackgroundColor( QColor( cyan ) ); } +void OxyFrame::mousePressEvent ( QMouseEvent * e ){ + emit clicked(); +}; diff --git a/noncore/apps/oxygen/oxyframe.h b/noncore/apps/oxygen/oxyframe.h index 9c7dab5..6ff9e27 100644 --- a/noncore/apps/oxygen/oxyframe.h +++ b/noncore/apps/oxygen/oxyframe.h @@ -19,6 +19,11 @@ class OxyFrame : public QFrame public: OxyFrame( QWidget *parent=0, const char *name=0); + + void mousePressEvent( QMouseEvent *); + + signals: + void clicked(); }; #endif diff --git a/noncore/apps/oxygen/psewidget.cpp b/noncore/apps/oxygen/psewidget.cpp index ab1467c..506e0cb 100644 --- a/noncore/apps/oxygen/psewidget.cpp +++ b/noncore/apps/oxygen/psewidget.cpp @@ -17,16 +17,18 @@ #include "oxyframe.h" -Element::Element( const QString &name ) +/*Element::Element( const QString &name ) { -} +}*/ PSEWidget::PSEWidget() : QWidget() { this->setCaption( "Periodic System" ); - QGridLayout *grid = new QGridLayout( this, 18,10 ); + QVBoxLayout *vlay = new QVBoxLayout( this ); + + QGridLayout *grid = new QGridLayout( 18,10 ); int h=0, v=0; for( int n = 0 ; n < 118 ; n++ ) { @@ -34,9 +36,19 @@ PSEWidget::PSEWidget() : QWidget() QList<OxyFrame> PSEframe; 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() )); } + + OxydataWidget *oxyDW = new OxydataWidget(this); + oxyDW->setElement( 1 ); + + vlay->addLayout( grid ); + vlay->addWidget( oxyDW ); } +void PSEWidget::slotShowElement(){ qDebug( "ja genau" );}; + void PSEWidget::position(int n, int& h, int& v) { //Hydrogen diff --git a/noncore/apps/oxygen/psewidget.h b/noncore/apps/oxygen/psewidget.h index 3ea58e3..2a1e85c 100644 --- a/noncore/apps/oxygen/psewidget.h +++ b/noncore/apps/oxygen/psewidget.h @@ -76,6 +76,9 @@ class PSEWidget : public QWidget void position( int, int&, int& ); + public slots: + void slotShowElement(); + }; #endif |