From 4ed76b385054144663500e7a145d2644620973f5 Mon Sep 17 00:00:00 2001 From: cniehaus Date: Mon, 16 Sep 2002 22:18:13 +0000 Subject: mmh, tried to derive QTableItem. Didn't work. Now my QTable-subclass isn't working either... Will have a look tomorrow --- 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 @@ - -dataWidget - - QDialog - - name - dataWidget - - - geometry - - 0 - 0 - 245 - 276 - - - - caption - Chemical Data - - - QComboBox - - name - dataCombo - - - geometry - - 10 - 10 - 230 - 50 - - - - - QTable - - name - dataTable - - - geometry - - 0 - 80 - 240 - 190 - - - - numRows - 8 - - - numCols - 2 - - - showGrid - false - - - - 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 @@ -13,9 +13,23 @@ #include #include #include +#include -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) ) ); Config test( "/home/opie/Settings/oxygendata", Config::File ); @@ -33,19 +47,19 @@ 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" ); } @@ -53,19 +67,19 @@ 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 ); + 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 @@ -8,10 +8,12 @@ * * **************************************************************************/ #include "datawidget.h" +#include "dataTable.h" class QTable; +class QComboBox; -class dataWidgetUI : public dataWidget +class dataWidgetUI : public QDialog { Q_OBJECT @@ -20,6 +22,8 @@ class dataWidgetUI : public dataWidget private: void createTableLayout(); + QTable *DataTable; + QComboBox *dataCombo; private slots: void slotShowData(int); 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 @@ -5,7 +5,7 @@ * the Free Software Foundation; either version 2 of the License, or * * ( at your option ) any later version. * * * - * ***********************************************************************/ + **************************************************************************/ #include 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 @@ -4,6 +4,7 @@ HEADERS = oxygen.h \ kmolcalc.h \ kmolelements.h \ calcdlgui.h \ + dataTable.h \ datawidgetui.h SOURCES = main.cpp \ @@ -11,12 +12,12 @@ SOURCES = main.cpp \ kmolcalc.cpp \ calcdlgui.cpp \ kmolelements.cpp \ + dataTable.cpp \ datawidgetui.cpp INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include LIBS += -lqpe -INTERFACES = calcdlg.ui \ - datawidget.ui +INTERFACES = calcdlg.ui TARGET = oxygen DESTDIR = $(OPIEDIR)/bin -- cgit v0.9.0.2