diff options
author | Timothy Pearson <[email protected]> | 2012-01-26 23:32:43 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2012-01-26 23:32:43 -0600 |
commit | ea318d1431c89e647598c510c4245c6571aa5f46 (patch) | |
tree | 996d29b80c30d453dda86d1a23162d441628f169 /doc/html/picture-example.html | |
parent | aaf89d4b48f69c9293feb187db26362e550b5561 (diff) | |
download | tqt3-ea318d1431c89e647598c510c4245c6571aa5f46.tar.gz tqt3-ea318d1431c89e647598c510c4245c6571aa5f46.zip |
Update to latest tqt3 automated conversion
Diffstat (limited to 'doc/html/picture-example.html')
-rw-r--r-- | doc/html/picture-example.html | 112 |
1 files changed, 56 insertions, 56 deletions
diff --git a/doc/html/picture-example.html b/doc/html/picture-example.html index 6734d4a17..1117c1fe8 100644 --- a/doc/html/picture-example.html +++ b/doc/html/picture-example.html @@ -47,47 +47,47 @@ a set of drawing commands. ** *****************************************************************************/ -#include <<a href="qapplication-h.html">qapplication.h</a>> -#include <<a href="qpainter-h.html">qpainter.h</a>> -#include <<a href="qpicture-h.html">qpicture.h</a>> -#include <<a href="qpixmap-h.html">qpixmap.h</a>> -#include <<a href="qwidget-h.html">qwidget.h</a>> -#include <<a href="qmessagebox-h.html">qmessagebox.h</a>> -#include <<a href="qfile-h.html">qfile.h</a>> +#include <<a href="qapplication-h.html">ntqapplication.h</a>> +#include <<a href="qpainter-h.html">ntqpainter.h</a>> +#include <<a href="qpicture-h.html">ntqpicture.h</a>> +#include <<a href="qpixmap-h.html">ntqpixmap.h</a>> +#include <<a href="qwidget-h.html">ntqwidget.h</a>> +#include <<a href="qmessagebox-h.html">ntqmessagebox.h</a>> +#include <<a href="qfile-h.html">ntqfile.h</a>> #include <ctype.h> -void paintCar( <a href="qpainter.html">TQPainter</a> *p ) // paint a car +void paintCar( <a href="ntqpainter.html">TQPainter</a> *p ) // paint a car { - <a href="qpointarray.html">TQPointArray</a> a; - <a href="qbrush.html">TQBrush</a> brush( TQt::yellow, TQt::SolidPattern ); -<a name="x120"></a> p-><a href="qpainter.html#setBrush">setBrush</a>( brush ); // use solid, yellow brush + <a href="ntqpointarray.html">TQPointArray</a> a; + <a href="ntqbrush.html">TQBrush</a> brush( TQt::yellow, TQt::SolidPattern ); +<a name="x120"></a> p-><a href="ntqpainter.html#setBrush">setBrush</a>( brush ); // use solid, yellow brush <a name="x125"></a> a.setPoints( 5, 50,50, 350,50, 450,120, 450,250, 50,250 ); -<a name="x115"></a> p-><a href="qpainter.html#drawPolygon">drawPolygon</a>( a ); // draw car body - - <a href="qfont.html">TQFont</a> f( "courier", 12, TQFont::Bold ); -<a name="x121"></a> p-><a href="qpainter.html#setFont">setFont</a>( f ); - - <a href="qcolor.html">TQColor</a> windowColor( 120, 120, 255 ); // a light blue color -<a name="x108"></a> brush.<a href="qbrush.html#setColor">setColor</a>( windowColor ); // set this brush color - p-><a href="qpainter.html#setBrush">setBrush</a>( brush ); // set brush -<a name="x116"></a> p-><a href="qpainter.html#drawRect">drawRect</a>( 80, 80, 250, 70 ); // car window -<a name="x117"></a> p-><a href="qpainter.html#drawText">drawText</a>( 180, 80, 150, 70, TQt::AlignCenter, "-- TQt --\nTrolltech AS" ); - - <a href="qpixmap.html">TQPixmap</a> pixmap; -<a name="x124"></a> if ( pixmap.<a href="qpixmap.html#load">load</a>("flag.bmp") ) // load and draw image -<a name="x114"></a> p-><a href="qpainter.html#drawPixmap">drawPixmap</a>( 100, 85, pixmap ); - -<a name="x119"></a> p-><a href="qpainter.html#setBackgroundMode">setBackgroundMode</a>( TQt::OpaqueMode ); // set opaque mode - p-><a href="qpainter.html#setBrush">setBrush</a>( TQt::DiagCrossPattern ); // black diagonal cross pattern -<a name="x112"></a> p-><a href="qpainter.html#drawEllipse">drawEllipse</a>( 90, 210, 80, 80 ); // back wheel - p-><a href="qpainter.html#setBrush">setBrush</a>( TQt::CrossPattern ); // black cross fill pattern - p-><a href="qpainter.html#drawEllipse">drawEllipse</a>( 310, 210, 80, 80 ); // front wheel +<a name="x115"></a> p-><a href="ntqpainter.html#drawPolygon">drawPolygon</a>( a ); // draw car body + + <a href="ntqfont.html">TQFont</a> f( "courier", 12, TQFont::Bold ); +<a name="x121"></a> p-><a href="ntqpainter.html#setFont">setFont</a>( f ); + + <a href="ntqcolor.html">TQColor</a> windowColor( 120, 120, 255 ); // a light blue color +<a name="x108"></a> brush.<a href="ntqbrush.html#setColor">setColor</a>( windowColor ); // set this brush color + p-><a href="ntqpainter.html#setBrush">setBrush</a>( brush ); // set brush +<a name="x116"></a> p-><a href="ntqpainter.html#drawRect">drawRect</a>( 80, 80, 250, 70 ); // car window +<a name="x117"></a> p-><a href="ntqpainter.html#drawText">drawText</a>( 180, 80, 150, 70, TQt::AlignCenter, "-- TQt --\nTrolltech AS" ); + + <a href="ntqpixmap.html">TQPixmap</a> pixmap; +<a name="x124"></a> if ( pixmap.<a href="ntqpixmap.html#load">load</a>("flag.bmp") ) // load and draw image +<a name="x114"></a> p-><a href="ntqpainter.html#drawPixmap">drawPixmap</a>( 100, 85, pixmap ); + +<a name="x119"></a> p-><a href="ntqpainter.html#setBackgroundMode">setBackgroundMode</a>( TQt::OpaqueMode ); // set opaque mode + p-><a href="ntqpainter.html#setBrush">setBrush</a>( TQt::DiagCrossPattern ); // black diagonal cross pattern +<a name="x112"></a> p-><a href="ntqpainter.html#drawEllipse">drawEllipse</a>( 90, 210, 80, 80 ); // back wheel + p-><a href="ntqpainter.html#setBrush">setBrush</a>( TQt::CrossPattern ); // black cross fill pattern + p-><a href="ntqpainter.html#drawEllipse">drawEllipse</a>( 310, 210, 80, 80 ); // front wheel } -class PictureDisplay : public <a href="qwidget.html">TQWidget</a> // picture display widget +class PictureDisplay : public <a href="ntqwidget.html">TQWidget</a> // picture display widget { public: PictureDisplay( const char *fileName ); @@ -96,18 +96,18 @@ protected: void paintEvent( <a href="qpaintevent.html">TQPaintEvent</a> * ); void keyPressEvent( <a href="qkeyevent.html">TQKeyEvent</a> * ); private: - <a href="qpicture.html">TQPicture</a> *pict; - <a href="qstring.html">TQString</a> name; + <a href="ntqpicture.html">TQPicture</a> *pict; + <a href="ntqstring.html">TQString</a> name; }; <a name="f207"></a>PictureDisplay::PictureDisplay( const char *fileName ) { - pict = new <a href="qpicture.html">TQPicture</a>; + pict = new <a href="ntqpicture.html">TQPicture</a>; name = fileName; -<a name="x122"></a> if ( !pict-><a href="qpicture.html#load">load</a>(fileName) ) { // cannot load picture +<a name="x122"></a> if ( !pict-><a href="ntqpicture.html#load">load</a>(fileName) ) { // cannot load picture delete pict; pict = 0; - name.<a href="qstring.html#sprintf">sprintf</a>( "Not able to load picture: %s", fileName ); + name.<a href="ntqstring.html#sprintf">sprintf</a>( "Not able to load picture: %s", fileName ); } } @@ -116,24 +116,24 @@ PictureDisplay::~PictureDisplay() delete pict; } -void PictureDisplay::<a href="qwidget.html#paintEvent">paintEvent</a>( <a href="qpaintevent.html">TQPaintEvent</a> * ) +void PictureDisplay::<a href="ntqwidget.html#paintEvent">paintEvent</a>( <a href="qpaintevent.html">TQPaintEvent</a> * ) { - <a href="qpainter.html">TQPainter</a> paint( this ); // paint widget + <a href="ntqpainter.html">TQPainter</a> paint( this ); // paint widget if ( pict ) -<a name="x113"></a> paint.<a href="qpainter.html#drawPicture">drawPicture</a>( *pict ); // draw picture +<a name="x113"></a> paint.<a href="ntqpainter.html#drawPicture">drawPicture</a>( *pict ); // draw picture else - paint.<a href="qpainter.html#drawText">drawText</a>( <a href="qwidget.html#rect">rect</a>(), AlignCenter, name ); + paint.<a href="ntqpainter.html#drawText">drawText</a>( <a href="ntqwidget.html#rect">rect</a>(), AlignCenter, name ); } -<a name="x127"></a>void PictureDisplay::<a href="qwidget.html#keyPressEvent">keyPressEvent</a>( <a href="qkeyevent.html">TQKeyEvent</a> *k ) +<a name="x127"></a>void PictureDisplay::<a href="ntqwidget.html#keyPressEvent">keyPressEvent</a>( <a href="qkeyevent.html">TQKeyEvent</a> *k ) { <a name="x109"></a> switch ( tolower(k-><a href="qkeyevent.html#ascii">ascii</a>()) ) { case 'r': // reload - pict-><a href="qpicture.html#load">load</a>( name ); - <a href="qwidget.html#update">update</a>(); + pict-><a href="ntqpicture.html#load">load</a>( name ); + <a href="ntqwidget.html#update">update</a>(); break; case 'q': // quit -<a name="x106"></a> TQApplication::<a href="qapplication.html#exit">exit</a>(); +<a name="x106"></a> TQApplication::<a href="ntqapplication.html#exit">exit</a>(); break; } } @@ -141,7 +141,7 @@ void PictureDisplay::<a href="qwidget.html#paintEvent">paintEvent</a>( <a href=" int main( int argc, char **argv ) { - <a href="qapplication.html">TQApplication</a> a( argc, argv ); // TQApplication required! + <a href="ntqapplication.html">TQApplication</a> a( argc, argv ); // TQApplication required! const char *fileName = "car.pic"; // default picture file name @@ -149,23 +149,23 @@ int main( int argc, char **argv ) fileName = argv[1]; if ( !TQFile::exists(fileName) ) { - <a href="qpicture.html">TQPicture</a> pict; // our picture - <a href="qpainter.html">TQPainter</a> paint; // our painter + <a href="ntqpicture.html">TQPicture</a> pict; // our picture + <a href="ntqpainter.html">TQPainter</a> paint; // our painter -<a name="x111"></a> paint.<a href="qpainter.html#begin">begin</a>( &pict ); // begin painting onto picture +<a name="x111"></a> paint.<a href="ntqpainter.html#begin">begin</a>( &pict ); // begin painting onto picture paintCar( &paint ); // paint! -<a name="x118"></a> paint.<a href="qpainter.html#end">end</a>(); // painting done +<a name="x118"></a> paint.<a href="ntqpainter.html#end">end</a>(); // painting done -<a name="x123"></a> pict.<a href="qpicture.html#save">save</a>( fileName ); // save picture -<a name="x110"></a> TQMessageBox::<a href="qmessagebox.html#information">information</a>(0, "TQt Example - Picture", "Saved. Run me again!"); +<a name="x123"></a> pict.<a href="ntqpicture.html#save">save</a>( fileName ); // save picture +<a name="x110"></a> TQMessageBox::<a href="ntqmessagebox.html#information">information</a>(0, "TQt Example - Picture", "Saved. Run me again!"); return 0; } else { PictureDisplay test( fileName ); // create picture display - a.<a href="qapplication.html#setMainWidget">setMainWidget</a>( &test); // set main widget - test.<a href="qwidget.html#setCaption">setCaption</a>("TQt Example - Picture"); - test.<a href="qwidget.html#show">show</a>(); // show it + a.<a href="ntqapplication.html#setMainWidget">setMainWidget</a>( &test); // set main widget + test.<a href="ntqwidget.html#setCaption">setCaption</a>("TQt Example - Picture"); + test.<a href="ntqwidget.html#show">show</a>(); // show it - return a.<a href="qapplication.html#exec">exec</a>(); // start event loop + return a.<a href="ntqapplication.html#exec">exec</a>(); // start event loop } } </pre> |