diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-06-02 23:07:22 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-06-02 23:22:42 +0900 |
commit | 8ac0e970e4464d9f8f73c0fb34a178ff135be8c3 (patch) | |
tree | b95884617b9a37accc843676d5d42be4116a3f54 /doc/html/showimg-example.html | |
parent | 68b81013e8668f50fc18b7e26a520ec93a7a1251 (diff) | |
download | tqt3-8ac0e970e4464d9f8f73c0fb34a178ff135be8c3.tar.gz tqt3-8ac0e970e4464d9f8f73c0fb34a178ff135be8c3.zip |
Rename ntqwidget* related files to equivalent tqwidget*
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'doc/html/showimg-example.html')
-rw-r--r-- | doc/html/showimg-example.html | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/doc/html/showimg-example.html b/doc/html/showimg-example.html index 3d2aee110..218dcf0a0 100644 --- a/doc/html/showimg-example.html +++ b/doc/html/showimg-example.html @@ -50,7 +50,7 @@ format (GIF, BMP, PPM, XMP, etc.). #ifndef SHOWIMG_H #define SHOWIMG_H -#include <<a href="qwidget-h.html">ntqwidget.h</a>> +#include <<a href="tqwidget-h.html">tqwidget.h</a>> #include <<a href="qimage-h.html">ntqimage.h</a>> @@ -58,11 +58,11 @@ class TQLabel; class TQMenuBar; class TQPopupMenu; -class ImageViewer : public <a href="ntqwidget.html">TQWidget</a> +class ImageViewer : public <a href="tqwidget.html">TQWidget</a> { <a href="metaobjects.html#TQ_OBJECT">TQ_OBJECT</a> public: - ImageViewer( <a href="ntqwidget.html">TQWidget</a> *parent=0, const char *name=0, int wFlags=0 ); + ImageViewer( <a href="tqwidget.html">TQWidget</a> *parent=0, const char *name=0, int wFlags=0 ); ~ImageViewer(); bool loadImage( const <a href="ntqstring.html">TQString</a>& ); protected: @@ -91,7 +91,7 @@ private: <a href="ntqpopupmenu.html">TQPopupMenu</a> *edit; <a href="ntqpopupmenu.html">TQPopupMenu</a> *options; - <a href="ntqwidget.html">TQWidget</a> *helpmsg; + <a href="tqwidget.html">TQWidget</a> *helpmsg; <a href="ntqlabel.html">TQLabel</a> *status; int si, sp, ac, co, mo, fd, bd, // Menu item ids td, ta, ba, fa, au, ad, dd, @@ -164,8 +164,8 @@ private slots: The menu uses a single slot to simplify the process of adding more items to the options menu. */ -<a name="f405"></a>ImageViewer::ImageViewer( <a href="ntqwidget.html">TQWidget</a> *parent, const char *name, int wFlags ) - : <a href="ntqwidget.html">TQWidget</a>( parent, name, wFlags ), +<a name="f405"></a>ImageViewer::ImageViewer( <a href="tqwidget.html">TQWidget</a> *parent, const char *name, int wFlags ) + : <a href="tqwidget.html">TQWidget</a>( parent, name, wFlags ), conversion_flags( PreferDither ), helpmsg( 0 ) { @@ -246,9 +246,9 @@ private slots: status = new <a href="ntqlabel.html">TQLabel</a>(this); status-><a href="ntqframe.html#setFrameStyle">setFrameStyle</a>( TQFrame::WinPanel | TQFrame::Sunken ); -<a name="x1354"></a> status-><a href="ntqwidget.html#setFixedHeight">setFixedHeight</a>( <a href="ntqwidget.html#fontMetrics">fontMetrics</a>().height() + 4 ); +<a name="x1354"></a> status-><a href="tqwidget.html#setFixedHeight">setFixedHeight</a>( <a href="tqwidget.html#fontMetrics">fontMetrics</a>().height() + 4 ); - <a href="ntqwidget.html#setMouseTracking">setMouseTracking</a>( TRUE ); + <a href="tqwidget.html#setMouseTracking">setMouseTracking</a>( TRUE ); } ImageViewer::~ImageViewer() @@ -272,7 +272,7 @@ void <a name="f406"></a>ImageViewer::doOption(int item) <a name="x1330"></a> options-><a href="ntqmenudata.html#setItemChecked">setItemChecked</a>(item, newbool); // And reconvert... reconvertImage(); - <a href="ntqwidget.html#repaint">repaint</a>(image.hasAlphaBuffer()); // show image in widget + <a href="tqwidget.html#repaint">repaint</a>(image.hasAlphaBuffer()); // show image in widget return; } @@ -308,7 +308,7 @@ void <a name="f406"></a>ImageViewer::doOption(int item) setMenuItemFlags(); // And reconvert... reconvertImage(); - <a href="ntqwidget.html#repaint">repaint</a>(image.hasAlphaBuffer()); // show image in widget + <a href="tqwidget.html#repaint">repaint</a>(image.hasAlphaBuffer()); // show image in widget } } @@ -451,7 +451,7 @@ void <a name="f411"></a>ImageViewer::newWindow() { ImageViewer* that = new ImageViewer(0, "new window", WDestructiveClose); that->options-><a href="ntqmenudata.html#setItemChecked">setItemChecked</a>( that->cc, useColorContext() ); - that-><a href="ntqwidget.html#show">show</a>(); + that-><a href="tqwidget.html#show">show</a>(); } /* @@ -464,7 +464,7 @@ void <a name="f412"></a>ImageViewer::openFile() this ); if ( !newfilename.<a href="ntqstring.html#isEmpty">isEmpty</a>() ) { loadImage( newfilename ) ; - <a href="ntqwidget.html#repaint">repaint</a>(); // show image in widget + <a href="tqwidget.html#repaint">repaint</a>(); // show image in widget } } @@ -489,7 +489,7 @@ bool <a name="f413"></a>ImageViewer::loadImage( const <a href="ntqstring.html">T if ( ok ) ok = reconvertImage(); if ( ok ) { - <a href="ntqwidget.html#setCaption">setCaption</a>( filename ); // set window caption + <a href="tqwidget.html#setCaption">setCaption</a>( filename ); // set window caption int w = pm.width(); int h = pm.height(); @@ -501,11 +501,11 @@ bool <a name="f413"></a>ImageViewer::loadImage( const <a href="ntqstring.html">T h *= multiply; } -<a name="x1347"></a><a name="x1325"></a> h += menubar-><a href="ntqmenubar.html#heightForWidth">heightForWidth</a>(w) + status-><a href="ntqwidget.html#height">height</a>(); - <a href="ntqwidget.html#resize">resize</a>( w, h ); // we resize to fit image +<a name="x1347"></a><a name="x1325"></a> h += menubar-><a href="ntqmenubar.html#heightForWidth">heightForWidth</a>(w) + status-><a href="tqwidget.html#height">height</a>(); + <a href="tqwidget.html#resize">resize</a>( w, h ); // we resize to fit image } else { pm.resize(0,0); // couldn't load image - <a href="ntqwidget.html#update">update</a>(); + <a href="tqwidget.html#update">update</a>(); } <a name="x1311"></a> TQApplication::<a href="ntqapplication.html#restoreOverrideCursor">restoreOverrideCursor</a>(); // restore original cursor } @@ -528,7 +528,7 @@ bool <a name="f414"></a>ImageViewer::reconvertImage() <a name="x1314"></a> alloc_context = TQColor::<a href="ntqcolor.html#enterAllocContext">enterAllocContext</a>(); // Clear the image to hide flickering palette <a href="ntqpainter.html">TQPainter</a> painter(this); -<a name="x1338"></a> painter.<a href="ntqpainter.html#eraseRect">eraseRect</a>(0, menubar-><a href="ntqmenubar.html#heightForWidth">heightForWidth</a>( <a href="ntqwidget.html#width">width</a>() ), width(), height()); +<a name="x1338"></a> painter.<a href="ntqpainter.html#eraseRect">eraseRect</a>(0, menubar-><a href="ntqmenubar.html#heightForWidth">heightForWidth</a>( <a href="tqwidget.html#width">width</a>() ), width(), height()); } TQApplication::<a href="ntqapplication.html#setOverrideCursor">setOverrideCursor</a>( waitCursor ); // this might take time @@ -536,7 +536,7 @@ bool <a name="f414"></a>ImageViewer::reconvertImage() { pmScaled = TQPixmap(); scale(); - <a href="ntqwidget.html#resize">resize</a>( <a href="ntqwidget.html#width">width</a>(), height() ); + <a href="tqwidget.html#resize">resize</a>( <a href="tqwidget.html#width">width</a>(), height() ); success = TRUE; // load successful } else { pm.resize(0,0); // couldn't load image @@ -568,21 +568,21 @@ bool <a name="f416"></a>ImageViewer::useColorContext() const void <a name="f417"></a>ImageViewer::scale() { - int h = <a href="ntqwidget.html#height">height</a>() - menubar-><a href="ntqmenubar.html#heightForWidth">heightForWidth</a>( <a href="ntqwidget.html#width">width</a>() ) - status-><a href="ntqwidget.html#height">height</a>(); + int h = <a href="tqwidget.html#height">height</a>() - menubar-><a href="ntqmenubar.html#heightForWidth">heightForWidth</a>( <a href="tqwidget.html#width">width</a>() ) - status-><a href="tqwidget.html#height">height</a>(); if ( image.isNull() ) return; TQApplication::<a href="ntqapplication.html#setOverrideCursor">setOverrideCursor</a>( waitCursor ); // this might take time - if ( <a href="ntqwidget.html#width">width</a>() == pm.width() && h == pm.height() ) + if ( <a href="tqwidget.html#width">width</a>() == pm.width() && h == pm.height() ) { // no need to scale if widget pmScaled = pm; // size equals pixmap size } else { if (smooth()) { - pmScaled.convertFromImage(image.smoothScale(<a href="ntqwidget.html#width">width</a>(), h), + pmScaled.convertFromImage(image.smoothScale(<a href="tqwidget.html#width">width</a>(), h), conversion_flags); } else { <a href="ntqwmatrix.html">TQWMatrix</a> m; // <a href="ntqwmatrix.html#TransformationMode">transformation matrix</a> -<a name="x1357"></a> m.<a href="ntqwmatrix.html#scale">scale</a>(((double)<a href="ntqwidget.html#width">width</a>())/pm.width(),// define scale factors +<a name="x1357"></a> m.<a href="ntqwmatrix.html#scale">scale</a>(((double)<a href="tqwidget.html#width">width</a>())/pm.width(),// define scale factors ((double)h)/pm.height()); pmScaled = pm.xForm( m ); // create scaled pixmap } @@ -595,30 +595,30 @@ void <a name="f417"></a>ImageViewer::scale() scale() to fit the pixmap to the new widget size. */ -<a name="x1353"></a>void ImageViewer::<a href="ntqwidget.html#resizeEvent">resizeEvent</a>( <a href="qresizeevent.html">TQResizeEvent</a> * ) +<a name="x1353"></a>void ImageViewer::<a href="tqwidget.html#resizeEvent">resizeEvent</a>( <a href="qresizeevent.html">TQResizeEvent</a> * ) { -<a name="x1355"></a> status-><a href="ntqwidget.html#setGeometry">setGeometry</a>(0, height() - status-><a href="ntqwidget.html#height">height</a>(), - <a href="ntqwidget.html#width">width</a>(), status-><a href="ntqwidget.html#height">height</a>()); +<a name="x1355"></a> status-><a href="tqwidget.html#setGeometry">setGeometry</a>(0, height() - status-><a href="tqwidget.html#height">height</a>(), + <a href="tqwidget.html#width">width</a>(), status-><a href="tqwidget.html#height">height</a>()); if ( pm.size() == TQSize( 0, 0 ) ) // we couldn't load the image return; - int h = <a href="ntqwidget.html#height">height</a>() - menubar-><a href="ntqmenubar.html#heightForWidth">heightForWidth</a>( <a href="ntqwidget.html#width">width</a>() ) - status-><a href="ntqwidget.html#height">height</a>(); - if ( <a href="ntqwidget.html#width">width</a>() != pmScaled.width() || h != pmScaled.height()) + int h = <a href="tqwidget.html#height">height</a>() - menubar-><a href="ntqmenubar.html#heightForWidth">heightForWidth</a>( <a href="tqwidget.html#width">width</a>() ) - status-><a href="tqwidget.html#height">height</a>(); + if ( <a href="tqwidget.html#width">width</a>() != pmScaled.width() || h != pmScaled.height()) { // if new size, scale(); // scale pmScaled to window updateStatus(); } if ( image.hasAlphaBuffer() ) - <a href="ntqwidget.html#erase">erase</a>(); + <a href="tqwidget.html#erase">erase</a>(); } bool <a name="f418"></a>ImageViewer::convertEvent( <a href="qmouseevent.html">TQMouseEvent</a>* e, int& x, int& y) { if ( pm.size() != TQSize( 0, 0 ) ) { - int h = <a href="ntqwidget.html#height">height</a>() - menubar-><a href="ntqmenubar.html#heightForWidth">heightForWidth</a>( <a href="ntqwidget.html#width">width</a>() ) - status-><a href="ntqwidget.html#height">height</a>(); + int h = <a href="tqwidget.html#height">height</a>() - menubar-><a href="ntqmenubar.html#heightForWidth">heightForWidth</a>( <a href="tqwidget.html#width">width</a>() ) - status-><a href="tqwidget.html#height">height</a>(); <a name="x1335"></a> int nx = e-><a href="qmouseevent.html#x">x</a>() * image.width() / width(); -<a name="x1336"></a> int ny = (e-><a href="qmouseevent.html#y">y</a>()-menubar-><a href="ntqmenubar.html#heightForWidth">heightForWidth</a>( <a href="ntqwidget.html#width">width</a>() )) * image.height() / h; +<a name="x1336"></a> int ny = (e-><a href="qmouseevent.html#y">y</a>()-menubar-><a href="ntqmenubar.html#heightForWidth">heightForWidth</a>( <a href="tqwidget.html#width">width</a>() )) * image.height() / h; if (nx != x || ny != y ) { x = nx; y = ny; @@ -629,12 +629,12 @@ bool <a name="f418"></a>ImageViewer::convertEvent( <a href="qmouseevent.html">TQ return FALSE; } -void ImageViewer::<a href="ntqwidget.html#mousePressEvent">mousePressEvent</a>( <a href="qmouseevent.html">TQMouseEvent</a> *e ) +void ImageViewer::<a href="tqwidget.html#mousePressEvent">mousePressEvent</a>( <a href="qmouseevent.html">TQMouseEvent</a> *e ) { may_be_other = convertEvent(e, clickx, clicky); } -<a name="x1350"></a>void ImageViewer::<a href="ntqwidget.html#mouseReleaseEvent">mouseReleaseEvent</a>( <a href="qmouseevent.html">TQMouseEvent</a> * ) +<a name="x1350"></a>void ImageViewer::<a href="tqwidget.html#mouseReleaseEvent">mouseReleaseEvent</a>( <a href="qmouseevent.html">TQMouseEvent</a> * ) { if ( may_be_other ) other = this; @@ -643,7 +643,7 @@ void ImageViewer::<a href="ntqwidget.html#mousePressEvent">mousePressEvent</a>( /* Record the pixel position of interest. */ -void ImageViewer::<a href="ntqwidget.html#mouseMoveEvent">mouseMoveEvent</a>( <a href="qmouseevent.html">TQMouseEvent</a> *e ) +void ImageViewer::<a href="tqwidget.html#mouseMoveEvent">mouseMoveEvent</a>( <a href="qmouseevent.html">TQMouseEvent</a> *e ) { if (convertEvent(e,pickx,picky)) { updateStatus(); @@ -661,12 +661,12 @@ void ImageViewer::<a href="ntqwidget.html#mouseMoveEvent">mouseMoveEvent</a>( <a an error message if no legal pixmap has been loaded. */ -void ImageViewer::<a href="ntqwidget.html#paintEvent">paintEvent</a>( <a href="qpaintevent.html">TQPaintEvent</a> *e ) +void ImageViewer::<a href="tqwidget.html#paintEvent">paintEvent</a>( <a href="qpaintevent.html">TQPaintEvent</a> *e ) { if ( pm.size() != TQSize( 0, 0 ) ) { // is an image loaded? <a href="ntqpainter.html">TQPainter</a> painter(this); <a name="x1340"></a><a name="x1339"></a> painter.<a href="ntqpainter.html#setClipRect">setClipRect</a>(e-><a href="qpaintevent.html#rect">rect</a>()); -<a name="x1337"></a> painter.<a href="ntqpainter.html#drawPixmap">drawPixmap</a>(0, menubar-><a href="ntqmenubar.html#heightForWidth">heightForWidth</a>( <a href="ntqwidget.html#width">width</a>() ), pmScaled); +<a name="x1337"></a> painter.<a href="ntqpainter.html#drawPixmap">drawPixmap</a>(0, menubar-><a href="ntqmenubar.html#heightForWidth">heightForWidth</a>( <a href="tqwidget.html#width">width</a>() ), pmScaled); } } @@ -691,7 +691,7 @@ void <a name="f419"></a>ImageViewer::giveHelp() TQMessageBox::Information, TQMessageBox::Ok, 0, 0, 0, 0, FALSE ); } <a name="x1317"></a> helpmsg-><a href="ntqdialog.html#show">show</a>(); -<a name="x1352"></a> helpmsg-><a href="ntqwidget.html#raise">raise</a>(); +<a name="x1352"></a> helpmsg-><a href="tqwidget.html#raise">raise</a>(); } void <a name="f420"></a>ImageViewer::copyFrom(ImageViewer* s) @@ -713,7 +713,7 @@ void <a name="f420"></a>ImageViewer::copyFrom(ImageViewer* s) } <a href="ntqimage.html#bitBlt">bitBlt</a>( &image, dx, dy, &s->image, sx, sy, sw, sh ); reconvertImage(); - <a href="ntqwidget.html#repaint">repaint</a>( image.hasAlphaBuffer() ); + <a href="tqwidget.html#repaint">repaint</a>( image.hasAlphaBuffer() ); } } ImageViewer* ImageViewer::other = 0; @@ -757,7 +757,7 @@ void <a name="f426"></a>ImageViewer::setImage(const <a href="ntqimage.html">TQIm pickx = -1; clickx = -1; - <a href="ntqwidget.html#setCaption">setCaption</a>( filename ); // set window caption + <a href="tqwidget.html#setCaption">setCaption</a>( filename ); // set window caption int w = image.width(); int h = image.height(); if ( !w ) @@ -771,11 +771,11 @@ void <a name="f426"></a>ImageViewer::setImage(const <a href="ntqimage.html">TQIm h *= multiply; } - h += menubar-><a href="ntqmenubar.html#heightForWidth">heightForWidth</a>(w) + status-><a href="ntqwidget.html#height">height</a>(); - <a href="ntqwidget.html#resize">resize</a>( w, h ); // we resize to fit image + h += menubar-><a href="ntqmenubar.html#heightForWidth">heightForWidth</a>(w) + status-><a href="tqwidget.html#height">height</a>(); + <a href="tqwidget.html#resize">resize</a>( w, h ); // we resize to fit image reconvertImage(); - <a href="ntqwidget.html#repaint">repaint</a>( image.hasAlphaBuffer() ); + <a href="tqwidget.html#repaint">repaint</a>( image.hasAlphaBuffer() ); updateStatus(); setMenuItemFlags(); @@ -806,7 +806,7 @@ void <a name="f431"></a>ImageViewer::toBitDepth(int d) { image = image.convertDepth(d); reconvertImage(); - <a href="ntqwidget.html#repaint">repaint</a>( image.hasAlphaBuffer() ); + <a href="tqwidget.html#repaint">repaint</a>( image.hasAlphaBuffer() ); } </pre> @@ -852,16 +852,16 @@ int main( int argc, char **argv ) // Create a window which looks after its own existence. ImageViewer *w = new ImageViewer(0, "new window", TQt::WDestructiveClose | TQt::WResizeNoErase ); -<a name="x1364"></a> w-><a href="ntqwidget.html#setCaption">setCaption</a>("TQt Example - Image Viewer"); - w-><a href="ntqwidget.html#show">show</a>(); +<a name="x1364"></a> w-><a href="tqwidget.html#setCaption">setCaption</a>("TQt Example - Image Viewer"); + w-><a href="tqwidget.html#show">show</a>(); } else { for ( int i=1; i<argc; i++ ) { // Create a window which looks after its own existence. ImageViewer *w = new ImageViewer(0, argv[i], TQt::WDestructiveClose | TQt::WResizeNoErase ); - w-><a href="ntqwidget.html#setCaption">setCaption</a>("TQt Example - Image Viewer"); + w-><a href="tqwidget.html#setCaption">setCaption</a>("TQt Example - Image Viewer"); w->loadImage( argv[i] ); - w-><a href="ntqwidget.html#show">show</a>(); + w-><a href="tqwidget.html#show">show</a>(); } } |