diff options
Diffstat (limited to 'doc/html/drawlines-example.html')
-rw-r--r-- | doc/html/drawlines-example.html | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/doc/html/drawlines-example.html b/doc/html/drawlines-example.html index eb804914e..2f96f4562 100644 --- a/doc/html/drawlines-example.html +++ b/doc/html/drawlines-example.html @@ -49,9 +49,9 @@ release the button, and watch the lines get drawn. ** *****************************************************************************/ -#include <<a href="qwidget-h.html">qwidget.h</a>> -#include <<a href="qpainter-h.html">qpainter.h</a>> -#include <<a href="qapplication-h.html">qapplication.h</a>> +#include <<a href="qwidget-h.html">ntqwidget.h</a>> +#include <<a href="qpainter-h.html">ntqpainter.h</a>> +#include <<a href="qapplication-h.html">ntqapplication.h</a>> #include <stdlib.h> @@ -63,10 +63,10 @@ const int MAXCOLORS = 40; // ConnectWidget - draws connected lines // -class ConnectWidget : public <a href="qwidget.html">TQWidget</a> +class ConnectWidget : public <a href="ntqwidget.html">TQWidget</a> { public: - ConnectWidget( <a href="qwidget.html">TQWidget</a> *parent=0, const char *name=0 ); + ConnectWidget( <a href="ntqwidget.html">TQWidget</a> *parent=0, const char *name=0 ); ~ConnectWidget(); protected: void paintEvent( <a href="qpaintevent.html">TQPaintEvent</a> * ); @@ -74,8 +74,8 @@ protected: void mouseReleaseEvent( <a href="qmouseevent.html">TQMouseEvent</a> *); void mouseMoveEvent( <a href="qmouseevent.html">TQMouseEvent</a> *); private: - <a href="qpoint.html">TQPoint</a> *points; // point array - <a href="qcolor.html">TQColor</a> *colors; // color array + <a href="ntqpoint.html">TQPoint</a> *points; // point array + <a href="ntqcolor.html">TQColor</a> *colors; // color array int count; // count = number of points bool down; // TRUE if mouse down }; @@ -85,14 +85,14 @@ private: // Constructs a ConnectWidget. // -<a name="f475"></a>ConnectWidget::ConnectWidget( <a href="qwidget.html">TQWidget</a> *parent, const char *name ) - : <a href="qwidget.html">TQWidget</a>( parent, name, WStaticContents ) +<a name="f475"></a>ConnectWidget::ConnectWidget( <a href="ntqwidget.html">TQWidget</a> *parent, const char *name ) + : <a href="ntqwidget.html">TQWidget</a>( parent, name, WStaticContents ) { - <a href="qwidget.html#setBackgroundColor">setBackgroundColor</a>( white ); // white background + <a href="ntqwidget.html#setBackgroundColor">setBackgroundColor</a>( white ); // white background count = 0; down = FALSE; - points = new <a href="qpoint.html">TQPoint</a>[MAXPOINTS]; - colors = new <a href="qcolor.html">TQColor</a>[MAXCOLORS]; + points = new <a href="ntqpoint.html">TQPoint</a>[MAXPOINTS]; + colors = new <a href="ntqcolor.html">TQColor</a>[MAXCOLORS]; for ( int i=0; i<MAXCOLORS; i++ ) // init color array colors[i] = TQColor( rand()&255, rand()&255, rand()&255 ); } @@ -108,13 +108,13 @@ ConnectWidget::~ConnectWidget() // Handles paint events for the connect widget. // -<a name="x1661"></a>void ConnectWidget::<a href="qwidget.html#paintEvent">paintEvent</a>( <a href="qpaintevent.html">TQPaintEvent</a> * ) +<a name="x1661"></a>void ConnectWidget::<a href="ntqwidget.html#paintEvent">paintEvent</a>( <a href="qpaintevent.html">TQPaintEvent</a> * ) { - <a href="qpainter.html">TQPainter</a> paint( this ); + <a href="ntqpainter.html">TQPainter</a> paint( this ); for ( int i=0; i<count-1; i++ ) { // connect all points for ( int j=i+1; j<count; j++ ) { - paint.<a href="qpainter.html#setPen">setPen</a>( colors[rand()%MAXCOLORS] ); // set random pen color -<a name="x1655"></a> paint.<a href="qpainter.html#drawLine">drawLine</a>( points[i], points[j] ); // draw line + paint.<a href="ntqpainter.html#setPen">setPen</a>( colors[rand()%MAXCOLORS] ); // set random pen color +<a name="x1655"></a> paint.<a href="ntqpainter.html#drawLine">drawLine</a>( points[i], points[j] ); // draw line } } } @@ -124,11 +124,11 @@ ConnectWidget::~ConnectWidget() // Handles mouse press events for the connect widget. // -<a name="x1659"></a>void ConnectWidget::<a href="qwidget.html#mousePressEvent">mousePressEvent</a>( <a href="qmouseevent.html">TQMouseEvent</a> * ) +<a name="x1659"></a>void ConnectWidget::<a href="ntqwidget.html#mousePressEvent">mousePressEvent</a>( <a href="qmouseevent.html">TQMouseEvent</a> * ) { down = TRUE; count = 0; // start recording points - <a href="qwidget.html#erase">erase</a>(); // erase widget contents + <a href="ntqwidget.html#erase">erase</a>(); // erase widget contents } @@ -136,10 +136,10 @@ ConnectWidget::~ConnectWidget() // Handles mouse release events for the connect widget. // -<a name="x1660"></a>void ConnectWidget::<a href="qwidget.html#mouseReleaseEvent">mouseReleaseEvent</a>( <a href="qmouseevent.html">TQMouseEvent</a> * ) +<a name="x1660"></a>void ConnectWidget::<a href="ntqwidget.html#mouseReleaseEvent">mouseReleaseEvent</a>( <a href="qmouseevent.html">TQMouseEvent</a> * ) { down = FALSE; // done recording points - <a href="qwidget.html#update">update</a>(); // draw the lines + <a href="ntqwidget.html#update">update</a>(); // draw the lines } @@ -147,12 +147,12 @@ ConnectWidget::~ConnectWidget() // Handles mouse move events for the connect widget. // -<a name="x1658"></a>void ConnectWidget::<a href="qwidget.html#mouseMoveEvent">mouseMoveEvent</a>( <a href="qmouseevent.html">TQMouseEvent</a> *e ) +<a name="x1658"></a>void ConnectWidget::<a href="ntqwidget.html#mouseMoveEvent">mouseMoveEvent</a>( <a href="qmouseevent.html">TQMouseEvent</a> *e ) { if ( down && count < MAXPOINTS ) { - <a href="qpainter.html">TQPainter</a> paint( this ); + <a href="ntqpainter.html">TQPainter</a> paint( this ); <a name="x1654"></a> points[count++] = e-><a href="qmouseevent.html#pos">pos</a>(); // add point -<a name="x1656"></a> paint.<a href="qpainter.html#drawPoint">drawPoint</a>( e-><a href="qmouseevent.html#pos">pos</a>() ); // plot point +<a name="x1656"></a> paint.<a href="ntqpainter.html#drawPoint">drawPoint</a>( e-><a href="qmouseevent.html#pos">pos</a>() ); // plot point } } @@ -163,14 +163,14 @@ ConnectWidget::~ConnectWidget() int main( int argc, char **argv ) { - <a href="qapplication.html">TQApplication</a> a( argc, argv ); + <a href="ntqapplication.html">TQApplication</a> a( argc, argv ); ConnectWidget connect; #ifndef QT_NO_WIDGET_TOPEXTRA // for TQt/Embedded minimal build - connect.<a href="qwidget.html#setCaption">setCaption</a>( "TQt Example - Draw lines"); + connect.<a href="ntqwidget.html#setCaption">setCaption</a>( "TQt Example - Draw lines"); #endif - a.<a href="qapplication.html#setMainWidget">setMainWidget</a>( &connect ); - connect.<a href="qwidget.html#show">show</a>(); - return a.<a href="qapplication.html#exec">exec</a>(); + a.<a href="ntqapplication.html#setMainWidget">setMainWidget</a>( &connect ); + connect.<a href="ntqwidget.html#show">show</a>(); + return a.<a href="ntqapplication.html#exec">exec</a>(); } </pre> |