summaryrefslogtreecommitdiffstats
path: root/libkdchart/KDChartPainter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libkdchart/KDChartPainter.cpp')
-rw-r--r--libkdchart/KDChartPainter.cpp614
1 files changed, 307 insertions, 307 deletions
diff --git a/libkdchart/KDChartPainter.cpp b/libkdchart/KDChartPainter.cpp
index 7643589..f68b8ff 100644
--- a/libkdchart/KDChartPainter.cpp
+++ b/libkdchart/KDChartPainter.cpp
@@ -27,7 +27,7 @@
**
**********************************************************************/
#include <KDChartParams.h>
-#if defined ( SUN7 ) || defined (_SGIAPI) || defined ( Q_WS_WIN)
+#if defined ( SUN7 ) || defined (_SGIAPI) || defined ( TQ_WS_WIN)
#include <math.h>
#else
#include <cmath>
@@ -55,9 +55,9 @@
#include <KDChart.h> // for static method KDChart::painterToDrawRect()
-#include <qpainter.h>
-#include <qpaintdevice.h>
-#include <qpaintdevicemetrics.h>
+#include <tqpainter.h>
+#include <tqpaintdevice.h>
+#include <tqpaintdevicemetrics.h>
#define DEGTORAD(d) (d)*M_PI/180
@@ -94,7 +94,7 @@
\param params the parameters of the chart to be drawn
*/
KDChartPainter::KDChartPainter( KDChartParams* params ) :
-_outermostRect( QRect(QPoint(0,0), QSize(0,0))),
+_outermostRect( TQRect(TQPoint(0,0), TQSize(0,0))),
_legendTitle( 0 ),
_params( params ),
_legendNewLinesStartAtLeft( true ),
@@ -103,7 +103,7 @@ _legendTitleWidth( 0 ),
_legendTitleMetricsHeight( 0 )
{
// 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.
}
/**
@@ -116,7 +116,7 @@ KDChartPainter::~KDChartPainter()
}
bool KDChartPainter::calculateAllAxesLabelTextsAndCalcValues(
- QPainter*,
+ TQPainter*,
KDChartTableDataBase*,
double,
double,
@@ -188,7 +188,7 @@ KDChartPainter* KDChartPainter::create( KDChartParams* params, bool make2nd )
\param painter an implementation object of a user-defined chart
implementation
*/
-void KDChartPainter::registerPainter( const QString& /*painterName*/,
+void KDChartPainter::registerPainter( const TQString& /*painterName*/,
KDChartPainter* /*painter*/ )
{
// PENDING(kalle) Implement this
@@ -205,7 +205,7 @@ void KDChartPainter::registerPainter( const QString& /*painterName*/,
\param the name under which the painter implementation is
registered
*/
-void KDChartPainter::unregisterPainter( const QString& /*painterName*/ )
+void KDChartPainter::unregisterPainter( const TQString& /*painterName*/ )
{
// PENDING(kalle) Implement this
qDebug( "Sorry, not implemented: KDChartPainter::unregisterPainter()" );
@@ -214,22 +214,22 @@ void KDChartPainter::unregisterPainter( const QString& /*painterName*/ )
/**
Paints the chart for which this chart painter is configured on a
- QPainter. This is the method that bundles all the painting
+ TQPainter. This is the method that bundles all the painting
functions that paint specific parts of the chart like axes or
legends. Subclasses can override this method, but should rarely
need to do so.
- \param painter the QPainter onto which the chart should be drawn
+ \param painter the TQPainter onto which the chart should be drawn
\param data the data which will be displayed as a chart
\param regions a pointer to a region list that will be filled with
regions representing the data segments if not null
*/
-void KDChartPainter::paint( QPainter* painter,
+void KDChartPainter::paint( TQPainter* painter,
KDChartTableDataBase* data,
bool paintFirst,
bool paintLast,
KDChartDataRegionList* regions,
- const QRect* rect,
+ const TQRect* rect,
bool mustCalculateGeometry )
{
@@ -241,7 +241,7 @@ void KDChartPainter::paint( QPainter* painter,
if( data->usedCols() == 0 && data->usedRows() == 0 )
return ;
- QRect drawRect;
+ TQRect drawRect;
//Pending Michel: at this point we have to setupGeometry
if( mustCalculateGeometry || _outermostRect.isNull() ){
if( rect )
@@ -329,7 +329,7 @@ void KDChartPainter::paint( QPainter* painter,
/**
Paints an area frame.
*/
-void KDChartPainter::paintArea( QPainter* painter,
+void KDChartPainter::paintArea( TQPainter* painter,
uint area,
KDChartDataRegionList* regions,
uint dataRow,
@@ -342,7 +342,7 @@ void KDChartPainter::paintArea( QPainter* painter,
params()->frameSettings( area, bFound );
if( bFound ) {
bool allCustomBoxes;
- QRect rect( calculateAreaRect( allCustomBoxes,
+ TQRect rect( calculateAreaRect( allCustomBoxes,
area,
dataRow, dataCol, data3rd, regions ) );
@@ -353,7 +353,7 @@ void KDChartPainter::paintArea( QPainter* painter,
}
-void KDChartPainter::paintDataRegionAreas( QPainter* painter,
+void KDChartPainter::paintDataRegionAreas( TQPainter* painter,
KDChartDataRegionList* regions )
{
if( regions ){
@@ -363,7 +363,7 @@ void KDChartPainter::paintDataRegionAreas( QPainter* painter,
params()->frameSettings( KDChartEnums::AreaChartDataRegion, bFound, &iterIdx );
while( bFound ) {
bool bDummy;
- QRect rect( calculateAreaRect( bDummy,
+ TQRect rect( calculateAreaRect( bDummy,
KDChartEnums::AreaChartDataRegion,
settings->dataRow(),
settings->dataCol(),
@@ -388,10 +388,10 @@ void KDChartPainter::paintDataRegionAreas( QPainter* painter,
}
-QRect KDChartPainter::trueFrameRect( const QRect& orgRect,
+TQRect KDChartPainter::trueFrameRect( const TQRect& orgRect,
const KDChartParams::KDChartFrameSettings* settings ) const
{
- QRect rect( orgRect );
+ TQRect rect( orgRect );
if( settings ){
rect.moveBy( -settings->innerGapX(), -settings->innerGapY() );
rect.setWidth( rect.width() + 2*settings->innerGapX() );
@@ -407,8 +407,8 @@ QRect KDChartPainter::trueFrameRect( const QRect& orgRect,
NOTE: areas around KDChartCustomBoxes are _not_ drawn here but
in KDChartCustomBox::paint() which is called by paintCustomBoxes().
*/
-void KDChartPainter::paintAreaWithGap( QPainter* painter,
- QRect rect,
+void KDChartPainter::paintAreaWithGap( TQPainter* painter,
+ TQRect rect,
const KDChartParams::KDChartFrameSettings& settings )
{
if( painter && rect.isValid() )
@@ -421,7 +421,7 @@ void KDChartPainter::paintAreaWithGap( QPainter* painter,
/**
Paints the data value texts near the data representations.
*/
-void KDChartPainter::paintDataValues( QPainter* painter,
+void KDChartPainter::paintDataValues( TQPainter* painter,
KDChartTableDataBase* data,
KDChartDataRegionList* regions )
{
@@ -437,28 +437,28 @@ void KDChartPainter::paintDataValues( QPainter* painter,
// out of loop status saving
painter->save();
- QFont font0( params()->dataValuesFont( 0 ) );
+ TQFont font0( params()->dataValuesFont( 0 ) );
if( params()->dataValuesUseFontRelSize( 0 ) ) {
- float size = QMIN(_areaWidthP1000, _areaHeightP1000) * abs(params()->dataValuesFontRelSize( 0 ));
+ float size = TQMIN(_areaWidthP1000, _areaHeightP1000) * abs(params()->dataValuesFontRelSize( 0 ));
if ( 9.0 > size )
size = 9.0;
font0.setPixelSize( static_cast < int > ( size ) );
}
painter->setFont( font0 );
- QFontMetrics fm0( painter->fontMetrics() );
+ TQFontMetrics fm0( painter->fontMetrics() );
double fm0HeightP100( fm0.height() / 100.0 );
- QFont font1( params()->dataValuesFont( 1 ) );
+ TQFont font1( params()->dataValuesFont( 1 ) );
if( params()->dataValuesUseFontRelSize( 1 ) ) {
- float size = QMIN(_areaWidthP1000, _areaHeightP1000) * abs(params()->dataValuesFontRelSize( 1 ));
+ float size = TQMIN(_areaWidthP1000, _areaHeightP1000) * abs(params()->dataValuesFontRelSize( 1 ));
if ( 9.0 > size )
size = 9.0;
font1.setPixelSize( static_cast < int > ( size ) );
} else
font1.setPixelSize( font0.pixelSize());
painter->setFont( font1 );
- QFontMetrics fm1( painter->fontMetrics() );
+ TQFontMetrics fm1( painter->fontMetrics() );
double fm1HeightP100( fm1.height() / 100.0 );
bool lastDigitIrrelevant0 = true;
@@ -467,13 +467,13 @@ void KDChartPainter::paintDataValues( QPainter* painter,
for ( region=regions->first();
region != 0;
region = regions->next() ) {
- QVariant vValY;
+ TQVariant vValY;
if( data->cellCoord( region->row, region->col, vValY, 1 ) ){
- if( QVariant::String == vValY.type() ){
- const QString sVal( vValY.toString() );
+ if( TQVariant::String == vValY.type() ){
+ const TQString sVal( vValY.toString() );
if( !sVal.isEmpty() )
region->text = sVal;
- }else if( QVariant::Double == vValY.type() ){
+ }else if( TQVariant::Double == vValY.type() ){
double value( vValY.toDouble() );
region->negative = 0.0 > value;
double divi( pow( 10.0, params()->dataValuesDivPow10( region->chart ) ) );
@@ -494,7 +494,7 @@ void KDChartPainter::paintDataValues( QPainter* painter,
region->text = "+LEMNISKATE";
else {
region->text.setNum( value, 'f', digits );
- if ( autoDigits && region->text.contains( '.' ) ) {
+ if ( autoDigits && region->text.tqcontains( '.' ) ) {
int len = region->text.length();
while ( 3 < len
&& '0' == region->text[ len-1 ]
@@ -518,21 +518,21 @@ void KDChartPainter::paintDataValues( QPainter* painter,
region = regions->next() )
if ( ( ( lastDigitIrrelevant0 && !region->chart )
|| ( lastDigitIrrelevant1 && region->chart ) )
- && region->text.contains( '.' )
+ && region->text.tqcontains( '.' )
&& ( 2 < region->text.length() ) )
region->text.truncate ( region->text.length() - 2 );
// draw the Data Value Texts and calculate the text regions
- painter->setPen( Qt::black );
+ painter->setPen( TQt::black );
bool allowOverlapping = params()->allowOverlappingDataValueTexts();
bool drawThisOne;
- QRegion lastRegionDone;
+ TQRegion lastRegionDone;
- QFontMetrics actFM( painter->fontMetrics() );
+ TQFontMetrics actFM( painter->fontMetrics() );
- QFont* oldFont = 0;
+ TQFont* oldFont = 0;
int oldRotation = 0;
uint oldChart = UINT_MAX;
uint oldDatacolorNo = UINT_MAX;
@@ -545,10 +545,10 @@ void KDChartPainter::paintDataValues( QPainter* painter,
if ( region->text.length() ) {
- QVariant vValY;
+ TQVariant vValY;
bool zero =
data->cellCoord( region->row, region->col, vValY, 1 ) &&
- QVariant::Double == vValY.type() &&
+ TQVariant::Double == vValY.type() &&
( 0.0 == vValY.toDouble() || 0 == vValY.toDouble() );
uint align( params()->dataValuesAnchorAlign( region->chart,
region->negative ) );
@@ -574,7 +574,7 @@ void KDChartPainter::paintDataValues( QPainter* painter,
KDChartEnums::PositionFlag anchorPos(
params()->dataValuesAnchorPosition( region->chart, region->negative ) );
- QPoint anchor(
+ TQPoint anchor(
rectangular
? KDChartEnums::positionFlagToPoint( region->rect(), anchorPos )
: KDChartEnums::positionFlagToPoint( region->points, anchorPos ) );
@@ -612,7 +612,7 @@ void KDChartPainter::paintDataValues( QPainter* painter,
double normAngle = angle / 16;
double normAngleRad = DEGTORAD( normAngle );
double sinAngle = sin( normAngleRad );
- QPoint& pM = region->points[ KDChartEnums::PosCenter ];
+ TQPoint pM = TQPoint(region->points[ KDChartEnums::PosCenter ]);
double dX( pM.x() - anchor.x() );
double dY( pM.y() - anchor.y() );
double radialLen( sinAngle ? dY / sinAngle : dY );
@@ -643,9 +643,9 @@ void KDChartPainter::paintDataValues( QPainter* painter,
if( params()->dataValuesShowInfinite( region->chart ) ){
//bool bIsLineChart = KDChartParams::Line == cType;
if( region->text == "-LEMNISKATE" )
- align = Qt::AlignRight + Qt::AlignVCenter;
+ align = TQt::AlignRight + TQt::AlignVCenter;
else
- align = Qt::AlignLeft + Qt::AlignVCenter;
+ align = TQt::AlignLeft + TQt::AlignVCenter;
if( !rotation )
rotation = 90;
else
@@ -657,10 +657,10 @@ void KDChartPainter::paintDataValues( QPainter* painter,
}
if ( rotation ) {
- anchor = painter->worldMatrix().map( anchor );
+ anchor = painter->tqworldMatrix().map( anchor );
// Temporary solution for fixing the data labels size
- // bug when in QPrinter::HighResolution mode:
+ // bug when in TQPrinter::HighResolution mode:
// There seem to be no backdraws by acting like this,
// but further investigation is required to detect the
// real error in the previous code/
@@ -688,10 +688,10 @@ void KDChartPainter::paintDataValues( QPainter* painter,
// oldRotation = rotation;
}
- QFont* actFont = region->chart ? &font1 : &font0;
+ TQFont* actFont = region->chart ? &font1 : &font0;
if( oldFont != actFont ) {
painter->setFont( *actFont );
- actFM = QFontMetrics( painter->fontMetrics() );
+ actFM = TQFontMetrics( painter->fontMetrics() );
// Comment this out - zooming and scrolling
//oldFont = actFont;
}
@@ -707,26 +707,26 @@ void KDChartPainter::paintDataValues( QPainter* painter,
true,
true,
5 );
- //anchor = painter->worldMatrix().map( anchor );
+ //anchor = painter->tqworldMatrix().map( anchor );
if( allowOverlapping ) {
drawThisOne = true;
}else {
- QRegion sectReg( infosKDD.region.intersect( lastRegionDone ) );
+ TQRegion sectReg( infosKDD.region.intersect( lastRegionDone ) );
drawThisOne = sectReg.isEmpty();
}
if( drawThisOne ) {
lastRegionDone = lastRegionDone.unite( infosKDD.region );
- region->pTextRegion = new QRegion( infosKDD.region );
+ region->pTextRegion = new TQRegion( infosKDD.region );
if( params()->dataValuesAutoColor( region->chart ) ) {
if( bIsAreaChart ){
- QColor color( params()->dataColor( region->row ) );
+ TQColor color( params()->dataColor( region->row ) );
/*
if( ( (0.0 > anchorDY) && region->negative )
|| ( (0.0 < anchorDY) && !region->negative ) )
painter->setPen(
- QColor( static_cast < int > ( 255- color.red() ),
+ TQColor( static_cast < int > ( 255- color.red() ),
static_cast < int > ( 255- color.green() ),
static_cast < int > ( 255- color.blue() ) ) );
else
@@ -735,7 +735,7 @@ void KDChartPainter::paintDataValues( QPainter* painter,
}else{
if( zero ) {
if( oldDatacolorNo != UINT_MAX ) {
- painter->setPen( Qt::black );
+ painter->setPen( TQt::black );
oldDatacolorNo = UINT_MAX;
}
}
@@ -746,8 +746,8 @@ void KDChartPainter::paintDataValues( QPainter* painter,
: region->row;
if( oldDatacolorNo != datacolorNo ) {
oldDatacolorNo = datacolorNo;
- QColor color( params()->dataColor( datacolorNo ) );
- painter->setPen( QColor(
+ TQColor color( params()->dataColor( datacolorNo ) );
+ painter->setPen( TQColor(
static_cast < int > (255-color.red() ),
static_cast < int > (255-color.green()),
static_cast < int > (255-color.blue() )));
@@ -773,7 +773,7 @@ void KDChartPainter::paintDataValues( QPainter* painter,
region->chart ? &font1 : &font0,
align,
false, // bool showAnchor
- 0, // const QFontMetrics* fontMet
+ 0, // const TQFontMetrics* fontMet
false, // bool noFirstrotate
false, // bool noBackrotate
0, // KDDrawTextRegionAndTrueRect* infos
@@ -783,7 +783,7 @@ void KDChartPainter::paintDataValues( QPainter* painter,
//Pending Michel Painting data value labels rotated.
painter->drawText( infosKDD.x , infosKDD.y ,
infosKDD.width, infosKDD.height,
- Qt::AlignHCenter | Qt::AlignVCenter | Qt::SingleLine,
+ TQt::AlignHCenter | TQt::AlignVCenter | TQt::SingleLine,
region->text );
}
@@ -796,69 +796,69 @@ void KDChartPainter::paintDataValues( QPainter* painter,
// no rotation:
painter->rotate( -oldRotation );
oldRotation = 0;
- QFontMetrics & fm = region->chart ? fm1 : fm0;
+ TQFontMetrics & fm = region->chart ? fm1 : fm0;
int boundingRectWidth = fm.boundingRect( region->text ).width();
int leftBearing = fm.leftBearing( region->text[ 0 ] );
- const QChar c = region->text.at( region->text.length() - 1 );
+ const TQChar c = region->text.at( region->text.length() - 1 );
int rightBearing = fm.rightBearing( c );
int w = boundingRectWidth + leftBearing + rightBearing + 1;
int h = fm.height(); // ascent + descent + 1
int dx = 0;
int dy = 0;
- switch( align & ( Qt::AlignLeft | Qt::AlignRight | Qt::AlignHCenter ) ) {
- case Qt::AlignRight:
+ switch( align & ( TQt::AlignLeft | TQt::AlignRight | TQt::AlignHCenter ) ) {
+ case TQt::AlignRight:
dx = -w+1;
break;
- case Qt::AlignHCenter:
+ case TQt::AlignHCenter:
// Center on the middle of the bounding rect, not
// the painted area, because numbers appear centered then
dx = -( ( boundingRectWidth / 2 ) + leftBearing );
break;
}
- switch( align & ( Qt::AlignTop | Qt::AlignBottom | Qt::AlignVCenter ) ) {
- case Qt::AlignBottom:
+ switch( align & ( TQt::AlignTop | TQt::AlignBottom | TQt::AlignVCenter ) ) {
+ case TQt::AlignBottom:
dy = -h+1;
break;
- case Qt::AlignVCenter:
+ case TQt::AlignVCenter:
dy = -h / 2;
break;
}
- QRegion thisRegion(
- QRect( anchor.x() + dx, anchor.y() + dy, w, h ) );
+ TQRegion thisRegion(
+ TQRect( anchor.x() + dx, anchor.y() + dy, w, h ) );
if( allowOverlapping )
drawThisOne = true;
else {
- QRegion sectReg( thisRegion.intersect( lastRegionDone ) );
+ TQRegion sectReg( thisRegion.intersect( lastRegionDone ) );
drawThisOne = sectReg.isEmpty();
}
if( drawThisOne ) {
lastRegionDone = lastRegionDone.unite( thisRegion );
- region->pTextRegion = new QRegion( thisRegion );
+ region->pTextRegion = new TQRegion( thisRegion );
#ifdef DEBUG_TEXT_PAINTING
// for testing:
- QRect rect( region->pTextRegion->boundingRect() );
+ TQRect rect( region->pTextRegion->boundingRect() );
painter->drawRect( rect );
- painter->setPen( Qt::red );
+ painter->setPen( TQt::red );
rect.setLeft( rect.left() + leftBearing );
rect.setTop( rect.top() + ( fm.height()-fm.boundingRect( region->text ).height() ) /2 );
rect.setWidth( fm.boundingRect( region->text ).width() );
rect.setHeight( fm.boundingRect( region->text ).height() );
painter->drawRect( rect );
- painter->setPen( Qt::black );
+ painter->setPen( TQt::black );
#endif
/*
NOTE: The following will be REMOVED again once
-the layout policy feature is implemented !!!
+the tqlayout policy feature is implemented !!!
*/
- QRect textRect( region->pTextRegion->boundingRect() );
+ TQRect textRect( region->pTextRegion->boundingRect() );
if( bIsAreaChart ){
- QBrush brush( params()->dataValuesBackground( region->chart ) );
+ TQBrush brush( params()->dataValuesBackground( region->chart ) );
painter->setBrush( brush );
- painter->setPen( Qt::NoPen );
- QRect rect( textRect );
+ painter->setPen( TQt::NoPen );
+ TQRect rect( textRect );
rect.moveBy( -2, 0 );
rect.setWidth( rect.width() + 4 );
painter->drawRect( rect );
@@ -866,12 +866,12 @@ the layout policy feature is implemented !!!
painter->setFont( region->chart ? font1 : font0 );
if( params()->dataValuesAutoColor( region->chart ) ) {
if( bIsAreaChart ){
- QColor color( params()->dataColor( region->row ) );
+ TQColor color( params()->dataColor( region->row ) );
/*
if( ( (0.0 > anchorDY) && region->negative )
|| ( (0.0 < anchorDY) && !region->negative ) )
painter->setPen(
- QColor( static_cast < int > ( 255- color.red() ),
+ TQColor( static_cast < int > ( 255- color.red() ),
static_cast < int > ( 255- color.green() ),
static_cast < int > ( 255- color.blue() ) ) );
else
@@ -879,14 +879,14 @@ the layout policy feature is implemented !!!
painter->setPen( color.dark() );
}else{
if( zero )
- painter->setPen( Qt::black );
+ painter->setPen( TQt::black );
else {
- QColor color( params()->dataColor(
+ TQColor color( params()->dataColor(
( KDChartParams::Pie == params()->chartType()
|| KDChartParams::Ring == params()->chartType() )
? region->col
: region->row ) );
- painter->setPen( QColor( static_cast < int > ( 255- color.red() ),
+ painter->setPen( TQColor( static_cast < int > ( 255- color.red() ),
static_cast < int > ( 255- color.green() ),
static_cast < int > ( 255- color.blue() ) ) );
}
@@ -897,7 +897,7 @@ the layout policy feature is implemented !!!
painter->drawText( textRect.left(), textRect.top(),
textRect.width()+1, textRect.height()+1,
- Qt::AlignLeft | Qt::AlignTop, region->text );
+ TQt::AlignLeft | TQt::AlignTop, region->text );
}
@@ -917,7 +917,7 @@ the layout policy feature is implemented !!!
/**
Paints all custom boxes.
*/
-void KDChartPainter::paintCustomBoxes( QPainter* painter,
+void KDChartPainter::paintCustomBoxes( TQPainter* painter,
KDChartDataRegionList* regions )
{
// paint all of the custom boxes AND their surrounding frames+background (if any)
@@ -945,7 +945,7 @@ void KDChartPainter::paintCustomBoxes( QPainter* painter,
= bIndividualFound ? individualFrameSettings
: bGlobalFound ? globalFrameSettings : 0;
// paint content
- const QPoint anchor( calculateAnchor( *box, regions ) );
+ const TQPoint anchor( calculateAnchor( *box, regions ) );
box->paint( painter,
anchor,
_areaWidthP1000,
@@ -961,10 +961,10 @@ void KDChartPainter::paintCustomBoxes( QPainter* painter,
/**
Calculated the top left corner of a custom box.
*/
-QPoint KDChartPainter::calculateAnchor( const KDChartCustomBox & box,
+TQPoint KDChartPainter::calculateAnchor( const KDChartCustomBox & box,
KDChartDataRegionList* regions ) const
{
- QPoint pt(0,0);
+ TQPoint pt(0,0);
// Recursion handling:
//
@@ -979,14 +979,14 @@ QPoint KDChartPainter::calculateAnchor( const KDChartCustomBox & box,
// Rule:
//
// A box may be aligned to another box (and the 2nd box may again be
- // aligned to a 3rd box and so on) but NO CIRCULAR alignment is allowed.
+ // aligned to a 3rd box and so on) but NO CIRCULAR tqalignment is allowed.
//
if( !box.anchorBeingCalculated() ) {
box.setInternalFlagAnchorBeingCalculated( true );
bool allCustomBoxes;
- QRect rect( calculateAreaRect( allCustomBoxes,
+ TQRect rect( calculateAreaRect( allCustomBoxes,
box.anchorArea(),
box.dataRow(),
box.dataCol(),
@@ -1022,14 +1022,14 @@ QPoint KDChartPainter::calculateAnchor( const KDChartCustomBox & box,
Calculated the rectangle covered by an area.
NOTE: KDChartCustomBox areas are _not_ calculated here.
*/
-QRect KDChartPainter::calculateAreaRect( bool & allCustomBoxes,
+TQRect KDChartPainter::calculateAreaRect( bool & allCustomBoxes,
uint area,
uint dataRow,
uint dataCol,
uint /*data3rd*/,
KDChartDataRegionList* regions ) const
{
- QRect rect(0,0, 0,0);
+ TQRect rect(0,0, 0,0);
allCustomBoxes = false;
uint pos;
switch( area ) {
@@ -1058,7 +1058,7 @@ QRect KDChartPainter::calculateAreaRect( bool & allCustomBoxes,
for( pos = KDChartParams::HdFtPosHeadersSTART;
KDChartParams::HdFtPosHeadersEND >= pos;
++pos ) {
- const QRect& r = params()->headerFooterRect( pos );
+ const TQRect& r = params()->headerFooterRect( pos );
if( r.isValid() ) {
if( bStart )
rect = r;
@@ -1074,7 +1074,7 @@ QRect KDChartPainter::calculateAreaRect( bool & allCustomBoxes,
for( pos = KDChartParams::HdFtPosFootersSTART;
KDChartParams::HdFtPosFootersEND >= pos;
++pos ) {
- const QRect& r = params()->headerFooterRect( pos );
+ const TQRect& r = params()->headerFooterRect( pos );
if( r.isValid() ) {
if( bStart )
rect = r;
@@ -1098,7 +1098,7 @@ QRect KDChartPainter::calculateAreaRect( bool & allCustomBoxes,
for( pos = KDChartParams::HdFtPosSTART;
KDChartParams::HdFtPosEND >= pos;
++pos ) {
- const QRect& r = params()->headerFooterRect( pos );
+ const TQRect& r = params()->headerFooterRect( pos );
if( r.isValid() ) {
if( bStart )
rect = r;
@@ -1140,13 +1140,13 @@ QRect KDChartPainter::calculateAreaRect( bool & allCustomBoxes,
break;
default: {
- uint maskBASE = KDChartEnums::AreaBASEMask & area;
- pos = area - maskBASE;
- if ( KDChartEnums::AreaAxisBASE == maskBASE ) {
+ uint tqmaskBASE = KDChartEnums::AreaBASEMask & area;
+ pos = area - tqmaskBASE;
+ if ( KDChartEnums::AreaAxisBASE == tqmaskBASE ) {
rect = params()->axisParams( pos ).axisTrueAreaRect();
- } else if ( KDChartEnums::AreaHdFtBASE == maskBASE ) {
+ } else if ( KDChartEnums::AreaHdFtBASE == tqmaskBASE ) {
rect = params()->headerFooterRect( pos );
- } else if ( KDChartEnums::AreaCustomBoxesBASE == maskBASE ) {
+ } else if ( KDChartEnums::AreaCustomBoxesBASE == tqmaskBASE ) {
const KDChartCustomBox * box = params()->customBox( pos );
if( box ) {
rect = box->trueRect( calculateAnchor( *box, regions ),
@@ -1160,13 +1160,13 @@ QRect KDChartPainter::calculateAreaRect( bool & allCustomBoxes,
}
-QPoint KDChartPainter::pointOnCircle( const QRect& rect, double angle )
+TQPoint KDChartPainter::pointOnCircle( const TQRect& rect, double angle )
{
// There are two ways of computing this: The simple, but slow one
- // is to use QPointArray.makeArc() and take the first point. The
+ // is to use TQPointArray.makeArc() and take the first point. The
// more advanced, but faster one is to do the trigonometric
// computionations ourselves. Since the comments in
- // QPointArray::makeArc() very often say that the code there is
+ // TQPointArray::makeArc() very often say that the code there is
// "poor", we'd better do it outselves...
double normAngle = angle / 16.0;
@@ -1175,13 +1175,13 @@ QPoint KDChartPainter::pointOnCircle( const QRect& rect, double angle )
double sinAngle = -sin( normAngleRad );
double posX = floor( cosAngle * ( double ) rect.width() / 2.0 + 0.5 );
double posY = floor( sinAngle * ( double ) rect.height() / 2.0 + 0.5 );
- return QPoint( static_cast<int>(posX) + rect.center().x(),
+ return TQPoint( static_cast<int>(posX) + rect.center().x(),
static_cast<int>(posY) + rect.center().y() );
}
-void KDChartPainter::makeArc( QPointArray& points,
- const QRect& rect,
+void KDChartPainter::makeArc( TQPointArray& points,
+ const TQRect& rect,
double startAngle, double angles )
{
double endAngle = startAngle + angles;
@@ -1205,7 +1205,7 @@ void KDChartPainter::makeArc( QPointArray& points,
double sinAngle = -sin( normAngleRad );
double posX = floor( cosAngle * rWid2 + 0.5 );
double posY = floor( sinAngle * rHig2 + 0.5 );
- points[i] = QPoint( ( int ) posX + rCX,
+ points[i] = TQPoint( ( int ) posX + rCX,
( int ) posY + rCY );
if( i+1 >= numSteps-1 )
angle = endAngle; // the very last step width may be smaller than 1.0
@@ -1222,10 +1222,10 @@ void KDChartPainter::makeArc( QPointArray& points,
provide the appropriate drawing code here. This method serves as a
fallback for chart types that do not have axes (like pies).
- \param painter the QPainter onto which the chart should be drawn
+ \param painter the TQPainter onto which the chart should be drawn
\param data the data that will be displayed as a chart
*/
-void KDChartPainter::paintAxes( QPainter* /*painter*/, KDChartTableDataBase* /*data*/ )
+void KDChartPainter::paintAxes( TQPainter* /*painter*/, KDChartTableDataBase* /*data*/ )
{
// This method intentionally left blank.
}
@@ -1238,11 +1238,11 @@ int KDChartPainter::legendTitleVertGap() const
}
-QFont KDChartPainter::trueLegendFont() const
+TQFont KDChartPainter::trueLegendFont() const
{
- QFont trueFont = params()->legendFont();
+ TQFont trueFont = params()->legendFont();
if ( params()->legendFontUseRelSize() ) {
- const double averageValueP1000 = QMIN(_areaWidthP1000, _areaHeightP1000);//( _areaWidthP1000 + _areaHeightP1000 ) / 2.0;
+ const double averageValueP1000 = TQMIN(_areaWidthP1000, _areaHeightP1000);//( _areaWidthP1000 + _areaHeightP1000 ) / 2.0;
trueFont.setPixelSize(
static_cast < int > ( params()->legendFontRelSize() * averageValueP1000 ) );
}
@@ -1253,15 +1253,15 @@ QFont KDChartPainter::trueLegendFont() const
/**
Calculates the size of the rectangle for horizontal legend orientation.
- \param painter the QPainter onto which the chart should be drawn
+ \param painter the TQPainter onto which the chart should be drawn
*/
-void KDChartPainter::calculateHorizontalLegendSize( QPainter* painter,
- QSize& size,
+void KDChartPainter::calculateHorizontalLegendSize( TQPainter* painter,
+ TQSize& size,
bool& legendNewLinesStartAtLeft ) const
{
legendNewLinesStartAtLeft = false;
- QRect legendRect( _legendRect );
+ TQRect legendRect( _legendRect );
/*
* Pending Michel reset the left side before calculating
*the new legend position calculation
@@ -1299,7 +1299,7 @@ void KDChartPainter::calculateHorizontalLegendSize( QPainter* painter,
const int rightEdge = _innermostRect.right()-_legendEMSpace;
bool bFirstLFWithTitle = _legendTitle;
painter->setFont( trueLegendFont() );
- QFontMetrics txtMetrics( painter->fontMetrics() );
+ TQFontMetrics txtMetrics( painter->fontMetrics() );
int dataset;
for ( dataset = 0; dataset < _numLegendTexts; ++dataset ) {
/*
@@ -1317,7 +1317,7 @@ void KDChartPainter::calculateHorizontalLegendSize( QPainter* painter,
ypos += bFirstLFWithTitle ? legendTitleVertGap() : _legendSpacing;
bFirstLFWithTitle = false;
}
- maxX = QMAX(maxX, x2+txtWidth+_legendEMSpace);
+ maxX = TQMAX(maxX, x2+txtWidth+_legendEMSpace);
xpos += txtWidth + em4;
x2 += txtWidth + em4;
@@ -1349,10 +1349,10 @@ bool KDChartPainter::mustDrawVerticalLegend() const
params()->legendPosition() == KDChartParams::LegendBottomRightRight;
}
-QFont KDChartPainter::trueLegendTitleFont() const
+TQFont KDChartPainter::trueLegendTitleFont() const
{
- const double averageValueP1000 = QMIN(_areaWidthP1000, _areaHeightP1000);//( _areaWidthP1000 + _areaHeightP1000 ) / 2.0;
- QFont font( params()->legendTitleFont() );
+ const double averageValueP1000 = TQMIN(_areaWidthP1000, _areaHeightP1000);//( _areaWidthP1000 + _areaHeightP1000 ) / 2.0;
+ TQFont font( params()->legendTitleFont() );
if ( params()->legendTitleFontUseRelSize() ) {
int nTxtHeight =
static_cast < int > ( params()->legendTitleFontRelSize()
@@ -1368,10 +1368,10 @@ QFont KDChartPainter::trueLegendTitleFont() const
draws a standard legend that should be suitable for most chart
types. Subclasses can provide their own implementations.
- \param painter the QPainter onto which the chart should be drawn
+ \param painter the TQPainter onto which the chart should be drawn
\param data the data that will be displayed as a chart
*/
-void KDChartPainter::paintLegend( QPainter* painter,
+void KDChartPainter::paintLegend( TQPainter* painter,
KDChartTableDataBase* /*data*/ )
{
if ( params()->legendPosition() == KDChartParams::NoLegend )
@@ -1385,8 +1385,8 @@ void KDChartPainter::paintLegend( QPainter* painter,
params()->frameSettings( KDChartEnums::AreaLegend, bFrameFound );
// start out with a rectangle around the legend
- //painter->setPen( QPen( Qt::black, 1 ) );
- //painter->setBrush( QBrush::NoBrush );
+ //painter->setPen( TQPen( TQt::black, 1 ) );
+ //painter->setBrush( TQBrush::NoBrush );
//Pending Michel: let us paint the frame at the end of the drawmarker
//and draw text process, in case we need to resize it then
/*
@@ -1416,7 +1416,7 @@ void KDChartPainter::paintLegend( QPainter* painter,
_legendTitle->draw( painter,
xpos,
ypos,
- QRegion( xpos,
+ TQRegion( xpos,
ypos ,
_legendTitleWidth,
_legendTitleHeight ),
@@ -1441,7 +1441,7 @@ void KDChartPainter::paintLegend( QPainter* painter,
const int rightEdge = _legendRect.right();
bool bFirstLF = true;
painter->setFont( trueLegendFont() );
- QFontMetrics txtMetrics( painter->fontMetrics() );
+ TQFontMetrics txtMetrics( painter->fontMetrics() );
int dataset;
for ( dataset = 0; dataset < _numLegendTexts; ++dataset ) {
/*
@@ -1464,11 +1464,11 @@ void KDChartPainter::paintLegend( QPainter* painter,
ypos += bFirstLF ? legendTitleVertGap() : _legendSpacing;
bFirstLF = false;
}
- painter->setBrush( QBrush( params()->dataColor( dataset ),
- QBrush::SolidPattern ) );
+ painter->setBrush( TQBrush( params()->dataColor( dataset ),
+ TQBrush::SolidPattern ) );
if( params()->legendShowLines() ){
- painter->setPen( QPen( params()->dataColor( dataset ), 2,
+ painter->setPen( TQPen( params()->dataColor( dataset ), 2,
params()->lineStyle( dataset ) ) );
painter->drawLine(
xpos - emDiv2,
@@ -1480,7 +1480,7 @@ void KDChartPainter::paintLegend( QPainter* painter,
/*
// draw marker if we have a marker, OR we have no marker and no line
if ( params()->lineMarker() ||
- params()->lineStyle( dataset ) == Qt::NoPen )*/
+ params()->lineStyle( dataset ) == TQt::NoPen )*/
drawMarker( painter,
params(),
_areaWidthP1000, _areaHeightP1000,
@@ -1489,18 +1489,18 @@ void KDChartPainter::paintLegend( QPainter* painter,
? params()->lineMarkerStyle( dataset )
: KDChartParams::LineMarkerSquare,
params()->dataColor(dataset),
- QPoint(xpos + emDiv2,
+ TQPoint(xpos + emDiv2,
bVertical? ypos + emDiv2: !bFirstLF ?ypos + _legendSpacing:_legendRect.center().y() - (legHeight / 2 ))/*ypos + emDiv2*/ ,
0, 0, 0, NULL, // these params are deadweight here. TODO
&legHeight /*&_legendEMSpace*/, &legHeight /*&_legendEMSpace*/,
- bVertical ? Qt::AlignCenter : (Qt::AlignTop | Qt::AlignHCenter) );
+ bVertical ? TQt::AlignCenter : (TQt::AlignTop | TQt::AlignHCenter) );
/*
painter->drawText(_legendRect.topLeft(), "topLeft" );
painter->drawText(_legendRect.topLeft().x(), _legendRect.center().y(), "center" );
painter->drawText(_legendRect.bottomLeft(), "bottomLeft" );
*/
/* old:
- painter->setPen( Qt::black );
+ painter->setPen( TQt::black );
painter->drawRect( xpos,
ypos + ( _legendHeight - _legendEMSpace ) / 2,
_legendEMSpace,
@@ -1511,7 +1511,7 @@ void KDChartPainter::paintLegend( QPainter* painter,
bVertical ? ypos : !bFirstLF ? ypos + _legendSpacing : _legendRect.center().y() - (legHeight / 2 ),
txtWidth,
legHeight,
- Qt::AlignLeft | Qt::AlignVCenter,
+ TQt::AlignLeft | TQt::AlignVCenter,
_legendTexts[ dataset ] );
if( bVertical )
@@ -1523,8 +1523,8 @@ void KDChartPainter::paintLegend( QPainter* painter,
}
}
- painter->setPen( QPen( Qt::black, 1 ) );
- painter->setBrush( QBrush::NoBrush );
+ painter->setPen( TQPen( TQt::black, 1 ) );
+ painter->setBrush( TQBrush::NoBrush );
if( !bFrameFound )
painter->drawRect( _legendRect );
@@ -1577,8 +1577,8 @@ void internSetAxisArea( KDChartParams* params, int axis,
int x0, int y0, int w0, int h0 )
{
// axis may never occupy more than 1000 per mille of the available space
- int nFrom = QMAX(-1000, params->axisParams( axis ).axisUseAvailableSpaceFrom());
- int nTo = QMAX(-1000, params->axisParams( axis ).axisUseAvailableSpaceTo());
+ int nFrom = TQMAX(-1000, params->axisParams( axis ).axisUseAvailableSpaceFrom());
+ int nTo = TQMAX(-1000, params->axisParams( axis ).axisUseAvailableSpaceTo());
adjustFromTo(nFrom,nTo);
KDChartAxisParams::AxisPos basicPos = KDChartAxisParams::basicAxisPos( axis );
@@ -1618,7 +1618,7 @@ void internSetAxisArea( KDChartParams* params, int axis,
}
params->setAxisArea( axis,
- QRect( x,
+ TQRect( x,
y,
w,
h ) );
@@ -1630,32 +1630,32 @@ void internSetAxisArea( KDChartParams* params, int axis,
in KDChartPainter draws a standard header that should be suitable
for most chart types. Subclasses can provide their own implementations.
- \param painter the QPainter onto which the chart should be drawn
+ \param painter the TQPainter onto which the chart should be drawn
\param data the data that will be displayed as a chart
*/
-void KDChartPainter::paintHeaderFooter( QPainter* painter,
+void KDChartPainter::paintHeaderFooter( TQPainter* painter,
KDChartTableDataBase* /*data*/ )
{
- const double averageValueP1000 = QMIN(_areaWidthP1000, _areaHeightP1000);//( _areaWidthP1000 + _areaHeightP1000 ) / 2.0;
+ const double averageValueP1000 = TQMIN(_areaWidthP1000, _areaHeightP1000);//( _areaWidthP1000 + _areaHeightP1000 ) / 2.0;
painter->save();
for( int iHdFt = KDChartParams::HdFtPosSTART;
iHdFt <= KDChartParams::HdFtPosEND; ++iHdFt ){
- QString txt( params()->headerFooterText( iHdFt ) );
+ TQString txt( params()->headerFooterText( iHdFt ) );
if ( !txt.isEmpty() ) {
- QFont actFont( params()->headerFooterFont( iHdFt ) );
+ TQFont actFont( params()->headerFooterFont( iHdFt ) );
if ( params()->headerFooterFontUseRelSize( iHdFt ) )
actFont.setPixelSize( static_cast < int > (
params()->headerFooterFontRelSize( iHdFt ) * averageValueP1000 ) );
painter->setPen( params()->headerFooterColor( iHdFt ) );
painter->setFont( actFont );
- // Note: The alignment flags used here match the rect calculation
+ // Note: The tqalignment flags used here match the rect calculation
// done in KDChartPainter::setupGeometry().
// AlignTop is done to ensure that the hd/ft texts of the same
// group (e.g. Hd2L and Hd2 and Hd2R) have the same baselines.
- QRect rect( params()->headerFooterRect( iHdFt ) );
+ TQRect rect( params()->headerFooterRect( iHdFt ) );
int dXY = iHdFt < KDChartParams::HdFtPosFootersSTART
? _hdLeading/3
: _ftLeading/3;
@@ -1663,7 +1663,7 @@ void KDChartPainter::paintHeaderFooter( QPainter* painter,
rect.setWidth( rect.width() -2*dXY +1 );
rect.setHeight( rect.height()-2*dXY +1 );
painter->drawText( rect,
- Qt::AlignLeft | Qt::AlignTop | Qt::SingleLine,
+ TQt::AlignLeft | TQt::AlignTop | TQt::SingleLine,
txt );
}
}
@@ -1672,7 +1672,7 @@ void KDChartPainter::paintHeaderFooter( QPainter* painter,
int KDChartPainter::calculateHdFtRects(
- QPainter* painter,
+ TQPainter* painter,
double averageValueP1000,
int xposLeft,
int xposRight,
@@ -1690,7 +1690,7 @@ int KDChartPainter::calculateHdFtRects(
bHeader ? KDChartParams::HdFtPosHeaders1START : KDChartParams::HdFtPosFooters1START,
bHeader ? KDChartParams::HdFtPosHeaders2START : KDChartParams::HdFtPosFooters2START };
const int rangeSize = 3;
- QFontMetrics* metrics[rangesCnt * rangeSize];
+ TQFontMetrics* metrics[rangesCnt * rangeSize];
int i;
for( i = 0; i < rangesCnt*rangeSize; ++i )
@@ -1701,16 +1701,16 @@ int KDChartPainter::calculateHdFtRects(
for( iRange = 0; iRange < rangesCnt; ++iRange ){
for( i = 0; i < rangeSize; ++i ){
iHdFt = ranges[iRange] + i;
- QString txt( params()->headerFooterText( iHdFt ) );
+ TQString txt( params()->headerFooterText( iHdFt ) );
if ( !txt.isEmpty() ) {
- QFont actFont( params()->headerFooterFont( iHdFt ) );
+ TQFont actFont( params()->headerFooterFont( iHdFt ) );
if ( params()->headerFooterFontUseRelSize( iHdFt ) ) {
actFont.setPixelSize( static_cast < int > (
params()->headerFooterFontRelSize( iHdFt ) * averageValueP1000 ) );
}
painter->setFont( actFont );
- metrics[ iRange*rangeSize + i ] = new QFontMetrics( painter->fontMetrics() );
- leading = QMAX( leading, metrics[ iRange*rangeSize + i ]->lineSpacing() / 2 );
+ metrics[ iRange*rangeSize + i ] = new TQFontMetrics( painter->fontMetrics() );
+ leading = TQMAX( leading, metrics[ iRange*rangeSize + i ]->lineSpacing() / 2 );
}
}
}
@@ -1736,16 +1736,16 @@ int KDChartPainter::calculateHdFtRects(
for( i = 0; i < rangeSize; ++i ){
iHdFt = ranges[iRange] + i;
if ( metrics[ iRange*rangeSize + i ] ) {
- QFontMetrics& m = *metrics[ iRange*rangeSize + i ];
+ TQFontMetrics& m = *metrics[ iRange*rangeSize + i ];
ascents[i] = m.ascent();
heights[i] = m.height() + leading23;
- // the following adds two spaces to work around a bug in Qt:
+ // the following adds two spaces to work around a bug in TQt:
// bounding rect sometimes is too small, if using italicized fonts
widths[ i] = m.boundingRect( params()->headerFooterText( iHdFt )+" " ).width() + leading23;
- maxAscent = QMAX( maxAscent, ascents[i] );
- maxHeight = QMAX( maxHeight, heights[i] );
+ maxAscent = TQMAX( maxAscent, ascents[i] );
+ maxHeight = TQMAX( maxHeight, heights[i] );
}else{
heights[i] = 0;
}
@@ -1766,7 +1766,7 @@ int KDChartPainter::calculateHdFtRects(
default: x1 = xposLeft + (xposRight-xposLeft-widths[i]) / 2;
}
((KDChartParams*)params())->__internalStoreHdFtRect( iHdFt,
- QRect( x1,
+ TQRect( x1,
bHeader
? yposTop + maxAscent - ascents[i]
: yposBottom + maxAscent - ascents[i],
@@ -1825,7 +1825,7 @@ void KDChartPainter::findChartDatasets( KDChartTableDataBase* data,
void KDChartPainter::calculateAllAxesRects(
- QPainter* painter,
+ TQPainter* painter,
bool finalPrecision,
KDChartTableDataBase* data
)
@@ -1836,7 +1836,7 @@ void KDChartPainter::calculateAllAxesRects(
const int trueWidth = _outermostRect.width();
const int trueHeight = _outermostRect.height();
- const double averageValueP1000 = QMIN(_areaWidthP1000, _areaHeightP1000);//( _areaWidthP1000 + _areaHeightP1000 ) / 2.0;
+ const double averageValueP1000 = TQMIN(_areaWidthP1000, _areaHeightP1000);//( _areaWidthP1000 + _areaHeightP1000 ) / 2.0;
// store the axes' 0 offsets
int nAxesLeft0 = _axesRect.left() - _outermostRect.left();
@@ -1904,11 +1904,11 @@ void KDChartPainter::calculateAllAxesRects(
if ( para.axisLabelsVisible() ) {
int fntHeight;
if ( para.axisLabelsFontUseRelSize() )
- fntHeight = QMAX(static_cast < int > ( para.axisLabelsFontRelSize() * averageValueP1000 ),
+ fntHeight = TQMAX(static_cast < int > ( para.axisLabelsFontRelSize() * averageValueP1000 ),
para.axisLabelsFontMinSize() );
else {
painter->setFont( para.axisLabelsFont() );
- QFontMetrics metrics( painter->fontMetrics() );
+ TQFontMetrics metrics( painter->fontMetrics() );
fntHeight = metrics.height();
}
// adjust text height in case of formatted Date/Time values
@@ -1920,21 +1920,21 @@ void KDChartPainter::calculateAllAxesRects(
qDebug( "IMPLEMENTATION ERROR: findDataset( DataEntry, ... ) should *always* return true. (a)" );
dataDataset = KDCHART_ALL_DATASETS;
}
- QVariant::Type valType = QVariant::Invalid;
+ TQVariant::Type valType = TQVariant::Invalid;
const bool dataCellsHaveSeveralCoordinates =
(KDCHART_ALL_DATASETS == dataDataset)
? data->cellsHaveSeveralCoordinates( &valType )
: data->cellsHaveSeveralCoordinates( dataDataset, dataDataset2, &valType );
- QString format( para.axisLabelsDateTimeFormat() );
+ TQString format( para.axisLabelsDateTimeFormat() );
if( dataCellsHaveSeveralCoordinates
- && QVariant::DateTime == valType ){
+ && TQVariant::DateTime == valType ){
if( KDCHART_AXIS_LABELS_AUTO_DATETIME_FORMAT == format )
- areaMin = QMAX( areaMin, static_cast < int > ( fntHeight * 6.75 ) );
+ areaMin = TQMAX( areaMin, static_cast < int > ( fntHeight * 6.75 ) );
else
- areaMin = QMAX( areaMin, fntHeight * ( 3 + format.contains("\n") ) );
+ areaMin = TQMAX( areaMin, fntHeight * ( 3 + format.tqcontains("\n") ) );
}
else
- areaMin = QMAX( areaMin, fntHeight * 3 );
+ areaMin = TQMAX( areaMin, fntHeight * 3 );
}
break;
case KDChartAxisParams::AxisPosLeft:
@@ -1958,21 +1958,21 @@ void KDChartPainter::calculateAllAxesRects(
internal__KDChart__CalcValues& cv = calcVal[iAxis];
const int nUsableAxisWidth = static_cast < int > (cv.pTextsW);
const KDChartAxisParams & para = params()->axisParams( iAxis );
- QFont axisLabelsFont( para.axisLabelsFont() );
+ TQFont axisLabelsFont( para.axisLabelsFont() );
if ( para.axisLabelsFontUseRelSize() ) {
axisLabelsFont.setPixelSize( static_cast < int > ( cv.nTxtHeight ) );
}
painter->setFont( para.axisLabelsFont() );
- QFontMetrics axisLabelsFontMetrics( painter->fontMetrics() );
+ TQFontMetrics axisLabelsFontMetrics( painter->fontMetrics() );
const int lenEM( axisLabelsFontMetrics.boundingRect("M").width() );
- const QStringList* labelTexts = para.axisLabelTexts();
+ const TQStringList* labelTexts = para.axisLabelTexts();
uint nLabels = ( 0 != labelTexts )
? labelTexts->count()
: 0;
int maxLabelsWidth = 0;
for ( uint i = 0; i < nLabels; ++i )
maxLabelsWidth =
- QMAX( maxLabelsWidth,
+ TQMAX( maxLabelsWidth,
axisLabelsFontMetrics.boundingRect(*labelTexts->at(i)).width() );
if( nUsableAxisWidth < maxLabelsWidth )
areaSize = maxLabelsWidth
@@ -2000,7 +2000,7 @@ void KDChartPainter::calculateAllAxesRects(
case KDChartAxisParams::AxisAreaModeFixedSize:
{
- areaSize = areaMax ? QMIN( areaMin, areaMax ) : areaMin;
+ areaSize = areaMax ? TQMIN( areaMin, areaMax ) : areaMin;
}
break;
}
@@ -2011,11 +2011,11 @@ void KDChartPainter::calculateAllAxesRects(
for( idx = 0; idx <= params()->maxCustomBoxIdx(); ++idx ) {
const KDChartCustomBox * box = params()->customBox( idx );
if ( box )
- if ( box->parentAxisArea() == KDChartAxisParams::AxisPosBottom
- || box->parentAxisArea() == KDChartAxisParams::AxisPosLeft
- || box->parentAxisArea() == KDChartAxisParams::AxisPosTop
- || box->parentAxisArea() == KDChartAxisParams::AxisPosRight )
- boxSize = box->trueRect(QPoint( 0,0 ), _areaWidthP1000, _areaHeightP1000 ).height();
+ if ( box->tqparentAxisArea() == KDChartAxisParams::AxisPosBottom
+ || box->tqparentAxisArea() == KDChartAxisParams::AxisPosLeft
+ || box->tqparentAxisArea() == KDChartAxisParams::AxisPosTop
+ || box->tqparentAxisArea() == KDChartAxisParams::AxisPosRight )
+ boxSize = box->trueRect(TQPoint( 0,0 ), _areaWidthP1000, _areaHeightP1000 ).height();
}
areaSize += boxSize;
@@ -2028,26 +2028,26 @@ void KDChartPainter::calculateAllAxesRects(
}
else{
// areaSize += boxSize;
- nAxesBottomADD = QMAX( nAxesBottomADD + boxSize, areaSize );
+ nAxesBottomADD = TQMAX( nAxesBottomADD + boxSize, areaSize );
}
break;
case KDChartAxisParams::AxisPosLeft:
if( bAddLeft )
nAxesLeftADD += areaSize;
else
- nAxesLeftADD = QMAX( nAxesLeftADD + boxSize, areaSize );
+ nAxesLeftADD = TQMAX( nAxesLeftADD + boxSize, areaSize );
break;
case KDChartAxisParams::AxisPosTop:
if( bAddTop )
nAxesTopADD += areaSize;
else
- nAxesTopADD = QMAX( nAxesTopADD + boxSize, areaSize );
+ nAxesTopADD = TQMAX( nAxesTopADD + boxSize, areaSize );
break;
case KDChartAxisParams::AxisPosRight:
if( bAddRight )
nAxesRightADD += areaSize;
else
- nAxesRightADD = QMAX( nAxesRightADD + boxSize, areaSize );
+ nAxesRightADD = TQMAX( nAxesRightADD + boxSize, areaSize );
break;
default:
break;
@@ -2061,16 +2061,16 @@ void KDChartPainter::calculateAllAxesRects(
}
int nMinDistance = static_cast < int > ( 30.0 * averageValueP1000 );
- int nAxesBottom = QMAX( nAxesBottom0 + nAxesBottomADD, nMinDistance );
+ int nAxesBottom = TQMAX( nAxesBottom0 + nAxesBottomADD, nMinDistance );
- // for micro alignment with the X axis, we adjust the Y axis - but not for Area Charts:
+ // for micro tqalignment with the X axis, we adjust the Y axis - but not for Area Charts:
// otherwise the areas drawn would overwrite the Y axis line.
- int nAxesLeft = QMAX( nAxesLeft0 + nAxesLeftADD, nMinDistance )
+ int nAxesLeft = TQMAX( nAxesLeft0 + nAxesLeftADD, nMinDistance )
- (bIsAreaChart ? 0 : 1);
- int nAxesTop = QMAX( nAxesTop0 + nAxesTopADD, nMinDistance );
+ int nAxesTop = TQMAX( nAxesTop0 + nAxesTopADD, nMinDistance );
- int nAxesRight = QMAX( nAxesRight0 + nAxesRightADD, nMinDistance );
+ int nAxesRight = TQMAX( nAxesRight0 + nAxesRightADD, nMinDistance );
int nBottom = params()->axisParams( KDChartAxisParams::AxisPosBottom ).axisTrueAreaSize();
int nLeft = params()->axisParams( KDChartAxisParams::AxisPosLeft ).axisTrueAreaSize();
@@ -2133,7 +2133,7 @@ void KDChartPainter::calculateAllAxesRects(
nRight2,
trueHeight - nAxesTop - nAxesBottom + 1 );
- _dataRect = QRect( _outermostRect.left() + nAxesLeft,
+ _dataRect = TQRect( _outermostRect.left() + nAxesLeft,
_outermostRect.top() + nAxesTop,
trueWidth - nAxesLeft - nAxesRight + 1,
trueHeight - nAxesTop - nAxesBottom + 1 );
@@ -2143,22 +2143,22 @@ void KDChartPainter::calculateAllAxesRects(
/**
This method will be called whenever any parameters that affect
- geometry have been changed. It will compute the appropriate
+ tqgeometry have been changed. It will compute the appropriate
positions for the various parts of the chart (legend, axes, data
area etc.). The implementation in KDChartPainter computes a
- standard geometry that should be suitable for most chart
+ standard tqgeometry that should be suitable for most chart
types. Subclasses can provide their own implementations.
\param data the data that will be displayed as a chart
\param drawRect the position and size of the area where the chart
is to be displayed in
*/
-void KDChartPainter::setupGeometry( QPainter* painter,
+void KDChartPainter::setupGeometry( TQPainter* painter,
KDChartTableDataBase* data,
- const QRect& drawRect )
+ const TQRect& drawRect )
{
//qDebug("INVOKING: KDChartPainter::setupGeometry()");
- // avoid recursion from repaint() being called due to params() changed signals...
+ // avoid recursion from tqrepaint() being called due to params() changed signals...
const bool oldBlockSignalsState = params()->signalsBlocked();
const_cast < KDChartParams* > ( params() )->blockSignals( true );
@@ -2191,8 +2191,8 @@ void KDChartPainter::setupGeometry( QPainter* painter,
? params()->globalLeadingBottom()
: static_cast < int > ( params()->globalLeadingBottom()* -_areaHeightP1000 );
- _innermostRect = QRect( QPoint(xposLeft, yposTop),
- QPoint(xposRight, yposBottom) );
+ _innermostRect = TQRect( TQPoint(xposLeft, yposTop),
+ TQPoint(xposRight, yposBottom) );
_logicalWidth = xposRight - xposLeft;
_logicalHeight = yposBottom - yposTop;
@@ -2202,7 +2202,7 @@ void KDChartPainter::setupGeometry( QPainter* painter,
_areaWidthP1000 = _logicalWidth / 1000.0;
_areaHeightP1000 = _logicalHeight / 1000.0;
- double averageValueP1000 = QMIN(_areaWidthP1000, _areaHeightP1000);//( _areaWidthP1000 + _areaHeightP1000 ) / 2.0;
+ double averageValueP1000 = TQMIN(_areaWidthP1000, _areaHeightP1000);//( _areaWidthP1000 + _areaHeightP1000 ) / 2.0;
// new code design:
// 1. now min-header-leading is text height/2
@@ -2238,9 +2238,9 @@ void KDChartPainter::setupGeometry( QPainter* painter,
delete _legendTitle;
_legendTitle = 0;
if ( hasLegendTitle ) {
- const QFont font( trueLegendTitleFont() );
+ const TQFont font( trueLegendTitleFont() );
painter->setFont( font );
- QFontMetrics legendTitleMetrics( painter->fontMetrics() );
+ TQFontMetrics legendTitleMetrics( painter->fontMetrics() );
_legendTitleMetricsHeight = legendTitleMetrics.height();
_legendTitle = new KDChartTextPiece( painter,
@@ -2252,7 +2252,7 @@ void KDChartPainter::setupGeometry( QPainter* painter,
}
painter->setFont( trueLegendFont() );
- QFontMetrics legendMetrics( painter->fontMetrics() );
+ TQFontMetrics legendMetrics( painter->fontMetrics() );
_legendSpacing = legendMetrics.lineSpacing();
_legendHeight = legendMetrics.height();
_legendLeading = legendMetrics.leading();
@@ -2263,7 +2263,7 @@ void KDChartPainter::setupGeometry( QPainter* painter,
int sizeY = 0;
for ( int dataset = 0; dataset < _numLegendTexts; dataset++ ) {
- sizeX = QMAX( sizeX, legendMetrics.width( _legendTexts[ dataset ] ) );
+ sizeX = TQMAX( sizeX, legendMetrics.width( _legendTexts[ dataset ] ) );
if( !_legendTexts[ dataset ].isEmpty() )
sizeY += _legendSpacing;
}
@@ -2282,13 +2282,13 @@ void KDChartPainter::setupGeometry( QPainter* painter,
// color box (where the title does not start yet, it is
// left-aligned with the color boxes) and after the title (to
// have some space before the boundary line comes).
- sizeX = QMAX( sizeX, _legendTitleWidth + _legendEMSpace*2 );
+ sizeX = TQMAX( sizeX, _legendTitleWidth + _legendEMSpace*2 );
//qDebug("setupGeometry mustDrawVerticalLegend: %s", mustDrawVerticalLegend() ? "YES":"NO ");
// PENDING Michel: do that after having calculated the position
if( !mustDrawVerticalLegend() ){
- QSize size;
+ TQSize size;
calculateHorizontalLegendSize( painter,
size,
_legendNewLinesStartAtLeft );
@@ -2299,8 +2299,8 @@ void KDChartPainter::setupGeometry( QPainter* painter,
switch ( params()->legendPosition() ) {
case KDChartParams::LegendTop:
if ( headerLineLeading )
- yposTop += QMAX( (int)params()->legendSpacing(), headerLineLeading );
- _legendRect = QRect( xposLeft + ( (xposRight-xposLeft) - sizeX ) / 2,
+ yposTop += TQMAX( (int)params()->legendSpacing(), headerLineLeading );
+ _legendRect = TQRect( xposLeft + ( (xposRight-xposLeft) - sizeX ) / 2,
yposTop, sizeX, sizeY );
yposTop = _legendRect.bottom() + params()->legendSpacing();
//qDebug("A: _legendRect:\n%i,%i\n%i,%i", _legendRect.left(),_legendRect.top(),_legendRect.right(),_legendRect.bottom() );
@@ -2308,7 +2308,7 @@ void KDChartPainter::setupGeometry( QPainter* painter,
case KDChartParams::LegendBottom:
if ( params()->showGrid() )
yposTop += headerLineLeading;
- _legendRect = QRect( xposLeft + ( (xposRight-xposLeft) - sizeX ) / 2,
+ _legendRect = TQRect( xposLeft + ( (xposRight-xposLeft) - sizeX ) / 2,
yposBottom - sizeY,
sizeX, sizeY );
yposBottom = _legendRect.top() - params()->legendSpacing();
@@ -2316,7 +2316,7 @@ void KDChartPainter::setupGeometry( QPainter* painter,
case KDChartParams::LegendLeft:
if ( params()->showGrid() )
yposTop += headerLineLeading;
- _legendRect = QRect( xposLeft + 1, ( yposBottom - yposTop - sizeY ) / 2 +
+ _legendRect = TQRect( xposLeft + 1, ( yposBottom - yposTop - sizeY ) / 2 +
yposTop,
sizeX, sizeY );
xposLeft = _legendRect.right() + params()->legendSpacing();
@@ -2324,75 +2324,75 @@ void KDChartPainter::setupGeometry( QPainter* painter,
case KDChartParams::LegendRight:
if ( params()->showGrid() )
yposTop += headerLineLeading;
- _legendRect = QRect( xposRight - sizeX - 1,
+ _legendRect = TQRect( xposRight - sizeX - 1,
( yposBottom - yposTop - sizeY ) / 2 + yposTop,
sizeX, sizeY );
xposRight = _legendRect.left() - params()->legendSpacing();
break;
case KDChartParams::LegendTopLeft:
if ( headerLineLeading )
- yposTop += QMAX( (int)params()->legendSpacing(), headerLineLeading );
- _legendRect = QRect( xposLeft + 1, yposTop, sizeX, sizeY );
+ yposTop += TQMAX( (int)params()->legendSpacing(), headerLineLeading );
+ _legendRect = TQRect( xposLeft + 1, yposTop, sizeX, sizeY );
yposTop = _legendRect.bottom() + params()->legendSpacing();
xposLeft = _legendRect.right() + params()->legendSpacing();
break;
case KDChartParams::LegendTopLeftTop:
if ( headerLineLeading )
- yposTop += QMAX( (int)params()->legendSpacing(), headerLineLeading );
- _legendRect = QRect( xposLeft + 1, yposTop, sizeX, sizeY );
+ yposTop += TQMAX( (int)params()->legendSpacing(), headerLineLeading );
+ _legendRect = TQRect( xposLeft + 1, yposTop, sizeX, sizeY );
yposTop = _legendRect.bottom() + params()->legendSpacing();
break;
case KDChartParams::LegendTopLeftLeft:
if ( headerLineLeading )
- yposTop += QMAX( (int)params()->legendSpacing(), headerLineLeading );
- _legendRect = QRect( xposLeft + 1, yposTop, sizeX, sizeY );
+ yposTop += TQMAX( (int)params()->legendSpacing(), headerLineLeading );
+ _legendRect = TQRect( xposLeft + 1, yposTop, sizeX, sizeY );
xposLeft = _legendRect.right() + params()->legendSpacing();
break;
case KDChartParams::LegendTopRight:
if ( headerLineLeading )
- yposTop += QMAX( (int)params()->legendSpacing(), headerLineLeading );
- _legendRect = QRect( xposRight - sizeX - 1,
+ yposTop += TQMAX( (int)params()->legendSpacing(), headerLineLeading );
+ _legendRect = TQRect( xposRight - sizeX - 1,
yposTop, sizeX, sizeY );
yposTop = _legendRect.bottom() + params()->legendSpacing();
xposRight = _legendRect.left() - params()->legendSpacing();
break;
case KDChartParams::LegendTopRightTop:
if ( headerLineLeading )
- yposTop += QMAX( (int)params()->legendSpacing(), headerLineLeading );
- _legendRect = QRect( xposRight - sizeX - 1,
+ yposTop += TQMAX( (int)params()->legendSpacing(), headerLineLeading );
+ _legendRect = TQRect( xposRight - sizeX - 1,
yposTop, sizeX, sizeY );
yposTop = _legendRect.bottom() + params()->legendSpacing();
break;
case KDChartParams::LegendTopRightRight:
if ( headerLineLeading )
- yposTop += QMAX( (int)params()->legendSpacing(), headerLineLeading );
- _legendRect = QRect( xposRight - sizeX - 1,
+ yposTop += TQMAX( (int)params()->legendSpacing(), headerLineLeading );
+ _legendRect = TQRect( xposRight - sizeX - 1,
yposTop, sizeX, sizeY );
xposRight = _legendRect.left() - params()->legendSpacing();
break;
case KDChartParams::LegendBottomLeft:
if ( params()->showGrid() )
yposTop += headerLineLeading;
- _legendRect = QRect( xposLeft + 1, yposBottom - sizeY, sizeX, sizeY );
+ _legendRect = TQRect( xposLeft + 1, yposBottom - sizeY, sizeX, sizeY );
yposBottom = _legendRect.top() - params()->legendSpacing();
xposLeft = _legendRect.right() + params()->legendSpacing();
break;
case KDChartParams::LegendBottomLeftBottom:
if ( params()->showGrid() )
yposTop += headerLineLeading;
- _legendRect = QRect( xposLeft + 1, yposBottom - sizeY, sizeX, sizeY );
+ _legendRect = TQRect( xposLeft + 1, yposBottom - sizeY, sizeX, sizeY );
yposBottom = _legendRect.top() - params()->legendSpacing();
break;
case KDChartParams::LegendBottomLeftLeft:
if ( params()->showGrid() )
yposTop += headerLineLeading;
- _legendRect = QRect( xposLeft + 1, yposBottom - sizeY, sizeX, sizeY );
+ _legendRect = TQRect( xposLeft + 1, yposBottom - sizeY, sizeX, sizeY );
xposLeft = _legendRect.right() + params()->legendSpacing();
break;
case KDChartParams::LegendBottomRight:
if ( params()->showGrid() )
yposTop += headerLineLeading;
- _legendRect = QRect( xposRight - sizeX - 1,
+ _legendRect = TQRect( xposRight - sizeX - 1,
yposBottom - sizeY, sizeX, sizeY );
yposBottom = _legendRect.top() - params()->legendSpacing();
xposRight = _legendRect.left() - params()->legendSpacing();
@@ -2400,14 +2400,14 @@ void KDChartPainter::setupGeometry( QPainter* painter,
case KDChartParams::LegendBottomRightBottom:
if ( params()->showGrid() )
yposTop += headerLineLeading;
- _legendRect = QRect( xposRight - sizeX - 1,
+ _legendRect = TQRect( xposRight - sizeX - 1,
yposBottom - sizeY, sizeX, sizeY );
yposBottom = _legendRect.top() - params()->legendSpacing();
break;
case KDChartParams::LegendBottomRightRight:
if ( params()->showGrid() )
yposTop += headerLineLeading;
- _legendRect = QRect( xposRight - sizeX - 1,
+ _legendRect = TQRect( xposRight - sizeX - 1,
yposBottom - sizeY, sizeX, sizeY );
xposRight = _legendRect.left() - params()->legendSpacing();
break;
@@ -2418,11 +2418,11 @@ void KDChartPainter::setupGeometry( QPainter* painter,
_params->setLegendArea( _legendRect );
}else{
- _params->setLegendArea( QRect(QPoint(0,0), QSize(0,0)) );
+ _params->setLegendArea( TQRect(TQPoint(0,0), TQSize(0,0)) );
}
- _axesRect = QRect( QPoint(xposLeft, yposTop), QPoint(xposRight, yposBottom) );
+ _axesRect = TQRect( TQPoint(xposLeft, yposTop), TQPoint(xposRight, yposBottom) );
// important rule: do *not* calculate axes areas for Polar charts!
// (even if left and bottom axes might be set active)
@@ -2458,7 +2458,7 @@ void KDChartPainter::setupGeometry( QPainter* painter,
void KDChartPainter::findLegendTexts( KDChartTableDataBase* data )
{
uint dataset;
- QVariant vValY;
+ TQVariant vValY;
switch ( params()->legendSource() ) {
case KDChartParams::LegendManual: {
// The easiest case: Take manually set strings, no matter whether any
@@ -2472,7 +2472,7 @@ void KDChartPainter::findLegendTexts( KDChartTableDataBase* data )
// Take whatever is in the first column
for ( dataset = 0; dataset < data->usedRows(); dataset++ ){
if( data->cellCoord( dataset, 0, vValY, 1 ) ){
- if( QVariant::String == vValY.type() )
+ if( TQVariant::String == vValY.type() )
_legendTexts[ dataset ] = vValY.toString();
else
_legendTexts[ dataset ] = "";
@@ -2488,7 +2488,7 @@ void KDChartPainter::findLegendTexts( KDChartTableDataBase* data )
// code below
for ( dataset = 0; dataset < data->usedRows(); dataset++ ) {
if( data->cellCoord( dataset, 0, vValY, 1 ) ){
- if( QVariant::String == vValY.type() )
+ if( TQVariant::String == vValY.type() )
_legendTexts[ dataset ] = vValY.toString();
else
_legendTexts[ dataset ] = "";
@@ -2537,9 +2537,9 @@ void KDChartPainter::findLegendTexts( KDChartTableDataBase* data )
\return the fallback text to use for describing the specified
dataset in the legend
*/
-QString KDChartPainter::fallbackLegendText( uint dataset ) const
+TQString KDChartPainter::fallbackLegendText( uint dataset ) const
{
- return QObject::tr( "Series " ) + QString::number( dataset + 1 );
+ return TQObject::tr( "Series " ) + TQString::number( dataset + 1 );
}
@@ -2570,11 +2570,11 @@ uint KDChartPainter::numLegendFallbackTexts( KDChartTableDataBase* data ) const
\param p the center of the marker
\param size the width and height of the marker: both values must be positive.
*/
-void KDChartPainter::drawMarker( QPainter* painter,
+void KDChartPainter::drawMarker( TQPainter* painter,
int style,
- const QColor& color,
- const QPoint& p,
- const QSize& size,
+ const TQColor& color,
+ const TQPoint& p,
+ const TQSize& size,
uint align )
{
int width = size.width();
@@ -2609,15 +2609,15 @@ void KDChartPainter::drawMarker( QPainter* painter,
\return pointer to the KDChartDataRegion that was appended to the regions list,
or zero if if parameter regions was zero
*/
-KDChartDataRegion* KDChartPainter::drawMarker( QPainter* painter,
+KDChartDataRegion* KDChartPainter::drawMarker( TQPainter* painter,
const KDChartParams* params,
double areaWidthP1000,
double areaHeightP1000,
int deltaX,
int deltaY,
int style,
- const QColor& color,
- const QPoint& _p,
+ const TQColor& color,
+ const TQPoint& _p,
uint dataset, uint value, uint chart,
KDChartDataRegionList* regions,
int* width,
@@ -2625,7 +2625,7 @@ KDChartDataRegion* KDChartPainter::drawMarker( QPainter* painter,
uint align )
{
KDChartDataRegion* datReg = 0;
- const double areaSizeP1000 = QMIN(areaWidthP1000, areaHeightP1000);
+ const double areaSizeP1000 = TQMIN(areaWidthP1000, areaHeightP1000);
int xsize = width ? *width : (params ? params->lineMarkerSize().width() : 12);
if( 0 > xsize )
xsize = static_cast < int > (xsize * -areaSizeP1000);
@@ -2633,8 +2633,8 @@ KDChartDataRegion* KDChartPainter::drawMarker( QPainter* painter,
if( 0 > ysize )
ysize = static_cast < int > (ysize * -areaSizeP1000);
if( KDChartParams::LineMarkerCross != style ){
- xsize = QMAX( xsize, 4 );
- ysize = QMAX( ysize, 4 );
+ xsize = TQMAX( xsize, 4 );
+ ysize = TQMAX( ysize, 4 );
}
uint xsize2 = xsize / 2;
uint ysize2 = ysize / 2;
@@ -2643,27 +2643,27 @@ KDChartDataRegion* KDChartPainter::drawMarker( QPainter* painter,
uint xsize6 = xsize / 6;
uint ysize6 = ysize / 6;
painter->setPen( color );
- const uint xysize2 = QMIN( xsize2, ysize2 );
+ const uint xysize2 = TQMIN( xsize2, ysize2 );
int x = _p.x();
int y = _p.y();
- if( align & Qt::AlignLeft )
+ if( align & TQt::AlignLeft )
x += xsize2;
- else if( align & Qt::AlignRight )
+ else if( align & TQt::AlignRight )
x -= xsize2;
- if( align & Qt::AlignTop )
+ if( align & TQt::AlignTop )
y += ysize2;
- else if( align & Qt::AlignBottom )
+ else if( align & TQt::AlignBottom )
y -= ysize2;
- const QPoint p(x, y);
+ const TQPoint p(x, y);
switch ( style ) {
case KDChartParams::LineMarkerSquare: {
- const QPen oldPen( painter->pen() );
- const QBrush oldBrush( painter->brush() );
+ const TQPen oldPen( painter->pen() );
+ const TQBrush oldBrush( painter->brush() );
painter->setBrush( color );
painter->setPen( color );
- QRect rect( QPoint( p.x() - xsize2, p.y() - ysize2 ), QPoint( p.x() + xsize2, p.y() + ysize2 ) );
+ TQRect rect( TQPoint( p.x() - xsize2, p.y() - ysize2 ), TQPoint( p.x() + xsize2, p.y() + ysize2 ) );
painter->drawRect( rect );
// Don't use rect for drawing after this!
rect.moveBy( deltaX, deltaY );
@@ -2679,9 +2679,9 @@ KDChartDataRegion* KDChartPainter::drawMarker( QPainter* painter,
break;
}
case KDChartParams::LineMarkerDiamond:{
- const QBrush oldBrush( painter->brush() );
+ const TQBrush oldBrush( painter->brush() );
painter->setBrush( color );
- QPointArray points( 4 );
+ TQPointArray points( 4 );
points.setPoint( 0, p.x() - xsize2, p.y() );
points.setPoint( 1, p.x(), p.y() - ysize2 );
points.setPoint( 2, p.x() + xsize2, p.y() );
@@ -2699,7 +2699,7 @@ KDChartDataRegion* KDChartPainter::drawMarker( QPainter* painter,
break;
}
case KDChartParams::LineMarker1Pixel: {
- QRect rect( p, p );
+ TQRect rect( p, p );
painter->drawRect( rect );
// Don't use rect for drawing after this!
rect.moveBy( deltaX, deltaY );
@@ -2712,7 +2712,7 @@ KDChartDataRegion* KDChartPainter::drawMarker( QPainter* painter,
break;
}
case KDChartParams::LineMarker4Pixels:{
- QRect rect( p, QPoint( p.x()+1, p.y()+1 ) );
+ TQRect rect( p, TQPoint( p.x()+1, p.y()+1 ) );
painter->drawRect( rect );
// Don't use rect for drawing after this!
rect.moveBy( deltaX, deltaY );
@@ -2725,13 +2725,13 @@ KDChartDataRegion* KDChartPainter::drawMarker( QPainter* painter,
break;
}
case KDChartParams::LineMarkerRing: {
- const QPen oldPen( painter->pen() );
- painter->setPen( QPen( color, QMIN(xsize4, ysize4) ) );
- const QBrush oldBrush( painter->brush() );
- painter->setBrush( Qt::NoBrush );
+ const TQPen oldPen( painter->pen() );
+ painter->setPen( TQPen( color, TQMIN(xsize4, ysize4) ) );
+ const TQBrush oldBrush( painter->brush() );
+ painter->setBrush( TQt::NoBrush );
painter->drawEllipse( p.x() - xsize2, p.y() - ysize2, xsize, ysize );
if ( regions ) {
- QPointArray points;
+ TQPointArray points;
points.makeEllipse( p.x() - xsize2, p.y() - ysize2, xsize, ysize );
// Don't use points for drawing after this!
points.translate( deltaX, deltaY );
@@ -2747,12 +2747,12 @@ KDChartDataRegion* KDChartPainter::drawMarker( QPainter* painter,
break;
}
case KDChartParams::LineMarkerCross: {
- const QPen oldPen( painter->pen() );
+ const TQPen oldPen( painter->pen() );
painter->setPen( color );
- const QBrush oldBrush( painter->brush() );
+ const TQBrush oldBrush( painter->brush() );
painter->setBrush( color );
int numPoints = (ysize && xsize) ? 12 : 4;
- QPointArray points( numPoints );
+ TQPointArray points( numPoints );
if( ysize && xsize ){
points.setPoint( 0, p.x() - xsize6, p.y() - ysize6 );
points.setPoint( 1, p.x() - xsize6, p.y() - ysize2 );
@@ -2791,14 +2791,14 @@ KDChartDataRegion* KDChartPainter::drawMarker( QPainter* painter,
break;
}
case KDChartParams::LineMarkerFastCross: {
- const QPen oldPen( painter->pen() );
+ const TQPen oldPen( painter->pen() );
painter->setPen( color );
- painter->drawLine( QPoint(p.x() - xysize2, p.y()),
- QPoint(p.x() + xysize2, p.y()) );
- painter->drawLine( QPoint(p.x(), p.y() - xysize2),
- QPoint(p.x(), p.y() + xysize2) );
- QRect rect( QPoint( p.x() - 2, p.y() - 2 ),
- QPoint( p.x() + 2, p.y() + 2 ) );
+ painter->drawLine( TQPoint(p.x() - xysize2, p.y()),
+ TQPoint(p.x() + xysize2, p.y()) );
+ painter->drawLine( TQPoint(p.x(), p.y() - xysize2),
+ TQPoint(p.x(), p.y() + xysize2) );
+ TQRect rect( TQPoint( p.x() - 2, p.y() - 2 ),
+ TQPoint( p.x() + 2, p.y() + 2 ) );
// Don't use rect for drawing after this!
rect.moveBy( deltaX, deltaY );
if ( regions ){
@@ -2813,11 +2813,11 @@ KDChartDataRegion* KDChartPainter::drawMarker( QPainter* painter,
}
case KDChartParams::LineMarkerCircle:
default: {
- const QBrush oldBrush( painter->brush() );
+ const TQBrush oldBrush( painter->brush() );
painter->setBrush( color );
painter->drawEllipse( p.x() - xsize2, p.y() - ysize2, xsize, ysize );
if ( regions ) {
- QPointArray points;
+ TQPointArray points;
points.makeEllipse( p.x() - xsize2, p.y() - ysize2, xsize, ysize );
// Don't use points for drawing after this!
points.translate( deltaX, deltaY );
@@ -2837,11 +2837,11 @@ KDChartDataRegion* KDChartPainter::drawMarker( QPainter* painter,
void KDChartPainter::drawExtraLinesAndMarkers(
KDChartPropertySet& propSet,
- const QPen& defaultPen,
+ const TQPen& defaultPen,
const KDChartParams::LineMarkerStyle& defaultMarkerStyle,
int myPointX,
int myPointY,
- QPainter* painter,
+ TQPainter* painter,
const KDChartAxisParams* abscissaPara,
const KDChartAxisParams* ordinatePara,
const double areaWidthP1000,
@@ -2851,20 +2851,20 @@ void KDChartPainter::drawExtraLinesAndMarkers(
// we can safely call the following functions and ignore their
// return values since they will touch the parameters' values
- // if the propSet *contains* corresponding own values only.
+ // if the propSet *tqcontains* corresponding own values only.
int iDummy;
uint extraLinesAlign = 0;
if( propSet.hasOwnExtraLinesAlign( iDummy, extraLinesAlign )
&& ( extraLinesAlign
- & ( Qt::AlignLeft | Qt::AlignRight | Qt::AlignHCenter |
- Qt::AlignTop | Qt::AlignBottom | Qt::AlignVCenter ) ) ){
+ & ( TQt::AlignLeft | TQt::AlignRight | TQt::AlignHCenter |
+ TQt::AlignTop | TQt::AlignBottom | TQt::AlignVCenter ) ) ){
bool extraLinesInFront = false;
propSet.hasOwnExtraLinesInFront( iDummy, extraLinesInFront );
if( bDrawInFront == extraLinesInFront ){
- const double areaSizeP1000 = QMIN(areaWidthP1000, areaHeightP1000);
+ const double areaSizeP1000 = TQMIN(areaWidthP1000, areaHeightP1000);
int extraLinesLength = -20;
int extraLinesWidth = defaultPen.width();
- QColor extraLinesColor = defaultPen.color();
+ TQColor extraLinesColor = defaultPen.color();
Qt::PenStyle extraLinesStyle = defaultPen.style();
uint extraMarkersAlign = 0;
propSet.hasOwnExtraLinesLength( iDummy, extraLinesLength );
@@ -2878,49 +2878,49 @@ void KDChartPainter::drawExtraLinesAndMarkers(
? static_cast<int>(areaHeightP1000 * extraLinesLength) / 2
: extraLinesLength / 2;
// draw the extra line(s)
- QPoint pL( (Qt::AlignLeft == (extraLinesAlign & Qt::AlignLeft))
+ TQPoint pL( (TQt::AlignLeft == (extraLinesAlign & TQt::AlignLeft))
? 0
- : (Qt::AlignHCenter == (extraLinesAlign & Qt::AlignHCenter))
+ : (TQt::AlignHCenter == (extraLinesAlign & TQt::AlignHCenter))
? myPointX - horiLenP2
: myPointX,
myPointY );
- QPoint pR( (Qt::AlignRight == (extraLinesAlign & Qt::AlignRight))
+ TQPoint pR( (TQt::AlignRight == (extraLinesAlign & TQt::AlignRight))
? abscissaPara->axisTrueAreaRect().width()
- : (Qt::AlignHCenter == (extraLinesAlign & Qt::AlignHCenter))
+ : (TQt::AlignHCenter == (extraLinesAlign & TQt::AlignHCenter))
? myPointX + horiLenP2
: myPointX,
myPointY );
- QPoint pT( myPointX,
- (Qt::AlignTop == (extraLinesAlign & Qt::AlignTop))
+ TQPoint pT( myPointX,
+ (TQt::AlignTop == (extraLinesAlign & TQt::AlignTop))
? 0
- : (Qt::AlignVCenter == (extraLinesAlign & Qt::AlignVCenter))
+ : (TQt::AlignVCenter == (extraLinesAlign & TQt::AlignVCenter))
? myPointY - vertLenP2
: myPointY );
- QPoint pB( myPointX,
- (Qt::AlignBottom == (extraLinesAlign & Qt::AlignBottom))
+ TQPoint pB( myPointX,
+ (TQt::AlignBottom == (extraLinesAlign & TQt::AlignBottom))
? ordinatePara->axisTrueAreaRect().height()
- : (Qt::AlignVCenter == (extraLinesAlign & Qt::AlignVCenter))
+ : (TQt::AlignVCenter == (extraLinesAlign & TQt::AlignVCenter))
? myPointY + vertLenP2
: myPointY );
- const QPen extraPen( extraLinesColor,
+ const TQPen extraPen( extraLinesColor,
0 > extraLinesWidth
? static_cast < int > ( areaSizeP1000 * -extraLinesWidth )
: extraLinesWidth,
extraLinesStyle );
- const QPen oldPen( painter->pen() );
+ const TQPen oldPen( painter->pen() );
painter->setPen( extraPen );
- if( extraLinesAlign & ( Qt::AlignLeft | Qt::AlignRight | Qt::AlignHCenter ) )
+ if( extraLinesAlign & ( TQt::AlignLeft | TQt::AlignRight | TQt::AlignHCenter ) )
painter->drawLine( pL, pR );
- if( extraLinesAlign & ( Qt::AlignTop | Qt::AlignBottom | Qt::AlignVCenter ) )
+ if( extraLinesAlign & ( TQt::AlignTop | TQt::AlignBottom | TQt::AlignVCenter ) )
painter->drawLine( pT, pB );
painter->setPen( oldPen );
// draw the marker(s) of the extra line(s)
propSet.hasOwnExtraMarkersAlign( iDummy, extraMarkersAlign );
if( extraMarkersAlign
- & ( Qt::AlignLeft | Qt::AlignRight |
- Qt::AlignTop | Qt::AlignBottom ) ){
- QSize extraMarkersSize = params()->lineMarkerSize();
- QColor extraMarkersColor = extraLinesColor;
+ & ( TQt::AlignLeft | TQt::AlignRight |
+ TQt::AlignTop | TQt::AlignBottom ) ){
+ TQSize extraMarkersSize = params()->lineMarkerSize();
+ TQColor extraMarkersColor = extraLinesColor;
int extraMarkersStyle = defaultMarkerStyle;
propSet.hasOwnExtraMarkersSize( iDummy, extraMarkersSize );
propSet.hasOwnExtraMarkersColor( iDummy, extraMarkersColor );
@@ -2932,7 +2932,7 @@ void KDChartPainter::drawExtraLinesAndMarkers(
w = static_cast < int > (w * -areaSizeP1000);
if( h < 0 )
h = static_cast < int > (h * -areaSizeP1000);
- if( extraMarkersAlign & Qt::AlignLeft )
+ if( extraMarkersAlign & TQt::AlignLeft )
drawMarker( painter,
params(),
_areaWidthP1000, _areaHeightP1000,
@@ -2942,8 +2942,8 @@ void KDChartPainter::drawExtraLinesAndMarkers(
pL,
0, 0, 0, 0,
&w, &h,
- Qt::AlignCenter );
- if( extraMarkersAlign & Qt::AlignRight )
+ TQt::AlignCenter );
+ if( extraMarkersAlign & TQt::AlignRight )
drawMarker( painter,
params(),
_areaWidthP1000, _areaHeightP1000,
@@ -2953,8 +2953,8 @@ void KDChartPainter::drawExtraLinesAndMarkers(
pR,
0, 0, 0, 0,
&w, &h,
- Qt::AlignCenter );
- if( extraMarkersAlign & Qt::AlignTop )
+ TQt::AlignCenter );
+ if( extraMarkersAlign & TQt::AlignTop )
drawMarker( painter,
params(),
_areaWidthP1000, _areaHeightP1000,
@@ -2964,8 +2964,8 @@ void KDChartPainter::drawExtraLinesAndMarkers(
pT,
0, 0, 0, 0,
&w, &h,
- Qt::AlignCenter );
- if( extraMarkersAlign & Qt::AlignBottom )
+ TQt::AlignCenter );
+ if( extraMarkersAlign & TQt::AlignBottom )
drawMarker( painter,
params(),
_areaWidthP1000, _areaHeightP1000,
@@ -2975,7 +2975,7 @@ void KDChartPainter::drawExtraLinesAndMarkers(
pB,
0, 0, 0, 0,
&w, &h,
- Qt::AlignCenter );
+ TQt::AlignCenter );
}
}
}