From 8ac0e970e4464d9f8f73c0fb34a178ff135be8c3 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sun, 2 Jun 2024 23:07:22 +0900 Subject: Rename ntqwidget* related files to equivalent tqwidget* Signed-off-by: Michele Calgaro --- doc/html/scribble-example.html | 62 +++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'doc/html/scribble-example.html') diff --git a/doc/html/scribble-example.html b/doc/html/scribble-example.html index a33542cf1..5c60e2591 100644 --- a/doc/html/scribble-example.html +++ b/doc/html/scribble-example.html @@ -54,7 +54,7 @@ in the canvas with different pens and save the result as picture. #include <ntqpen.h> #include <ntqpoint.h> #include <ntqpixmap.h> -#include <ntqwidget.h> +#include <tqwidget.h> #include <ntqstring.h> #include <ntqpointarray.h> @@ -64,12 +64,12 @@ class TQPaintEvent; class TQToolButton; class TQSpinBox; -class Canvas : public TQWidget +class Canvas : public TQWidget { TQ_OBJECT public: - Canvas( TQWidget *parent = 0, const char *name = 0 ); + Canvas( TQWidget *parent = 0, const char *name = 0 ); void setPenColor( const TQColor &c ) { pen.setColor( c ); } @@ -108,7 +108,7 @@ class Scribble : public TQMainWindow TQ_OBJECT public: - Scribble( TQWidget *parent = 0, const char *name = 0 ); + Scribble( TQWidget *parent = 0, const char *name = 0 ); protected: Canvas* canvas; @@ -160,16 +160,16 @@ protected slots: const bool no_writing = FALSE; -Canvas::Canvas( TQWidget *parent, const char *name ) - : TQWidget( parent, name, WStaticContents ), pen( TQt::red, 3 ), polyline(3), - mousePressed( FALSE ), buffer( width(), height() ) +Canvas::Canvas( TQWidget *parent, const char *name ) + : TQWidget( parent, name, WStaticContents ), pen( TQt::red, 3 ), polyline(3), + mousePressed( FALSE ), buffer( width(), height() ) { if ((tqApp->argc() > 0) && !buffer.load(tqApp->argv()[1])) - buffer.fill( colorGroup().base() ); - setBackgroundMode( TQWidget::PaletteBase ); + buffer.fill( colorGroup().base() ); + setBackgroundMode( TQWidget::PaletteBase ); #ifndef TQT_NO_CURSOR - setCursor( TQt::crossCursor ); + setCursor( TQt::crossCursor ); #endif } @@ -181,22 +181,22 @@ void Canvas::save( const TQStringCanvas::clearScreen() { - buffer.fill( colorGroup().base() ); - repaint( FALSE ); + buffer.fill( colorGroup().base() ); + repaint( FALSE ); } -void Canvas::mousePressEvent( TQMouseEvent *e ) +void Canvas::mousePressEvent( TQMouseEvent *e ) { mousePressed = TRUE; polyline[2] = polyline[1] = polyline[0] = e->pos(); } -void Canvas::mouseReleaseEvent( TQMouseEvent * ) +void Canvas::mouseReleaseEvent( TQMouseEvent * ) { mousePressed = FALSE; } -void Canvas::mouseMoveEvent( TQMouseEvent *e ) +void Canvas::mouseMoveEvent( TQMouseEvent *e ) { if ( mousePressed ) { TQPainter painter; @@ -219,24 +219,24 @@ void Canvas::clearScreen() } } -void Canvas::resizeEvent( TQResizeEvent *e ) +void Canvas::resizeEvent( TQResizeEvent *e ) { - TQWidget::resizeEvent( e ); + TQWidget::resizeEvent( e ); - int w = width() > buffer.width() ? - width() : buffer.width(); - int h = height() > buffer.height() ? - height() : buffer.height(); + int w = width() > buffer.width() ? + width() : buffer.width(); + int h = height() > buffer.height() ? + height() : buffer.height(); TQPixmap tmp( buffer ); buffer.resize( w, h ); - buffer.fill( colorGroup().base() ); + buffer.fill( colorGroup().base() ); bitBlt( &buffer, 0, 0, &tmp, 0, 0, tmp.width(), tmp.height() ); } -void Canvas::paintEvent( TQPaintEvent *e ) +void Canvas::paintEvent( TQPaintEvent *e ) { - TQWidget::paintEvent( e ); + TQWidget::paintEvent( e ); TQMemArray<TQRect> rects = e->region().rects(); for ( uint i = 0; i < rects.count(); i++ ) { @@ -247,7 +247,7 @@ void Canvas::clearScreen() //------------------------------------------------------ -Scribble::Scribble( TQWidget *parent, const char *name ) +Scribble::Scribble( TQWidget *parent, const char *name ) : TQMainWindow( parent, name ) { canvas = new Canvas( this ); @@ -287,8 +287,8 @@ void Scribble::slotSave() formats.insert( menu->insertItem( TQString( "%1..." ).arg( str ) ), new TQString( str ) ); } - menu->setMouseTracking( TRUE ); - int id = menu->exec( bSave->mapToGlobal( TQPoint( 0, bSave->height() + 1 ) ) ); + menu->setMouseTracking( TRUE ); + int id = menu->exec( bSave->mapToGlobal( TQPoint( 0, bSave->height() + 1 ) ) ); if ( id != -1 ) { TQString format = *formats[ id ]; @@ -341,14 +341,14 @@ int main( int argc, char **argv ) Scribble scribble; - scribble.resize( 500, 350 ); - scribble.setCaption("TQt Example - Scribble"); + scribble.resize( 500, 350 ); + scribble.setCaption("TQt Example - Scribble"); a.setMainWidget( &scribble ); if ( TQApplication::desktop()->width() > 550 && TQApplication::desktop()->height() > 366 ) - scribble.show(); + scribble.show(); else - scribble.showMaximized(); + scribble.showMaximized(); return a.exec(); } -- cgit v1.2.3