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/progress-example.html | |
parent | aaf89d4b48f69c9293feb187db26362e550b5561 (diff) | |
download | tqt3-ea318d1431c89e647598c510c4245c6571aa5f46.tar.gz tqt3-ea318d1431c89e647598c510c4245c6571aa5f46.zip |
Update to latest tqt3 automated conversion
Diffstat (limited to 'doc/html/progress-example.html')
-rw-r--r-- | doc/html/progress-example.html | 206 |
1 files changed, 103 insertions, 103 deletions
diff --git a/doc/html/progress-example.html b/doc/html/progress-example.html index e20a0aba9..009b4dab0 100644 --- a/doc/html/progress-example.html +++ b/doc/html/progress-example.html @@ -48,17 +48,17 @@ demonstrates simple use of menus. ** *****************************************************************************/ -#include <<a href="qprogressdialog-h.html">qprogressdialog.h</a>> -#include <<a href="qapplication-h.html">qapplication.h</a>> -#include <<a href="qmenubar-h.html">qmenubar.h</a>> -#include <<a href="qpopupmenu-h.html">qpopupmenu.h</a>> -#include <<a href="qpainter-h.html">qpainter.h</a>> +#include <<a href="qprogressdialog-h.html">ntqprogressdialog.h</a>> +#include <<a href="qapplication-h.html">ntqapplication.h</a>> +#include <<a href="qmenubar-h.html">ntqmenubar.h</a>> +#include <<a href="qpopupmenu-h.html">ntqpopupmenu.h</a>> +#include <<a href="qpainter-h.html">ntqpainter.h</a>> #include <stdlib.h> -class AnimatedThingy : public <a href="qlabel.html">TQLabel</a> { +class AnimatedThingy : public <a href="ntqlabel.html">TQLabel</a> { public: - AnimatedThingy( <a href="qwidget.html">TQWidget</a>* parent, const <a href="qstring.html">TQString</a>& s ) : - <a href="qlabel.html">TQLabel</a>(parent), + AnimatedThingy( <a href="ntqwidget.html">TQWidget</a>* parent, const <a href="ntqstring.html">TQString</a>& s ) : + <a href="ntqlabel.html">TQLabel</a>(parent), label(s), step(0) { @@ -77,16 +77,16 @@ public: void show() { if (!isVisible()) startTimer(100); - TQWidget::<a href="qwidget.html#show">show</a>(); + TQWidget::<a href="ntqwidget.html#show">show</a>(); } void hide() { -<a name="x89"></a> TQWidget::<a href="qwidget.html#hide">hide</a>(); +<a name="x89"></a> TQWidget::<a href="ntqwidget.html#hide">hide</a>(); killTimers(); } - <a href="qsize.html">TQSize</a> sizeHint() const + <a href="ntqsize.html">TQSize</a> sizeHint() const { return TQSize(120,100); } @@ -94,15 +94,15 @@ public: protected: void timerEvent(TQTimerEvent*) { - <a href="qpainter.html">TQPainter</a> p(this); -<a name="x76"></a> <a href="qpen.html">TQPen</a> pn=p.<a href="qpainter.html#pen">pen</a>(); -<a name="x80"></a> pn.<a href="qpen.html#setWidth">setWidth</a>(2); -<a name="x79"></a> pn.<a href="qpen.html#setColor">setColor</a>(backgroundColor()); -<a name="x78"></a> p.<a href="qpainter.html#setPen">setPen</a>(pn); + <a href="ntqpainter.html">TQPainter</a> p(this); +<a name="x76"></a> <a href="ntqpen.html">TQPen</a> pn=p.<a href="ntqpainter.html#pen">pen</a>(); +<a name="x80"></a> pn.<a href="ntqpen.html#setWidth">setWidth</a>(2); +<a name="x79"></a> pn.<a href="ntqpen.html#setColor">setColor</a>(backgroundColor()); +<a name="x78"></a> p.<a href="ntqpainter.html#setPen">setPen</a>(pn); step = (step + 1) % nqix; -<a name="x73"></a> p.<a href="qpainter.html#drawLine">drawLine</a>(ox[0][step], oy[0][step], ox[1][step], oy[1][step]); +<a name="x73"></a> p.<a href="ntqpainter.html#drawLine">drawLine</a>(ox[0][step], oy[0][step], ox[1][step], oy[1][step]); inc(x0, dx0, width()); inc(y0, dy0, height()); @@ -113,31 +113,31 @@ protected: ox[1][step] = x1; oy[1][step] = y1; - <a href="qcolor.html">TQColor</a> c; -<a name="x66"></a> c.<a href="qcolor.html#setHsv">setHsv</a>( (step*255)/nqix, 255, 255 ); // rainbow effect - pn.<a href="qpen.html#setColor">setColor</a>(c); - p.<a href="qpainter.html#setPen">setPen</a>(pn); - p.<a href="qpainter.html#drawLine">drawLine</a>(ox[0][step], oy[0][step], ox[1][step], oy[1][step]); - p.<a href="qpainter.html#setPen">setPen</a>(colorGroup().text()); -<a name="x74"></a> p.<a href="qpainter.html#drawText">drawText</a>(rect(), AlignCenter, label); + <a href="ntqcolor.html">TQColor</a> c; +<a name="x66"></a> c.<a href="ntqcolor.html#setHsv">setHsv</a>( (step*255)/nqix, 255, 255 ); // rainbow effect + pn.<a href="ntqpen.html#setColor">setColor</a>(c); + p.<a href="ntqpainter.html#setPen">setPen</a>(pn); + p.<a href="ntqpainter.html#drawLine">drawLine</a>(ox[0][step], oy[0][step], ox[1][step], oy[1][step]); + p.<a href="ntqpainter.html#setPen">setPen</a>(colorGroup().text()); +<a name="x74"></a> p.<a href="ntqpainter.html#drawText">drawText</a>(rect(), AlignCenter, label); } void paintEvent(TQPaintEvent* event) { - <a href="qpainter.html">TQPainter</a> p(this); - <a href="qpen.html">TQPen</a> pn=p.<a href="qpainter.html#pen">pen</a>(); - pn.<a href="qpen.html#setWidth">setWidth</a>(2); - p.<a href="qpainter.html#setPen">setPen</a>(pn); -<a name="x77"></a> p.<a href="qpainter.html#setClipRect">setClipRect</a>(event->rect()); + <a href="ntqpainter.html">TQPainter</a> p(this); + <a href="ntqpen.html">TQPen</a> pn=p.<a href="ntqpainter.html#pen">pen</a>(); + pn.<a href="ntqpen.html#setWidth">setWidth</a>(2); + p.<a href="ntqpainter.html#setPen">setPen</a>(pn); +<a name="x77"></a> p.<a href="ntqpainter.html#setClipRect">setClipRect</a>(event->rect()); for (int i=0; i<nqix; i++) { - <a href="qcolor.html">TQColor</a> c; - c.<a href="qcolor.html#setHsv">setHsv</a>( (i*255)/nqix, 255, 255 ); // rainbow effect - pn.<a href="qpen.html#setColor">setColor</a>(c); - p.<a href="qpainter.html#setPen">setPen</a>(pn); - p.<a href="qpainter.html#drawLine">drawLine</a>(ox[0][i], oy[0][i], ox[1][i], oy[1][i]); + <a href="ntqcolor.html">TQColor</a> c; + c.<a href="ntqcolor.html#setHsv">setHsv</a>( (i*255)/nqix, 255, 255 ); // rainbow effect + pn.<a href="ntqpen.html#setColor">setColor</a>(c); + p.<a href="ntqpainter.html#setPen">setPen</a>(pn); + p.<a href="ntqpainter.html#drawLine">drawLine</a>(ox[0][i], oy[0][i], ox[1][i], oy[1][i]); } - p.<a href="qpainter.html#setPen">setPen</a>(colorGroup().text()); - p.<a href="qpainter.html#drawText">drawText</a>(rect(), AlignCenter, label); + p.<a href="ntqpainter.html#setPen">setPen</a>(colorGroup().text()); + p.<a href="ntqpainter.html#drawText">drawText</a>(rect(), AlignCenter, label); } private: @@ -153,12 +153,12 @@ private: int oy[2][nqix]; int x0,y0,x1,y1; int dx0,dy0,dx1,dy1; - <a href="qstring.html">TQString</a> label; + <a href="ntqstring.html">TQString</a> label; int step; }; -class CPUWaster : public <a href="qwidget.html">TQWidget</a> +class CPUWaster : public <a href="ntqwidget.html">TQWidget</a> { <a href="metaobjects.html#Q_OBJECT">Q_OBJECT</a> @@ -171,10 +171,10 @@ class CPUWaster : public <a href="qwidget.html">TQWidget</a> while (n--) r*=(n%3 ? 5 : 4); return r; } - <a href="qstring.html">TQString</a> drawItemText(int id) + <a href="ntqstring.html">TQString</a> drawItemText(int id) { - <a href="qstring.html">TQString</a> str; - str.<a href="qstring.html#sprintf">sprintf</a>("%d Rectangles", drawItemRects(id)); + <a href="ntqstring.html">TQString</a> str; + str.<a href="ntqstring.html#sprintf">sprintf</a>("%d Rectangles", drawItemRects(id)); return str; } @@ -182,29 +182,29 @@ public: CPUWaster() : pb(0) { - menubar = new <a href="qmenubar.html">TQMenuBar</a>( this, "menu" ); - <a href="qapplication.html#Q_CHECK_PTR">Q_CHECK_PTR</a>( menubar ); + menubar = new <a href="ntqmenubar.html">TQMenuBar</a>( this, "menu" ); + <a href="ntqapplication.html#Q_CHECK_PTR">Q_CHECK_PTR</a>( menubar ); - <a href="qpopupmenu.html">TQPopupMenu</a>* file = new <a href="qpopupmenu.html">TQPopupMenu</a>(); - <a href="qapplication.html#Q_CHECK_PTR">Q_CHECK_PTR</a>( file ); - menubar-><a href="qmenudata.html#insertItem">insertItem</a>( "&File", file ); + <a href="ntqpopupmenu.html">TQPopupMenu</a>* file = new <a href="ntqpopupmenu.html">TQPopupMenu</a>(); + <a href="ntqapplication.html#Q_CHECK_PTR">Q_CHECK_PTR</a>( file ); + menubar-><a href="ntqmenudata.html#insertItem">insertItem</a>( "&File", file ); for (int i=first_draw_item; i<=last_draw_item; i++) - file-><a href="qmenudata.html#insertItem">insertItem</a>( drawItemText(i), i ); -<a name="x67"></a> connect( menubar, SIGNAL(<a href="qmenubar.html#activated">activated</a>(int)), this, SLOT(doMenuItem(int)) ); -<a name="x69"></a> file-><a href="qmenudata.html#insertSeparator">insertSeparator</a>(); - file-><a href="qmenudata.html#insertItem">insertItem</a>( "Quit", qApp, SLOT(<a href="qapplication.html#quit">quit</a>()) ); - - options = new <a href="qpopupmenu.html">TQPopupMenu</a>(); - <a href="qapplication.html#Q_CHECK_PTR">Q_CHECK_PTR</a>( options ); - menubar-><a href="qmenudata.html#insertItem">insertItem</a>( "&Options", options ); - td_id = options-><a href="qmenudata.html#insertItem">insertItem</a>( "Timer driven", this, SLOT(timerDriven()) ); - ld_id = options-><a href="qmenudata.html#insertItem">insertItem</a>( "Loop driven", this, SLOT(loopDriven()) ); - options-><a href="qmenudata.html#insertSeparator">insertSeparator</a>(); - dl_id = options-><a href="qmenudata.html#insertItem">insertItem</a>( "Default label", this, SLOT(defaultLabel()) ); - cl_id = options-><a href="qmenudata.html#insertItem">insertItem</a>( "Custom label", this, SLOT(customLabel()) ); - options-><a href="qmenudata.html#insertSeparator">insertSeparator</a>(); - md_id = options-><a href="qmenudata.html#insertItem">insertItem</a>( "No minimum duration", this, SLOT(toggleMinimumDuration()) ); -<a name="x81"></a> options-><a href="qpopupmenu.html#setCheckable">setCheckable</a>( TRUE ); + file-><a href="ntqmenudata.html#insertItem">insertItem</a>( drawItemText(i), i ); +<a name="x67"></a> connect( menubar, SIGNAL(<a href="ntqmenubar.html#activated">activated</a>(int)), this, SLOT(doMenuItem(int)) ); +<a name="x69"></a> file-><a href="ntqmenudata.html#insertSeparator">insertSeparator</a>(); + file-><a href="ntqmenudata.html#insertItem">insertItem</a>( "Quit", qApp, SLOT(<a href="ntqapplication.html#quit">quit</a>()) ); + + options = new <a href="ntqpopupmenu.html">TQPopupMenu</a>(); + <a href="ntqapplication.html#Q_CHECK_PTR">Q_CHECK_PTR</a>( options ); + menubar-><a href="ntqmenudata.html#insertItem">insertItem</a>( "&Options", options ); + td_id = options-><a href="ntqmenudata.html#insertItem">insertItem</a>( "Timer driven", this, SLOT(timerDriven()) ); + ld_id = options-><a href="ntqmenudata.html#insertItem">insertItem</a>( "Loop driven", this, SLOT(loopDriven()) ); + options-><a href="ntqmenudata.html#insertSeparator">insertSeparator</a>(); + dl_id = options-><a href="ntqmenudata.html#insertItem">insertItem</a>( "Default label", this, SLOT(defaultLabel()) ); + cl_id = options-><a href="ntqmenudata.html#insertItem">insertItem</a>( "Custom label", this, SLOT(customLabel()) ); + options-><a href="ntqmenudata.html#insertSeparator">insertSeparator</a>(); + md_id = options-><a href="ntqmenudata.html#insertItem">insertItem</a>( "No minimum duration", this, SLOT(toggleMinimumDuration()) ); +<a name="x81"></a> options-><a href="ntqpopupmenu.html#setCheckable">setCheckable</a>( TRUE ); loopDriven(); defaultLabel(); @@ -225,65 +225,65 @@ public slots: void timerDriven() { timer_driven = TRUE; -<a name="x71"></a> options-><a href="qmenudata.html#setItemChecked">setItemChecked</a>( td_id, TRUE ); - options-><a href="qmenudata.html#setItemChecked">setItemChecked</a>( ld_id, FALSE ); +<a name="x71"></a> options-><a href="ntqmenudata.html#setItemChecked">setItemChecked</a>( td_id, TRUE ); + options-><a href="ntqmenudata.html#setItemChecked">setItemChecked</a>( ld_id, FALSE ); } void loopDriven() { timer_driven = FALSE; - options-><a href="qmenudata.html#setItemChecked">setItemChecked</a>( ld_id, TRUE ); - options-><a href="qmenudata.html#setItemChecked">setItemChecked</a>( td_id, FALSE ); + options-><a href="ntqmenudata.html#setItemChecked">setItemChecked</a>( ld_id, TRUE ); + options-><a href="ntqmenudata.html#setItemChecked">setItemChecked</a>( td_id, FALSE ); } void defaultLabel() { default_label = TRUE; - options-><a href="qmenudata.html#setItemChecked">setItemChecked</a>( dl_id, TRUE ); - options-><a href="qmenudata.html#setItemChecked">setItemChecked</a>( cl_id, FALSE ); + options-><a href="ntqmenudata.html#setItemChecked">setItemChecked</a>( dl_id, TRUE ); + options-><a href="ntqmenudata.html#setItemChecked">setItemChecked</a>( cl_id, FALSE ); } void customLabel() { default_label = FALSE; - options-><a href="qmenudata.html#setItemChecked">setItemChecked</a>( dl_id, FALSE ); - options-><a href="qmenudata.html#setItemChecked">setItemChecked</a>( cl_id, TRUE ); + options-><a href="ntqmenudata.html#setItemChecked">setItemChecked</a>( dl_id, FALSE ); + options-><a href="ntqmenudata.html#setItemChecked">setItemChecked</a>( cl_id, TRUE ); } void toggleMinimumDuration() { - options-><a href="qmenudata.html#setItemChecked">setItemChecked</a>( md_id, -<a name="x70"></a> !options-><a href="qmenudata.html#isItemChecked">isItemChecked</a>( md_id ) ); + options-><a href="ntqmenudata.html#setItemChecked">setItemChecked</a>( md_id, +<a name="x70"></a> !options-><a href="ntqmenudata.html#isItemChecked">isItemChecked</a>( md_id ) ); } private: void timerEvent( <a href="qtimerevent.html">TQTimerEvent</a>* ) { if (!got_stop) -<a name="x86"></a><a name="x85"></a> pb-><a href="qprogressdialog.html#setProgress">setProgress</a>( pb-><a href="qprogressdialog.html#totalSteps">totalSteps</a>() - rects ); +<a name="x86"></a><a name="x85"></a> pb-><a href="ntqprogressdialog.html#setProgress">setProgress</a>( pb-><a href="ntqprogressdialog.html#totalSteps">totalSteps</a>() - rects ); rects--; { - <a href="qpainter.html">TQPainter</a> p(this); + <a href="ntqpainter.html">TQPainter</a> p(this); int ww = width(); int wh = height(); if ( ww > 8 && wh > 8 ) { - <a href="qcolor.html">TQColor</a> c(rand()%255, rand()%255, rand()%255); + <a href="ntqcolor.html">TQColor</a> c(rand()%255, rand()%255, rand()%255); int x = rand() % (ww-8); int y = rand() % (wh-8); int w = rand() % (ww-x); int h = rand() % (wh-y); -<a name="x75"></a> p.<a href="qpainter.html#fillRect">fillRect</a>( x, y, w, h, c ); +<a name="x75"></a> p.<a href="ntqpainter.html#fillRect">fillRect</a>( x, y, w, h, c ); } } if (!rects || got_stop) { if (!got_stop) - pb-><a href="qprogressdialog.html#setProgress">setProgress</a>( pb-><a href="qprogressdialog.html#totalSteps">totalSteps</a>() ); - <a href="qpainter.html">TQPainter</a> p(this); - p.<a href="qpainter.html#fillRect">fillRect</a>(0, 0, width(), height(), backgroundColor()); + pb-><a href="ntqprogressdialog.html#setProgress">setProgress</a>( pb-><a href="ntqprogressdialog.html#totalSteps">totalSteps</a>() ); + <a href="ntqpainter.html">TQPainter</a> p(this); + p.<a href="ntqpainter.html#fillRect">fillRect</a>(0, 0, width(), height(), backgroundColor()); enableDrawingItems(TRUE); killTimers(); delete pb; @@ -291,21 +291,21 @@ private: } } - <a href="qprogressdialog.html">TQProgressDialog</a>* newProgressDialog( const char* label, int steps, bool modal ) + <a href="ntqprogressdialog.html">TQProgressDialog</a>* newProgressDialog( const char* label, int steps, bool modal ) { - <a href="qprogressdialog.html">TQProgressDialog</a> *d = new <a href="qprogressdialog.html">TQProgressDialog</a>(label, "Cancel", steps, this, + <a href="ntqprogressdialog.html">TQProgressDialog</a> *d = new <a href="ntqprogressdialog.html">TQProgressDialog</a>(label, "Cancel", steps, this, "progress", modal); - if ( options-><a href="qmenudata.html#isItemChecked">isItemChecked</a>( md_id ) ) -<a name="x84"></a> d-><a href="qprogressdialog.html#setMinimumDuration">setMinimumDuration</a>(0); + if ( options-><a href="ntqmenudata.html#isItemChecked">isItemChecked</a>( md_id ) ) +<a name="x84"></a> d-><a href="ntqprogressdialog.html#setMinimumDuration">setMinimumDuration</a>(0); if ( !default_label ) -<a name="x83"></a> d-><a href="qprogressdialog.html#setLabel">setLabel</a>( new AnimatedThingy(d,label) ); +<a name="x83"></a> d-><a href="ntqprogressdialog.html#setLabel">setLabel</a>( new AnimatedThingy(d,label) ); return d; } void enableDrawingItems(bool yes) { for (int i=first_draw_item; i<=last_draw_item; i++) { -<a name="x72"></a> menubar-><a href="qmenudata.html#setItemEnabled">setItemEnabled</a>(i, yes); +<a name="x72"></a> menubar-><a href="ntqmenudata.html#setItemEnabled">setItemEnabled</a>(i, yes); } } @@ -313,45 +313,45 @@ private: { if ( timer_driven ) { if ( pb ) { - <a href="qapplication.html#qWarning">qWarning</a>("This cannot happen!"); + <a href="ntqapplication.html#qWarning">qWarning</a>("This cannot happen!"); return; } rects = n; pb = newProgressDialog("Drawing rectangles.\n" "Using timer event.", n, FALSE); - pb-><a href="qwidget.html#setCaption">setCaption</a>("Please Wait"); -<a name="x82"></a> connect(pb, SIGNAL(<a href="qprogressdialog.html#cancelled">cancelled</a>()), this, SLOT(stopDrawing())); + pb-><a href="ntqwidget.html#setCaption">setCaption</a>("Please Wait"); +<a name="x82"></a> connect(pb, SIGNAL(<a href="ntqprogressdialog.html#cancelled">cancelled</a>()), this, SLOT(stopDrawing())); enableDrawingItems(FALSE); startTimer(0); got_stop = FALSE; } else { - <a href="qprogressdialog.html">TQProgressDialog</a>* lpb = newProgressDialog( + <a href="ntqprogressdialog.html">TQProgressDialog</a>* lpb = newProgressDialog( "Drawing rectangles.\nUsing loop.", n, TRUE); - lpb-><a href="qwidget.html#setCaption">setCaption</a>("Please Wait"); + lpb-><a href="ntqwidget.html#setCaption">setCaption</a>("Please Wait"); - <a href="qpainter.html">TQPainter</a> p(this); + <a href="ntqpainter.html">TQPainter</a> p(this); for (int i=0; i<n; i++) { - lpb-><a href="qprogressdialog.html#setProgress">setProgress</a>(i); -<a name="x87"></a> if ( lpb-><a href="qprogressdialog.html#wasCancelled">wasCancelled</a>() ) + lpb-><a href="ntqprogressdialog.html#setProgress">setProgress</a>(i); +<a name="x87"></a> if ( lpb-><a href="ntqprogressdialog.html#wasCancelled">wasCancelled</a>() ) break; - <a href="qcolor.html">TQColor</a> c(rand()%255, rand()%255, rand()%255); + <a href="ntqcolor.html">TQColor</a> c(rand()%255, rand()%255, rand()%255); int x = rand()%(width()-8); int y = rand()%(height()-8); int w = rand()%(width()-x); int h = rand()%(height()-y); - p.<a href="qpainter.html#fillRect">fillRect</a>(x,y,w,h,c); + p.<a href="ntqpainter.html#fillRect">fillRect</a>(x,y,w,h,c); } - p.<a href="qpainter.html#fillRect">fillRect</a>(0, 0, width(), height(), backgroundColor()); + p.<a href="ntqpainter.html#fillRect">fillRect</a>(0, 0, width(), height(), backgroundColor()); delete lpb; } } - <a href="qmenubar.html">TQMenuBar</a>* menubar; - <a href="qprogressdialog.html">TQProgressDialog</a>* pb; - <a href="qpopupmenu.html">TQPopupMenu</a>* options; + <a href="ntqmenubar.html">TQMenuBar</a>* menubar; + <a href="ntqprogressdialog.html">TQProgressDialog</a>* pb; + <a href="ntqpopupmenu.html">TQPopupMenu</a>* options; int td_id, ld_id; int dl_id, cl_id; int md_id; @@ -363,16 +363,16 @@ private: int main( int argc, char **argv ) { - <a href="qapplication.html">TQApplication</a> a( argc, argv ); + <a href="ntqapplication.html">TQApplication</a> a( argc, argv ); int wincount = argc > 1 ? atoi(argv[1]) : 1; for ( int i=0; i<wincount; i++ ) { CPUWaster* cpuw = new CPUWaster; - if ( i == 0 ) a.<a href="qapplication.html#setMainWidget">setMainWidget</a>(cpuw); - cpuw-><a href="qwidget.html#show">show</a>(); + if ( i == 0 ) a.<a href="ntqapplication.html#setMainWidget">setMainWidget</a>(cpuw); + cpuw-><a href="ntqwidget.html#show">show</a>(); } - return a.<a href="qapplication.html#exec">exec</a>(); + return a.<a href="ntqapplication.html#exec">exec</a>(); } #include "progress.moc" |