Diffstat (limited to 'noncore/apps/oxygen/dataTable.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/oxygen/dataTable.cpp | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/noncore/apps/oxygen/dataTable.cpp b/noncore/apps/oxygen/dataTable.cpp index f03e973..6c6b9dc 100644 --- a/noncore/apps/oxygen/dataTable.cpp +++ b/noncore/apps/oxygen/dataTable.cpp @@ -1,47 +1,40 @@ /*************************************************************************** * * * 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 "oxygen.h" #include "dataTable.h" #include <qtable.h> OxydataTable::OxydataTable(int numRows, int numCols, QWidget *parent, const char *name) : QTable(numRows, numRows, parent, name) { } - void OxydataTable::paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected) { - if ( cr.width() == 0 || cr.height() == 0 ) + if ( cr.width() == 0 || cr.height() == 0 ) return; - if ( selected && - row == currentRow() && - col == currentColumn() ) - selected = FALSE; + selected = FALSE; int w = cr.width(); int h = cr.height(); - QTableItem *itm = item( row, col ); - if ( itm ) { + QTableItem *itm = item( row, col ); + QColorGroup colgrp = colorGroup(); + if ( itm ) + { + if ( row%2 ) + colgrp.setColor( QColorGroup::Base, QColor( cyan ) ); + else + colgrp.setColor( QColorGroup::Base, QColor( white ) ); p->save(); - itm->paint( p, colorGroup(), cr, selected ); + itm->paint( p, colgrp, cr, selected ); p->restore(); - } else { - if ( currentRow()%2 ) //every even row - p->fillRect( 0, 0, w, h, selected ? colorGroup().brush( QColorGroup::Highlight ) : colorGroup().brush( QColorGroup::Base ) ); - else //every odd row - p->fillRect( 0, 0, w, h, selected ? colorGroup().brush( QColorGroup::Highlight ) : colorGroup().brush( QColorGroup::Base ) ); } } - - - - |