Drop use of COMPAT_TQT_VERSION define

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit fded561239)
r14.1.x
Michele Calgaro 1 year ago
parent f25aee7b80
commit 75cc9de8f4
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -78,39 +78,6 @@ KDChartAxesPainter::~KDChartAxesPainter()
} }
#if COMPAT_TQT_VERSION < 0x030000
TQDateTime dateTimeFromString( const TQString& s ) // only ISODate is allowed
{
int year( s.mid( 0, 4 ).toInt() );
int month( s.mid( 5, 2 ).toInt() );
int day( s.mid( 8, 2 ).toInt() );
TQString t( s.mid( 11 ) );
int hour( t.mid( 0, 2 ).toInt() );
int minute( t.mid( 3, 2 ).toInt() );
int second( t.mid( 6, 2 ).toInt() );
int msec( t.mid( 9, 3 ).toInt() );
if ( year && month && day )
return TQDateTime( TQDate( year, month, day ),
TQTime( hour, minute, second, msec ) );
else
return TQDateTime();
}
TQString dateTimeToString( const TQDateTime& dt ) // ISODate is returned
{
TQString date;
TQString month(
TQString::number( dt.date().month() ).rightJustify( 2, '0' ) );
TQString day(
TQString::number( dt.date().day() ).rightJustify( 2, '0' ) );
date = TQString::number( dt.date().year() ) + "-" + month + "-" + day;
TQString time;
time.sprintf( "%.2d:%.2d:%.2d",
dt.time().hour(), dt.time().minute(), dt.time().second() );
return date + "T" + time;
}
#endif
/** /**
ReCalculate the labels based upon given nDelta and nDeltaPix. ReCalculate the labels based upon given nDelta and nDeltaPix.
@ -572,11 +539,7 @@ void KDChartAxesPainter::paintAxes( TQPainter* painter,
if( sameDay ){ if( sameDay ){
commonDtHeader = TQString::number( dLow.day() ) commonDtHeader = TQString::number( dLow.day() )
+ ". " + ". "
#if COMPAT_TQT_VERSION >= 0x030000
+ TQDate::longMonthName( dLow.month() ) + TQDate::longMonthName( dLow.month() )
#else
+ dLow.monthName( dLow.month() )
#endif
+ ' ' + ' '
+ TQString::number( dLow.year() ); + TQString::number( dLow.year() );
if( sameHour ){ if( sameHour ){
@ -609,11 +572,7 @@ void KDChartAxesPainter::paintAxes( TQPainter* painter,
commonDtHeader += "00"; commonDtHeader += "00";
} }
}else if( sameMonth ) }else if( sameMonth )
#if COMPAT_TQT_VERSION >= 0x030000
commonDtHeader = TQDate::longMonthName( dLow.month() ) commonDtHeader = TQDate::longMonthName( dLow.month() )
#else
commonDtHeader = dLow.monthName( dLow.month() )
#endif
+ ' ' + ' '
+ TQString::number( dLow.year() ); + TQString::number( dLow.year() );
else if( sameYear ) else if( sameYear )
@ -684,14 +643,9 @@ void KDChartAxesPainter::paintAxes( TQPainter* painter,
TQString text; TQString text;
if( cv.isDateTime ){ if( cv.isDateTime ){
#if COMPAT_TQT_VERSION >= 0x030000
TQDateTime dt( TQDateTime::fromString( *it, TQDateTime dt( TQDateTime::fromString( *it,
Qt::ISODate ) ); Qt::ISODate ) );
text = dt.toString( formatDT ); text = dt.toString( formatDT );
#else
TQDateTime dt( dateTimeFromString( *it ) );
text = dt.toString();
#endif
}else{ }else{
text = *it; text = *it;
} }
@ -1685,14 +1639,9 @@ void KDChartAxesPainter::paintAxes( TQPainter* painter,
++labelIter ) { ++labelIter ) {
TQDateTime dt; TQDateTime dt;
if( cv.isDateTime ){ if( cv.isDateTime ){
#if COMPAT_TQT_VERSION >= 0x030000
dt = TQDateTime::fromString( *labelIter, dt = TQDateTime::fromString( *labelIter,
Qt::ISODate ); Qt::ISODate );
label = dt.toString( formatDT ); label = dt.toString( formatDT );
#else
dt = dateTimeFromString( *labelIter );
label = dt.toString();
#endif
}else{ }else{
label = *labelIter; label = *labelIter;
} }
@ -3277,11 +3226,7 @@ void KDChartAxesPainter::calculateLabelTexts(
if( autoDtLabels ) if( autoDtLabels )
labelTexts.append( "x" ); labelTexts.append( "x" );
else else
#if COMPAT_TQT_VERSION >= 0x030000
labelTexts.append( dt.toString( Qt::ISODate ) ); labelTexts.append( dt.toString( Qt::ISODate ) );
#else
labelTexts.append( dateTimeToString( dt ) );
#endif
bDone = (goDown ? (dt < dtLow ) : (dt > dtHigh)); bDone = (goDown ? (dt < dtLow ) : (dt > dtHigh));
/*if( bDone ){ /*if( bDone ){
dtHigh = dt; dtHigh = dt;
@ -4425,12 +4370,7 @@ void KDChartAxesPainter::paintData( TQPainter* painter,
//ourClipRect.setRight( ourClipRect.right() - 1 ); //ourClipRect.setRight( ourClipRect.right() - 1 );
const TQWMatrix & world = painter->worldMatrix(); const TQWMatrix & world = painter->worldMatrix();
ourClipRect = ourClipRect = world.mapRect( ourClipRect );
#if COMPAT_TQT_VERSION >= 0x030000
world.mapRect( ourClipRect );
#else
world.map( ourClipRect );
#endif
painter->setClipRect( ourClipRect ); painter->setClipRect( ourClipRect );
painter->translate( _dataRect.x(), _dataRect.y() ); painter->translate( _dataRect.x(), _dataRect.y() );

@ -58,25 +58,9 @@
#endif #endif
#endif #endif
// --- new format since TQt 3.0.0 or since 3.0.4 ???
#ifndef COMPAT_TQT_VERSION
#if defined(_MSC_VER)
#pragma message( "using TQt > 2.3.2" )
#endif
//#define COMPAT_TQT_VERSION [[[TQT_VERSION IS DEPRECATED]]]
#define COMPAT_TQT_VERSION 0x039999
#endif
// since TQt 3.1 they do /not/ include limits.h or climits on windows anymore
// so we must include that manually
#if COMPAT_TQT_VERSION > 0x030099
#if defined(_MSC_VER) #if defined(_MSC_VER)
#include <climits> #include <climits>
#endif #endif
#endif
#include <tqmemarray.h> #include <tqmemarray.h>
#include <tqptrlist.h> #include <tqptrlist.h>

@ -113,13 +113,7 @@ KDChartParams::KDChartParams()
_printDataValuesSettings2._dataValuesShowInfinite = true; _printDataValuesSettings2._dataValuesShowInfinite = true;
setAllowOverlappingDataValueTexts( false ); setAllowOverlappingDataValueTexts( false );
#if COMPAT_TQT_VERSION >= 0x030100
setOptimizeOutputForScreen( false ); setOptimizeOutputForScreen( false );
#else
setOptimizeOutputForScreen( true );
#endif
setGlobalLeading( 0,0,0,0 ); setGlobalLeading( 0,0,0,0 );

@ -90,13 +90,7 @@ void KDChartPiePainter::paintData( TQPainter* painter,
ourClipRect.addCoords( -1,-1,1,1 ); ourClipRect.addCoords( -1,-1,1,1 );
const TQWMatrix & world = painter->worldMatrix(); const TQWMatrix & world = painter->worldMatrix();
ourClipRect = ourClipRect = world.mapRect( ourClipRect );
#if COMPAT_TQT_VERSION >= 0x030000
world.mapRect( ourClipRect );
#else
world.map( ourClipRect );
#endif
painter->setClipRect( ourClipRect ); painter->setClipRect( ourClipRect );
// find which dataset to paint // find which dataset to paint

@ -90,13 +90,7 @@ void KDChartPolarPainter::paintData( TQPainter* painter,
// //
const TQWMatrix & world = painter->worldMatrix(); const TQWMatrix & world = painter->worldMatrix();
ourClipRect = ourClipRect = world.mapRect( ourClipRect );
#if COMPAT_TQT_VERSION >= 0x030000
world.mapRect( ourClipRect );
#else
world.map( ourClipRect );
#endif
painter->setClipRect( ourClipRect ); painter->setClipRect( ourClipRect );

@ -85,13 +85,7 @@ void KDChartRingPainter::paintData( TQPainter* painter,
TQRect ourClipRect( _dataRect ); TQRect ourClipRect( _dataRect );
const TQWMatrix & world = painter->worldMatrix(); const TQWMatrix & world = painter->worldMatrix();
ourClipRect = ourClipRect = world.mapRect( ourClipRect );
#if COMPAT_TQT_VERSION >= 0x030000
world.mapRect( ourClipRect );
#else
world.map( ourClipRect );
#endif
ourClipRect.setTop(ourClipRect.top()-1); ourClipRect.setTop(ourClipRect.top()-1);
ourClipRect.setLeft(ourClipRect.left()-1); ourClipRect.setLeft(ourClipRect.left()-1);
ourClipRect.setBottom(ourClipRect.bottom()+1); ourClipRect.setBottom(ourClipRect.bottom()+1);

@ -33,15 +33,8 @@
#include <KDChartGlobal.h> #include <KDChartGlobal.h>
#include <KDChartListTable.h> #include <KDChartListTable.h>
#if COMPAT_TQT_VERSION >= 0x030000
#include <KDChartVectorTable.h> #include <KDChartVectorTable.h>
#endif
#if COMPAT_TQT_VERSION >= 0x030000
typedef KDChartVectorTableData KDChartTableData; typedef KDChartVectorTableData KDChartTableData;
#else
typedef KDChartListTableData KDChartTableData;
#endif
#endif #endif

@ -68,12 +68,7 @@ double KDChartVectorSeries::maxValue( int coordinate, bool &ok ) const
double maxValue = 0.0; double maxValue = 0.0;
bool bStart = true; bool bStart = true;
#if COMPAT_TQT_VERSION >= 0x030000
KDChartVectorSeries::const_iterator i; KDChartVectorSeries::const_iterator i;
#else
KDChartVectorSeries::ConstIterator i;
#endif
for ( i = begin(); i != end(); i ++ ) for ( i = begin(); i != end(); i ++ )
{ {
const KDChartData& d = *i; const KDChartData& d = *i;
@ -100,12 +95,7 @@ double KDChartVectorSeries::minValue( int coordinate, bool &ok ) const
double minValue = 0.0; double minValue = 0.0;
bool bStart = true; bool bStart = true;
#if COMPAT_TQT_VERSION >= 0x030000
KDChartVectorSeries::const_iterator i; KDChartVectorSeries::const_iterator i;
#else
KDChartVectorSeries::ConstIterator i;
#endif
for ( i = begin(); i != end(); i ++ ) for ( i = begin(); i != end(); i ++ )
{ {
const KDChartData& d = *i; const KDChartData& d = *i;

@ -222,10 +222,6 @@ namespace KDXML {
createIntNode( doc, fontElement, "PointSize", font.pointSize() ); createIntNode( doc, fontElement, "PointSize", font.pointSize() );
createIntNode( doc, fontElement, "Weight", font.weight() ); createIntNode( doc, fontElement, "Weight", font.weight() );
createBoolNode( doc, fontElement, "Italic", font.italic() ); createBoolNode( doc, fontElement, "Italic", font.italic() );
#if COMPAT_TQT_VERSION < 0x030000
// TQt 3 handles the charset internally.
createIntNode( doc, fontElement, "CharSet", font.charSet() );
#endif
} }
@ -614,10 +610,6 @@ namespace KDXML {
font.setPointSize( pointSize ); font.setPointSize( pointSize );
font.setWeight( weight ); font.setWeight( weight );
font.setItalic( italic ); font.setItalic( italic );
#if COMPAT_TQT_VERSION < 0x030000
// TQt 3 handles charsets internally.
font.setCharSet( (TQFont::CharSet)charSet );
#endif
} }
return ok; return ok;

Loading…
Cancel
Save