summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (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
@@ -12,5 +12,5 @@
<x>0</x>
<y>0</y>
- <width>249</width>
+ <width>245</width>
<height>276</height>
</rect>
@@ -22,25 +22,7 @@
<widget>
<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>
<property stdset="1">
@@ -71,5 +53,5 @@
<property stdset="1">
<name>numRows</name>
- <number>6</number>
+ <number>8</number>
</property>
<property stdset="1">
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
@@ -13,28 +13,59 @@
#include <qtable.h>
#include <qstring.h>
+#include <qcombobox.h>
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();
dataTable->verticalHeader()->hide();
dataTable->setTopMargin( 0 );
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
@@ -18,3 +18,9 @@ class dataWidgetUI : public dataWidget
public:
dataWidgetUI();
+
+ private:
+ void createTableLayout();
+
+ private slots:
+ void slotShowData(int);
};