-rw-r--r-- | noncore/apps/oxygen/datawidget.ui | 67 | ||||
-rw-r--r-- | noncore/apps/oxygen/datawidgetui.cpp | 56 | ||||
-rw-r--r-- | noncore/apps/oxygen/datawidgetui.h | 6 | ||||
-rw-r--r-- | noncore/apps/oxygen/main.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/oxygen/oxygen.pro | 5 |
5 files changed, 44 insertions, 92 deletions
diff --git a/noncore/apps/oxygen/datawidget.ui b/noncore/apps/oxygen/datawidget.ui deleted file mode 100644 index 4dc91ea..0000000 --- a/noncore/apps/oxygen/datawidget.ui +++ b/dev/null @@ -1,67 +0,0 @@ -<!DOCTYPE UI><UI> -<class>dataWidget</class> -<widget> - <class>QDialog</class> - <property stdset="1"> - <name>name</name> - <cstring>dataWidget</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>0</x> - <y>0</y> - <width>245</width> - <height>276</height> - </rect> - </property> - <property stdset="1"> - <name>caption</name> - <string>Chemical Data</string> - </property> - <widget> - <class>QComboBox</class> - <property stdset="1"> - <name>name</name> - <cstring>dataCombo</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>10</x> - <y>10</y> - <width>230</width> - <height>50</height> - </rect> - </property> - </widget> - <widget> - <class>QTable</class> - <property stdset="1"> - <name>name</name> - <cstring>dataTable</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>0</x> - <y>80</y> - <width>240</width> - <height>190</height> - </rect> - </property> - <property stdset="1"> - <name>numRows</name> - <number>8</number> - </property> - <property stdset="1"> - <name>numCols</name> - <number>2</number> - </property> - <property stdset="1"> - <name>showGrid</name> - <bool>false</bool> - </property> - </widget> -</widget> -</UI> diff --git a/noncore/apps/oxygen/datawidgetui.cpp b/noncore/apps/oxygen/datawidgetui.cpp index 67f59d9..79d35e5 100644 --- a/noncore/apps/oxygen/datawidgetui.cpp +++ b/noncore/apps/oxygen/datawidgetui.cpp @@ -15,5 +15,19 @@ #include <qcombobox.h> +#include <qlayout.h> -dataWidgetUI::dataWidgetUI() : dataWidget() +dataWidgetUI::dataWidgetUI() : QDialog() { + this->setCaption("foo"); + + QVBoxLayout *vbox = new QVBoxLayout( this ); + + dataCombo = new QComboBox( this ); + DataTable = new QTable( 7,2, this ); + + vbox->addWidget( dataCombo ); + vbox->addWidget( DataTable ); + + DataTable->show(); + dataCombo->show(); + connect ( dataCombo, SIGNAL( activated(int) ), this, SLOT( slotShowData(int) ) ); @@ -35,15 +49,15 @@ dataWidgetUI::dataWidgetUI() : dataWidget() void dataWidgetUI::createTableLayout(){ - dataTable->horizontalHeader()->hide(); - dataTable->verticalHeader()->hide(); - dataTable->setTopMargin( 0 ); - dataTable->setLeftMargin( 0 ); + DataTable->horizontalHeader()->hide(); + DataTable->verticalHeader()->hide(); + DataTable->setTopMargin( 0 ); + DataTable->setLeftMargin( 0 ); - 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" ); + 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" ); } @@ -55,17 +69,17 @@ void dataWidgetUI::slotShowData(int number){ QString weight = test.readEntry( "Weight" ); - dataTable->setText( 0,1,weight ); + DataTable->setText( 0,1,weight ); QString block = test.readEntry( "Block" ); - dataTable->setText( 1,1,block ); + DataTable->setText( 1,1,block ); QString grp = test.readEntry( "Group" ); - dataTable->setText( 2,1,grp ); + DataTable->setText( 2,1,grp ); QString en = test.readEntry( "EN" ); - dataTable->setText( 3,1,en ); + DataTable->setText( 3,1,en ); QString ar = test.readEntry( "AR" ); - dataTable->setText( 4,1,ar ) ; + DataTable->setText( 4,1,ar ) ; QString ion = test.readEntry( "IE" ); - dataTable->setText( 5,1,ion ); + DataTable->setText( 5,1,ion ); QString dens = test.readEntry( "Density" ); - dataTable->setText( 6,1,dens ); + DataTable->setText( 6,1,dens ); QString bp = test.readEntry( "BP" ); - dataTable->setText( 7,1,bp ); + DataTable->setText( 7,1,bp ); } diff --git a/noncore/apps/oxygen/datawidgetui.h b/noncore/apps/oxygen/datawidgetui.h index 582bc19..a158545 100644 --- a/noncore/apps/oxygen/datawidgetui.h +++ b/noncore/apps/oxygen/datawidgetui.h @@ -10,6 +10,8 @@ #include "datawidget.h" +#include "dataTable.h" class QTable; +class QComboBox; -class dataWidgetUI : public dataWidget +class dataWidgetUI : public QDialog { @@ -22,2 +24,4 @@ class dataWidgetUI : public dataWidget void createTableLayout(); + QTable *DataTable; + QComboBox *dataCombo; diff --git a/noncore/apps/oxygen/main.cpp b/noncore/apps/oxygen/main.cpp index 328b61f..31e44dc 100644 --- a/noncore/apps/oxygen/main.cpp +++ b/noncore/apps/oxygen/main.cpp @@ -7,3 +7,3 @@ * * - * ***********************************************************************/ + **************************************************************************/ diff --git a/noncore/apps/oxygen/oxygen.pro b/noncore/apps/oxygen/oxygen.pro index 7736a97..1bbeb94 100644 --- a/noncore/apps/oxygen/oxygen.pro +++ b/noncore/apps/oxygen/oxygen.pro @@ -6,2 +6,3 @@ HEADERS = oxygen.h \ calcdlgui.h \ + dataTable.h \ datawidgetui.h @@ -13,2 +14,3 @@ SOURCES = main.cpp \ kmolelements.cpp \ + dataTable.cpp \ datawidgetui.cpp @@ -17,4 +19,3 @@ DEPENDPATH += $(OPIEDIR)/include LIBS += -lqpe -INTERFACES = calcdlg.ui \ - datawidget.ui +INTERFACES = calcdlg.ui TARGET = oxygen |