From ea318d1431c89e647598c510c4245c6571aa5f46 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 26 Jan 2012 23:32:43 -0600 Subject: Update to latest tqt3 automated conversion --- doc/html/timers.html | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'doc/html/timers.html') diff --git a/doc/html/timers.html b/doc/html/timers.html index ccf18b0fc..0dc2cd561 100644 --- a/doc/html/timers.html +++ b/doc/html/timers.html @@ -33,14 +33,14 @@ body { background: #ffffff; color: black; } -

TQObject, the base class of all TQt objects, provides the basic timer -support in TQt. With TQObject::startTimer(), you start a timer with +

TQObject, the base class of all TQt objects, provides the basic timer +support in TQt. With TQObject::startTimer(), you start a timer with an interval in milliseconds as argument. The function returns a unique integer timer id. The timer will now "fire" every interval -milliseconds, until you explicitly call TQObject::killTimer() with +milliseconds, until you explicitly call TQObject::killTimer() with the timer id.

For this mechanism to work, the application must run in an event -loop. You start an event loop with TQApplication::exec(). When a +loop. You start an event loop with TQApplication::exec(). When a timer fires, the application sends a TQTimerEvent, and the flow of control leaves the event loop until the timer event is processed. This implies that a timer cannot fire while your application is busy doing @@ -51,26 +51,26 @@ one year is possible). The accuracy depends on the underlying operating system. Windows 95/98 has 55 millisecond (18.2 times per second) accuracy; other systems that we have tested (UNIX X11 and Windows NT) can handle 1 millisecond intervals. -

The main API for the timer functionality is TQTimer. That class +

The main API for the timer functionality is TQTimer. That class provides regular timers that emit a signal when the timer fires, and -inherits TQObject so that it fits well into the ownership structure +inherits TQObject so that it fits well into the ownership structure of most GUI programs. The normal way of using it is like this:

-    TQTimer * counter = new TQTimer( this );
-    connect( counter, SIGNAL(timeout()),
+    TQTimer * counter = new TQTimer( this );
+    connect( counter, SIGNAL(timeout()),
              this, SLOT(updateCaption()) );
-    counter->start( 1000 );
+    counter->start( 1000 );
 

The counter timer is made into a child of this widget, so that when this widget is deleted, the timer is deleted too. Next, its timeout signal is connected to the slot that will do the work, and finally it's started. -

TQTimer also provides a simple one-shot timer API. TQButton uses this +

TQTimer also provides a simple one-shot timer API. TQButton uses this to show the button being pressed down and then (0.1 seconds later) be released when the keyboard is used to "press" a button, for example:

-    TQTimer::singleShot( 100, this, SLOT(animateTimeout()) );
+    TQTimer::singleShot( 100, this, SLOT(animateTimeout()) );
 

0.1 seconds after this line of code is executed, the same button's @@ -87,11 +87,11 @@ single-threaded application without blocking the user interface. // has finished. Note that this example is not complete, just an // outline. - class Mandelbrot : public TQObject + class Mandelbrot : public TQObject { Q_OBJECT // required for signals/slots public: - Mandelbrot( TQObject *parent=0, const char *name ); + Mandelbrot( TQObject *parent=0, const char *name ); ... public slots: void start(); @@ -100,7 +100,7 @@ single-threaded application without blocking the user interface. private slots: void calculate(); private: - TQTimer timer; + TQTimer timer; ... }; @@ -108,10 +108,10 @@ single-threaded application without blocking the user interface. // Constructs and initializes a Mandelbrot object. // - Mandelbrot::Mandelbrot( TQObject *parent=0, const char *name ) - : TQObject( parent, name ) + Mandelbrot::Mandelbrot( TQObject *parent=0, const char *name ) + : TQObject( parent, name ) { - connect( &timer, SIGNAL(timeout()), SLOT(calculate()) ); + connect( &timer, SIGNAL(timeout()), SLOT(calculate()) ); ... } @@ -122,8 +122,8 @@ single-threaded application without blocking the user interface. void Mandelbrot::start() { - if ( !timer.isActive() ) // not already running - timer.start( 10 ); // timeout every 10 ms + if ( !timer.isActive() ) // not already running + timer.start( 10 ); // timeout every 10 ms } // @@ -135,7 +135,7 @@ single-threaded application without blocking the user interface. { ... // perform the calculation for a scanline if ( finished ) { // no more scanlines - timer.stop(); + timer.stop(); emit done(); } } -- cgit v1.2.1