summaryrefslogtreecommitdiff
authorcniehaus <cniehaus>2002-09-16 22:18:13 (UTC)
committer cniehaus <cniehaus>2002-09-16 22:18:13 (UTC)
commit4ed76b385054144663500e7a145d2644620973f5 (patch) (side-by-side diff)
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 @@
-<!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
@@ -10,15 +10,29 @@
#include <qpe/config.h>
#include "datawidgetui.h"
#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 );
//read in all names of the 118 elements
for ( int i = 1 ; i < 119 ; i++ )
{
@@ -30,42 +44,42 @@ dataWidgetUI::dataWidgetUI() : dataWidget()
createTableLayout();
slotShowData( 1 ); //this way we do always get data here
}
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" );
}
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
@@ -5,22 +5,26 @@
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* ( at your option ) any later version. *
* *
**************************************************************************/
#include "datawidget.h"
+#include "dataTable.h"
class QTable;
+class QComboBox;
-class dataWidgetUI : public dataWidget
+class dataWidgetUI : public QDialog
{
Q_OBJECT
public:
dataWidgetUI();
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
@@ -2,13 +2,13 @@
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* ( at your option ) any later version. *
* *
- * ***********************************************************************/
+ **************************************************************************/
#include <qpe/qpeapplication.h>
#include "oxygen.h"
int main(int argc, char **argv)
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
@@ -1,23 +1,24 @@
TEMPLATE = app
CONFIG = qt warn_on release
HEADERS = oxygen.h \
kmolcalc.h \
kmolelements.h \
calcdlgui.h \
+ dataTable.h \
datawidgetui.h
SOURCES = main.cpp \
oxygen.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
TRANSLATIONS = ../../../i18n/de/oxygen.ts