diff options
Diffstat (limited to 'doc/html/tutorial1-08.html')
-rw-r--r-- | doc/html/tutorial1-08.html | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/doc/html/tutorial1-08.html b/doc/html/tutorial1-08.html index 13676712a..629ec4818 100644 --- a/doc/html/tutorial1-08.html +++ b/doc/html/tutorial1-08.html @@ -86,13 +86,13 @@ function using <a href="ntqapplication.html#qInstallMsgHandler">::qInstallMsgHan <a name="1-3"></a><p> CannonField is a new custom widget that knows how to display itself. <p> -<p> <pre> class CannonField : public <a href="ntqwidget.html">TQWidget</a> +<p> <pre> class CannonField : public <a href="tqwidget.html">TQWidget</a> { <a href="metaobjects.html#TQ_OBJECT">TQ_OBJECT</a> public: - CannonField( <a href="ntqwidget.html">TQWidget</a> *parent=0, const char *name=0 ); + CannonField( <a href="tqwidget.html">TQWidget</a> *parent=0, const char *name=0 ); </pre> -<p> CannonField inherits <a href="ntqwidget.html">TQWidget</a>, and we use the same idiom as for LCDRange. +<p> CannonField inherits <a href="tqwidget.html">TQWidget</a>, and we use the same idiom as for LCDRange. <p> <pre> int angle() const { return ang; } <a href="ntqsizepolicy.html">TQSizePolicy</a> sizePolicy() const; @@ -114,13 +114,13 @@ to update itself (i.e., paint the widget's surface). </h3> <a name="1-4"></a><p> -<p> <pre> CannonField::CannonField( <a href="ntqwidget.html">TQWidget</a> *parent, const char *name ) - : <a href="ntqwidget.html">TQWidget</a>( parent, name ) +<p> <pre> CannonField::CannonField( <a href="tqwidget.html">TQWidget</a> *parent, const char *name ) + : <a href="tqwidget.html">TQWidget</a>( parent, name ) { </pre> <p> Again, we use the same idiom as for LCDRange in the previous chapter. <p> <pre> ang = 45; - <a href="ntqwidget.html#setPalette">setPalette</a>( TQPalette( TQColor( 250, 250, 200) ) ); + <a href="tqwidget.html#setPalette">setPalette</a>( TQPalette( TQColor( 250, 250, 200) ) ); } </pre> <p> The constructor initializes the angle value to 45 degrees and sets a @@ -137,7 +137,7 @@ colors will actually be used.) if ( ang == degrees ) return; ang = degrees; - <a href="ntqwidget.html#repaint">repaint</a>(); + <a href="tqwidget.html#repaint">repaint</a>(); emit angleChanged( ang ); } </pre> @@ -146,13 +146,13 @@ colors will actually be used.) chosen not to issue a warning if the new angle is out of range. <p> If the new angle equals the old one, we return immediately. It is important to only emit the signal angleChanged() when the angle <em>really</em> has changed. -<p> Then we set the new angle value and repaint our widget. The <a href="ntqwidget.html#repaint">TQWidget::repaint</a>() function clears the widget (usually filling it with +<p> Then we set the new angle value and repaint our widget. The <a href="tqwidget.html#repaint">TQWidget::repaint</a>() function clears the widget (usually filling it with its background color) and sends a paint event to the widget. This results in a call to the paint event function of the widget. <p> Finally, we emit the angleChanged() signal to tell the outside world that the angle has changed. The <tt>emit</tt> keyword is unique to TQt and not regular C++ syntax. In fact, it is a macro. -<p> <pre> <a name="x2336"></a>void CannonField::<a href="ntqwidget.html#paintEvent">paintEvent</a>( <a href="qpaintevent.html">TQPaintEvent</a> * ) +<p> <pre> <a name="x2336"></a>void CannonField::<a href="tqwidget.html#paintEvent">paintEvent</a>( <a href="qpaintevent.html">TQPaintEvent</a> * ) { <a href="ntqstring.html">TQString</a> s = "Angle = " + TQString::number( ang ); <a href="ntqpainter.html">TQPainter</a> p( this ); @@ -174,10 +174,10 @@ We'll come back to TQPainter later; it can do a great many things. <p> <pre> #include "cannon.h" </pre> <p> We include our new class. -<p> <pre> class MyWidget: public <a href="ntqwidget.html">TQWidget</a> +<p> <pre> class MyWidget: public <a href="tqwidget.html">TQWidget</a> { public: - MyWidget( <a href="ntqwidget.html">TQWidget</a> *parent=0, const char *name=0 ); + MyWidget( <a href="tqwidget.html">TQWidget</a> *parent=0, const char *name=0 ); }; </pre> <p> This time we include a single LCDRange and a CannonField in our top-level @@ -244,7 +244,7 @@ resized. </pre> <p> We set an initial angle value. Note that this will trigger the connection from LCDRange to CannonField. -<p> <pre> <a name="x2339"></a> angle-><a href="ntqwidget.html#setFocus">setFocus</a>(); +<p> <pre> <a name="x2339"></a> angle-><a href="tqwidget.html#setFocus">setFocus</a>(); </pre> <p> Our last action is to set <tt>angle</tt> to have <a href="focus.html#keyboard-focus">keyboard focus</a> so that keyboard input will go to the LCDRange widget by default. @@ -252,7 +252,7 @@ keyboard input will go to the LCDRange widget by default. to be terribly useful. However, its constructor just got a new line: <p> -<pre> <a href="ntqwidget.html#setFocusProxy">setFocusProxy</a>( slider ); +<pre> <a href="tqwidget.html#setFocusProxy">setFocusProxy</a>( slider ); </pre> <p> The LCDRange sets the slider to be its focus proxy. That means that when someone (the program or the user) wants to give the LCDRange |