summaryrefslogtreecommitdiff
path: root/noncore/apps/oxygen/dataTable.cpp
authorcniehaus <cniehaus>2002-09-20 21:45:30 (UTC)
committer cniehaus <cniehaus>2002-09-20 21:45:30 (UTC)
commitd5db444cb70986baceda8ad1e01b0fb8384d12b4 (patch) (side-by-side diff)
tree65cab6b3cfb9c67336ce4f3e61d3e9df2476d8ca /noncore/apps/oxygen/dataTable.cpp
parent20c93734a4eada53d056f13558cbf60d6eff5bac (diff)
downloadopie-d5db444cb70986baceda8ad1e01b0fb8384d12b4.zip
opie-d5db444cb70986baceda8ad1e01b0fb8384d12b4.tar.gz
opie-d5db444cb70986baceda8ad1e01b0fb8384d12b4.tar.bz2
from now on I consider Oxygen as almost done :)
* the strange display-bug in the QTable is fixed. Now there are really only two colums and not a million or so * now the alingment is correct. I reimplemented virtual void alignment() in a class derived from QTableItem * s/setElement( 1 )/setElement( 0 )/ as that method starts with 0 and not 1 Credits to Robert Gogolok who did most of the reimplementation of the alignment.
Diffstat (limited to 'noncore/apps/oxygen/dataTable.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/oxygen/dataTable.cpp35
1 files changed, 27 insertions, 8 deletions
diff --git a/noncore/apps/oxygen/dataTable.cpp b/noncore/apps/oxygen/dataTable.cpp
index ff01417..f034c45 100644
--- a/noncore/apps/oxygen/dataTable.cpp
+++ b/noncore/apps/oxygen/dataTable.cpp
@@ -61,2 +61,3 @@ void OxydataWidget::setElement( int el )
+
DataTable->setText( 0,1,configobj.readEntry( "Weight" ) );
@@ -70,2 +71,3 @@ void OxydataWidget::setElement( int el )
DataTable->setText( 8,1,configobj.readEntry( "MP" ) );
+
}
@@ -83,2 +85,3 @@ void OxydataWidget::setTable() const
DataTable->setText( 8,0, tr( "Meltingpoint" ) );
+
}
@@ -86,4 +89,13 @@ void OxydataWidget::setTable() const
OxydataTable::OxydataTable(int numRows, int numCols, QWidget *parent,
- const char *name) : QTable(numRows, numRows, parent, name)
+ 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);
+ }
+
+
this->setShowGrid( false );
@@ -96,9 +108,2 @@ OxydataTable::OxydataTable(int numRows, int numCols, QWidget *parent,
-int OxydataTable::alignment() const
-{
- return AlignLeft | AlignVCenter;
-};
-
-
-
void OxydataTable::paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected)
@@ -122 +127,15 @@ void OxydataTable::paintCell( QPainter *p, int row, int col, const QRect &cr, b
}
+
+OxydataQTI::OxydataQTI(QTable * table, EditType et, const QString & text )
+ : QTableItem ( table, et, text )
+{
+}
+
+int OxydataQTI::alignment() const
+{
+ if ( col()%2 )
+ {
+ return AlignRight | AlignVCenter;
+ }else return AlignLeft | AlignVCenter;
+};
+