From ea318d1431c89e647598c510c4245c6571aa5f46 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 26 Jan 2012 23:32:43 -0600 Subject: Update to latest tqt3 automated conversion --- doc/html/tutorial1-09.html | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'doc/html/tutorial1-09.html') diff --git a/doc/html/tutorial1-09.html b/doc/html/tutorial1-09.html index 3edac0352..57a97b894 100644 --- a/doc/html/tutorial1-09.html +++ b/doc/html/tutorial1-09.html @@ -52,32 +52,32 @@ implementation.

-

    void CannonField::paintEvent( TQPaintEvent * )
+

    void CannonField::paintEvent( TQPaintEvent * )
     {
-        TQPainter p( this );
+        TQPainter p( this );
 
-

We'll now start to use TQPainter in earnest. We create a painter that +

We'll now start to use TQPainter in earnest. We create a painter that operates on this widget. -

        p.setBrush( blue );
+

        p.setBrush( blue );
 

When TQPainter fills a rectangle, a circle, or whatever, it fills the shape using its brush. Here we set it to use a blue brush. (We could also use a pattern.) -

        p.setPen( NoPen );
+

        p.setPen( NoPen );
 

And the edges of what TQPainter draws are drawn using the pen. Here we set it to NoPen, meaning that there will be no special edge when we draw something; the blue brush will go all the way to the edges of the things we draw. -

        p.translate( 0, rect().bottom() );
+

        p.translate( 0, rect().bottom() );
 
-

The TQPainter::translate() function translates the coordinate +

The TQPainter::translate() function translates the coordinate system of the TQPainter; i.e., it moves it by an offset. Here we set the (0, 0) point to the bottom-left corner of the widget. The x and y directions remain unchanged, i.e., all the y coordinates inside the widget are now negative (see The Coordinate System for more information about TQt's coordinate system). -

        p.drawPie( TQRect(-35, -35, 70, 70), 0, 90*16 );
+

        p.drawPie( TQRect(-35, -35, 70, 70), 0, 90*16 );
 

The drawPie() function draws a pie shape inside the specified rectangle using a start angle and an arc length. The angles are @@ -85,21 +85,21 @@ specified in 1/16th of a degree. Zero degrees is at the 3 o'clock position. The drawing direction is counter-clockwise. Here we draw a quarter of a circle in the bottom-left corner of the widget. The pie is filled with blue and has no outline. -

        p.rotate( -ang );
+

        p.rotate( -ang );
 
-

The TQPainter::rotate() function rotates the coordinate system of the -TQPainter around the origin. The rotation argument is a float given +

The TQPainter::rotate() function rotates the coordinate system of the +TQPainter around the origin. The rotation argument is a float given in degrees (not given in 1/16th of a degree as above) and clockwise. Here we rotate the coordinate system ang degrees counter-clockwise. -

        p.drawRect( TQRect(33, -4, 15, 8) );
+

        p.drawRect( TQRect(33, -4, 15, 8) );
 
-

The TQPainter::drawRect() function draws the specified rectangle. Here +

The TQPainter::drawRect() function draws the specified rectangle. Here we draw the barrel of the cannon.

It can often be difficult to envision the resulting drawing when the coordinate system has been transformed (translated, rotated, scaled, or sheared) as above.

In this case the coordinate system is first translated and then rotated. -If the rectangle TQRect(33, -4, 15, 8) had been drawn in the translated +If the rectangle TQRect(33, -4, 15, 8) had been drawn in the translated coordinate system, it would have looked like this:

The cannon translated but not rotated

Note that the rectangle is clipped by the border of the CannonField @@ -114,12 +114,12 @@ this time.

    int main( int argc, char **argv )
     {
-        TQApplication::setColorSpec( TQApplication::CustomColor );
-        TQApplication a( argc, argv );
+        TQApplication::setColorSpec( TQApplication::CustomColor );
+        TQApplication a( argc, argv );
 

We tell TQt that we want a different color-allocation strategy for this program. There is no single correct color-allocation strategy. Because -this program uses an unusual yellow but not many colors, CustomColor is best. There are several other allocation strategies; you can read about them in the TQApplication::setColorSpec() +this program uses an unusual yellow but not many colors, CustomColor is best. There are several other allocation strategies; you can read about them in the TQApplication::setColorSpec() documentation.

Mostly you can ignore this, since the default is good. Occasionally some applications with unusual color use look bad; changing the -- cgit v1.2.1