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/hello-example.html | 86 ++++++++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 43 deletions(-) (limited to 'doc/html/hello-example.html') diff --git a/doc/html/hello-example.html b/doc/html/hello-example.html index 31f338144..821c3ec57 100644 --- a/doc/html/hello-example.html +++ b/doc/html/hello-example.html @@ -50,10 +50,10 @@ and in different colors. #ifndef HELLO_H #define HELLO_H -#include <qwidget.h> +#include <ntqwidget.h> -class Hello : public TQWidget +class Hello : public TQWidget { Q_OBJECT public: @@ -66,7 +66,7 @@ protected: private slots: void animate(); private: - TQString t; + TQString t; int b; }; @@ -86,10 +86,10 @@ private: *****************************************************************************/ #include "hello.h" -#include <qpushbutton.h> -#include <qtimer.h> -#include <qpainter.h> -#include <qpixmap.h> +#include <ntqpushbutton.h> +#include <ntqtimer.h> +#include <ntqpainter.h> +#include <ntqpixmap.h> /* @@ -97,13 +97,13 @@ private: */ Hello::Hello( const char *text, TQWidget *parent, const char *name ) - : TQWidget(parent,name), t(text), b(0) + : TQWidget(parent,name), t(text), b(0) { - TQTimer *timer = new TQTimer(this); - connect( timer, SIGNAL(timeout()), SLOT(animate()) ); - timer->start( 40 ); + TQTimer *timer = new TQTimer(this); + connect( timer, SIGNAL(timeout()), SLOT(animate()) ); + timer->start( 40 ); - resize( 260, 130 ); + resize( 260, 130 ); } @@ -114,7 +114,7 @@ private: void Hello::animate() { b = (b + 1) & 15; - repaint( FALSE ); + repaint( FALSE ); } @@ -125,9 +125,9 @@ void Hello::animate() the widget. */ -void Hello::mouseReleaseEvent( TQMouseEvent *e ) +void Hello::mouseReleaseEvent( TQMouseEvent *e ) { - if ( rect().contains( e->pos() ) ) + if ( rect().contains( e->pos() ) ) emit clicked(); } @@ -139,7 +139,7 @@ void Hello::animate() pixmap is then blt'ed to the screen. */ -void Hello::paintEvent( TQPaintEvent * ) +void Hello::paintEvent( TQPaintEvent * ) { static int sin_tbl[16] = { 0, 38, 71, 92, 100, 92, 71, 38, 0, -38, -71, -92, -100, -92, -71, -38}; @@ -148,34 +148,34 @@ void Hello::paintEvent( TQFontMetrics fm = fontMetrics(); - int w = fm.width(t) + 20; - int h = fm.height() * 2; - int pmx = width()/2 - w/2; - int pmy = height()/2 - h/2; + TQFontMetrics fm = fontMetrics(); + int w = fm.width(t) + 20; + int h = fm.height() * 2; + int pmx = width()/2 - w/2; + int pmy = height()/2 - h/2; // 2: Create the pixmap and fill it with the widget's background - TQPixmap pm( w, h ); - pm.fill( this, pmx, pmy ); + TQPixmap pm( w, h ); + pm.fill( this, pmx, pmy ); // 3: Paint the pixmap. Cool wave effect - TQPainter p; + TQPainter p; int x = 10; - int y = h/2 + fm.descent(); + int y = h/2 + fm.descent(); int i = 0; - p.begin( &pm ); - p.setFont( font() ); + p.begin( &pm ); + p.setFont( font() ); while ( !t[i].isNull() ) { int i16 = (b+i) & 15; - p.setPen( TQColor((15-i16)*16,255,255,TQColor::Hsv) ); - p.drawText( x, y-sin_tbl[i16]*h/800, t.mid(i,1), 1 ); - x += fm.width( t[i] ); + p.setPen( TQColor((15-i16)*16,255,255,TQColor::Hsv) ); + p.drawText( x, y-sin_tbl[i16]*h/800, t.mid(i,1), 1 ); + x += fm.width( t[i] ); i++; } - p.end(); + p.end(); // 4: Copy the pixmap to the Hello widget - bitBlt( this, pmx, pmy, &pm ); + bitBlt( this, pmx, pmy, &pm ); } @@ -192,7 +192,7 @@ void Hello::paintEvent( qapplication.h> +#include <ntqapplication.h> /* @@ -202,25 +202,25 @@ void Hello::paintEvent( TQApplication a(argc,argv); - TQString s; + TQApplication a(argc,argv); + TQString s; for ( int i=1; i<argc; i++ ) { s += argv[i]; if ( i<argc-1 ) s += " "; } - if ( s.isEmpty() ) + if ( s.isEmpty() ) s = "Hello, World"; Hello h( s ); #ifndef QT_NO_WIDGET_TOPEXTRA // for TQt/Embedded minimal build - h.setCaption( "TQt says hello" ); + h.setCaption( "TQt says hello" ); #endif - TQObject::connect( &h, SIGNAL(clicked()), &a, SLOT(quit()) ); - h.setFont( TQFont("times",32,TQFont::Bold) ); // default font - h.setBackgroundColor( TQt::white ); // default bg color - a.setMainWidget( &h ); - h.show(); - return a.exec(); + TQObject::connect( &h, SIGNAL(clicked()), &a, SLOT(quit()) ); + h.setFont( TQFont("times",32,TQFont::Bold) ); // default font + h.setBackgroundColor( TQt::white ); // default bg color + a.setMainWidget( &h ); + h.show(); + return a.exec(); } -- cgit v1.2.3