diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:44:41 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:44:41 +0000 |
commit | a374efce3a207b39514be3c52264091400ce297e (patch) | |
tree | 77bdf654b55826d4f59b53a5621310206bcaead1 /kig/misc/kigpainter.cpp | |
parent | f81a494f3957d5cf38c787973415597941934727 (diff) | |
download | tdeedu-a374efce3a207b39514be3c52264091400ce297e.tar.gz tdeedu-a374efce3a207b39514be3c52264091400ce297e.zip |
TQt4 port kdeedu
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1236073 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kig/misc/kigpainter.cpp')
-rw-r--r-- | kig/misc/kigpainter.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/kig/misc/kigpainter.cpp b/kig/misc/kigpainter.cpp index 98594ecb..95be1837 100644 --- a/kig/misc/kigpainter.cpp +++ b/kig/misc/kigpainter.cpp @@ -42,18 +42,18 @@ KigPainter::KigPainter( const ScreenInfo& si, TQPaintDevice* device, const KigDocument& doc, bool no ) : mP ( device ), - color( Qt::blue ), + color( TQt::blue ), style( Qt::SolidLine ), pointstyle( 0 ), width( -1 ), brushStyle( Qt::NoBrush ), - brushColor( Qt::blue ), + brushColor( TQt::blue ), mdoc( doc ), msi( si ), mNeedOverlay( no ), overlayenlarge( 0 ) { - mP.setBackgroundColor( Qt::white ); + mP.setBackgroundColor( TQt::white ); } KigPainter::~KigPainter() @@ -136,7 +136,7 @@ void KigPainter::drawFatPoint( const Coordinate& p ) Rect r( tl, br ); TQRect qr = toScreen( r ); mP.drawRect( qr ); - mP.fillRect( qr, TQBrush( color, Qt::SolidPattern ) ); + mP.fillRect( qr, TQBrush( color, TQt::SolidPattern ) ); if( mNeedOverlay ) mOverlay.push_back( qr ); break; } @@ -196,7 +196,7 @@ void KigPainter::drawText( const Rect p, const TQString s, int textFlags, int le void KigPainter::textOverlay( const TQRect& r, const TQString s, int textFlags, int len ) { - // kdDebug() << Rect::fromQRect( mP.boundingRect( r, textFlags, s, len ) ) << endl; + // kdDebug() << Rect::fromTQRect( mP.boundingRect( r, textFlags, s, len ) ) << endl; TQRect newr( mP.boundingRect( r, textFlags, s, len ) ); newr.setWidth( newr.width() + 4 ); newr.setHeight( newr.height() + 4 ); @@ -218,7 +218,7 @@ void KigPainter::setColor( const TQColor& c ) mP.setPen( TQPen( color, width == -1 ? 1 : width, style ) ); } -void KigPainter::setStyle( const PenStyle c ) +void KigPainter::setStyle( const Qt::PenStyle c ) { style = c; mP.setPen( TQPen( color, width == -1 ? 1 : width, style ) ); @@ -251,7 +251,7 @@ void KigPainter::setBrush( const TQBrush& b ) mP.setBrush( b ); } -void KigPainter::setBrushStyle( const BrushStyle c ) +void KigPainter::setBrushStyle( const Qt::BrushStyle c ) { brushStyle = c; mP.setBrush( TQBrush( brushColor, brushStyle ) ); @@ -292,7 +292,7 @@ void KigPainter::drawPolygon( const std::vector<TQPoint>& pts, TQBrush oldbrush = mP.brush(); setBrush( TQBrush( color, Dense4Pattern ) ); setPen( Qt::NoPen ); - // i know this isn't really fast, but i blame it all on Qt with its + // i know this isn't really fast, but i blame it all on TQt with its // stupid container classes... what's wrong with the STL ? TQPointArray t( pts.size() ); int c = 0; @@ -300,7 +300,7 @@ void KigPainter::drawPolygon( const std::vector<TQPoint>& pts, { t.putPoints( c++, 1, i->x(), i->y() ); }; - mP.drawPolygon( t, winding, index, npoints ); + mP.tqdrawPolygon( t, winding, index, npoints ); setPen( oldpen ); setBrush( oldbrush ); if( mNeedOverlay ) mOverlay.push_back( t.boundingRect() ); @@ -499,9 +499,9 @@ void KigPainter::drawObjects( const std::vector<ObjectHolder*>& os, bool sel ) void KigPainter::drawFilledRect( const TQRect& r ) { - TQPen pen( Qt::black, 1, Qt::DotLine ); + TQPen pen( TQt::black, 1, TQt::DotLine ); setPen( pen ); - setBrush( TQBrush( Qt::cyan, Dense6Pattern ) ); + setBrush( TQBrush( TQt::cyan, Dense6Pattern ) ); drawRect( r.normalize() ); } @@ -511,7 +511,7 @@ void KigPainter::drawTextStd( const TQPoint& p, const TQString& s ) // tf = text formatting flags int tf = AlignLeft | AlignTop | DontClip | WordBreak; // we need the rect where we're going to paint text - setPen(TQPen(Qt::blue, 1, SolidLine)); + setPen(TQPen(TQt::blue, 1, SolidLine)); setBrush(Qt::NoBrush); drawText( Rect( msi.fromScreen(p), window().bottomRight() @@ -645,7 +645,7 @@ void KigPainter::drawAngle( const Coordinate& cpoint, const double dstartangle, setBrushStyle( Qt::SolidPattern ); // drawPolygon( arrow ); - mP.drawPolygon( arrow, false, 0, -1 ); + mP.tqdrawPolygon( arrow, false, 0, -1 ); // if ( mNeedOverlay ) mOverlay.push_back( toScreen( r ) ); setWholeWinOverlay(); //mp: ugly! why not compute a correct overlay? @@ -679,7 +679,7 @@ void KigPainter::drawVector( const Coordinate& a, const Coordinate& b ) Coordinate c = b - dir + perp; Coordinate d = b - dir - perp; // draw the arrow lines with a normal style - mP.setPen( TQPen( color, width == -1 ? 1 : width, Qt::SolidLine ) ); + mP.setPen( TQPen( color, width == -1 ? 1 : width, TQt::SolidLine ) ); drawSegment( b, c ); drawSegment( b, d ); // setting again the original style @@ -835,7 +835,7 @@ void KigPainter::drawCurve( const CurveImp* curve ) bool dooverlay = ! overlaypt && h < hmaxoverlay && valid0 && valid1 && fabs( p0.x - p1.x ) <= overlayRectSize() && fabs( p0.y - p1.y ) <= overlayRectSize(); - bool addn = sr.contains( p2 ) || h >= hmax; + bool addn = sr.tqcontains( p2 ) || h >= hmax; // estimated error between the curve and the segments double errsq = 1e21; if ( allvalid ) errsq = (0.5*p0 + 0.5*p1 - p2).squareLength(); @@ -859,7 +859,7 @@ void KigPainter::drawCurve( const CurveImp* curve ) if ( curpolylinenextfree > 0 && curpolyline[curpolylinenextfree - 1] != tp1 ) { // flush the current part of the curve - mP.drawPolyline( curpolyline, 0, curpolylinenextfree ); + mP.tqdrawPolyline( curpolyline, 0, curpolylinenextfree ); curpolylinenextfree = 0; } if ( curpolylinenextfree == 0 ) @@ -870,10 +870,10 @@ void KigPainter::drawCurve( const CurveImp* curve ) else if ( h >= hmin ) // we do not continue to subdivide indefinitely! { // push into stack in order to process both subintervals - if ( addn || ( valid0 && sr.contains( p0 ) ) ) + if ( addn || ( valid0 && sr.tqcontains( p0 ) ) ) workstack.push( workitem( curitem.first, coordparampair( t2, p2 ), overlaypt ) ); - if ( addn || ( valid1 && sr.contains( p1 ) ) ) + if ( addn || ( valid1 && sr.tqcontains( p1 ) ) ) { curitem = workitem( coordparampair( t2, p2 ), curitem.second , overlaypt ); @@ -883,7 +883,7 @@ void KigPainter::drawCurve( const CurveImp* curve ) } } // flush the rest of the curve - mP.drawPolyline( curpolyline, 0, curpolylinenextfree ); + mP.tqdrawPolyline( curpolyline, 0, curpolylinenextfree ); curpolylinenextfree = 0; if ( ! workstack.empty () ) @@ -912,10 +912,10 @@ void KigPainter::drawTextFrame( const Rect& frame, { // inspired upon kgeo, thanks to Marc Bartsch, i've taken some of // his code too.. - setPen( TQPen( Qt::black, 1 ) ); + setPen( TQPen( TQt::black, 1 ) ); setBrush( TQBrush( TQColor( 255, 255, 222 ) ) ); drawRect( frame ); - setPen( TQPen( TQColor( 197, 194, 197 ), 1, Qt::SolidLine ) ); + setPen( TQPen( TQColor( 197, 194, 197 ), 1, TQt::SolidLine ) ); TQRect qr = toScreen( frame ); @@ -924,7 +924,7 @@ void KigPainter::drawTextFrame( const Rect& frame, }; setPen( oldpen ); setBrush( oldbrush ); - drawText( frame, s, Qt::AlignVCenter | Qt::AlignLeft ); + drawText( frame, s, TQt::AlignVCenter | TQt::AlignLeft ); } void KigPainter::drawArc( const Coordinate& center, const double radius, |