]> Git trees. - libqmvoc.git/commitdiff
* make all the plotwidget styles working again
authorPino Toscano <pino@kde.org>
Tue, 20 Sep 2005 18:54:26 +0000 (18:54 +0000)
committerPino Toscano <pino@kde.org>
Tue, 20 Sep 2005 18:54:26 +0000 (18:54 +0000)
* useless header, go away

svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=462331

kdeeduplot/kplotaxis.h
kdeeduplot/kplotwidget.cpp

index 3a82417c36e206b6a8e1c143076c7edbfb36fe10..fb7f3f47432ce40f5eb76d2121e9364a6be5c27a 100644 (file)
@@ -20,8 +20,6 @@
 
 #include <qstring.h>
 
-#include <kdemacros.h>
-
 /**class KPlotAxis
        *@short Contains all data for drawing an axis including format specification axis labels.
        *@author Andreas Nicolai
index e26c3d0d23f90ae0447fe67d5ae2eda92a225441..6a88767d98722962af67bbe277dbcb88765d7a81 100644 (file)
@@ -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<DPoint*>::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;
                        }
                }
        }