summaryrefslogtreecommitdiffstats
path: root/libkdchart/KDChartRingPainter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libkdchart/KDChartRingPainter.cpp')
-rw-r--r--libkdchart/KDChartRingPainter.cpp62
1 files changed, 31 insertions, 31 deletions
diff --git a/libkdchart/KDChartRingPainter.cpp b/libkdchart/KDChartRingPainter.cpp
index 2087066..d9016ed 100644
--- a/libkdchart/KDChartRingPainter.cpp
+++ b/libkdchart/KDChartRingPainter.cpp
@@ -29,8 +29,8 @@
#include "KDChartRingPainter.h"
#include "KDChartParams.h"
-#include <qpainter.h>
-#include <qvaluestack.h>
+#include <tqpainter.h>
+#include <tqvaluestack.h>
#include <stdlib.h>
@@ -53,7 +53,7 @@
KDChartPainter( 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.
}
@@ -69,24 +69,24 @@ KDChartRingPainter::~KDChartRingPainter()
/**
Paints the actual data area.
- \param painter the QPainter onto which the chart should be painted
+ \param painter the TQPainter onto which the chart should be painted
\param data the data that will be displayed as a chart
\param paint2nd specifies whether the main chart or the additional chart is to be drawn now
\param regions a pointer to a list of regions that will be filled
with regions representing the data segments, if not null
*/
-void KDChartRingPainter::paintData( QPainter* painter,
+void KDChartRingPainter::paintData( TQPainter* painter,
KDChartTableDataBase* data,
bool paint2nd,
KDChartDataRegionList* regions )
{
uint chart = paint2nd ? 1 : 0;
- QRect ourClipRect( _dataRect );
+ TQRect ourClipRect( _dataRect );
- const QWMatrix & world = painter->worldMatrix();
+ const TQWMatrix & world = painter->tqworldMatrix();
ourClipRect =
-#if COMPAT_QT_VERSION >= 0x030000
+#if COMPAT_TQT_VERSION >= 0x030000
world.mapRect( ourClipRect );
#else
world.map( ourClipRect );
@@ -135,7 +135,7 @@ void KDChartRingPainter::paintData( QPainter* painter,
_numValues = data->usedCols();
// compute position
- _size = QMIN( _dataRect.width(), _dataRect.height() ); // initial size
+ _size = TQMIN( _dataRect.width(), _dataRect.height() ); // initial size
// if the rings explode, we need to give them additional space =>
// make the basic size smaller
if ( params()->explode() ) {
@@ -146,12 +146,12 @@ void KDChartRingPainter::paintData( QPainter* painter,
int x = ( _dataRect.width() == _size ) ? 0 : ( ( _dataRect.width() - _size ) / 2 );
int y = ( _dataRect.height() == _size ) ? 0 : ( ( _dataRect.height() - _size ) / 2 );
- _position = QRect( x, y, _size, _size );
+ _position = TQRect( x, y, _size, _size );
_position.moveBy( _dataRect.left(), _dataRect.top() );
// We need the row sums anyway later, so we can just as well compute them
// here, because we need them in case of relative ring thicknesses.
- QMemArray<double> rowsums;
+ TQMemArray<double> rowsums;
double totalSum = 0.0;
rowsums.resize( datasetEnd+1 ); // not datasetNum!
for( int d1 = (int)datasetStart; d1 <= (int)datasetEnd; d1++ ) {
@@ -159,7 +159,7 @@ void KDChartRingPainter::paintData( QPainter* painter,
totalSum += rowsums[d1];
}
- QMemArray<int> ringthicknesses;
+ TQMemArray<int> ringthicknesses;
ringthicknesses.resize( datasetEnd+1 ); // not datasetNum!
// constant ring thickness
@@ -183,27 +183,27 @@ void KDChartRingPainter::paintData( QPainter* painter,
// Loop through all the displayable datasets; each dataset is one ring
for( int dataset = (int)datasetStart; dataset <= (int)datasetEnd; dataset++ ) {
- double sectorsPerValue = 5760.0 / rowsums[dataset]; // 5760 == 16*360, number of sections in Qt circle
+ double sectorsPerValue = 5760.0 / rowsums[dataset]; // 5760 == 16*360, number of sections in TQt circle
//int sectorsPerValueI = static_cast<int>( sectorsPerValue );
double currentstartpos = (double)params()->ringStart() * 16.0;
// Loop through all the values; each value is one piece on the ring.
- QVariant vValY;
+ TQVariant vValY;
for( int value = 0; value < _numValues; value++ ) {
// is there anything at all at this value?
double cellValue = 0.0;
if( data->cellCoord( dataset, value, vValY, 1 ) &&
- QVariant::Double == vValY.type() ){
+ TQVariant::Double == vValY.type() ){
cellValue = fabs( vValY.toDouble() );
// Explosion: Only explode if explosion is turned on generally
// and we are on the first ring. Besides, if there is a list
// of explodeable values, the current value must be on this
// list.
- QValueList<int> explodeList = params()->explodeValues();
+ TQValueList<int> explodeList = params()->explodeValues();
bool explode = params()->explode() && // explosion is on at all
( dataset == (int)datasetStart ) && // outermost ring
( ( explodeList.count() == 0 ) || // either nothing on explode list
- ( explodeList.find( value ) != explodeList.end() ) ); // or pie is on it
+ ( explodeList.tqfind( value ) != explodeList.end() ) ); // or pie is on it
drawOneSegment( painter,
currentouterradius,
@@ -220,7 +220,7 @@ void KDChartRingPainter::paintData( QPainter* painter,
-void KDChartRingPainter::drawOneSegment( QPainter* painter,
+void KDChartRingPainter::drawOneSegment( TQPainter* painter,
uint outerRadius,
uint innerRadius,
double startAngle,
@@ -235,14 +235,14 @@ void KDChartRingPainter::drawOneSegment( QPainter* painter,
if( angles == 5760.0 )
startAngle = 0.0;
- painter->setPen( QPen( params()->outlineDataColor(),
+ painter->setPen( TQPen( params()->outlineDataColor(),
params()->outlineDataLineWidth() ) );
painter->setBrush( params()->dataColor( value ) );
uint outerRadius2 = outerRadius * 2;
uint innerRadius2 = innerRadius * 2;
- QRect drawPosition = _position;
+ TQRect drawPosition = _position;
if ( explode ) {
// need to compute a new position for each pie
double explodeAngle = ( startAngle + angles / 2.0 ) / 16.0;
@@ -252,8 +252,8 @@ void KDChartRingPainter::drawOneSegment( QPainter* painter,
// find the explode factor for this particular ring segment
double explodeFactor = 0.0;
- QMap<int,double> explodeFactors = params()->explodeFactors();
- if( !explodeFactors.contains( value ) ) // not on factors list, use default
+ TQMap<int,double> explodeFactors = params()->explodeFactors();
+ if( !explodeFactors.tqcontains( value ) ) // not on factors list, use default
explodeFactor = params()->explodeFactor();
else // on factors list, use segment-specific value
explodeFactor = explodeFactors[value];
@@ -263,23 +263,23 @@ void KDChartRingPainter::drawOneSegment( QPainter* painter,
drawPosition.moveBy( static_cast<int>( explodeX ), static_cast<int>( explodeY ) );
}
- QRect outerRect( drawPosition.x() +
+ TQRect outerRect( drawPosition.x() +
( drawPosition.width() - outerRadius2 ) / 2,
drawPosition.y() +
( drawPosition.height() - outerRadius2 ) / 2,
outerRadius2, outerRadius2 );
- QRect innerRect( drawPosition.x() +
+ TQRect innerRect( drawPosition.x() +
( drawPosition.width() - innerRadius2 ) / 2,
drawPosition.y() +
( drawPosition.height() - innerRadius2 ) / 2,
innerRadius2, innerRadius2 );
// Start with getting the points for the inner arc.
- QPointArray innerArc;
+ TQPointArray innerArc;
makeArc( innerArc, innerRect, startAngle, angles );
// And the points for the outer arc
- QPointArray outerArc;
+ TQPointArray outerArc;
makeArc( outerArc, outerRect, startAngle, angles );
// Now copy the points from the outer arc in the reverse order onto the
@@ -318,17 +318,17 @@ void KDChartRingPainter::drawOneSegment( QPainter* painter,
= pointOnCircle( innerRect, aA );
datReg->points[ KDChartEnums::PosCenterLeft ]
- = QPoint( ( datReg->points[ KDChartEnums::PosTopLeft ].x()
+ = TQPoint( ( datReg->points[ KDChartEnums::PosTopLeft ].x()
+ datReg->points[ KDChartEnums::PosBottomLeft ].x() ) / 2,
( datReg->points[ KDChartEnums::PosTopLeft ].y()
+ datReg->points[ KDChartEnums::PosBottomLeft ].y() ) / 2 );
datReg->points[ KDChartEnums::PosCenter ]
- = QPoint( ( datReg->points[ KDChartEnums::PosTopCenter ].x()
+ = TQPoint( ( datReg->points[ KDChartEnums::PosTopCenter ].x()
+ datReg->points[ KDChartEnums::PosBottomCenter ].x() ) / 2,
( datReg->points[ KDChartEnums::PosTopCenter ].y()
+ datReg->points[ KDChartEnums::PosBottomCenter ].y() ) / 2 );
datReg->points[ KDChartEnums::PosCenterRight ]
- = QPoint( ( datReg->points[ KDChartEnums::PosTopRight ].x()
+ = TQPoint( ( datReg->points[ KDChartEnums::PosTopRight ].x()
+ datReg->points[ KDChartEnums::PosBottomRight ].x() ) / 2,
( datReg->points[ KDChartEnums::PosTopRight ].y()
+ datReg->points[ KDChartEnums::PosBottomRight ].y() ) / 2 );
@@ -379,9 +379,9 @@ void KDChartRingPainter::drawOneSegment( QPainter* painter,
\return the fallback text to use for describing the specified
dataset in the legend
*/
-QString KDChartRingPainter::fallbackLegendText( uint dataset ) const
+TQString KDChartRingPainter::fallbackLegendText( uint dataset ) const
{
- return QObject::tr( "Item " ) + QString::number( dataset + 1 );
+ return TQObject::tr( "Item " ) + TQString::number( dataset + 1 );
}