summaryrefslogtreecommitdiffstats
path: root/libkdeedu/kdeeduplot
diff options
context:
space:
mode:
Diffstat (limited to 'libkdeedu/kdeeduplot')
-rw-r--r--libkdeedu/kdeeduplot/kplotaxis.cpp4
-rw-r--r--libkdeedu/kdeeduplot/kplotaxis.h16
-rw-r--r--libkdeedu/kdeeduplot/kplotobject.cpp4
-rw-r--r--libkdeedu/kdeeduplot/kplotobject.h30
-rw-r--r--libkdeedu/kdeeduplot/kplotwidget.cpp60
-rw-r--r--libkdeedu/kdeeduplot/kplotwidget.h38
6 files changed, 76 insertions, 76 deletions
diff --git a/libkdeedu/kdeeduplot/kplotaxis.cpp b/libkdeedu/kdeeduplot/kplotaxis.cpp
index 0099e0c2..69af4673 100644
--- a/libkdeedu/kdeeduplot/kplotaxis.cpp
+++ b/libkdeedu/kdeeduplot/kplotaxis.cpp
@@ -15,7 +15,7 @@
* *
***************************************************************************/
-#include <qpainter.h>
+#include <tqpainter.h>
#include <kdebug.h>
#include <klocale.h>
#include "kplotaxis.h"
@@ -25,7 +25,7 @@ KPlotAxis::KPlotAxis() : m_visible(true), m_labelFieldWidth(0), m_labelFmt('g'),
{
}
-KPlotAxis::KPlotAxis(const QString& label) : m_visible(true), m_label(label),
+KPlotAxis::KPlotAxis(const TQString& label) : m_visible(true), m_label(label),
m_labelFieldWidth(0), m_labelFmt('g'), m_labelPrec(2)
{
}
diff --git a/libkdeedu/kdeeduplot/kplotaxis.h b/libkdeedu/kdeeduplot/kplotaxis.h
index 3a82417c..107620b8 100644
--- a/libkdeedu/kdeeduplot/kplotaxis.h
+++ b/libkdeedu/kdeeduplot/kplotaxis.h
@@ -18,7 +18,7 @@
#ifndef KPLOTAXIS_H
#define KPLOTAXIS_H
-#include <qstring.h>
+#include <tqstring.h>
#include <kdemacros.h>
@@ -34,7 +34,7 @@ public:
KPlotAxis();
/**@short Constructor, constructs a labeled axis. */
- KPlotAxis(const QString& label);
+ KPlotAxis(const TQString& label);
/**@short Destructor. */
virtual ~KPlotAxis() {}
@@ -55,12 +55,12 @@ public:
*@param label A short string describing the data plotted on the axis.
*Set the label to an empty string to omit the axis label.
*/
- virtual void setLabel( const QString& label ) { m_label = label; }
+ virtual void setLabel( const TQString& label ) { m_label = label; }
/**@short Returns the axis label. */
- virtual QString label() const { return m_label; }
+ virtual TQString label() const { return m_label; }
- /**@short Set the number format for the tick labels, see QString::arg() for
+ /**@short Set the number format for the tick labels, see TQString::arg() for
description of arguments.
*/
virtual void setLabelFormat(int fieldWidth, char fmt = 'g', int prec=-1) {
@@ -78,9 +78,9 @@ public:
private:
bool m_visible; ///< Property "visible" defines if Axis is drawn or not.
QString m_label; ///< The label of the axis.
- int m_labelFieldWidth; ///< Field width for number labels, see QString::arg().
- char m_labelFmt; ///< Number format for number labels, see QString::arg().
- int m_labelPrec; ///< Number precision for number labels, see QString::arg().
+ int m_labelFieldWidth; ///< Field width for number labels, see TQString::arg().
+ char m_labelFmt; ///< Number format for number labels, see TQString::arg().
+ int m_labelPrec; ///< Number precision for number labels, see TQString::arg().
};
#endif // KPLOTAXIS_H
diff --git a/libkdeedu/kdeeduplot/kplotobject.cpp b/libkdeedu/kdeeduplot/kplotobject.cpp
index 145f12c3..b5aaf8d8 100644
--- a/libkdeedu/kdeeduplot/kplotobject.cpp
+++ b/libkdeedu/kdeeduplot/kplotobject.cpp
@@ -15,7 +15,7 @@
* *
***************************************************************************/
-#include <qpainter.h>
+#include <tqpainter.h>
#include <kdebug.h>
#include "kplotobject.h"
@@ -23,7 +23,7 @@ KPlotObject::KPlotObject() {
KPlotObject( "", "white", POINTS );
}
-KPlotObject::KPlotObject( const QString &n, const QString &c, PTYPE t, unsigned int s, unsigned int p ) {
+KPlotObject::KPlotObject( const TQString &n, const TQString &c, PTYPE t, unsigned int s, unsigned int p ) {
//We use the set functions because they may include data validation
setName( n );
setColor( c );
diff --git a/libkdeedu/kdeeduplot/kplotobject.h b/libkdeedu/kdeeduplot/kplotobject.h
index 52d79540..69fcd054 100644
--- a/libkdeedu/kdeeduplot/kplotobject.h
+++ b/libkdeedu/kdeeduplot/kplotobject.h
@@ -25,7 +25,7 @@ class QPainter;
#include <kdemacros.h>
/**class DRect
- *@short equivalent of QRect with double x,y coordinates
+ *@short equivalent of TQRect with double x,y coordinates
*@author Jason Harris
*@version 1.0
*/
@@ -52,7 +52,7 @@ private:
};
/**class DPoint
- *@short equivalent of QPoint with double x,y coordinates
+ *@short equivalent of TQPoint with double x,y coordinates
*@author Jason Harris
*@version 1.0
*/
@@ -65,10 +65,10 @@ public:
double x() const { return X; }
double y() const { return Y; }
- QPoint qpoint( QRect pb, DRect db ) {
+ TQPoint qpoint( TQRect pb, DRect db ) {
int px = pb.left() + int( pb.width()*( x() - db.x() )/db.width() );
int py = pb.top() + int( pb.height()*( db.y2() - y() )/db.height() );
- return QPoint( px, py );
+ return TQPoint( px, py );
}
void setX( double x ) { X = x; }
@@ -83,9 +83,9 @@ private:
*@author Jason Harris
*@version 1.0
*Each KPlotObject consists of a list of QPoints, an object type, a color, a size,
- *and a QString name. An additional integer (param) specifies something further
+ *and a TQString name. An additional integer (param) specifies something further
*about the object's appearance, depending on its type. There is a draw function
- *for plotting the object on a KPlotWidget's QPainter.
+ *for plotting the object on a KPlotWidget's TQPainter.
*/
class KDE_EXPORT KPlotObject{
public:
@@ -111,7 +111,7 @@ public:
/**Constructor. Create a KPlotObject according to the arguments.
*/
- KPlotObject( const QString &name, const QString &color, PTYPE otype, unsigned int size=2, unsigned int param=0 );
+ KPlotObject( const TQString &name, const TQString &color, PTYPE otype, unsigned int size=2, unsigned int param=0 );
/**Destructor (empty)
*/
@@ -119,21 +119,21 @@ public:
/**@return the KPlotObject's Name
*/
- QString name() const { return Name; }
+ TQString name() const { return Name; }
/**@short set the KPlotObject's Name
*@param n the new name
*/
- void setName( const QString &n ) { Name = n; }
+ void setName( const TQString &n ) { Name = n; }
/**@return the KPlotObject's Color
*/
- QString color() const { return Color; }
+ TQString color() const { return Color; }
/**@short set the KPlotObject's Color
*@param c the new color
*/
- void setColor( const QString &c ) { Color = c; }
+ void setColor( const TQString &c ) { Color = c; }
/**@return the KPlotObject's Type
*/
@@ -169,7 +169,7 @@ public:
*/
DPoint* point( unsigned int i ) { return pList.at(i); }
- QPtrList<DPoint>* points() { return &pList; }
+ TQPtrList<DPoint>* points() { return &pList; }
/**@short Add a point to the object's list.
*@param p the DPoint to add.
@@ -182,7 +182,7 @@ public:
*/
void addPoint( DPoint *p ) { pList.append( p ); }
-/**@short remove the QPoint at position index from the list of points
+/**@short remove the TQPoint at position index from the list of points
*@param index the index of the point to be removed.
*/
void removePoint( unsigned int index );
@@ -196,10 +196,10 @@ public:
void clearPoints() { pList.clear(); }
private:
- QPtrList<DPoint> pList;
+ TQPtrList<DPoint> pList;
PTYPE Type;
unsigned int Size, Parameter;
- QString Color, Name;
+ TQString Color, Name;
};
#endif
diff --git a/libkdeedu/kdeeduplot/kplotwidget.cpp b/libkdeedu/kdeeduplot/kplotwidget.cpp
index e2103509..99e9b321 100644
--- a/libkdeedu/kdeeduplot/kplotwidget.cpp
+++ b/libkdeedu/kdeeduplot/kplotwidget.cpp
@@ -17,34 +17,34 @@
#include <math.h> //for log10(), pow(), modf()
#include <kdebug.h>
-#include <qpainter.h>
-#include <qpixmap.h>
+#include <tqpainter.h>
+#include <tqpixmap.h>
#include "kplotwidget.h"
#include "kplotwidget.moc"
-KPlotWidget::KPlotWidget( double x1, double x2, double y1, double y2, QWidget *parent, const char* name )
- : QWidget( parent, name, WNoAutoErase ),
+KPlotWidget::KPlotWidget( double x1, double x2, double y1, double y2, TQWidget *parent, const char* name )
+ : TQWidget( parent, name, WNoAutoErase ),
dXtick(0.0), dYtick(0.0),
nmajX(0), nminX(0), nmajY(0), nminY(0),
ShowTickMarks( true ), ShowTickLabels( true ), ShowGrid( false )
{
- setBackgroundMode( QWidget::NoBackground );
+ setBackgroundMode( TQWidget::NoBackground );
//set DataRect
setLimits( x1, x2, y1, y2 );
setDefaultPadding();
//Set PixRect (starts at (0,0) because we will translate by leftPadding(), topPadding() )
- PixRect = QRect( 0, 0, width() - leftPadding() - rightPadding(),
+ PixRect = TQRect( 0, 0, width() - leftPadding() - rightPadding(),
height() - topPadding() - bottomPadding() );
- buffer = new QPixmap();
+ buffer = new TQPixmap();
//default colors:
- setBGColor( QColor( "black" ) );
- setFGColor( QColor( "white" ) );
- setGridColor( QColor( "grey" ) );
+ setBGColor( TQColor( "black" ) );
+ setFGColor( TQColor( "white" ) );
+ setGridColor( TQColor( "grey" ) );
ObjectList.setAutoDelete( true );
}
@@ -131,16 +131,16 @@ void KPlotWidget::updateTickmarks() {
} //end for iaxis
}
-void KPlotWidget::resizeEvent( QResizeEvent* /* e */ ) {
+void KPlotWidget::resizeEvent( TQResizeEvent* /* e */ ) {
int newWidth = width() - leftPadding() - rightPadding();
int newHeight = height() - topPadding() - bottomPadding();
- PixRect = QRect( 0, 0, newWidth, newHeight );
+ PixRect = TQRect( 0, 0, newWidth, newHeight );
buffer->resize( width(), height() );
}
-void KPlotWidget::paintEvent( QPaintEvent* /* e */ ) {
- QPainter p;
+void KPlotWidget::paintEvent( TQPaintEvent* /* e */ ) {
+ TQPainter p;
p.begin( buffer );
p.fillRect( 0, 0, width(), height(), bgColor() );
@@ -153,20 +153,20 @@ void KPlotWidget::paintEvent( QPaintEvent* /* e */ ) {
bitBlt( this, 0, 0, buffer );
}
-void KPlotWidget::drawObjects( QPainter *p ) {
+void KPlotWidget::drawObjects( TQPainter *p ) {
for ( KPlotObject *po = ObjectList.first(); po; po = ObjectList.next() ) {
if ( po->points()->count() ) {
//draw the plot object
- p->setPen( QColor( po->color() ) );
+ p->setPen( TQColor( po->color() ) );
switch ( po->type() ) {
case KPlotObject::POINTS :
{
- p->setBrush( QColor( po->color() ) );
+ p->setBrush( TQColor( po->color() ) );
for ( DPoint *dp = po->points()->first(); dp; dp = po->points()->next() ) {
- QPoint q = dp->qpoint( PixRect, DataRect );
+ TQPoint q = dp->qpoint( PixRect, DataRect );
int x1 = q.x() - po->size()/2;
int y1 = q.y() - po->size()/2;
@@ -184,7 +184,7 @@ void KPlotWidget::drawObjects( QPainter *p ) {
case KPlotObject::CURVE :
{
- p->setPen( QPen( QColor( po->color() ), po->size(), (QPen::PenStyle)po->param() ) );
+ p->setPen( TQPen( TQColor( po->color() ), po->size(), (TQPen::PenStyle)po->param() ) );
DPoint *dp = po->points()->first();
p->moveTo( dp->qpoint( PixRect, DataRect ) );
for ( dp = po->points()->next(); dp; dp = po->points()->next() )
@@ -194,17 +194,17 @@ void KPlotWidget::drawObjects( QPainter *p ) {
case KPlotObject::LABEL : //draw label centered at point in x, and slightly below point in y.
{
- QPoint q = po->points()->first()->qpoint( PixRect, DataRect );
+ TQPoint q = po->points()->first()->qpoint( PixRect, DataRect );
p->drawText( q.x()-20, q.y()+6, 40, 10, Qt::AlignCenter | Qt::DontClip, po->name() );
break;
}
case KPlotObject::POLYGON :
{
- p->setPen( QPen( QColor( po->color() ), po->size(), (QPen::PenStyle)po->param() ) );
+ p->setPen( TQPen( TQColor( po->color() ), po->size(), (TQPen::PenStyle)po->param() ) );
p->setBrush( po->color() );
- QPointArray a( po->count() );
+ TQPointArray a( po->count() );
unsigned int i=0;
for ( DPoint *dp = po->points()->first(); dp; dp = po->points()->next() )
@@ -222,7 +222,7 @@ void KPlotWidget::drawObjects( QPainter *p ) {
double KPlotWidget::dmod( double a, double b ) { return ( b * ( ( a / b ) - int( a / b ) ) ); }
-void KPlotWidget::drawBox( QPainter *p ) {
+void KPlotWidget::drawBox( TQPainter *p ) {
//First, fill in padding region with bgColor() to mask out-of-bounds plot data
p->setPen( bgColor() );
p->setBrush( bgColor() );
@@ -269,7 +269,7 @@ void KPlotWidget::drawBox( QPainter *p ) {
double dminY = dYtick/nminY;
//set small font for tick labels
- QFont f = p->font();
+ TQFont f = p->font();
int s = f.pointSize();
f.setPointSize( s - 2 );
p->setFont( f );
@@ -294,9 +294,9 @@ void KPlotWidget::drawBox( QPainter *p ) {
double lab = x0 + ix*dXtick;
if ( fabs(lab)/dXtick < 0.00001 ) lab = 0.0; //fix occassional roundoff error with "0.0" label
- QString str = QString( "%1" ).arg( lab, BottomAxis.labelFieldWidth(), BottomAxis.labelFmt(), BottomAxis.labelPrec() );
+ TQString str = TQString( "%1" ).arg( lab, BottomAxis.labelFieldWidth(), BottomAxis.labelFmt(), BottomAxis.labelPrec() );
if ( px > 0 && px < PixRect.width() ) {
- QRect r( px - BIGTICKSIZE, PixRect.height()+BIGTICKSIZE, 2*BIGTICKSIZE, BIGTICKSIZE );
+ TQRect r( px - BIGTICKSIZE, PixRect.height()+BIGTICKSIZE, 2*BIGTICKSIZE, BIGTICKSIZE );
p->drawText( r, Qt::AlignCenter | Qt::DontClip, str );
}
}
@@ -315,7 +315,7 @@ void KPlotWidget::drawBox( QPainter *p ) {
// Draw X Axis Label
if ( ! BottomAxis.label().isEmpty() ) {
- QRect r( 0, PixRect.height() + 2*YPADDING, PixRect.width(), YPADDING );
+ TQRect r( 0, PixRect.height() + 2*YPADDING, PixRect.width(), YPADDING );
p->drawText( r, Qt::AlignCenter, BottomAxis.label() );
}
@@ -340,9 +340,9 @@ void KPlotWidget::drawBox( QPainter *p ) {
double lab = y0 + iy*dYtick;
if ( fabs(lab)/dYtick < 0.00001 ) lab = 0.0; //fix occassional roundoff error with "0.0" label
- QString str = QString( "%1" ).arg( lab, LeftAxis.labelFieldWidth(), LeftAxis.labelFmt(), LeftAxis.labelPrec() );
+ TQString str = TQString( "%1" ).arg( lab, LeftAxis.labelFieldWidth(), LeftAxis.labelFmt(), LeftAxis.labelPrec() );
if ( py > 0 && py < PixRect.height() ) {
- QRect r( -2*BIGTICKSIZE, py-SMALLTICKSIZE, 2*BIGTICKSIZE, 2*SMALLTICKSIZE );
+ TQRect r( -2*BIGTICKSIZE, py-SMALLTICKSIZE, 2*BIGTICKSIZE, 2*SMALLTICKSIZE );
p->drawText( r, Qt::AlignCenter | Qt::DontClip, str );
}
}
@@ -367,7 +367,7 @@ void KPlotWidget::drawBox( QPainter *p ) {
p->translate( -3*XPADDING, PixRect.height() );
p->rotate( -90.0 );
- QRect r( 0, 0, PixRect.height(), XPADDING );
+ TQRect r( 0, 0, PixRect.height(), XPADDING );
p->drawText( r, Qt::AlignCenter, LeftAxis.label() ); //draw the label, now that we are sideways
p->restore(); //restore translation/rotation state
diff --git a/libkdeedu/kdeeduplot/kplotwidget.h b/libkdeedu/kdeeduplot/kplotwidget.h
index b24e31bf..216e6209 100644
--- a/libkdeedu/kdeeduplot/kplotwidget.h
+++ b/libkdeedu/kdeeduplot/kplotwidget.h
@@ -18,7 +18,7 @@
#ifndef _KPLOTWIDGET_H_
#define _KPLOTWIDGET_H_
-#include <qwidget.h>
+#include <tqwidget.h>
#include "kplotobject.h"
#include "kplotaxis.h"
@@ -38,7 +38,7 @@ class QPixmap;
*tickmarks and labels and a list of KPlotObjects to be drawn.
*/
-class KDE_EXPORT KPlotWidget : public QWidget {
+class KDE_EXPORT KPlotWidget : public TQWidget {
Q_OBJECT
public:
/**@short Constructor. Sets the primary x and y limits in data units.
@@ -49,7 +49,7 @@ public:
*@param parent the parent widget
*@param name name label for the KPlotWidget
*/
- KPlotWidget( double x1=0.0, double x2=1.0, double y1=0.0, double y2=1.0, QWidget *parent=0, const char* name=0 );
+ KPlotWidget( double x1=0.0, double x2=1.0, double y1=0.0, double y2=1.0, TQWidget *parent=0, const char* name=0 );
/**Destructor (empty)
*/
@@ -111,28 +111,28 @@ public:
virtual KPlotObject *object( int i ) { return ObjectList.at(i); }
/**@return the background color */
- virtual QColor bgColor() const { return cBackground; }
+ virtual TQColor bgColor() const { return cBackground; }
/**@return the foreground color */
- virtual QColor fgColor() const { return cForeground; }
+ virtual TQColor fgColor() const { return cForeground; }
/**@return the grid color */
- virtual QColor gridColor() const { return cGrid; }
+ virtual TQColor gridColor() const { return cGrid; }
/**@short set the background color
*@param bg the new background color
*/
- virtual void setBGColor( const QColor &bg ) { cBackground = bg; setBackgroundColor( bg ); }
+ virtual void setBGColor( const TQColor &bg ) { cBackground = bg; setBackgroundColor( bg ); }
/**@short set the foreground color
*@param fg the new foreground color
*/
- virtual void setFGColor( const QColor &fg ) { cForeground = fg; }
+ virtual void setFGColor( const TQColor &fg ) { cForeground = fg; }
/**@short set the grid color
*@param gc the new grid color
*/
- virtual void setGridColor( const QColor &gc ) { cGrid = gc; }
+ virtual void setGridColor( const TQColor &gc ) { cGrid = gc; }
/**@short toggle whether plot axes are drawn.
*@param show if true, axes will be drawn.
@@ -157,13 +157,13 @@ public:
*Set the label to an empty string to omit the axis label.
*This function is deprecated, set the label property in the BottomAxis directly.
*/
- virtual void setXAxisLabel( QString xlabel ) { BottomAxis.setLabel(xlabel); }
+ virtual void setXAxisLabel( TQString xlabel ) { BottomAxis.setLabel(xlabel); }
/**@short (Deprecated) Sets the Y-axis label
*@param ylabel a short string describing the data plotted on the y-axis.
*Set the label to an empty string to omit the axis label.
*This function is deprecated, set the label property in the LeftAxis directly.
*/
- virtual void setYAxisLabel( QString ylabel ) { LeftAxis.setLabel(ylabel); }
+ virtual void setYAxisLabel( TQString ylabel ) { LeftAxis.setLabel(ylabel); }
/**@returns the number of pixels to the left of the plot area. Padding values
*are set to -1 by default; if unchanged, this function will try to guess
@@ -214,23 +214,23 @@ public:
protected:
/**@short the paint event handler, executed when update() or repaint() is called.
*/
- virtual void paintEvent( QPaintEvent* /* e */ );
+ virtual void paintEvent( TQPaintEvent* /* e */ );
/**@short the resize event handler, called when the widget is resized.
*/
- virtual void resizeEvent( QResizeEvent* /* e */ );
+ virtual void resizeEvent( TQResizeEvent* /* e */ );
/**@short draws all of the objects onto the widget. Internal use only; one should simply call update()
*to draw the widget with axes and all objects.
*@param p pointer to the painter on which we are drawing
*/
- virtual void drawObjects( QPainter *p );
+ virtual void drawObjects( TQPainter *p );
/**@short draws the plot axes and axis labels. Internal use only; one should simply call update()
*to draw the widget with axes and all objects.
*@param p pointer to the painter on which we are drawing
*/
- virtual void drawBox( QPainter *p );
+ virtual void drawBox( TQPainter *p );
/**@short modulus function for double variables.
*For example, dmod( 17.0, 7.0 ) returns 3.0
@@ -244,20 +244,20 @@ protected:
int nmajX, nminX, nmajY, nminY;
//Limits of the plot area in pixel units
- QRect PixRect;
+ TQRect PixRect;
//Limits of the plot area in data units
DRect DataRect;
//List of KPlotObjects
- QPtrList<KPlotObject> ObjectList;
+ TQPtrList<KPlotObject> ObjectList;
//Colors
- QColor cBackground, cForeground, cGrid;
+ TQColor cBackground, cForeground, cGrid;
//draw options
bool ShowTickMarks, ShowTickLabels, ShowGrid;
//padding
int LeftPadding, RightPadding, TopPadding, BottomPadding;
- QPixmap *buffer;
+ TQPixmap *buffer;
};
#endif