diff options
Diffstat (limited to 'kpresenter/KPrPicturePreview.cpp')
-rw-r--r-- | kpresenter/KPrPicturePreview.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/kpresenter/KPrPicturePreview.cpp b/kpresenter/KPrPicturePreview.cpp index 7dd8cf8c..7964b4bc 100644 --- a/kpresenter/KPrPicturePreview.cpp +++ b/kpresenter/KPrPicturePreview.cpp @@ -23,12 +23,12 @@ #include "KPrPicturePreview.h" -#include <qimage.h> -#include <qpainter.h> +#include <tqimage.h> +#include <tqpainter.h> -KPrPicturePreview::KPrPicturePreview( QWidget* parent, const char* name) -: QFrame( parent, name ) +KPrPicturePreview::KPrPicturePreview( TQWidget* tqparent, const char* name) +: TQFrame( tqparent, name ) , mirrorType( PM_NORMAL ) , depth( 0 ) , swapRGB( false ) @@ -40,12 +40,12 @@ KPrPicturePreview::KPrPicturePreview( QWidget* parent, const char* name) } -void KPrPicturePreview::drawContents( QPainter *painter ) +void KPrPicturePreview::drawContents( TQPainter *painter ) { - QSize ext = contentsRect().size(); + TQSize ext = contentsRect().size(); - QPixmap _pix = origPixmap; - QImage img( _pix.convertToImage().smoothScale( ext.width(),ext.height(), QImage::ScaleMin ) ); + TQPixmap _pix = origPixmap; + TQImage img( _pix.convertToImage().smoothScale( ext.width(),ext.height(), TQ_ScaleMin ) ); bool _horizontal = false; bool _vertical = false; @@ -61,7 +61,7 @@ void KPrPicturePreview::drawContents( QPainter *painter ) img = img.mirror( _horizontal, _vertical ); if ( depth != 0 ) { - QImage tmpImg = img.convertDepth( depth ); + TQImage tmpImg = img.convertDepth( depth ); if ( !tmpImg.isNull() ) img = tmpImg; } @@ -73,9 +73,9 @@ void KPrPicturePreview::drawContents( QPainter *painter ) if ( grayscal ) { if ( depth == 1 || depth == 8 ) { for ( int i = 0; i < img.numColors(); ++i ) { - QRgb rgb = img.color( i ); - int gray = qGray( rgb ); - rgb = qRgb( gray, gray, gray ); + TQRgb rgb = img.color( i ); + int gray = tqGray( rgb ); + rgb = tqRgb( gray, gray, gray ); img.setColor( i, rgb ); } } @@ -88,9 +88,9 @@ void KPrPicturePreview::drawContents( QPainter *painter ) for ( _x = 0; _x < _width; ++_x ) { for ( _y = 0; _y < _height; ++_y ) { if ( img.valid( _x, _y ) ) { - QRgb rgb = img.pixel( _x, _y ); - int gray = qGray( rgb ); - rgb = qRgb( gray, gray, gray ); + TQRgb rgb = img.pixel( _x, _y ); + int gray = tqGray( rgb ); + rgb = tqRgb( gray, gray, gray ); img.setPixel( _x, _y, rgb ); } } @@ -102,8 +102,8 @@ void KPrPicturePreview::drawContents( QPainter *painter ) if ( bright != 0 ) { if ( depth == 1 || depth == 8 ) { for ( int i = 0; i < img.numColors(); ++i ) { - QRgb rgb = img.color( i ); - QColor c( rgb ); + TQRgb rgb = img.color( i ); + TQColor c( rgb ); if ( bright > 0 ) rgb = c.light( 100 + bright ).rgb(); @@ -122,8 +122,8 @@ void KPrPicturePreview::drawContents( QPainter *painter ) for ( _x = 0; _x < _width; ++_x ) { for ( _y = 0; _y < _height; ++_y ) { if ( img.valid( _x, _y ) ) { - QRgb rgb = img.pixel( _x, _y ); - QColor c( rgb ); + TQRgb rgb = img.pixel( _x, _y ); + TQColor c( rgb ); if ( bright > 0 ) rgb = c.light( 100 + bright ).rgb(); @@ -139,15 +139,15 @@ void KPrPicturePreview::drawContents( QPainter *painter ) _pix.convertFromImage( img ); - QPixmap tmpPix( _pix.size() ); - tmpPix.fill( Qt::white ); + TQPixmap tmpPix( _pix.size() ); + tmpPix.fill( TQt::white ); - QPainter _p; + TQPainter _p; _p.begin( &tmpPix ); _p.drawPixmap( 0, 0, _pix ); _p.end(); - QSize _pixSize = _pix.size(); + TQSize _pixSize = _pix.size(); int _x = 0, _y = 0; int w = _pixSize.width(), h = _pixSize.height(); _x = ( ext.width() - w ) / 2; @@ -162,7 +162,7 @@ void KPrPicturePreview::slotNormalPicture() if ( mirrorType != PM_NORMAL ) { mirrorType = PM_NORMAL; - repaint( false ); + tqrepaint( false ); } } @@ -172,7 +172,7 @@ void KPrPicturePreview::slotHorizontalMirrorPicture() if ( mirrorType != PM_HORIZONTAL ) { mirrorType = PM_HORIZONTAL; - repaint( false ); + tqrepaint( false ); } } @@ -182,7 +182,7 @@ void KPrPicturePreview::slotVerticalMirrorPicture() if ( mirrorType != PM_VERTICAL ) { mirrorType = PM_VERTICAL; - repaint( false ); + tqrepaint( false ); } } @@ -192,7 +192,7 @@ void KPrPicturePreview::slotHorizontalAndVerticalMirrorPicture() if ( mirrorType != PM_HORIZONTALANDVERTICAL ) { mirrorType = PM_HORIZONTALANDVERTICAL; - repaint( false ); + tqrepaint( false ); } } @@ -202,7 +202,7 @@ void KPrPicturePreview::slotPictureDepth0() if ( depth !=0 ) { depth = 0; - repaint( false ); + tqrepaint( false ); } } @@ -212,7 +212,7 @@ void KPrPicturePreview::slotPictureDepth1() if ( depth != 1 ) { depth = 1; - repaint( false ); + tqrepaint( false ); } } @@ -222,7 +222,7 @@ void KPrPicturePreview::slotPictureDepth8() if ( depth != 8) { depth = 8; - repaint( false ); + tqrepaint( false ); } } @@ -232,7 +232,7 @@ void KPrPicturePreview::slotPictureDepth16() if ( depth != 16 ) { depth = 16; - repaint( false ); + tqrepaint( false ); } } @@ -242,7 +242,7 @@ void KPrPicturePreview::slotPictureDepth32() if ( depth !=32 ) { depth = 32; - repaint( false ); + tqrepaint( false ); } } @@ -252,7 +252,7 @@ void KPrPicturePreview::slotSwapRGBPicture( bool _on ) if ( swapRGB != _on ) { swapRGB = _on; - repaint( false ); + tqrepaint( false ); } } @@ -262,7 +262,7 @@ void KPrPicturePreview::slotGrayscalPicture( bool _on ) if ( grayscal != _on ) { grayscal = _on; - repaint( false ); + tqrepaint( false ); } } @@ -272,7 +272,7 @@ void KPrPicturePreview::slotBrightValue( int _value ) if ( bright != _value ) { bright = _value; - repaint( false ); + tqrepaint( false ); } } @@ -282,7 +282,7 @@ void KPrPicturePreview::setDepth( int _depth) if ( _depth != depth ) { depth = _depth; - repaint( false ); + tqrepaint( false ); } } @@ -292,15 +292,15 @@ void KPrPicturePreview::setMirrorType (PictureMirrorType _t) if ( mirrorType != _t ) { mirrorType = _t; - repaint( false ); + tqrepaint( false ); } } -void KPrPicturePreview::setPicturePixmap(const QPixmap &_pixmap) +void KPrPicturePreview::setPicturePixmap(const TQPixmap &_pixmap) { origPixmap = _pixmap; - repaint( false ); + tqrepaint( false ); } |