summaryrefslogtreecommitdiff
authorcniehaus <cniehaus>2002-09-16 22:18:13 (UTC)
committer cniehaus <cniehaus>2002-09-16 22:18:13 (UTC)
commit4ed76b385054144663500e7a145d2644620973f5 (patch) (unidiff)
tree90969f4449306da4ae98bf16c833b446d3b41886
parent154ef04f6d74044a750ec89c14f3521b0602e795 (diff)
downloadopie-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
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/oxygen/datawidget.ui67
-rw-r--r--noncore/apps/oxygen/datawidgetui.cpp56
-rw-r--r--noncore/apps/oxygen/datawidgetui.h6
-rw-r--r--noncore/apps/oxygen/main.cpp2
-rw-r--r--noncore/apps/oxygen/oxygen.pro5
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 @@
1<!DOCTYPE UI><UI>
2<class>dataWidget</class>
3<widget>
4 <class>QDialog</class>
5 <property stdset="1">
6 <name>name</name>
7 <cstring>dataWidget</cstring>
8 </property>
9 <property stdset="1">
10 <name>geometry</name>
11 <rect>
12 <x>0</x>
13 <y>0</y>
14 <width>245</width>
15 <height>276</height>
16 </rect>
17 </property>
18 <property stdset="1">
19 <name>caption</name>
20 <string>Chemical Data</string>
21 </property>
22 <widget>
23 <class>QComboBox</class>
24 <property stdset="1">
25 <name>name</name>
26 <cstring>dataCombo</cstring>
27 </property>
28 <property stdset="1">
29 <name>geometry</name>
30 <rect>
31 <x>10</x>
32 <y>10</y>
33 <width>230</width>
34 <height>50</height>
35 </rect>
36 </property>
37 </widget>
38 <widget>
39 <class>QTable</class>
40 <property stdset="1">
41 <name>name</name>
42 <cstring>dataTable</cstring>
43 </property>
44 <property stdset="1">
45 <name>geometry</name>
46 <rect>
47 <x>0</x>
48 <y>80</y>
49 <width>240</width>
50 <height>190</height>
51 </rect>
52 </property>
53 <property stdset="1">
54 <name>numRows</name>
55 <number>8</number>
56 </property>
57 <property stdset="1">
58 <name>numCols</name>
59 <number>2</number>
60 </property>
61 <property stdset="1">
62 <name>showGrid</name>
63 <bool>false</bool>
64 </property>
65 </widget>
66</widget>
67</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 @@
13#include <qtable.h> 13#include <qtable.h>
14#include <qstring.h> 14#include <qstring.h>
15#include <qcombobox.h> 15#include <qcombobox.h>
16#include <qlayout.h>
16 17
17dataWidgetUI::dataWidgetUI() : dataWidget() 18dataWidgetUI::dataWidgetUI() : QDialog()
18{ 19{
20 this->setCaption("foo");
21
22 QVBoxLayout *vbox = new QVBoxLayout( this );
23
24 dataCombo = new QComboBox( this );
25 DataTable = new QTable( 7,2, this );
26
27 vbox->addWidget( dataCombo );
28 vbox->addWidget( DataTable );
29
30 DataTable->show();
31 dataCombo->show();
32
19 connect ( dataCombo, SIGNAL( activated(int) ), this, SLOT( slotShowData(int) ) ); 33 connect ( dataCombo, SIGNAL( activated(int) ), this, SLOT( slotShowData(int) ) );
20 Config test( "/home/opie/Settings/oxygendata", Config::File ); 34 Config test( "/home/opie/Settings/oxygendata", Config::File );
21 35
@@ -33,19 +47,19 @@ dataWidgetUI::dataWidgetUI() : dataWidget()
33} 47}
34 48
35void dataWidgetUI::createTableLayout(){ 49void dataWidgetUI::createTableLayout(){
36 dataTable->horizontalHeader()->hide(); 50 DataTable->horizontalHeader()->hide();
37 dataTable->verticalHeader()->hide(); 51 DataTable->verticalHeader()->hide();
38 dataTable->setTopMargin( 0 ); 52 DataTable->setTopMargin( 0 );
39 dataTable->setLeftMargin( 0 ); 53 DataTable->setLeftMargin( 0 );
40 54
41 dataTable->setText( 0,0,"Weight:" ); 55 DataTable->setText( 0,0,"Weight:" );
42 dataTable->setText( 1,0,"Block" ); 56 DataTable->setText( 1,0,"Block" );
43 dataTable->setText( 2,0,"Group" ); 57 DataTable->setText( 2,0,"Group" );
44 dataTable->setText( 3,0,"Electronegativity" ); 58 DataTable->setText( 3,0,"Electronegativity" );
45 dataTable->setText( 4,0,"Atomic radius" ); 59 DataTable->setText( 4,0,"Atomic radius" );
46 dataTable->setText( 5,0,"Ionizationenergie" ); 60 DataTable->setText( 5,0,"Ionizationenergie" );
47 dataTable->setText( 6,0,"Density" ); 61 DataTable->setText( 6,0,"Density" );
48 dataTable->setText( 7,0,"Boilingpoint" ); 62 DataTable->setText( 7,0,"Boilingpoint" );
49} 63}
50 64
51 65
@@ -53,19 +67,19 @@ void dataWidgetUI::slotShowData(int number){
53 Config test( "/home/opie/Settings/oxygendata", Config::File ); 67 Config test( "/home/opie/Settings/oxygendata", Config::File );
54 test.setGroup( QString::number( number+1 )); 68 test.setGroup( QString::number( number+1 ));
55 QString weight = test.readEntry( "Weight" ); 69 QString weight = test.readEntry( "Weight" );
56 dataTable->setText( 0,1,weight ); 70 DataTable->setText( 0,1,weight );
57 QString block = test.readEntry( "Block" ); 71 QString block = test.readEntry( "Block" );
58 dataTable->setText( 1,1,block ); 72 DataTable->setText( 1,1,block );
59 QString grp = test.readEntry( "Group" ); 73 QString grp = test.readEntry( "Group" );
60 dataTable->setText( 2,1,grp ); 74 DataTable->setText( 2,1,grp );
61 QString en = test.readEntry( "EN" ); 75 QString en = test.readEntry( "EN" );
62 dataTable->setText( 3,1,en ); 76 DataTable->setText( 3,1,en );
63 QString ar = test.readEntry( "AR" ); 77 QString ar = test.readEntry( "AR" );
64 dataTable->setText( 4,1,ar ) ; 78 DataTable->setText( 4,1,ar ) ;
65 QString ion = test.readEntry( "IE" ); 79 QString ion = test.readEntry( "IE" );
66 dataTable->setText( 5,1,ion ); 80 DataTable->setText( 5,1,ion );
67 QString dens = test.readEntry( "Density" ); 81 QString dens = test.readEntry( "Density" );
68 dataTable->setText( 6,1,dens ); 82 DataTable->setText( 6,1,dens );
69 QString bp = test.readEntry( "BP" ); 83 QString bp = test.readEntry( "BP" );
70 dataTable->setText( 7,1,bp ); 84 DataTable->setText( 7,1,bp );
71} 85}
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 @@
8 * * 8 * *
9 **************************************************************************/ 9 **************************************************************************/
10#include "datawidget.h" 10#include "datawidget.h"
11#include "dataTable.h"
11 12
12class QTable; 13class QTable;
14class QComboBox;
13 15
14class dataWidgetUI : public dataWidget 16class dataWidgetUI : public QDialog
15{ 17{
16 Q_OBJECT 18 Q_OBJECT
17 19
@@ -20,6 +22,8 @@ class dataWidgetUI : public dataWidget
20 22
21 private: 23 private:
22 void createTableLayout(); 24 void createTableLayout();
25 QTable *DataTable;
26 QComboBox *dataCombo;
23 27
24 private slots: 28 private slots:
25 void slotShowData(int); 29 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 @@
5 * the Free Software Foundation; either version 2 of the License, or * 5 * the Free Software Foundation; either version 2 of the License, or *
6 * ( at your option ) any later version. * 6 * ( at your option ) any later version. *
7 * * 7 * *
8 * ***********************************************************************/ 8 **************************************************************************/
9 9
10 10
11#include <qpe/qpeapplication.h> 11#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 \
4 kmolcalc.h \ 4 kmolcalc.h \
5 kmolelements.h \ 5 kmolelements.h \
6 calcdlgui.h \ 6 calcdlgui.h \
7 dataTable.h \
7 datawidgetui.h 8 datawidgetui.h
8 9
9 SOURCES = main.cpp \ 10 SOURCES = main.cpp \
@@ -11,12 +12,12 @@ SOURCES = main.cpp \
11 kmolcalc.cpp \ 12 kmolcalc.cpp \
12 calcdlgui.cpp \ 13 calcdlgui.cpp \
13 kmolelements.cpp \ 14 kmolelements.cpp \
15 dataTable.cpp \
14 datawidgetui.cpp 16 datawidgetui.cpp
15INCLUDEPATH += $(OPIEDIR)/include 17INCLUDEPATH += $(OPIEDIR)/include
16DEPENDPATH += $(OPIEDIR)/include 18DEPENDPATH += $(OPIEDIR)/include
17 LIBS += -lqpe 19 LIBS += -lqpe
18 INTERFACES= calcdlg.ui \ 20 INTERFACES= calcdlg.ui
19 datawidget.ui
20 TARGET = oxygen 21 TARGET = oxygen
21 DESTDIR = $(OPIEDIR)/bin 22 DESTDIR = $(OPIEDIR)/bin
22 23