author | cniehaus <cniehaus> | 2002-09-16 22:18:13 (UTC) |
---|---|---|
committer | cniehaus <cniehaus> | 2002-09-16 22:18:13 (UTC) |
commit | 4ed76b385054144663500e7a145d2644620973f5 (patch) (side-by-side diff) | |
tree | 90969f4449306da4ae98bf16c833b446d3b41886 /noncore | |
parent | 154ef04f6d74044a750ec89c14f3521b0602e795 (diff) | |
download | opie-4ed76b385054144663500e7a145d2644620973f5.zip opie-4ed76b385054144663500e7a145d2644620973f5.tar.gz opie-4ed76b385054144663500e7a145d2644620973f5.tar.bz2 |
mmh, tried to derive QTableItem. Didn't work. Now my QTable-subclass isn't
working either... Will have a look tomorrow
-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 @@ -13,9 +13,23 @@ #include <qtable.h> #include <qstring.h> #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) ) ); 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 <qpe/qpeapplication.h> 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 |