diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-07-15 19:08:22 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-07-18 09:31:41 +0900 |
commit | a30f5359f03c3017fa19a6770fab32d25d22cb87 (patch) | |
tree | cb365dd7a1c3666e3f972c6cad04be7b8e846cba /doc/html/drawdemo-example.html | |
parent | 25ad1267da6916e738a126ff5a9b41cd686adfc6 (diff) | |
download | tqt3-a30f5359f03c3017fa19a6770fab32d25d22cb87.tar.gz tqt3-a30f5359f03c3017fa19a6770fab32d25d22cb87.zip |
Rename graphics class nt* related files to equivalent tq* (part 1)
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'doc/html/drawdemo-example.html')
-rw-r--r-- | doc/html/drawdemo-example.html | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/doc/html/drawdemo-example.html b/doc/html/drawdemo-example.html index 07c90e8c4..5ecd477c6 100644 --- a/doc/html/drawdemo-example.html +++ b/doc/html/drawdemo-example.html @@ -48,7 +48,7 @@ You can easily add you own drawing functions. *****************************************************************************/ #include <<a href="tqwidget-h.html">tqwidget.h</a>> -#include <<a href="qpainter-h.html">ntqpainter.h</a>> +#include <<a href="tqpainter-h.html">tqpainter.h</a>> #include <<a href="qprinter-h.html">ntqprinter.h</a>> #include <<a href="qpushbutton-h.html">ntqpushbutton.h</a>> #include <<a href="qradiobutton-h.html">ntqradiobutton.h</a>> @@ -66,12 +66,12 @@ You can easily add you own drawing functions. // The coordinate system x=(0..500), y=(0..500) spans the paint device. // -void drawColorWheel( <a href="ntqpainter.html">TQPainter</a> *p ) +void drawColorWheel( <a href="tqpainter.html">TQPainter</a> *p ) { - <a href="ntqfont.html">TQFont</a> f( "times", 18, TQFont::Bold ); -<a name="x1075"></a> p-><a href="ntqpainter.html#setFont">setFont</a>( f ); -<a name="x1076"></a> p-><a href="ntqpainter.html#setPen">setPen</a>( TQt::black ); -<a name="x1077"></a> p-><a href="ntqpainter.html#setWindow">setWindow</a>( 0, 0, 500, 500 ); // defines coordinate system + <a href="tqfont.html">TQFont</a> f( "times", 18, TQFont::Bold ); +<a name="x1075"></a> p-><a href="tqpainter.html#setFont">setFont</a>( f ); +<a name="x1076"></a> p-><a href="tqpainter.html#setPen">setPen</a>( TQt::black ); +<a name="x1077"></a> p-><a href="tqpainter.html#setWindow">setWindow</a>( 0, 0, 500, 500 ); // defines coordinate system for ( int i=0; i<36; i++ ) { // draws 36 rotated rectangles @@ -79,16 +79,16 @@ void drawColorWheel( <a href="ntqpainter.html">TQPainter</a> *p ) <a name="x1097"></a> matrix.<a href="ntqwmatrix.html#translate">translate</a>( 250.0F, 250.0F ); // move to center <a name="x1096"></a> matrix.<a href="ntqwmatrix.html#shear">shear</a>( 0.0F, 0.3F ); // twist it <a name="x1095"></a> matrix.<a href="ntqwmatrix.html#rotate">rotate</a>( (float)i*10 ); // rotate 0,10,20,.. degrees -<a name="x1078"></a> p-><a href="ntqpainter.html#setWorldMatrix">setWorldMatrix</a>( matrix ); // use this world matrix +<a name="x1078"></a> p-><a href="tqpainter.html#setWorldMatrix">setWorldMatrix</a>( matrix ); // use this world matrix - <a href="ntqcolor.html">TQColor</a> c; -<a name="x1063"></a> c.<a href="ntqcolor.html#setHsv">setHsv</a>( i*10, 255, 255 ); // rainbow effect -<a name="x1074"></a> p-><a href="ntqpainter.html#setBrush">setBrush</a>( c ); // solid fill with color c -<a name="x1070"></a> p-><a href="ntqpainter.html#drawRect">drawRect</a>( 70, -10, 80, 10 ); // draw the rectangle + <a href="tqcolor.html">TQColor</a> c; +<a name="x1063"></a> c.<a href="tqcolor.html#setHsv">setHsv</a>( i*10, 255, 255 ); // rainbow effect +<a name="x1074"></a> p-><a href="tqpainter.html#setBrush">setBrush</a>( c ); // solid fill with color c +<a name="x1070"></a> p-><a href="tqpainter.html#drawRect">drawRect</a>( 70, -10, 80, 10 ); // draw the rectangle <a href="tqstring.html">TQString</a> n; n.<a href="tqstring.html#sprintf">sprintf</a>( "H=%d", i*10 ); -<a name="x1072"></a> p-><a href="ntqpainter.html#drawText">drawText</a>( 80+70+5, 0, n ); // draw the hue number +<a name="x1072"></a> p-><a href="tqpainter.html#drawText">drawText</a>( 80+70+5, 0, n ); // draw the hue number } } @@ -97,7 +97,7 @@ void drawColorWheel( <a href="ntqpainter.html">TQPainter</a> *p ) // This function draws a few lines of text using different fonts. // -void drawFonts( <a href="ntqpainter.html">TQPainter</a> *p ) +void drawFonts( <a href="tqpainter.html">TQPainter</a> *p ) { static const char *fonts[] = { "Helvetica", "Courier", "Times", 0 }; static int sizes[] = { 10, 12, 18, 24, 36, 0 }; @@ -106,12 +106,12 @@ void drawFonts( <a href="ntqpainter.html">TQPainter</a> *p ) while ( fonts[f] ) { int s = 0; while ( sizes[s] ) { - <a href="ntqfont.html">TQFont</a> font( fonts[f], sizes[s] ); - p-><a href="ntqpainter.html#setFont">setFont</a>( font ); -<a name="x1073"></a> <a href="ntqfontmetrics.html">TQFontMetrics</a> fm = p-><a href="ntqpainter.html#fontMetrics">fontMetrics</a>(); -<a name="x1064"></a> y += fm.<a href="ntqfontmetrics.html#ascent">ascent</a>(); - p-><a href="ntqpainter.html#drawText">drawText</a>( 10, y, "Quartz Glyph Job Vex'd Cwm Finks" ); -<a name="x1065"></a> y += fm.<a href="ntqfontmetrics.html#descent">descent</a>(); + <a href="tqfont.html">TQFont</a> font( fonts[f], sizes[s] ); + p-><a href="tqpainter.html#setFont">setFont</a>( font ); +<a name="x1073"></a> <a href="tqfontmetrics.html">TQFontMetrics</a> fm = p-><a href="tqpainter.html#fontMetrics">fontMetrics</a>(); +<a name="x1064"></a> y += fm.<a href="tqfontmetrics.html#ascent">ascent</a>(); + p-><a href="tqpainter.html#drawText">drawText</a>( 10, y, "Quartz Glyph Job Vex'd Cwm Finks" ); +<a name="x1065"></a> y += fm.<a href="tqfontmetrics.html#descent">descent</a>(); s++; } f++; @@ -123,22 +123,22 @@ void drawFonts( <a href="ntqpainter.html">TQPainter</a> *p ) // This function draws some shapes // -void drawShapes( <a href="ntqpainter.html">TQPainter</a> *p ) +void drawShapes( <a href="tqpainter.html">TQPainter</a> *p ) { - <a href="ntqbrush.html">TQBrush</a> b1( TQt::blue ); - <a href="ntqbrush.html">TQBrush</a> b2( TQt::green, TQt::Dense6Pattern ); // green 12% fill - <a href="ntqbrush.html">TQBrush</a> b3( TQt::NoBrush ); // void brush - <a href="ntqbrush.html">TQBrush</a> b4( TQt::CrossPattern ); // black cross pattern - - p-><a href="ntqpainter.html#setPen">setPen</a>( TQt::red ); - p-><a href="ntqpainter.html#setBrush">setBrush</a>( b1 ); - p-><a href="ntqpainter.html#drawRect">drawRect</a>( 10, 10, 200, 100 ); - p-><a href="ntqpainter.html#setBrush">setBrush</a>( b2 ); -<a name="x1071"></a> p-><a href="ntqpainter.html#drawRoundRect">drawRoundRect</a>( 10, 150, 200, 100, 20, 20 ); - p-><a href="ntqpainter.html#setBrush">setBrush</a>( b3 ); -<a name="x1068"></a> p-><a href="ntqpainter.html#drawEllipse">drawEllipse</a>( 250, 10, 200, 100 ); - p-><a href="ntqpainter.html#setBrush">setBrush</a>( b4 ); -<a name="x1069"></a> p-><a href="ntqpainter.html#drawPie">drawPie</a>( 250, 150, 200, 100, 45*16, 90*16 ); + <a href="tqbrush.html">TQBrush</a> b1( TQt::blue ); + <a href="tqbrush.html">TQBrush</a> b2( TQt::green, TQt::Dense6Pattern ); // green 12% fill + <a href="tqbrush.html">TQBrush</a> b3( TQt::NoBrush ); // void brush + <a href="tqbrush.html">TQBrush</a> b4( TQt::CrossPattern ); // black cross pattern + + p-><a href="tqpainter.html#setPen">setPen</a>( TQt::red ); + p-><a href="tqpainter.html#setBrush">setBrush</a>( b1 ); + p-><a href="tqpainter.html#drawRect">drawRect</a>( 10, 10, 200, 100 ); + p-><a href="tqpainter.html#setBrush">setBrush</a>( b2 ); +<a name="x1071"></a> p-><a href="tqpainter.html#drawRoundRect">drawRoundRect</a>( 10, 150, 200, 100, 20, 20 ); + p-><a href="tqpainter.html#setBrush">setBrush</a>( b3 ); +<a name="x1068"></a> p-><a href="tqpainter.html#drawEllipse">drawEllipse</a>( 250, 10, 200, 100 ); + p-><a href="tqpainter.html#setBrush">setBrush</a>( b4 ); +<a name="x1069"></a> p-><a href="tqpainter.html#drawPie">drawPie</a>( 250, 150, 200, 100, 45*16, 90*16 ); } @@ -178,8 +178,8 @@ public slots: void updateIt( int ); void printIt(); protected: - void drawIt( <a href="ntqpainter.html">TQPainter</a> * ); - void paintEvent( <a href="qpaintevent.html">TQPaintEvent</a> * ); + void drawIt( <a href="tqpainter.html">TQPainter</a> * ); + void paintEvent( <a href="tqpaintevent.html">TQPaintEvent</a> * ); void resizeEvent( <a href="qresizeevent.html">TQResizeEvent</a> * ); private: <a href="ntqprinter.html">TQPrinter</a> *printer; @@ -209,13 +209,13 @@ private: int maxheight = 10; int i; const char *n; -<a name="x1084"></a> <a href="ntqfontmetrics.html">TQFontMetrics</a> fm = bgroup-><a href="tqwidget.html#fontMetrics">fontMetrics</a>(); +<a name="x1084"></a> <a href="tqfontmetrics.html">TQFontMetrics</a> fm = bgroup-><a href="tqwidget.html#fontMetrics">fontMetrics</a>(); // Find out the longest function description. // Here we make use of the last "0,0"-entry in the // ourDrawFunctions-array. for ( i=0; (n=ourDrawFunctions[i].name) != 0; i++ ) { -<a name="x1066"></a> int w = fm.<a href="ntqfontmetrics.html#width">width</a>( n ); +<a name="x1066"></a> int w = fm.<a href="tqfontmetrics.html#width">width</a>( n ); maxwidth = TQMAX(w,maxwidth); // TQMAX is a macro defined in ntqglobal.h // and returns the biggest of to values. // Due to its macro nature one should use it with care and with @@ -295,7 +295,7 @@ void <a name="f368"></a>DrawView::updateIt( int index ) // Calls the drawing function as specified by the radio buttons. // -void <a name="f369"></a>DrawView::drawIt( <a href="ntqpainter.html">TQPainter</a> *p ) +void <a name="f369"></a>DrawView::drawIt( <a href="tqpainter.html">TQPainter</a> *p ) { (*ourDrawFunctions[drawindex].f)(p); } @@ -307,8 +307,8 @@ void <a name="f369"></a>DrawView::drawIt( <a href="ntqpainter.html">TQPainter</a void <a name="f370"></a>DrawView::printIt() { <a name="x1079"></a> if ( printer-><a href="ntqprinter.html#setup">setup</a>( this ) ) { - <a href="ntqpainter.html">TQPainter</a> paint; -<a name="x1067"></a> if( !paint.<a href="ntqpainter.html#begin">begin</a>( printer ) ) + <a href="tqpainter.html">TQPainter</a> paint; +<a name="x1067"></a> if( !paint.<a href="tqpainter.html#begin">begin</a>( printer ) ) return; drawIt( &paint ); } @@ -318,9 +318,9 @@ void <a name="f370"></a>DrawView::printIt() // Called when the widget needs to be updated. // -void DrawView::<a href="tqwidget.html#paintEvent">paintEvent</a>( <a href="qpaintevent.html">TQPaintEvent</a> * ) +void DrawView::<a href="tqwidget.html#paintEvent">paintEvent</a>( <a href="tqpaintevent.html">TQPaintEvent</a> * ) { - <a href="ntqpainter.html">TQPainter</a> paint( this ); + <a href="tqpainter.html">TQPainter</a> paint( this ); drawIt( &paint ); } |