diff options
Diffstat (limited to 'doc/html/simple-application.html')
-rw-r--r-- | doc/html/simple-application.html | 32 |
1 files changed, 16 insertions, 16 deletions
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 <a href="tutorial2.html">Tutorial #2</a>.) <p> It also illustrates some aspects of <a href="ntqwhatsthis.html">TQWhatsThis</a> (for simple help) and a typical <tt>main()</tt> using <a href="ntqapplication.html">TQApplication</a>. -<p> Finally, it shows a typical print function based on <a href="ntqprinter.html">TQPrinter</a>. +<p> Finally, it shows a typical print function based on <a href="tqprinter.html">TQPrinter</a>. <p> <h2> The declaration of ApplicationWindow </h2> <a name="1"></a><p> Here's the header file in full: @@ -82,7 +82,7 @@ private slots: void aboutTQt(); private: - <a href="ntqprinter.html">TQPrinter</a> *printer; + <a href="tqprinter.html">TQPrinter</a> *printer; <a href="tqtextedit.html">TQTextEdit</a> *e; <a href="tqstring.html">TQString</a> filename; }; @@ -176,12 +176,12 @@ compile them into the binary. This is what we are doing here. </pre> <p> <em>ApplicationWindow</em> inherits <a href="tqmainwindow.html">TQMainWindow</a>, the TQt class that provides typical application main windows, with menu bars, toolbars, etc. -<p> <pre> printer = new <a href="ntqprinter.html">TQPrinter</a>( TQPrinter::HighResolution ); +<p> <pre> printer = new <a href="tqprinter.html">TQPrinter</a>( TQPrinter::HighResolution ); </pre> <p> The application example can print things, and we chose to have a -<a href="ntqprinter.html">TQPrinter</a> object lying around so that when the user changes a setting +<a href="tqprinter.html">TQPrinter</a> object lying around so that when the user changes a setting during one printing, the new setting will be the default next time. -<p> <pre> <a href="ntqpixmap.html">TQPixmap</a> openIcon, saveIcon, printIcon; +<p> <pre> <a href="tqpixmap.html">TQPixmap</a> openIcon, saveIcon, printIcon; </pre> <p> 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. <p> <a name="printer"></a> <p> <pre> void ApplicationWindow::print() { - printer-><a href="ntqprinter.html#setFullPage">setFullPage</a>( TRUE ); - if ( printer-><a href="ntqprinter.html#setup">setup</a>(this) ) { // printer dialog + printer-><a href="tqprinter.html#setFullPage">setFullPage</a>( TRUE ); + if ( printer-><a href="tqprinter.html#setup">setup</a>(this) ) { // printer dialog <a href="tqmainwindow.html#statusBar">statusBar</a>()->message( "Printing..." ); <a href="tqpainter.html">TQPainter</a> p; if( !p.<a href="tqpainter.html#begin">begin</a>( printer ) ) { // paint on printer @@ -462,24 +462,24 @@ and implicitly changes the window system caption to the new name. <a href="tqpaintdevicemetrics.html">TQPaintDeviceMetrics</a> metrics( p.<a href="tqpainter.html#device">device</a>() ); int dpiy = metrics.<a href="tqpaintdevicemetrics.html#logicalDpiY">logicalDpiY</a>(); int margin = (int) ( (2/2.54)*dpiy ); // 2 cm margins - <a href="ntqrect.html">TQRect</a> view( margin, margin, metrics.<a href="tqpaintdevicemetrics.html#width">width</a>() - 2*margin, metrics.<a href="tqpaintdevicemetrics.html#height">height</a>() - 2*margin ); + <a href="tqrect.html">TQRect</a> view( margin, margin, metrics.<a href="tqpaintdevicemetrics.html#width">width</a>() - 2*margin, metrics.<a href="tqpaintdevicemetrics.html#height">height</a>() - 2*margin ); <a href="ntqsimplerichtext.html">TQSimpleRichText</a> richText( TQStyleSheet::<a href="tqstylesheet.html#convertFromPlainText">convertFromPlainText</a>(e-><a href="tqtextedit.html#text">text</a>()), TQFont(), e-><a href="tqtextedit.html#context">context</a>(), e-><a href="tqtextedit.html#styleSheet">styleSheet</a>(), e-><a href="tqtextedit.html#mimeSourceFactory">mimeSourceFactory</a>(), - view.<a href="ntqrect.html#height">height</a>() ); - richText.<a href="ntqsimplerichtext.html#setWidth">setWidth</a>( &p, view.<a href="ntqrect.html#width">width</a>() ); + view.<a href="tqrect.html#height">height</a>() ); + richText.<a href="ntqsimplerichtext.html#setWidth">setWidth</a>( &p, view.<a href="tqrect.html#width">width</a>() ); int page = 1; do { richText.<a href="ntqsimplerichtext.html#draw">draw</a>( &p, margin, margin, view, colorGroup() ); - view.<a href="ntqrect.html#moveBy">moveBy</a>( 0, view.<a href="ntqrect.html#height">height</a>() ); - p.<a href="tqpainter.html#translate">translate</a>( 0 , -view.<a href="ntqrect.html#height">height</a>() ); - p.<a href="tqpainter.html#drawText">drawText</a>( view.<a href="ntqrect.html#right">right</a>() - p.<a href="tqpainter.html#fontMetrics">fontMetrics</a>().width( TQString::<a href="tqstring.html#number">number</a>( page ) ), - view.<a href="ntqrect.html#bottom">bottom</a>() + p.<a href="tqpainter.html#fontMetrics">fontMetrics</a>().ascent() + 5, TQString::number( page ) ); - if ( view.<a href="ntqrect.html#top">top</a>() - margin >= richText.<a href="ntqsimplerichtext.html#height">height</a>() ) + view.<a href="tqrect.html#moveBy">moveBy</a>( 0, view.<a href="tqrect.html#height">height</a>() ); + p.<a href="tqpainter.html#translate">translate</a>( 0 , -view.<a href="tqrect.html#height">height</a>() ); + p.<a href="tqpainter.html#drawText">drawText</a>( view.<a href="tqrect.html#right">right</a>() - p.<a href="tqpainter.html#fontMetrics">fontMetrics</a>().width( TQString::<a href="tqstring.html#number">number</a>( page ) ), + view.<a href="tqrect.html#bottom">bottom</a>() + p.<a href="tqpainter.html#fontMetrics">fontMetrics</a>().ascent() + 5, TQString::number( page ) ); + if ( view.<a href="tqrect.html#top">top</a>() - margin >= richText.<a href="ntqsimplerichtext.html#height">height</a>() ) break; - printer-><a href="ntqprinter.html#newPage">newPage</a>(); + printer-><a href="tqprinter.html#newPage">newPage</a>(); page++; } while (TRUE); |