diff options
Diffstat (limited to 'kig/misc/coordinate_system.cpp')
-rw-r--r-- | kig/misc/coordinate_system.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/kig/misc/coordinate_system.cpp b/kig/misc/coordinate_system.cpp index 859ed81d..deefe954 100644 --- a/kig/misc/coordinate_system.cpp +++ b/kig/misc/coordinate_system.cpp @@ -40,7 +40,7 @@ #include <math.h> class CoordinateValidator - : public QValidator + : public TQValidator { bool mpolar; #ifdef KIG_USE_KDOUBLEVALIDATOR @@ -80,7 +80,7 @@ TQValidator::State CoordinateValidator::validate( TQString & input, int & pos ) if( tinput[tinput.length() - 1 ] == ' ' ) tinput.truncate( tinput.length() - 1 ); if ( tinput[0] == '(' ) tinput = tinput.mid( 1 ); if( tinput[0] == ' ' ) tinput = tinput.mid( 1 ); - int scp = tinput.find( ';' ); + int scp = tinput.tqfind( ';' ); if ( scp == -1 ) return mdv.validate( tinput, pos ) == Invalid ? Invalid : Valid; else { @@ -101,34 +101,34 @@ TQValidator::State CoordinateValidator::validate( TQString & input, int & pos ) void CoordinateValidator::fixup( TQString & input ) const { - int nsc = input.contains( ';' ); + int nsc = input.tqcontains( ';' ); if ( nsc > 1 ) { // where is the second ';' - int i = input.find( ';' ); - i = input.find( ';', i ); + int i = input.tqfind( ';' ); + i = input.tqfind( ';', i ); input = input.left( i ); }; // now the string has at most one semicolon left.. - int sc = input.find( ';' ); + int sc = input.tqfind( ';' ); if ( sc == -1 ) { sc = input.length(); KLocale* l = KGlobal::locale(); if ( mpolar ) - input.append( TQString::fromLatin1( ";" ) + l->positiveSign() + - TQString::fromLatin1( "0°" ) ); + input.append( TQString::tqfromLatin1( ";" ) + l->positiveSign() + + TQString::tqfromLatin1( "0°" ) ); else - input.append( TQString::fromLatin1( ";" ) + l->positiveSign() + - TQString::fromLatin1( "0" ) + l->decimalSymbol() + - TQString::fromLatin1( "0" ) ); + input.append( TQString::tqfromLatin1( ";" ) + l->positiveSign() + + TQString::tqfromLatin1( "0" ) + l->decimalSymbol() + + TQString::tqfromLatin1( "0" ) ); }; mre.exactMatch( input ); TQString ds1 = mre.cap( 1 ); mdv.fixup( ds1 ); TQString ds2 = mre.cap( 2 ); mdv.fixup( ds2 ); - input = ds1 + TQString::fromLatin1( "; " ) + ds2; + input = ds1 + TQString::tqfromLatin1( "; " ) + ds2; } EuclideanCoords::EuclideanCoords() @@ -146,7 +146,7 @@ TQString EuclideanCoords::fromScreen( const Coordinate& p, const KigDocument& d int l = kigMax( 0, (int) ( 3 - log10( m ) ) ); TQString xs = KGlobal::locale()->formatNumber( p.x, l ); TQString ys = KGlobal::locale()->formatNumber( p.y, l ); - return TQString::fromLatin1( "( %1; %2 )" ).arg( xs ).arg( ys ); + return TQString::tqfromLatin1( "( %1; %2 )" ).tqarg( xs ).tqarg( ys ); } Coordinate EuclideanCoords::toScreen(const TQString& s, bool& ok) const @@ -255,7 +255,7 @@ void EuclideanCoords::drawGrid( KigPainter& p, bool showgrid, bool showaxes ) co /****** the axes ******/ if ( showaxes ) { - p.setPen( TQPen( Qt::gray, 1, Qt::SolidLine ) ); + p.setPen( TQPen( TQt::gray, 1, TQt::SolidLine ) ); // x axis p.drawSegment( Coordinate( hmin, 0 ), Coordinate( hmax, 0 ) ); // y axis @@ -286,8 +286,8 @@ void EuclideanCoords::drawGrid( KigPainter& p, bool showgrid, bool showaxes ) co ); }; // arrows on the ends of the axes... - p.setPen( TQPen( Qt::gray, 1, Qt::SolidLine ) ); - p.setBrush( TQBrush( Qt::gray ) ); + p.setPen( TQPen( TQt::gray, 1, TQt::SolidLine ) ); + p.setBrush( TQBrush( TQt::gray ) ); std::vector<Coordinate> a; // the arrow on the right end of the X axis... @@ -354,7 +354,7 @@ TQString PolarCoords::fromScreen( const Coordinate& pt, const KigDocument& d ) c TQString rs = KGlobal::locale()->formatNumber( r, l ); TQString ts = KGlobal::locale()->formatNumber( theta, 0 ); - return TQString::fromLatin1("( %1; %2° )").arg( rs ).arg( ts ); + return TQString::tqfromLatin1("( %1; %2° )").tqarg( rs ).tqarg( ts ); } TQString PolarCoords::coordinateFormatNotice() const @@ -450,7 +450,7 @@ void PolarCoords::drawGrid( KigPainter& p, bool showgrid, bool showaxes ) const /****** the axes ******/ if ( showaxes ) { - p.setPen( TQPen( Qt::gray, 1, Qt::SolidLine ) ); + p.setPen( TQPen( TQt::gray, 1, TQt::SolidLine ) ); // x axis p.drawSegment( Coordinate( hmin, 0 ), Coordinate( hmax, 0 ) ); // y axis @@ -482,8 +482,8 @@ void PolarCoords::drawGrid( KigPainter& p, bool showgrid, bool showaxes ) const ); }; // arrows on the ends of the axes... - p.setPen( TQPen( Qt::gray, 1, Qt::SolidLine ) ); - p.setBrush( TQBrush( Qt::gray ) ); + p.setPen( TQPen( TQt::gray, 1, TQt::SolidLine ) ); + p.setBrush( TQBrush( TQt::gray ) ); std::vector<Coordinate> a; // the arrow on the right end of the X axis... @@ -575,7 +575,7 @@ TQString CoordinateSystemFactory::setCoordinateSystemStatement( int id ) return i18n( "Set Polar Coordinate System" ); default: assert( false ); - return TQString::null; + return TQString(); } } @@ -608,15 +608,15 @@ Coordinate EuclideanCoords::snapToGrid( const Coordinate& c, const double hgraphmin = ceil( hmin / hd) * hd; const double vgraphmin = ceil( vmin / vd ) * vd; - const double nx = qRound( ( c.x - hgraphmin ) / hd ) * hd + hgraphmin; - const double ny = qRound( ( c.y - vgraphmin ) / vd ) * vd + vgraphmin; + const double nx = tqRound( ( c.x - hgraphmin ) / hd ) * hd + hgraphmin; + const double ny = tqRound( ( c.y - vgraphmin ) / vd ) * vd + vgraphmin; return Coordinate( nx, ny ); } Coordinate PolarCoords::snapToGrid( const Coordinate& c, const KigWidget& w ) const { - // we reuse the drawGrid code to find + // we reuse the drawGrid code to tqfind // we multiply by sqrt( 2 ) cause we don't want to miss circles in // the corners, that intersect with the axes outside of the @@ -643,7 +643,7 @@ Coordinate PolarCoords::snapToGrid( const Coordinate& c, double d = kigMin( hd, vd ); double dist = c.length(); - double ndist = qRound( dist / d ) * d; + double ndist = tqRound( dist / d ) * d; return c.normalize( ndist ); } |