summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/oxygen/dataTable.cpp29
-rw-r--r--noncore/apps/oxygen/datawidgetui.cpp4
2 files changed, 13 insertions, 20 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
@@ -18,11 +18,7 @@ OxydataTable::OxydataTable(int numRows, int numCols, QWidget *parent,
-
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;
@@ -31,17 +27,14 @@ void OxydataTable::paintCell( QPainter *p, int row, int col, const QRect &cr, b
- 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 ) );
}
}
-
-
-
-
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
@@ -12,3 +12,2 @@
#include "datawidgetui.h"
-#include <qtable.h>
#include <qstring.h>
@@ -19,3 +18,3 @@ dataWidgetUI::dataWidgetUI() : QDialog()
{
- this->setCaption("foo");
+ this->setCaption("Chemical Data");
@@ -25,2 +24,3 @@ dataWidgetUI::dataWidgetUI() : QDialog()
DataTable = new OxydataTable( 7,2, this );
+ DataTable->setShowGrid( false );