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/progressbar-example.html | 118 +++++++++++++++++++------------------- 1 file changed, 59 insertions(+), 59 deletions(-) (limited to 'doc/html/progressbar-example.html') diff --git a/doc/html/progressbar-example.html b/doc/html/progressbar-example.html index 99a024dae..dc54be1dd 100644 --- a/doc/html/progressbar-example.html +++ b/doc/html/progressbar-example.html @@ -49,25 +49,25 @@ This example shows how to use a progress bar. #ifndef PROGRESSBAR_H #define PROGRESSBAR_H -#include <qbuttongroup.h> -#include <qtimer.h> +#include <ntqbuttongroup.h> +#include <ntqtimer.h> class TQRadioButton; class TQPushButton; class TQProgressBar; -class ProgressBar : public TQButtonGroup +class ProgressBar : public TQButtonGroup { Q_OBJECT public: - ProgressBar( TQWidget *parent = 0, const char *name = 0 ); + ProgressBar( TQWidget *parent = 0, const char *name = 0 ); protected: - TQRadioButton *slow, *normal, *fast; - TQPushButton *start, *pause, *reset; - TQProgressBar *progress; - TQTimer timer; + TQRadioButton *slow, *normal, *fast; + TQPushButton *start, *pause, *reset; + TQProgressBar *progress; + TQTimer timer; protected slots: void slotStart(); @@ -93,12 +93,12 @@ protected slots: #include "progressbar.h" -#include <qradiobutton.h> -#include <qpushbutton.h> -#include <qprogressbar.h> -#include <qlayout.h> +#include <ntqradiobutton.h> +#include <ntqpushbutton.h> +#include <ntqprogressbar.h> +#include <ntqlayout.h> -#include <qmotifstyle.h> +#include <ntqmotifstyle.h> /* * Constructor @@ -106,21 +106,21 @@ protected slots: * Creates child widgets of the ProgressBar widget */ -ProgressBar::ProgressBar( TQWidget *parent, const char *name ) - : TQButtonGroup( 0, Horizontal, "Progress Bar", parent, name ), timer() +ProgressBar::ProgressBar( TQWidget *parent, const char *name ) + : TQButtonGroup( 0, Horizontal, "Progress Bar", parent, name ), timer() { - setMargin( 10 ); + setMargin( 10 ); - TQGridLayout* toplayout = new TQGridLayout( layout(), 2, 2, 5); + TQGridLayout* toplayout = new TQGridLayout( layout(), 2, 2, 5); - setRadioButtonExclusive( TRUE ); + setRadioButtonExclusive( TRUE ); // insert three radiobuttons which the user can use // to set the speed of the progress and two pushbuttons // to start/pause/continue and reset the progress - slow = new TQRadioButton( "S&low", this ); - normal = new TQRadioButton( "&Normal", this ); - fast = new TQRadioButton( "&Fast", this ); + slow = new TQRadioButton( "S&low", this ); + normal = new TQRadioButton( "&Normal", this ); + fast = new TQRadioButton( "&Fast", this ); TQVBoxLayout* vb1 = new TQVBoxLayout; toplayout->addLayout( vb1, 0, 0 ); vb1->addWidget( slow ); @@ -128,32 +128,32 @@ protected slots: vb1->addWidget( fast ); // two push buttons, one for start, for for reset. - start = new TQPushButton( "&Start", this ); - reset = new TQPushButton( "&Reset", this ); + start = new TQPushButton( "&Start", this ); + reset = new TQPushButton( "&Reset", this ); TQVBoxLayout* vb2 = new TQVBoxLayout; toplayout->addLayout( vb2, 0, 1 ); vb2->addWidget( start ); vb2->addWidget( reset ); // Create the progressbar - progress = new TQProgressBar( 100, this ); - // progress->setStyle( new TQMotifStyle() ); + progress = new TQProgressBar( 100, this ); + // progress->setStyle( new TQMotifStyle() ); toplayout->addMultiCellWidget( progress, 1, 1, 0, 1 ); // connect the clicked() SIGNALs of the pushbuttons to SLOTs - connect( start, SIGNAL( clicked() ), this, SLOT( slotStart() ) ); - connect( reset, SIGNAL( clicked() ), this, SLOT( slotReset() ) ); + connect( start, SIGNAL( clicked() ), this, SLOT( slotStart() ) ); + connect( reset, SIGNAL( clicked() ), this, SLOT( slotReset() ) ); // connect the timeout() SIGNAL of the progress-timer to a SLOT - connect( &timer, SIGNAL( timeout() ), this, SLOT( slotTimeout() ) ); + connect( &timer, SIGNAL( timeout() ), this, SLOT( slotTimeout() ) ); // Let's start with normal speed... - normal->setChecked( TRUE ); + normal->setChecked( TRUE ); // some contraints - start->setFixedWidth( 80 ); - setMinimumWidth( 300 ); + start->setFixedWidth( 80 ); + setMinimumWidth( 300 ); } /* @@ -166,20 +166,20 @@ protected slots: void ProgressBar::slotStart() { // If the progress bar is at the beginning... - if ( progress->progress() == -1 ) { + if ( progress->progress() == -1 ) { // ...set according to the checked speed-radiobutton // the number of steps which are needed to complete the process - if ( slow->isChecked() ) - progress->setTotalSteps( 10000 ); - else if ( normal->isChecked() ) - progress->setTotalSteps( 1000 ); + if ( slow->isChecked() ) + progress->setTotalSteps( 10000 ); + else if ( normal->isChecked() ) + progress->setTotalSteps( 1000 ); else - progress->setTotalSteps( 50 ); + progress->setTotalSteps( 50 ); // disable the speed-radiobuttons - slow->setEnabled( FALSE ); - normal->setEnabled( FALSE ); - fast->setEnabled( FALSE ); + slow->setEnabled( FALSE ); + normal->setEnabled( FALSE ); + fast->setEnabled( FALSE ); } // If the progress is not running... @@ -187,12 +187,12 @@ void ProgressBar::slotStart() // ...start the timer (and so the progress) with a interval of 1 ms... timer.start( 1 ); // ...and rename the start/pause/continue button to Pause - start->setText( "&Pause" ); + start->setText( "&Pause" ); } else { // if the prgress is running... // ...stop the timer (and so the prgress)... timer.stop(); // ...and rename the start/pause/continue button to Continue - start->setText( "&Continue" ); + start->setText( "&Continue" ); } } @@ -208,17 +208,17 @@ void ProgressBar::slotReset() timer.stop(); // rename the start/pause/continue button to Start... - start->setText( "&Start" ); + start->setText( "&Start" ); // ...and enable this button - start->setEnabled( TRUE ); + start->setEnabled( TRUE ); // enable the speed-radiobuttons - slow->setEnabled( TRUE ); - normal->setEnabled( TRUE ); - fast->setEnabled( TRUE ); + slow->setEnabled( TRUE ); + normal->setEnabled( TRUE ); + fast->setEnabled( TRUE ); // reset the progressbar - progress->reset(); + progress->reset(); } /* @@ -230,22 +230,22 @@ void ProgressBar::slotReset() void ProgressBar::slotTimeout() { - int p = progress->progress(); + int p = progress->progress(); #if 1 // If the progress is complete... - if ( p == progress->totalSteps() ) { + if ( p == progress->totalSteps() ) { // ...rename the start/pause/continue button to Start... - start->setText( "&Start" ); + start->setText( "&Start" ); // ...and disable it... - start->setEnabled( FALSE ); + start->setEnabled( FALSE ); // ...and return return; } #endif // If the process is not complete increase it - progress->setProgress( ++p ); + progress->setProgress( ++p ); } @@ -262,18 +262,18 @@ void ProgressBar::slotTimeout() *****************************************************************************/ #include "progressbar.h" -#include <qapplication.h> +#include <ntqapplication.h> int main(int argc,char **argv) { - TQApplication a(argc,argv); + TQApplication a(argc,argv); ProgressBar progressbar; - progressbar.setCaption("TQt Example - ProgressBar"); - a.setMainWidget(&progressbar); - progressbar.show(); + progressbar.setCaption("TQt Example - ProgressBar"); + a.setMainWidget(&progressbar); + progressbar.show(); - return a.exec(); + return a.exec(); } -- cgit v1.2.1