From e7ca67ec6d024db2763eb70397e9b0b5b842bcdc Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Tue, 20 Sep 2005 18:54:26 +0000 Subject: [PATCH] * make all the plotwidget styles working again * useless header, go away svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=462331 --- kdeeduplot/kplotaxis.h | 2 -- kdeeduplot/kplotwidget.cpp | 21 ++++++++++----------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/kdeeduplot/kplotaxis.h b/kdeeduplot/kplotaxis.h index 3a82417..fb7f3f4 100644 --- a/kdeeduplot/kplotaxis.h +++ b/kdeeduplot/kplotaxis.h @@ -20,8 +20,6 @@ #include -#include - /**class KPlotAxis *@short Contains all data for drawing an axis including format specification axis labels. *@author Andreas Nicolai diff --git a/kdeeduplot/kplotwidget.cpp b/kdeeduplot/kplotwidget.cpp index e26c3d0..6a88767 100644 --- a/kdeeduplot/kplotwidget.cpp +++ b/kdeeduplot/kplotwidget.cpp @@ -187,13 +187,10 @@ void KPlotWidget::drawObjects( QPainter *p ) { case KPlotObject::CURVE : { p->setPen( QPen( QColor( po->color() ), po->size(), (Qt::PenStyle)po->param() ) ); - DPoint *dp = po->points()->first(); -#warning "Qt4 : moveTo ? lineTo ?" -#if 0 - p->moveTo( dp->qpoint( PixRect, DataRect ) ); - for ( dp = po->points()->next(); dp; dp = po->points()->next() ) - p->lineTo( dp->qpoint( PixRect, DataRect ) ); -#endif + QPolygon poly; + for ( QList::ConstIterator dpit = po->points()->begin(); dpit != po->points()->constEnd(); ++dpit ) + poly << ( *dpit )->qpoint( PixRect, DataRect ); + p->drawPolyline( poly ); break; } @@ -206,9 +203,9 @@ void KPlotWidget::drawObjects( QPainter *p ) { case KPlotObject::POLYGON : { - p->setPen( QPen( QColor( po->color() ), po->size(), (Qt::PenStyle)po->param() ) ); -#warning "Qt4 p->setBrush( po->color() ); ?" - //p->setBrush( po->color() ); + QColor co( po->color() ); + p->setPen( QPen( co, po->size(), (Qt::PenStyle)po->param() ) ); + p->setBrush( co ); QPolygon a( po->count() ); @@ -220,7 +217,9 @@ void KPlotWidget::drawObjects( QPainter *p ) { break; } - case KPlotObject::UNKNOWN_TYPE : break; + case KPlotObject::UNKNOWN_TYPE : + default: + kdDebug() << "Unknown object type: " << po->type() << endl; } } } -- 2.47.3