summaryrefslogtreecommitdiffstats
path: root/karbon/vtool.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 /karbon/vtool.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 'karbon/vtool.cc')
-rw-r--r--karbon/vtool.cc60
1 files changed, 30 insertions, 30 deletions
diff --git a/karbon/vtool.cc b/karbon/vtool.cc
index 66114048..140d6513 100644
--- a/karbon/vtool.cc
+++ b/karbon/vtool.cc
@@ -17,8 +17,8 @@
* Boston, MA 02110-1301, USA.
*/
-#include <qevent.h>
-#include <qlabel.h>
+#include <tqevent.h>
+#include <tqlabel.h>
#include <kdebug.h>
#include <kiconloader.h>
@@ -31,7 +31,7 @@
#include "vtool.moc"
-VTool::VTool( KarbonView *view, const char *name ) : QObject( 0, name ), m_view( view )
+VTool::VTool( KarbonView *view, const char *name ) : TQObject( 0, name ), m_view( view )
{
m_mouseButtonIsDown = false;
m_isDragging = false;
@@ -69,7 +69,7 @@ VTool::view() const
}
bool
-VTool::mouseEvent( QMouseEvent* mouseEvent, const KoPoint &canvasCoordinate )
+VTool::mouseEvent( TQMouseEvent* mouseEvent, const KoPoint &canvasCoordinate )
{
if( !view() || !view()->part() || !view()->part()->isReadWrite() )
return false;
@@ -79,24 +79,24 @@ VTool::mouseEvent( QMouseEvent* mouseEvent, const KoPoint &canvasCoordinate )
setCursor();
- m_altPressed = mouseEvent->state() & Qt::AltButton;
- m_shiftPressed = mouseEvent->state() & Qt::ShiftButton;
- m_ctrlPressed = mouseEvent->state() & Qt::ControlButton;
+ m_altPressed = mouseEvent->state() & TQt::AltButton;
+ m_shiftPressed = mouseEvent->state() & TQt::ShiftButton;
+ m_ctrlPressed = mouseEvent->state() & TQt::ControlButton;
// Mouse events:
- if( mouseEvent->type() == QEvent::MouseButtonDblClick )
+ if( mouseEvent->type() == TQEvent::MouseButtonDblClick )
{
mouseButtonDblClick();
return true;
}
- if( mouseEvent->type() == QEvent::MouseButtonPress )
+ if( mouseEvent->type() == TQEvent::MouseButtonPress )
{
m_firstPoint.setX( canvasCoordinate.x() );
m_firstPoint.setY( canvasCoordinate.y() );
- if( mouseEvent->button() == QEvent::RightButton )
+ if( mouseEvent->button() == Qt::RightButton )
rightMouseButtonPress();
else
mouseButtonPress();
@@ -106,7 +106,7 @@ VTool::mouseEvent( QMouseEvent* mouseEvent, const KoPoint &canvasCoordinate )
return true;
}
- if( mouseEvent->type() == QEvent::MouseMove )
+ if( mouseEvent->type() == TQEvent::MouseMove )
{
//setCursor();
@@ -122,7 +122,7 @@ VTool::mouseEvent( QMouseEvent* mouseEvent, const KoPoint &canvasCoordinate )
return true;
}
- if( mouseEvent->type() == QEvent::MouseButtonRelease )
+ if( mouseEvent->type() == TQEvent::MouseButtonRelease )
{
if( m_isDragging )
{
@@ -131,7 +131,7 @@ VTool::mouseEvent( QMouseEvent* mouseEvent, const KoPoint &canvasCoordinate )
m_isDragging = false;
}
else if( m_mouseButtonIsDown ) // False if canceled.
- if( mouseEvent->button() == QEvent::RightButton )
+ if( mouseEvent->button() == Qt::RightButton )
rightMouseButtonRelease();
else
mouseButtonRelease();
@@ -145,17 +145,17 @@ VTool::mouseEvent( QMouseEvent* mouseEvent, const KoPoint &canvasCoordinate )
}
bool
-VTool::keyEvent( QEvent* event )
+VTool::keyEvent( TQEvent* event )
{
// Key press events.
- if( event->type() == QEvent::KeyPress )
+ if( event->type() == TQEvent::KeyPress )
{
- QKeyEvent* keyEvent = static_cast<QKeyEvent*>( event );
+ TQKeyEvent* keyEvent = TQT_TQKEYEVENT( event );
// Terminate the current drawing with the Enter-key:
if(
- ( keyEvent->key() == Qt::Key_Enter ||
- keyEvent->key() == Qt::Key_Return )
+ ( keyEvent->key() == TQt::Key_Enter ||
+ keyEvent->key() == TQt::Key_Return )
&& !m_isDragging )
{
accept();
@@ -164,7 +164,7 @@ VTool::keyEvent( QEvent* event )
}
// Terminate the current drawing with the Enter-key:
- if( keyEvent->key() == Qt::Key_Backspace && !m_isDragging )
+ if( keyEvent->key() == TQt::Key_Backspace && !m_isDragging )
{
cancelStep();
@@ -172,7 +172,7 @@ VTool::keyEvent( QEvent* event )
}
// Cancel dragging with ESC-key:
- if( keyEvent->key() == Qt::Key_Escape )
+ if( keyEvent->key() == TQt::Key_Escape )
{
cancel();
@@ -183,7 +183,7 @@ VTool::keyEvent( QEvent* event )
}
// If SHIFT is pressed, some tools create a "square" object while dragging:
- if( keyEvent->key() == Qt::Key_Shift )
+ if( keyEvent->key() == TQt::Key_Shift )
{
m_shiftPressed = true;
if( m_isDragging )
@@ -195,7 +195,7 @@ VTool::keyEvent( QEvent* event )
}
// If Ctrl is pressed, some tools create a "centered" object while dragging:
- if( keyEvent->key() == Qt::Key_Control )
+ if( keyEvent->key() == TQt::Key_Control )
{
m_ctrlPressed = true;
if( m_isDragging )
@@ -209,12 +209,12 @@ VTool::keyEvent( QEvent* event )
}
// Key release events:
- if( event->type() == QEvent::KeyRelease )
+ if( event->type() == TQEvent::KeyRelease )
{
- QKeyEvent* keyEvent = static_cast<QKeyEvent*>( event );
+ TQKeyEvent* keyEvent = TQT_TQKEYEVENT( event );
- Qt::Key key = (Qt::Key)keyEvent->key();
- if( key == Qt::Key_Shift )
+ TQt::Key key = (TQt::Key)keyEvent->key();
+ if( key == TQt::Key_Shift )
{
m_shiftPressed = false;
if( m_isDragging )
@@ -225,7 +225,7 @@ VTool::keyEvent( QEvent* event )
}
}
- if( key == Qt::Key_Control )
+ if( key == TQt::Key_Control )
{
m_ctrlPressed = false;
if( m_isDragging )
@@ -236,7 +236,7 @@ VTool::keyEvent( QEvent* event )
}
}
- if( key == Qt::Key_Left || key == Qt::Key_Right || key == Qt::Key_Up || key == Qt::Key_Down )
+ if( key == TQt::Key_Left || key == TQt::Key_Right || key == TQt::Key_Up || key == TQt::Key_Down )
{
arrowKeyReleased( key );
return true;
@@ -253,7 +253,7 @@ VTool::activate()
{
kdDebug() << k_funcinfo << endl;
refreshUnit();
- QPixmap Icon = BarIcon( icon() );
+ TQPixmap Icon = BarIcon( icon() );
view()->contextHelpAction()->updateHelp( uiname(), contextHelp(), &Icon );
view()->statusMessage()->setText( statusText() );
toolController()->setCurrentTool( this );
@@ -269,7 +269,7 @@ VTool::activate()
else
{
refreshUnit();
- QPixmap Icon = BarIcon( icon() );
+ TQPixmap Icon = BarIcon( icon() );
view()->contextHelpAction()->updateHelp( uiname(), contextHelp(), &Icon );
view()->statusMessage()->setText( statusText() );
toolController()->activeTool()->action()->setChecked( true );