From a30f5359f03c3017fa19a6770fab32d25d22cb87 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Mon, 15 Jul 2024 19:08:22 +0900 Subject: Rename graphics class nt* related files to equivalent tq* (part 1) Signed-off-by: Michele Calgaro --- doc/html/tutorial1-10.html | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'doc/html/tutorial1-10.html') diff --git a/doc/html/tutorial1-10.html b/doc/html/tutorial1-10.html index c1949dd59..8bb1345ba 100644 --- a/doc/html/tutorial1-10.html +++ b/doc/html/tutorial1-10.html @@ -122,9 +122,9 @@ the drawing a little bit.

The implementation of setForce() is quite similar to that of setAngle(). The only difference is that because we don't show the force value, we don't need to repaint the widget. -

    void CannonField::paintEvent( TQPaintEvent *e )
+

    void CannonField::paintEvent( TQPaintEvent *e )
     {
-        if ( !e->rect().intersects( cannonRect() ) )
+        if ( !e->rect().intersects( cannonRect() ) )
             return;
 

We have now optimized the paint event to repaint only the parts of the @@ -144,20 +144,20 @@ not any more. We've kept the code for educational purposes.

        pix.fill( this, cr.topLeft() );
 

We fill the pixmap with the background from this widget. -

        TQPainter p( &pix );
-        p.setBrush( blue );
-        p.setPen( NoPen );
-        p.translate( 0, pix.height() - 1 );
-        p.drawPie( TQRect( -35,-35, 70, 70 ), 0, 90*16 );
-        p.rotate( -ang );
-        p.drawRect( TQRect(33, -4, 15, 8) );
-        p.end();
+

        TQPainter p( &pix );
+        p.setBrush( blue );
+        p.setPen( NoPen );
+        p.translate( 0, pix.height() - 1 );
+        p.drawPie( TQRect( -35,-35, 70, 70 ), 0, 90*16 );
+        p.rotate( -ang );
+        p.drawRect( TQRect(33, -4, 15, 8) );
+        p.end();
 

We paint, as in Chapter 9, but now we paint in the pixmap.

At this point, we have a painter variable and a pixmap that looks precisely right, but we still haven't painted on the screen. -

        p.begin( this );
-        p.drawPixmap( cr.topLeft(), pix );
+

        p.begin( this );
+        p.drawPixmap( cr.topLeft(), pix );
 

So we open the painter on the CannonField itself and then draw the pixmap.

That's all. A couple of extra lines at the top and a couple at the -- cgit v1.2.3