diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-29 16:05:55 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-29 16:05:55 +0000 |
commit | 87a016680e3677da3993f333561e79eb0cead7d5 (patch) | |
tree | cbda2b4df8b8ee0d8d1617e6c75bec1e3ee0ccba /src/mechanics/chassiscircular2.cpp | |
parent | 6ce3d1ad09c1096b5ed3db334e02859e45d5c32b (diff) | |
download | ktechlab-87a016680e3677da3993f333561e79eb0cead7d5.tar.gz ktechlab-87a016680e3677da3993f333561e79eb0cead7d5.zip |
TQt4 port ktechlab
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktechlab@1238801 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/mechanics/chassiscircular2.cpp')
-rw-r--r-- | src/mechanics/chassiscircular2.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/mechanics/chassiscircular2.cpp b/src/mechanics/chassiscircular2.cpp index 91b9f0a..715073f 100644 --- a/src/mechanics/chassiscircular2.cpp +++ b/src/mechanics/chassiscircular2.cpp @@ -13,8 +13,8 @@ #include "libraryitem.h" #include <klocale.h> -#include <qpainter.h> -#include <qwmatrix.h> +#include <tqpainter.h> +#include <tqwmatrix.h> #include <algorithm> #include <cmath> @@ -31,7 +31,7 @@ Item* ChassisCircular2::construct( ItemDocument *itemDocument, bool newItem, con LibraryItem* ChassisCircular2::libraryItem() { return new LibraryItem( - QString("mech/chassis_circular_2"), + TQString("mech/chassis_circular_2"), i18n("Circular 2-Wheel Chassis"), i18n("Chassis'"), "chassis.png", @@ -49,10 +49,10 @@ ChassisCircular2::ChassisCircular2( MechanicsDocument *mechanicsDocument, bool n m_theta1 = 0.0; m_theta2 = 0.0; - QPointArray pa; + TQPointArray pa; pa.makeEllipse( -25, -25, 50, 50 ); - QWMatrix m(4,0,0,4,0,0); - m.setTransformationMode( QWMatrix::Areas ); + TQWMatrix m(4,0,0,4,0,0); + m.setTransformationMode( TQWMatrix::Areas ); pa = m.map(pa); setItemPoints(pa); @@ -70,8 +70,8 @@ void ChassisCircular2::itemResized() const double w = sizeRect().width(); const double h = sizeRect().height(); - m_wheel1Pos = QRect( int(w/5), int(h/6), int(w/4), int(h/8) ); - m_wheel2Pos = QRect( int(w/5), int(5*h/6-h/8), int(w/4), int(h/8) ); + m_wheel1Pos = TQRect( int(w/5), int(h/6), int(w/4), int(h/8) ); + m_wheel2Pos = TQRect( int(w/5), int(5*h/6-h/8), int(w/4), int(h/8) ); } @@ -97,7 +97,7 @@ void ChassisCircular2::advance( int phase ) } -void ChassisCircular2::drawShape( QPainter &p ) +void ChassisCircular2::drawShape( TQPainter &p ) { const double _x = int(sizeRect().x() + x()); const double _y = int(sizeRect().y() + y()); @@ -105,8 +105,8 @@ void ChassisCircular2::drawShape( QPainter &p ) const double h = sizeRect().height(); initPainter(p); - p.setBrush( QColor( 255, 246, 210 ) ); - QRect circleRect = sizeRect(); + p.setBrush( TQColor( 255, 246, 210 ) ); + TQRect circleRect = sizeRect(); circleRect.moveLeft( int(circleRect.left() + x()) ); circleRect.moveTop( int(circleRect.top() + y()) ); p.drawEllipse(circleRect); @@ -118,24 +118,24 @@ void ChassisCircular2::drawShape( QPainter &p ) const double y1 = _y+(h/6); // Wheel 1 y-pos const double y2 = _y+(5*h/6)-H; // Wheel 2 y-pos - p.setPen( Qt::NoPen ); + p.setPen( TQt::NoPen ); const double stripeWidth = 5; const double offset2 = 1 + int(m_theta1*m_wheel1Pos.width())%int(2*stripeWidth); const double offset1 = 1 + int(m_theta2*m_wheel2Pos.width())%int(2*stripeWidth); - p.setBrush( QColor( 255, 232, 182 ) ); + p.setBrush( TQColor( 255, 232, 182 ) ); for ( double i=-1; i<std::ceil(m_wheel1Pos.width()/stripeWidth); ++i ) { - p.setClipRect( QRect( int(_x+m_wheel1Pos.x()+2), int(_y+m_wheel1Pos.y()+2), int(m_wheel1Pos.width()-4), int(m_wheel1Pos.height()-4) ), QPainter::CoordPainter ); + p.setClipRect( TQRect( int(_x+m_wheel1Pos.x()+2), int(_y+m_wheel1Pos.y()+2), int(m_wheel1Pos.width()-4), int(m_wheel1Pos.height()-4) ), TQPainter::CoordPainter ); p.drawRect( int(offset1+X + i*stripeWidth*2), int(y1+1), int(stripeWidth), int(H-2) ); - p.setClipRect( QRect( int(_x+m_wheel2Pos.x()+2), int(_y+m_wheel2Pos.y()+2), int(m_wheel2Pos.width()-4), int(m_wheel2Pos.height()-4) ), QPainter::CoordPainter ); + p.setClipRect( TQRect( int(_x+m_wheel2Pos.x()+2), int(_y+m_wheel2Pos.y()+2), int(m_wheel2Pos.width()-4), int(m_wheel2Pos.height()-4) ), TQPainter::CoordPainter ); p.drawRect( int(offset2+X + i*stripeWidth*2), int(y2+1), int(stripeWidth), int(H-2) ); } p.setClipping(false); - p.setPen( Qt::black ); - p.setBrush( Qt::NoBrush ); + p.setPen( TQt::black ); + p.setBrush( TQt::NoBrush ); p.drawRoundRect( int(X), int(y1), int(w/4), int(H), 25, 50 ); p.drawRoundRect( int(X), int(y2), int(w/4), int(H), 25, 50 ); |