summaryrefslogtreecommitdiff
path: root/noncore
authorcniehaus <cniehaus>2002-09-16 18:21:45 (UTC)
committer cniehaus <cniehaus>2002-09-16 18:21:45 (UTC)
commit5502a0dc488a96eed8105762a9183f53ef4fe50c (patch) (side-by-side diff)
tree38f57c98ffe84a4c01d8820237042c468a816a45 /noncore
parent79b8169dfefae4c3b6bfe0652270bb66a04a6b3f (diff)
downloadopie-5502a0dc488a96eed8105762a9183f53ef4fe50c.zip
opie-5502a0dc488a96eed8105762a9183f53ef4fe50c.tar.gz
opie-5502a0dc488a96eed8105762a9183f53ef4fe50c.tar.bz2
ok, fixed the stupid bugs :)) Works now (click on "Data")
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/oxygen/datawidget.ui24
-rw-r--r--noncore/apps/oxygen/datawidgetui.cpp59
-rw-r--r--noncore/apps/oxygen/datawidgetui.h6
3 files changed, 54 insertions, 35 deletions
diff --git a/noncore/apps/oxygen/datawidget.ui b/noncore/apps/oxygen/datawidget.ui
index a4dcab2..4dc91ea 100644
--- a/noncore/apps/oxygen/datawidget.ui
+++ b/noncore/apps/oxygen/datawidget.ui
@@ -13,3 +13,3 @@
<y>0</y>
- <width>249</width>
+ <width>245</width>
<height>276</height>
@@ -23,23 +23,5 @@
<class>QComboBox</class>
- <item>
- <property>
- <name>text</name>
- <string>Helium</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>Carbon</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>Oxygen</string>
- </property>
- </item>
<property stdset="1">
<name>name</name>
- <cstring>ComboBox2</cstring>
+ <cstring>dataCombo</cstring>
</property>
@@ -72,3 +54,3 @@
<name>numRows</name>
- <number>6</number>
+ <number>8</number>
</property>
diff --git a/noncore/apps/oxygen/datawidgetui.cpp b/noncore/apps/oxygen/datawidgetui.cpp
index 5b34cf5..67f59d9 100644
--- a/noncore/apps/oxygen/datawidgetui.cpp
+++ b/noncore/apps/oxygen/datawidgetui.cpp
@@ -14,2 +14,3 @@
#include <qstring.h>
+#include <qcombobox.h>
@@ -17,16 +18,19 @@ dataWidgetUI::dataWidgetUI() : dataWidget()
{
- Config test( "oxygendata" );
- test.setGroup( "1" );
+ connect ( dataCombo, SIGNAL( activated(int) ), this, SLOT( slotShowData(int) ) );
+ Config test( "/home/opie/Settings/oxygendata", Config::File );
- if ( test.hasKey( "Name" ) )
+ //read in all names of the 118 elements
+ for ( int i = 1 ; i < 119 ; i++ )
{
- qDebug ( "geht" );
- }else qDebug( "geht nicht" );
+ test.setGroup( QString::number( i ) );
+ QString foo = test.readEntry( "Name" );
+ dataCombo->insertItem( foo );
+ }
- QString foo = test.readEntry( "Name" );
- //test.writeEntry( "Name", "test123" );
+ createTableLayout();
+ slotShowData( 1 ); //this way we do always get data here
- qDebug( "hier sollte was kommen" );
- qDebug( foo );
-
+}
+
+void dataWidgetUI::createTableLayout(){
dataTable->horizontalHeader()->hide();
@@ -35,6 +39,33 @@ dataWidgetUI::dataWidgetUI() : dataWidget()
dataTable->setLeftMargin( 0 );
- dataTable->setText( 0,0,"Atomic Radius" );
- dataTable->setText( 0,1,"17 nm" );
- dataTable->setText( 1,0,"Elec. neg." );
- dataTable->setText( 1,1,"234 Joule" );
+
+ dataTable->setText( 0,0,"Weight:" );
+ dataTable->setText( 1,0,"Block" );
+ dataTable->setText( 2,0,"Group" );
+ dataTable->setText( 3,0,"Electronegativity" );
+ dataTable->setText( 4,0,"Atomic radius" );
+ dataTable->setText( 5,0,"Ionizationenergie" );
+ dataTable->setText( 6,0,"Density" );
+ dataTable->setText( 7,0,"Boilingpoint" );
+}
+
+
+void dataWidgetUI::slotShowData(int number){
+ Config test( "/home/opie/Settings/oxygendata", Config::File );
+ test.setGroup( QString::number( number+1 ));
+ QString weight = test.readEntry( "Weight" );
+ dataTable->setText( 0,1,weight );
+ QString block = test.readEntry( "Block" );
+ dataTable->setText( 1,1,block );
+ QString grp = test.readEntry( "Group" );
+ dataTable->setText( 2,1,grp );
+ QString en = test.readEntry( "EN" );
+ dataTable->setText( 3,1,en );
+ QString ar = test.readEntry( "AR" );
+ dataTable->setText( 4,1,ar ) ;
+ QString ion = test.readEntry( "IE" );
+ dataTable->setText( 5,1,ion );
+ QString dens = test.readEntry( "Density" );
+ dataTable->setText( 6,1,dens );
+ QString bp = test.readEntry( "BP" );
+ dataTable->setText( 7,1,bp );
}
diff --git a/noncore/apps/oxygen/datawidgetui.h b/noncore/apps/oxygen/datawidgetui.h
index 47d9698..582bc19 100644
--- a/noncore/apps/oxygen/datawidgetui.h
+++ b/noncore/apps/oxygen/datawidgetui.h
@@ -19,2 +19,8 @@ class dataWidgetUI : public dataWidget
dataWidgetUI();
+
+ private:
+ void createTableLayout();
+
+ private slots:
+ void slotShowData(int);
};