summaryrefslogtreecommitdiffstats
path: root/kghostview/scrollbox.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-19 19:03:33 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-19 19:03:33 +0000
commite69e8b1d09fb579316595b4e6a850e717358a8b1 (patch)
treea24fc20865f65772f530d16177520190594ffdd2 /kghostview/scrollbox.cpp
parenteecec9afb81fdebb0f22e9da22635874c403f854 (diff)
downloadtdegraphics-e69e8b1d09fb579316595b4e6a850e717358a8b1.tar.gz
tdegraphics-e69e8b1d09fb579316595b4e6a850e717358a8b1.zip
TQt4 port kdegraphics
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1237557 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kghostview/scrollbox.cpp')
-rw-r--r--kghostview/scrollbox.cpp29
1 files changed, 17 insertions, 12 deletions
diff --git a/kghostview/scrollbox.cpp b/kghostview/scrollbox.cpp
index d318ec31..f9c23904 100644
--- a/kghostview/scrollbox.cpp
+++ b/kghostview/scrollbox.cpp
@@ -22,8 +22,8 @@
#include "scrollbox.h"
-ScrollBox::ScrollBox( TQWidget* parent, const char* name )
- : TQFrame( parent, name )
+ScrollBox::ScrollBox( TQWidget* tqparent, const char* name )
+ : TQFrame( tqparent, name )
{
setFrameStyle( Panel | Sunken );
}
@@ -31,15 +31,15 @@ ScrollBox::ScrollBox( TQWidget* parent, const char* name )
void ScrollBox::mousePressEvent( TQMouseEvent* e )
{
mouse = e->pos();
- if( e->button() == RightButton )
+ if( e->button() == Qt::RightButton )
emit button3Pressed();
- if( e->button() == MidButton )
+ if( e->button() == Qt::MidButton )
emit button2Pressed();
}
void ScrollBox::mouseMoveEvent( TQMouseEvent* e )
{
- if( e->state() != LeftButton )
+ if( e->state() != Qt::LeftButton )
return;
int dx = ( e->pos().x() - mouse.x() ) * pagesize.width() / width();
@@ -57,8 +57,11 @@ void ScrollBox::mouseMoveEvent( TQMouseEvent* e )
void ScrollBox::resizeEvent( TQResizeEvent * )
{
- if ( paletteBackgroundPixmap() )
- setPaletteBackgroundPixmap( paletteBackgroundPixmap()->convertToImage().smoothScale( size() ) );
+ if ( paletteBackgroundPixmap() ) {
+ TQPixmap pm;
+ pm.convertFromImage(paletteBackgroundPixmap()->convertToImage().smoothScale( size() ));
+ setPaletteBackgroundPixmap( pm );
+ }
}
void ScrollBox::drawContents( TQPainter* paint )
@@ -77,7 +80,7 @@ void ScrollBox::drawContents( TQPainter* paint )
TQRect c( contentsRect() );
- paint -> setPen( Qt::red );
+ paint -> setPen( TQt::red );
int len = pagesize.width();
int x = c.x() + c.width() * viewpos.x() / len;
@@ -96,19 +99,19 @@ void ScrollBox::setPageSize( const TQSize& s )
{
pagesize = s;
setFixedHeight( s.height() * width() / s.width() );
- repaint();
+ tqrepaint();
}
void ScrollBox::setViewSize( const TQSize& s )
{
viewsize = s;
- repaint();
+ tqrepaint();
}
void ScrollBox::setViewPos( const TQPoint& pos )
{
viewpos = pos;
- repaint();
+ tqrepaint();
}
void ScrollBox::setThumbnail( TQPixmap img )
@@ -116,7 +119,9 @@ void ScrollBox::setThumbnail( TQPixmap img )
// The line below is needed to work around certain "features" of styles such as liquid
// see bug:61711 for more info (LPC, 20 Aug '03)
setBackgroundOrigin( TQWidget::WidgetOrigin );
- setPaletteBackgroundPixmap( img.convertToImage().smoothScale( size() ) );
+ TQPixmap pm;
+ pm.convertFromImage(img.convertToImage().smoothScale( size() ));
+ setPaletteBackgroundPixmap( pm );
}
void ScrollBox::clear()