summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/oxygen/dataTable.cpp23
-rw-r--r--noncore/apps/oxygen/datawidgetui.cpp4
2 files changed, 10 insertions, 17 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
@@ -16,32 +16,25 @@ OxydataTable::OxydataTable(int numRows, int numCols, QWidget *parent,
16{ 16{
17} 17}
18 18
19
20void OxydataTable::paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected) 19void OxydataTable::paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected)
21{ 20{
22 if ( cr.width() == 0 || cr.height() == 0 ) 21 if ( cr.width() == 0 || cr.height() == 0 )
23 return; 22 return;
24 if ( selected &&
25 row == currentRow() &&
26 col == currentColumn() )
27 selected = FALSE; 23 selected = FALSE;
28 24
29 int w = cr.width(); 25 int w = cr.width();
30 int h = cr.height(); 26 int h = cr.height();
31 27
32 QTableItem *itm = item( row, col ); 28 QTableItem *itm = item( row, col );
33 if ( itm ) { 29 QColorGroup colgrp = colorGroup();
30 if ( itm )
31 {
32 if ( row%2 )
33 colgrp.setColor( QColorGroup::Base, QColor( cyan ) );
34 else
35 colgrp.setColor( QColorGroup::Base, QColor( white ) );
34 p->save(); 36 p->save();
35 itm->paint( p, colorGroup(), cr, selected ); 37 itm->paint( p, colgrp, cr, selected );
36 p->restore(); 38 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 } 39 }
43} 40}
44
45
46
47
diff --git a/noncore/apps/oxygen/datawidgetui.cpp b/noncore/apps/oxygen/datawidgetui.cpp
index 0f8a146..c8492e5 100644
--- a/noncore/apps/oxygen/datawidgetui.cpp
+++ b/noncore/apps/oxygen/datawidgetui.cpp
@@ -10,19 +10,19 @@
10 10
11#include <qpe/config.h> 11#include <qpe/config.h>
12#include "datawidgetui.h" 12#include "datawidgetui.h"
13#include <qtable.h>
14#include <qstring.h> 13#include <qstring.h>
15#include <qcombobox.h> 14#include <qcombobox.h>
16#include <qlayout.h> 15#include <qlayout.h>
17 16
18dataWidgetUI::dataWidgetUI() : QDialog() 17dataWidgetUI::dataWidgetUI() : QDialog()
19{ 18{
20 this->setCaption("foo"); 19 this->setCaption("Chemical Data");
21 20
22 QVBoxLayout *vbox = new QVBoxLayout( this ); 21 QVBoxLayout *vbox = new QVBoxLayout( this );
23 22
24 dataCombo = new QComboBox( this ); 23 dataCombo = new QComboBox( this );
25 DataTable = new OxydataTable( 7,2, this ); 24 DataTable = new OxydataTable( 7,2, this );
25 DataTable->setShowGrid( false );
26 26
27 vbox->addWidget( dataCombo ); 27 vbox->addWidget( dataCombo );
28 vbox->addWidget( DataTable ); 28 vbox->addWidget( DataTable );