summaryrefslogtreecommitdiff
path: root/noncore/apps/oxygen/dataTable.cpp
authorcniehaus <cniehaus>2002-09-17 11:26:33 (UTC)
committer cniehaus <cniehaus>2002-09-17 11:26:33 (UTC)
commitbb15715567b88dd01f074092c1c4c3b7e0702693 (patch) (unidiff)
tree01bbe60177230f5e9b5b482c4e436e454b5c933e /noncore/apps/oxygen/dataTable.cpp
parent92b88813ad8d6352fbf74964fc56dfc1a2aada8c (diff)
downloadopie-bb15715567b88dd01f074092c1c4c3b7e0702693.zip
opie-bb15715567b88dd01f074092c1c4c3b7e0702693.tar.gz
opie-bb15715567b88dd01f074092c1c4c3b7e0702693.tar.bz2
first attempt of a reimplementation of paintCell
Diffstat (limited to 'noncore/apps/oxygen/dataTable.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/oxygen/dataTable.cpp29
1 files changed, 26 insertions, 3 deletions
diff --git a/noncore/apps/oxygen/dataTable.cpp b/noncore/apps/oxygen/dataTable.cpp
index 80c0311..f03e973 100644
--- a/noncore/apps/oxygen/dataTable.cpp
+++ b/noncore/apps/oxygen/dataTable.cpp
@@ -2,23 +2,46 @@
2 * * 2 * *
3 * This program is free software; you can redistribute it and/or modify * 3 * This program is free software; you can redistribute it and/or modify *
4 * it under the terms of the GNU General Public License as published by * 4 * it under the terms of the GNU General Public License as published by *
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#include "oxygen.h" 9#include "oxygen.h"
10 10
11#include "dataTable.h" 11#include "dataTable.h"
12#include <qtable.h> 12#include <qtable.h>
13 13
14dataTable::dataTable() : QTable() 14OxydataTable::OxydataTable(int numRows, int numCols, QWidget *parent,
15 const char *name) : QTable(numRows, numRows, parent, name)
15{ 16{
16} 17}
17 18
18void dataTable::paintCell( QPainter *p, int, int, const QRect &cr, bool ) 19
20void OxydataTable::paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected)
19{ 21{
20 if ( currentRow()%2) qDebug("foo" ); 22 if ( cr.width() == 0 || cr.height() == 0 )
23 return;
24 if ( selected &&
25 row == currentRow() &&
26 col == currentColumn() )
27 selected = FALSE;
28
29 int w = cr.width();
30 int h = cr.height();
31
32 QTableItem *itm = item( row, col );
33 if ( itm ) {
34 p->save();
35 itm->paint( p, colorGroup(), cr, selected );
36 p->restore();
37 } else {
38 if ( currentRow()%2 ) //every even row
39 p->fillRect( 0, 0, w, h, selected ? colorGroup().brush( QColorGroup::Highlight ) : colorGroup().brush( QColorGroup::Base ) );
40 else //every odd row
41 p->fillRect( 0, 0, w, h, selected ? colorGroup().brush( QColorGroup::Highlight ) : colorGroup().brush( QColorGroup::Base ) );
42 }
21} 43}
22 44
23 45
24 46
47