summaryrefslogtreecommitdiff
path: root/noncore/apps/oxygen
Side-by-side diff
Diffstat (limited to 'noncore/apps/oxygen') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/oxygen/calcdlg.ui4
-rw-r--r--noncore/apps/oxygen/dataTable.cpp10
-rw-r--r--noncore/apps/oxygen/dataTable.h3
-rw-r--r--noncore/apps/oxygen/datawidgetui.cpp1
-rw-r--r--noncore/apps/oxygen/psewidget.cpp1
5 files changed, 15 insertions, 4 deletions
diff --git a/noncore/apps/oxygen/calcdlg.ui b/noncore/apps/oxygen/calcdlg.ui
index a8ed170..c817a47 100644
--- a/noncore/apps/oxygen/calcdlg.ui
+++ b/noncore/apps/oxygen/calcdlg.ui
@@ -2,25 +2,25 @@
<class>CalcDlg</class>
<widget>
<class>QWidget</class>
<property stdset="1">
<name>name</name>
<cstring>CalcDlg</cstring>
</property>
<property stdset="1">
<name>geometry</name>
<rect>
<x>0</x>
<y>0</y>
- <width>241</width>
+ <width>237</width>
<height>318</height>
</rect>
</property>
<property stdset="1">
<name>caption</name>
<string>Form1</string>
</property>
<widget>
<class>QTabWidget</class>
<property stdset="1">
<name>name</name>
<cstring>TabWidget3</cstring>
@@ -67,25 +67,25 @@
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabel2</cstring>
</property>
<property stdset="1">
<name>text</name>
- <string>chemical Formula</string>
+ <string>Chemical Formula</string>
</property>
</widget>
<widget>
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>formula</cstring>
</property>
</widget>
<widget>
<class>QLayoutWidget</class>
<property stdset="1">
diff --git a/noncore/apps/oxygen/dataTable.cpp b/noncore/apps/oxygen/dataTable.cpp
index 98d3bd8..82b425e 100644
--- a/noncore/apps/oxygen/dataTable.cpp
+++ b/noncore/apps/oxygen/dataTable.cpp
@@ -34,25 +34,24 @@ OxydataWidget::OxydataWidget(QWidget *parent) : QWidget(parent)
middle = new QLabel( hbox );
right = new QLabel( hbox );
right->setAlignment( AlignRight );
middle->setAlignment( AlignHCenter );
QFont bf;
bf.setBold( true );
bf.setPointSize( bf.pointSize()+2 );
middle->setFont( bf );
DataTable = new OxydataTable( 9,2, this );
- //DataTable->setColumnWidth ( 1 , ( parent->width())-10 );
setTable();
qgrid->addWidget( hbox,0,0 );
qgrid->addWidget( DataTable,1,0 );
}
void OxydataWidget::setElement( int el )
{
Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File );
configobj.setGroup( QString::number( el+1 ));
@@ -74,25 +73,34 @@ void OxydataWidget::setElement( int el )
void OxydataWidget::setTable() const
{
DataTable->setText( 0,0, tr( "Weight:" ) );
DataTable->setText( 1,0, tr( "Block" )) ;
DataTable->setText( 2,0, tr( "Group" )) ;
DataTable->setText( 3,0, tr( "Electronegativity" )) ;
DataTable->setText( 4,0, tr( "Atomic radius" )) ;
DataTable->setText( 5,0, tr( "Ionizationenergie" )) ;
DataTable->setText( 6,0, tr( "Density" )) ;
DataTable->setText( 7,0, tr( "Boilingpoint" ) );
DataTable->setText( 8,0, tr( "Meltingpoint" ) );
+}
+
+void OxydataWidget::setLayout()
+{
+#warning this is not working and I have no idea why!
+// DataTable->setColumnWidth ( 0 , this->width()/2 );
+// DataTable->setColumnWidth ( 1 , this->width()/2 );
+ DataTable->setColumnWidth ( 0 , 110 );
+ DataTable->setColumnWidth ( 1 , 110 );
}
OxydataTable::OxydataTable(int numRows, int numCols, QWidget *parent,
const char *name) : QTable(numRows, numCols,parent, name)
{
for (int zeile = 0; zeile < numRows; zeile++)
for ( int spalte = 0; spalte < numCols; spalte++ )
{
OxydataQTI *testus = new OxydataQTI (this, OxydataQTI::Never, "hm" );
setItem(zeile, spalte, (QTableItem*)testus);
}
diff --git a/noncore/apps/oxygen/dataTable.h b/noncore/apps/oxygen/dataTable.h
index a4a3b18..f2eb71d 100644
--- a/noncore/apps/oxygen/dataTable.h
+++ b/noncore/apps/oxygen/dataTable.h
@@ -25,28 +25,29 @@ class OxydataTable;
*
* Author: Carsten Niehaus <cniehaus@handhelds.org>
*/
class OxydataWidget : public QWidget
{
Q_OBJECT
public:
OxydataWidget(QWidget *parent=0);
QLabel *left, *middle, *right;
+ void setLayout();
private:
- OxydataTable *DataTable;
void setTable() const;
+ OxydataTable *DataTable;
public slots:
void setElement( int );
};
/*
* A OxydataTable is derived from QTable. I recoded the paintCell to have
* different colors in the backgound. Furthermore this widget never has a
* grid, thus I removed that code in paintCell.
*
* Author: Carsten Niehaus <cniehaus@handhelds.org>
*/
diff --git a/noncore/apps/oxygen/datawidgetui.cpp b/noncore/apps/oxygen/datawidgetui.cpp
index c7afa32..99c4fd7 100644
--- a/noncore/apps/oxygen/datawidgetui.cpp
+++ b/noncore/apps/oxygen/datawidgetui.cpp
@@ -36,17 +36,18 @@ dataWidgetUI::dataWidgetUI() : QWidget()
//read in all names of the 118 elements
Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File );
for ( int i = 1 ; i < 119 ; i++ )
{
configobj.setGroup( QString::number( i ) );
QString foo = configobj.readEntry( "Name" );
dataCombo->insertItem( QString::number( i )+" - "+foo );
}
OxydataWidget *oxyDW = new OxydataWidget(this);
connect ( dataCombo, SIGNAL( activated(int) ), oxyDW, SLOT( setElement(int) ) );
oxyDW->setElement( 0 );
+ oxyDW->setLayout();
qgrid->addWidget( dataCombo, 0,0);
qgrid->addWidget( oxyDW , 1,0 );
}
diff --git a/noncore/apps/oxygen/psewidget.cpp b/noncore/apps/oxygen/psewidget.cpp
index ba9b71a..18b41c3 100644
--- a/noncore/apps/oxygen/psewidget.cpp
+++ b/noncore/apps/oxygen/psewidget.cpp
@@ -40,24 +40,25 @@ PSEWidget::PSEWidget() : QWidget()
position( n+1,h,v );
QList<OxyFrame> PSEframe;
PSEframe.append( new OxyFrame( this , QString::number(n) ) );
grid->addWidget( PSEframe.current() , v/40+1 , h/40 );
PSEframe.current()->setMinimumHeight( 11 );
PSEframe.current()->setPalette( QPalette( PSEColor( configobj.readEntry( "Block" ) ) ) );
connect( PSEframe.current(), SIGNAL( num(QString) ), this, SLOT( slotShowElement(QString) ));
}
oxyDW = new OxydataWidget(this);
oxyDW->setElement( 0 );
+ oxyDW->setLayout();
vlay->addLayout( grid );
vlay->addWidget( oxyDW );
}
QColor PSEWidget::PSEColor( QString block )
{
QColor c;
if ( block == "s" ) c.setRgb( 213 , 233 , 231 );
else if ( block == "d" ) c.setRgb( 200,230,160 );
else if ( block == "p" ) c.setRgb( 238,146,138 );
else if ( block == "f" ) c.setRgb( 190 , 190 , 190 );