summaryrefslogtreecommitdiffstats
path: root/kspread/kspread_handler.cc
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kspread/kspread_handler.cc
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kspread/kspread_handler.cc')
-rw-r--r--kspread/kspread_handler.cc114
1 files changed, 57 insertions, 57 deletions
diff --git a/kspread/kspread_handler.cc b/kspread/kspread_handler.cc
index 4e74958f..5adedbfd 100644
--- a/kspread/kspread_handler.cc
+++ b/kspread/kspread_handler.cc
@@ -2,7 +2,7 @@
// TODO: insert copyright header
//
-#include <qpainter.h>
+#include <tqpainter.h>
#include "kspread_view.h"
@@ -12,8 +12,8 @@
using namespace KSpread;
-InsertHandler::InsertHandler( View* view, QWidget* widget )
- : KoEventHandler( widget )
+InsertHandler::InsertHandler( View* view, TQWidget* widget )
+ : KoEventHandler( TQT_TQOBJECT(widget) )
{
m_view = view;
m_started = false;
@@ -24,49 +24,49 @@ InsertHandler::InsertHandler( View* view, QWidget* widget )
InsertHandler::~InsertHandler()
{
- ((QWidget*)target())->setCursor( arrowCursor );
+ ((TQWidget*)target())->setCursor( arrowCursor );
m_view->resetInsertHandle();
}
-bool InsertHandler::eventFilter( QObject*, QEvent* ev )
+bool InsertHandler::eventFilter( TQObject*, TQEvent* ev )
{
- if ( ev->type() == QEvent::MouseButtonPress )
+ if ( ev->type() == TQEvent::MouseButtonPress )
{
- QMouseEvent* e = (QMouseEvent*)ev;
+ TQMouseEvent* e = (TQMouseEvent*)ev;
- m_geometryStart = e->pos();
- m_geometryEnd = e->pos();
+ m_tqgeometryStart = e->pos();
+ m_tqgeometryEnd = e->pos();
m_started = false;
m_clicked = true;
return true;
}
- else if ( ev->type() == QEvent::MouseMove )
+ else if ( ev->type() == TQEvent::MouseMove )
{
if ( !m_clicked )
return true;
- QMouseEvent* e = (QMouseEvent*)ev;
+ TQMouseEvent* e = (TQMouseEvent*)ev;
- QPainter painter;
- painter.begin( (QWidget*)target() );
+ TQPainter painter;
+ painter.begin( (TQWidget*)target() );
painter.setRasterOp( NotROP );
- QPen pen;
- pen.setStyle( DashLine );
+ TQPen pen;
+ pen.setStyle( Qt::DashLine );
painter.setPen( pen );
if ( m_started )
{
- int x = m_geometryStart.x();
- int y = m_geometryStart.y();
- if ( x > m_geometryEnd.x() )
- x = m_geometryEnd.x();
- if ( y > m_geometryEnd.y() )
- y = m_geometryEnd.y();
- int w = m_geometryEnd.x() - m_geometryStart.x();
+ int x = m_tqgeometryStart.x();
+ int y = m_tqgeometryStart.y();
+ if ( x > m_tqgeometryEnd.x() )
+ x = m_tqgeometryEnd.x();
+ if ( y > m_tqgeometryEnd.y() )
+ y = m_tqgeometryEnd.y();
+ int w = m_tqgeometryEnd.x() - m_tqgeometryStart.x();
if ( w < 0 ) w *= -1;
- int h = m_geometryEnd.y() - m_geometryStart.y();
+ int h = m_tqgeometryEnd.y() - m_tqgeometryStart.y();
if ( h < 0 ) h *= -1;
if ( w < KS_MIN_RECTSIZE ) w = KS_MIN_RECTSIZE;
@@ -77,17 +77,17 @@ bool InsertHandler::eventFilter( QObject*, QEvent* ev )
else
m_started = true;
- m_geometryEnd = e->pos();
+ m_tqgeometryEnd = e->pos();
- int x = m_geometryStart.x();
- int y = m_geometryStart.y();
- if ( x > m_geometryEnd.x() )
- x = m_geometryEnd.x();
- if ( y > m_geometryEnd.y() )
- y = m_geometryEnd.y();
- int w = m_geometryEnd.x() - m_geometryStart.x();
+ int x = m_tqgeometryStart.x();
+ int y = m_tqgeometryStart.y();
+ if ( x > m_tqgeometryEnd.x() )
+ x = m_tqgeometryEnd.x();
+ if ( y > m_tqgeometryEnd.y() )
+ y = m_tqgeometryEnd.y();
+ int w = m_tqgeometryEnd.x() - m_tqgeometryStart.x();
if ( w < 0 ) w *= -1;
- int h = m_geometryEnd.y() - m_geometryStart.y();
+ int h = m_tqgeometryEnd.y() - m_tqgeometryStart.y();
if ( h < 0 ) h *= -1;
if ( w < KS_MIN_RECTSIZE ) w = KS_MIN_RECTSIZE;
@@ -98,9 +98,9 @@ bool InsertHandler::eventFilter( QObject*, QEvent* ev )
return true;
}
- else if ( ev->type() == QEvent::MouseButtonRelease )
+ else if ( ev->type() == TQEvent::MouseButtonRelease )
{
- QMouseEvent* e = (QMouseEvent*)ev;
+ TQMouseEvent* e = (TQMouseEvent*)ev;
if ( !m_started )
{
@@ -108,41 +108,41 @@ bool InsertHandler::eventFilter( QObject*, QEvent* ev )
return true;
}
- m_geometryEnd = e->pos();
-
- int x = m_geometryStart.x();
- int y = m_geometryStart.y();
- if ( x > m_geometryEnd.x() )
- x = m_geometryEnd.x();
- if ( y > m_geometryEnd.y() )
- y = m_geometryEnd.y();
- int w = m_geometryEnd.x() - m_geometryStart.x();
+ m_tqgeometryEnd = e->pos();
+
+ int x = m_tqgeometryStart.x();
+ int y = m_tqgeometryStart.y();
+ if ( x > m_tqgeometryEnd.x() )
+ x = m_tqgeometryEnd.x();
+ if ( y > m_tqgeometryEnd.y() )
+ y = m_tqgeometryEnd.y();
+ int w = m_tqgeometryEnd.x() - m_tqgeometryStart.x();
if ( w < 0 ) w *= -1;
- int h = m_geometryEnd.y() - m_geometryStart.y();
+ int h = m_tqgeometryEnd.y() - m_tqgeometryStart.y();
if ( h < 0 ) h *= -1;
if ( w < KS_MIN_RECTSIZE ) w = KS_MIN_RECTSIZE;
if ( h < KS_MIN_RECTSIZE ) h = KS_MIN_RECTSIZE;
- QPainter painter;
- painter.begin( (QWidget*)target() );
+ TQPainter painter;
+ painter.begin( (TQWidget*)target() );
- QPen pen;
- pen.setStyle( DashLine );
+ TQPen pen;
+ pen.setStyle( Qt::DashLine );
painter.setPen( pen );
painter.setRasterOp( NotROP );
painter.drawRect( x, y, w, h );
painter.end();
- insertObject( QRect( x, y, w, h) );
+ insertObject( TQRect( x, y, w, h) );
delete this;
return true;
}
- else if ( ev->type() == QEvent::KeyPress )
+ else if ( ev->type() == TQEvent::KeyPress )
{
- QKeyEvent* e = (QKeyEvent*)ev;
+ TQKeyEvent* e = (TQKeyEvent*)ev;
if ( e->key() != Key_Escape )
return false;
@@ -153,32 +153,32 @@ bool InsertHandler::eventFilter( QObject*, QEvent* ev )
return false;
}
-InsertPartHandler::InsertPartHandler( View* view, QWidget* widget, const KoDocumentEntry& entry )
+InsertPartHandler::InsertPartHandler( View* view, TQWidget* widget, const KoDocumentEntry& entry )
: InsertHandler( view, widget ), m_entry( entry )
{
}
InsertPartHandler::~InsertPartHandler()
{
}
-void InsertPartHandler::insertObject( QRect r)
+void InsertPartHandler::insertObject( TQRect r)
{
m_view->insertChild( r, m_entry );
}
-InsertChartHandler::InsertChartHandler( View* view, QWidget* widget, const KoDocumentEntry& entry )
+InsertChartHandler::InsertChartHandler( View* view, TQWidget* widget, const KoDocumentEntry& entry )
: InsertHandler( view, widget ), m_entry( entry )
{
}
InsertChartHandler::~InsertChartHandler()
{
}
-void InsertChartHandler::insertObject( QRect r)
+void InsertChartHandler::insertObject( TQRect r)
{
m_view->insertChart( r, m_entry );
}
-InsertPictureHandler::InsertPictureHandler( View* view, QWidget* widget, const KURL &file )
+InsertPictureHandler::InsertPictureHandler( View* view, TQWidget* widget, const KURL &file )
: InsertHandler( view, widget )
{
m_file = file;
@@ -186,7 +186,7 @@ InsertPictureHandler::InsertPictureHandler( View* view, QWidget* widget, const K
InsertPictureHandler::~InsertPictureHandler()
{
}
-void InsertPictureHandler::insertObject( QRect r)
+void InsertPictureHandler::insertObject( TQRect r)
{
//m_view->insertPicture(/* r,*/ m_file );
}