summaryrefslogtreecommitdiffstats
path: root/krita/plugins/viewplugins/screenshot/regiongrabber.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'krita/plugins/viewplugins/screenshot/regiongrabber.cpp')
-rw-r--r--krita/plugins/viewplugins/screenshot/regiongrabber.cpp76
1 files changed, 38 insertions, 38 deletions
diff --git a/krita/plugins/viewplugins/screenshot/regiongrabber.cpp b/krita/plugins/viewplugins/screenshot/regiongrabber.cpp
index f42f6b94..570c9e3f 100644
--- a/krita/plugins/viewplugins/screenshot/regiongrabber.cpp
+++ b/krita/plugins/viewplugins/screenshot/regiongrabber.cpp
@@ -20,29 +20,29 @@
#include "regiongrabber.h"
-#include <qpainter.h>
-#include <qpalette.h>
-#include <qstyle.h>
-#include <qtimer.h>
-#include <qtooltip.h>
+#include <tqpainter.h>
+#include <tqpalette.h>
+#include <tqstyle.h>
+#include <tqtimer.h>
+#include <tqtooltip.h>
#include <kglobalsettings.h>
-SizeTip::SizeTip( QWidget *parent, const char *name )
- : QLabel( parent, name, WStyle_Customize | WX11BypassWM |
+SizeTip::SizeTip( TQWidget *tqparent, const char *name )
+ : TQLabel( tqparent, name, WStyle_Customize | WX11BypassWM |
WStyle_StaysOnTop | WStyle_NoBorder | WStyle_Tool )
{
setMargin( 2 );
setIndent( 0 );
- setFrameStyle( QFrame::Plain | QFrame::Box );
+ setFrameStyle( TQFrame::Plain | TQFrame::Box );
- setPalette( QToolTip::palette() );
+ setPalette( TQToolTip::palette() );
}
-void SizeTip::setTip( const QRect &rect )
+void SizeTip::setTip( const TQRect &rect )
{
- QString tip = QString( "%1x%2" ).arg( rect.width() )
- .arg( rect.height() );
+ TQString tip = TQString( "%1x%2" ).tqarg( rect.width() )
+ .tqarg( rect.height() );
setText( tip );
adjustSize();
@@ -50,34 +50,34 @@ void SizeTip::setTip( const QRect &rect )
positionTip( rect );
}
-void SizeTip::positionTip( const QRect &rect )
+void SizeTip::positionTip( const TQRect &rect )
{
- QRect tipRect = geometry();
- tipRect.moveTopLeft( QPoint( 0, 0 ) );
+ TQRect tipRect = tqgeometry();
+ tipRect.moveTopLeft( TQPoint( 0, 0 ) );
if ( rect.intersects( tipRect ) )
{
- QRect deskR = KGlobalSettings::desktopGeometry( QPoint( 0, 0 ) );
+ TQRect deskR = KGlobalSettings::desktopGeometry( TQPoint( 0, 0 ) );
- tipRect.moveCenter( QPoint( deskR.width()/2, deskR.height()/2 ) );
- if ( !rect.contains( tipRect, true ) && rect.intersects( tipRect ) )
- tipRect.moveBottomRight( geometry().bottomRight() );
+ tipRect.moveCenter( TQPoint( deskR.width()/2, deskR.height()/2 ) );
+ if ( !rect.tqcontains( tipRect, true ) && rect.intersects( tipRect ) )
+ tipRect.moveBottomRight( tqgeometry().bottomRight() );
}
move( tipRect.topLeft() );
}
RegionGrabber::RegionGrabber()
- : QWidget( 0, 0 ),
+ : TQWidget( 0, 0 ),
mouseDown( false ), sizeTip( 0L )
{
- sizeTip = new SizeTip( ( QWidget * )0L );
+ sizeTip = new SizeTip( ( TQWidget * )0L );
- tipTimer = new QTimer( this );
+ tipTimer = new TQTimer( this );
Q_CHECK_PTR(tipTimer);
- connect( tipTimer, SIGNAL( timeout() ), SLOT( updateSizeTip() ) );
+ connect( tipTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( updateSizeTip() ) );
- QTimer::singleShot( 200, this, SLOT( initGrabber() ) );
+ TQTimer::singleShot( 200, this, TQT_SLOT( initGrabber() ) );
}
RegionGrabber::~RegionGrabber()
@@ -87,7 +87,7 @@ RegionGrabber::~RegionGrabber()
void RegionGrabber::initGrabber()
{
- pixmap = QPixmap::grabWindow( qt_xrootwin() );
+ pixmap = TQPixmap::grabWindow( qt_xrootwin() );
setPaletteBackgroundPixmap( pixmap );
showFullScreen();
@@ -95,16 +95,16 @@ void RegionGrabber::initGrabber()
grabMouse( crossCursor );
}
-void RegionGrabber::mousePressEvent( QMouseEvent *e )
+void RegionGrabber::mousePressEvent( TQMouseEvent *e )
{
if ( e->button() == LeftButton )
{
mouseDown = true;
- grabRect = QRect( e->pos(), e->pos() );
+ grabRect = TQRect( e->pos(), e->pos() );
}
}
-void RegionGrabber::mouseMoveEvent( QMouseEvent *e )
+void RegionGrabber::mouseMoveEvent( TQMouseEvent *e )
{
if ( mouseDown )
{
@@ -117,7 +117,7 @@ void RegionGrabber::mouseMoveEvent( QMouseEvent *e )
}
}
-void RegionGrabber::mouseReleaseEvent( QMouseEvent *e )
+void RegionGrabber::mouseReleaseEvent( TQMouseEvent *e )
{
mouseDown = false;
drawRubber();
@@ -126,7 +126,7 @@ void RegionGrabber::mouseReleaseEvent( QMouseEvent *e )
grabRect.setBottomRight( e->pos() );
grabRect = grabRect.normalize();
- QPixmap region = QPixmap::grabWindow( winId(), grabRect.x(), grabRect.y(),
+ TQPixmap region = TQPixmap::grabWindow( winId(), grabRect.x(), grabRect.y(),
grabRect.width(), grabRect.height() );
releaseMouse();
@@ -134,12 +134,12 @@ void RegionGrabber::mouseReleaseEvent( QMouseEvent *e )
emit regionGrabbed( region );
}
-void RegionGrabber::keyPressEvent( QKeyEvent *e )
+void RegionGrabber::keyPressEvent( TQKeyEvent *e )
{
- if ( e->key() == Qt::Key_Escape )
+ if ( e->key() == TQt::Key_Escape )
{
releaseMouse();
- emit regionGrabbed( QPixmap() );
+ emit regionGrabbed( TQPixmap() );
}
else
e->ignore();
@@ -147,7 +147,7 @@ void RegionGrabber::keyPressEvent( QKeyEvent *e )
void RegionGrabber::updateSizeTip()
{
- QRect rect = grabRect.normalize();
+ TQRect rect = grabRect.normalize();
sizeTip->setTip( rect );
sizeTip->show();
@@ -155,14 +155,14 @@ void RegionGrabber::updateSizeTip()
void RegionGrabber::drawRubber()
{
- QPainter p;
+ TQPainter p;
p.begin( this );
p.setRasterOp( NotROP );
- p.setPen( QPen( color0, 1 ) );
+ p.setPen( TQPen( color0, 1 ) );
p.setBrush( NoBrush );
- style().drawPrimitive( QStyle::PE_FocusRect, &p, grabRect, colorGroup(),
- QStyle::Style_Default, QStyleOption( colorGroup().base() ) );
+ style().drawPrimitive( TQStyle::PE_FocusRect, &p, grabRect, tqcolorGroup(),
+ TQStyle::Style_Default, TQStyleOption( tqcolorGroup().base() ) );
p.end();
}