diff options
Diffstat (limited to 'libkdchart/KDChartHiLoPainter.cpp')
-rw-r--r-- | libkdchart/KDChartHiLoPainter.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/libkdchart/KDChartHiLoPainter.cpp b/libkdchart/KDChartHiLoPainter.cpp index c95d482..bb8b2e3 100644 --- a/libkdchart/KDChartHiLoPainter.cpp +++ b/libkdchart/KDChartHiLoPainter.cpp @@ -30,7 +30,7 @@ #include <KDChartParams.h> #include "KDChartTextPiece.h" -#include <qpainter.h> +#include <tqpainter.h> #include <stdlib.h> @@ -49,7 +49,7 @@ KDChartAxesPainter( params ) { // This constructor intentionally left blank so far; we cannot setup the - // geometry yet since we do not know the size of the painter. + // tqgeometry yet since we do not know the size of the painter. } @@ -75,9 +75,9 @@ KDChartHiLoPainter::~KDChartHiLoPainter() \return the fallback text to use for describing the specified dataset in the legend */ -QString KDChartHiLoPainter::fallbackLegendText( uint dataset ) const +TQString KDChartHiLoPainter::fallbackLegendText( uint dataset ) const { - return QObject::tr( "Value " ) + QString::number( dataset + 1 ); + return TQObject::tr( "Value " ) + TQString::number( dataset + 1 ); } @@ -106,8 +106,8 @@ int KDChartHiLoPainter::clipShiftUp( bool, double ) const return 0; } -void KDChartHiLoPainter::specificPaintData( QPainter* painter, - const QRect& ourClipRect, +void KDChartHiLoPainter::specificPaintData( TQPainter* painter, + const TQRect& ourClipRect, KDChartTableDataBase* data, KDChartDataRegionList* /*regions*/, const KDChartAxisParams* axisPara, @@ -173,22 +173,22 @@ void KDChartHiLoPainter::specificPaintData( QPainter* painter, ++dataset ) { // The first and the second col are always high and low; we sort them // accordingly. - QVariant valueA; - QVariant valueB; + TQVariant valueA; + TQVariant valueB; if( dataset >= datasetStart && dataset <= datasetEnd && data->cellCoord( dataset, 0, valueA, 1 ) && data->cellCoord( dataset, 1, valueB, 1 ) && - QVariant::Double == valueA.type() && - QVariant::Double == valueB.type() ){ + TQVariant::Double == valueA.type() && + TQVariant::Double == valueB.type() ){ const double cellValue1 = valueA.toDouble(); const double cellValue2 = valueB.toDouble(); - const double lowValue = QMIN( cellValue1, cellValue2 ); - const double highValue = QMAX( cellValue1, cellValue2 ); + const double lowValue = TQMIN( cellValue1, cellValue2 ); + const double highValue = TQMAX( cellValue1, cellValue2 ); const double lowDrawValue = lowValue * pixelsPerUnit; const double highDrawValue = highValue * pixelsPerUnit; - painter->setPen( QPen( params()->dataColor( dataset ), + painter->setPen( TQPen( params()->dataColor( dataset ), nLineWidth ) ); // draw line from low to high int xpos = static_cast<int>( @@ -212,7 +212,7 @@ void KDChartHiLoPainter::specificPaintData( QPainter* painter, if( params()->hiLoChartSubType() == KDChartParams::HiLoOpenClose ) { // Only do this if there is a value in the third col. if( data->cellCoord( dataset, 2, valueA, 1 ) && - QVariant::Double == valueA.type() ) { + TQVariant::Double == valueA.type() ) { hasOpen = true; openValue = valueA.toDouble(); openDrawValue = openValue * pixelsPerUnit; @@ -229,10 +229,10 @@ void KDChartHiLoPainter::specificPaintData( QPainter* painter, // HiLoOpenClose). if( ( params()->hiLoChartSubType() == KDChartParams::HiLoClose && data->cellCoord( dataset, 2, valueA, 1 ) && - QVariant::Double == valueA.type() ) || + TQVariant::Double == valueA.type() ) || ( params()->hiLoChartSubType() == KDChartParams::HiLoOpenClose && data->cellCoord( dataset, 3, valueB, 1 ) && - QVariant::Double == valueB.type() ) ) { + TQVariant::Double == valueB.type() ) ) { hasClose = true; closeValue = ( params()->hiLoChartSubType() == KDChartParams::HiLoClose ) ? valueA.toDouble() @@ -247,14 +247,14 @@ void KDChartHiLoPainter::specificPaintData( QPainter* painter, // Draw the low value, if requested. if( params()->hiLoChartPrintLowValues() ) { // PENDING(kalle) Number formatting? - QFont theFont( params()->hiLoChartLowValuesFont() ); + TQFont theFont( params()->hiLoChartLowValuesFont() ); if ( params()->hiLoChartLowValuesUseFontRelSize() ) { int nTxtHeight = static_cast < int > ( params()->hiLoChartLowValuesFontRelSize() * averageValueP1000 ); theFont.setPointSizeFloat( nTxtHeight ); } - KDChartTextPiece lowText( painter, QString::number( lowValue ), + KDChartTextPiece lowText( painter, TQString::number( lowValue ), theFont ); int width = lowText.width(); int height = lowText.height(); @@ -278,7 +278,7 @@ void KDChartHiLoPainter::specificPaintData( QPainter* painter, - lowYPos + height/2 + nLineWidth/2; - }// else + } else ; // no way to draw it (really?) } lowText.draw( painter, @@ -290,14 +290,14 @@ void KDChartHiLoPainter::specificPaintData( QPainter* painter, // Draw the high value, if requested. if( params()->hiLoChartPrintHighValues() ) { // PENDING(kalle) Number formatting? - QFont theFont( params()->hiLoChartHighValuesFont() ); + TQFont theFont( params()->hiLoChartHighValuesFont() ); if ( params()->hiLoChartHighValuesUseFontRelSize() ) { int nTxtHeight = static_cast < int > ( params()->hiLoChartHighValuesFontRelSize() * averageValueP1000 ); theFont.setPointSizeFloat( nTxtHeight ); } - KDChartTextPiece highText( painter, QString::number( highValue ), + KDChartTextPiece highText( painter, TQString::number( highValue ), theFont ); int width = highText.width(); int height = highText.height(); @@ -319,7 +319,7 @@ void KDChartHiLoPainter::specificPaintData( QPainter* painter, - highYPos + height/2 - nLineWidth/2; - } //else + } else ; // no way to draw it (really?) } highText.draw( painter, @@ -332,14 +332,14 @@ void KDChartHiLoPainter::specificPaintData( QPainter* painter, if( params()->hiLoChartPrintOpenValues() && params()->hiLoChartSubType() == KDChartParams::HiLoOpenClose ) { // PENDING(kalle) Number formatting? - QFont theFont( params()->hiLoChartOpenValuesFont() ); + TQFont theFont( params()->hiLoChartOpenValuesFont() ); if ( params()->hiLoChartOpenValuesUseFontRelSize() ) { int nTxtHeight = static_cast < int > ( params()->hiLoChartOpenValuesFontRelSize() * averageValueP1000 ); theFont.setPointSizeFloat( nTxtHeight ); } - KDChartTextPiece openText( painter, QString::number( openValue ), + KDChartTextPiece openText( painter, TQString::number( openValue ), theFont ); int width = openText.width(); int height = openText.height(); @@ -361,14 +361,14 @@ void KDChartHiLoPainter::specificPaintData( QPainter* painter, || params()->hiLoChartSubType() == KDChartParams::HiLoClose ) ) { // PENDING(kalle) Number formatting? - QFont theFont( params()->hiLoChartCloseValuesFont() ); + TQFont theFont( params()->hiLoChartCloseValuesFont() ); if ( params()->hiLoChartCloseValuesUseFontRelSize() ) { int nTxtHeight = static_cast < int > ( params()->hiLoChartCloseValuesFontRelSize() * averageValueP1000 ); theFont.setPointSizeFloat( nTxtHeight ); } - KDChartTextPiece closeText( painter, QString::number( closeValue ), + KDChartTextPiece closeText( painter, TQString::number( closeValue ), theFont ); //int width = closeText.width(); int height = closeText.height(); |