From 1e9fa8e06de5da7fcc268e9cccb2d6b21c5f53a3 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sat, 20 Jul 2024 20:15:52 +0900 Subject: Rename graphics class nt* related files to equivalent tq* (part 2) Signed-off-by: Michele Calgaro --- doc/html/simple-application.html | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'doc/html/simple-application.html') diff --git a/doc/html/simple-application.html b/doc/html/simple-application.html index b667b00a0..efe781b30 100644 --- a/doc/html/simple-application.html +++ b/doc/html/simple-application.html @@ -38,7 +38,7 @@ body { background: #ffffff; color: black; } modern application window tends to use. (See also Tutorial #2.)

It also illustrates some aspects of TQWhatsThis (for simple help) and a typical main() using TQApplication. -

Finally, it shows a typical print function based on TQPrinter. +

Finally, it shows a typical print function based on TQPrinter.

The declaration of ApplicationWindow

Here's the header file in full: @@ -82,7 +82,7 @@ private slots: void aboutTQt(); private: - TQPrinter *printer; + TQPrinter *printer; TQTextEdit *e; TQString filename; }; @@ -176,12 +176,12 @@ compile them into the binary. This is what we are doing here.

ApplicationWindow inherits TQMainWindow, the TQt class that provides typical application main windows, with menu bars, toolbars, etc. -

        printer = new TQPrinter( TQPrinter::HighResolution );
+

        printer = new TQPrinter( TQPrinter::HighResolution );
 

The application example can print things, and we chose to have a -TQPrinter object lying around so that when the user changes a setting +TQPrinter object lying around so that when the user changes a setting during one printing, the new setting will be the default next time. -

        TQPixmap openIcon, saveIcon, printIcon;
+

        TQPixmap openIcon, saveIcon, printIcon;
 

For the sake of simplicity, our example only has a few commands in the toolbar. The above variables are used to hold an icon for each of @@ -450,8 +450,8 @@ and implicitly changes the window system caption to the new name.

    void ApplicationWindow::print()
     {
-        printer->setFullPage( TRUE );
-        if ( printer->setup(this) ) {               // printer dialog
+        printer->setFullPage( TRUE );
+        if ( printer->setup(this) ) {               // printer dialog
             statusBar()->message( "Printing..." );
             TQPainter p;
             if( !p.begin( printer ) ) {               // paint on printer
@@ -462,24 +462,24 @@ and implicitly changes the window system caption to the new name.
             TQPaintDeviceMetrics metrics( p.device() );
             int dpiy = metrics.logicalDpiY();
             int margin = (int) ( (2/2.54)*dpiy ); // 2 cm margins
-            TQRect view( margin, margin, metrics.width() - 2*margin, metrics.height() - 2*margin );
+            TQRect view( margin, margin, metrics.width() - 2*margin, metrics.height() - 2*margin );
             TQSimpleRichText richText( TQStyleSheet::convertFromPlainText(e->text()),
                                       TQFont(),
                                       e->context(),
                                       e->styleSheet(),
                                       e->mimeSourceFactory(),
-                                      view.height() );
-            richText.setWidth( &p, view.width() );
+                                      view.height() );
+            richText.setWidth( &p, view.width() );
             int page = 1;
             do {
                 richText.draw( &p, margin, margin, view, colorGroup() );
-                view.moveBy( 0, view.height() );
-                p.translate( 0 , -view.height() );
-                p.drawText( view.right() - p.fontMetrics().width( TQString::number( page ) ),
-                            view.bottom() + p.fontMetrics().ascent() + 5, TQString::number( page ) );
-                if ( view.top() - margin >= richText.height() )
+                view.moveBy( 0, view.height() );
+                p.translate( 0 , -view.height() );
+                p.drawText( view.right() - p.fontMetrics().width( TQString::number( page ) ),
+                            view.bottom() + p.fontMetrics().ascent() + 5, TQString::number( page ) );
+                if ( view.top() - margin >= richText.height() )
                     break;
-                printer->newPage();
+                printer->newPage();
                 page++;
             } while (TRUE);
 
-- 
cgit v1.2.3