diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /karbon/tools/vselectnodestool.cc | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-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/tools/vselectnodestool.cc')
-rw-r--r-- | karbon/tools/vselectnodestool.cc | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/karbon/tools/vselectnodestool.cc b/karbon/tools/vselectnodestool.cc index 1c628faa..4d1511ce 100644 --- a/karbon/tools/vselectnodestool.cc +++ b/karbon/tools/vselectnodestool.cc @@ -19,8 +19,8 @@ #include <math.h> -#include <qcursor.h> -#include <qlabel.h> +#include <tqcursor.h> +#include <tqlabel.h> #include <klocale.h> #include <KoPoint.h> @@ -63,18 +63,18 @@ VSelectNodesTool::activate() view()->part()->document().selection()->setSelectObjects( false ); // deselect all nodes view()->part()->document().selection()->selectNodes( false ); - view()->repaintAll( view()->part()->document().selection()->boundingBox() ); + view()->tqrepaintAll( view()->part()->document().selection()->boundingBox() ); } VTool::activate(); } -QString +TQString VSelectNodesTool::statusText() { if( m_state == normal ) return i18n( "Editing Nodes" ); else - return QString( "" ); + return TQString( "" ); } void @@ -82,11 +82,11 @@ VSelectNodesTool::draw() { VPainter *painter = view()->painterFactory()->editpainter(); painter->setZoomFactor( view()->zoom() ); - painter->setRasterOp( Qt::NotROP ); + painter->setRasterOp( TQt::NotROP ); if( m_state == dragging ) { - painter->setPen( Qt::DotLine ); + painter->setPen( TQt::DotLine ); painter->newPath(); painter->moveTo( KoPoint( m_first.x(), m_first.y() ) ); painter->lineTo( KoPoint( m_current.x(), m_first.y() ) ); @@ -115,12 +115,12 @@ VSelectNodesTool::setCursor() const KoRect selrect = calcSelRect( last() ); - QPtrList<VSegment> segments = view()->part()->document().selection()->getSegments( selrect ); + TQPtrList<VSegment> segments = view()->part()->document().selection()->getSegments( selrect ); if( segments.count() > 0 ) { VSegment* seg = segments.at( 0 ); for( int i = 0; i < seg->degree(); ++i ) - if( seg->pointIsSelected( i ) && selrect.contains( seg->point( i ) ) ) + if( seg->pointIsSelected( i ) && selrect.tqcontains( seg->point( i ) ) ) { view()->setCursor( VCursor::needleMoveArrow() ); break; @@ -141,7 +141,7 @@ VSelectNodesTool::mouseButtonPress() recalc(); view()->part()->document().selection()->setState( VObject::edit ); - view()->repaintAll( view()->part()->document().selection()->boundingBox() ); + view()->tqrepaintAll( view()->part()->document().selection()->boundingBox() ); view()->part()->document().selection()->setState( VObject::selected ); VSelection* selection = view()->part()->document().selection(); @@ -149,7 +149,7 @@ VSelectNodesTool::mouseButtonPress() KoRect selrect = calcSelRect( m_current ); // get segments with control points inside selection rect - QPtrList<VSegment> segments = selection->getSegments( selrect ); + TQPtrList<VSegment> segments = selection->getSegments( selrect ); if( segments.count() > 0 ) { VSegment *seg = segments.at( 0 ); @@ -158,16 +158,16 @@ VSelectNodesTool::mouseButtonPress() // allow moving bezier points only if one of the bezier points is within the selection rect // and no neighboring knot is selected - if( segments.count() == 1 && ! selrect.contains( seg->knot() ) && ! seg->knotIsSelected() + if( segments.count() == 1 && ! selrect.tqcontains( seg->knot() ) && ! seg->knotIsSelected() && ( prev && ! prev->knotIsSelected() ) ) { - if( selrect.contains( seg->point( 1 ) ) ) + if( selrect.tqcontains( seg->point( 1 ) ) ) { m_state = movingbezier1; if( next ) next->selectPoint( 0, false ); } - else if( selrect.contains( seg->point( 0 ) ) ) + else if( selrect.tqcontains( seg->point( 0 ) ) ) { m_state = movingbezier2; if( prev ) @@ -180,7 +180,7 @@ VSelectNodesTool::mouseButtonPress() { for( int i = 0; i < seg->degree(); ++i ) { - if( seg->pointIsSelected( i ) && selrect.contains( seg->point( i ) ) ) + if( seg->pointIsSelected( i ) && selrect.tqcontains( seg->point( i ) ) ) { m_state = moving; break; @@ -197,7 +197,7 @@ VSelectNodesTool::mouseButtonPress() { for( int i = 0; i < seg->degree(); ++i ) { - if( selrect.contains( seg->point( i ) ) ) + if( selrect.tqcontains( seg->point( i ) ) ) { KoPoint vDist = seg->point( i ) - m_current; double dist = vDist.x()*vDist.x() + vDist.y()*vDist.y(); @@ -228,21 +228,21 @@ VSelectNodesTool::rightMouseButtonPress() recalc(); view()->part()->document().selection()->setState( VObject::edit ); - view()->repaintAll( view()->part()->document().selection()->boundingBox() ); + view()->tqrepaintAll( view()->part()->document().selection()->boundingBox() ); view()->part()->document().selection()->setState( VObject::selected ); draw(); } bool -VSelectNodesTool::keyReleased( Qt::Key key ) +VSelectNodesTool::keyReleased( TQt::Key key ) { VSelection* selection = view()->part()->document().selection(); switch( key ) { // increase/decrease the handle size - case Qt::Key_I: + case TQt::Key_I: { uint handleSize = selection->handleSize(); if( shiftPressed() ) @@ -251,7 +251,7 @@ VSelectNodesTool::keyReleased( Qt::Key key ) selection->setHandleSize( --handleSize ); } break; - case Qt::Key_Delete: + case TQt::Key_Delete: if( selection->objects().count() > 0 ) view()->part()->addCommand( new VDeleteNodeCmd( &view()->part()->document() ), true ); break; @@ -259,7 +259,7 @@ VSelectNodesTool::keyReleased( Qt::Key key ) } if( view() ) - view()->repaintAll( selection->boundingBox() ); + view()->tqrepaintAll( selection->boundingBox() ); return true; } @@ -280,7 +280,7 @@ VSelectNodesTool::mouseButtonRelease() selection->append( selrect.normalize(), false, true ); view()->selectionChanged(); - view()->part()->repaintAllViews(); + view()->part()->tqrepaintAllViews(); m_state = normal; } @@ -297,7 +297,7 @@ VSelectNodesTool::rightMouseButtonRelease() selection->take( selrect.normalize(), false, false ); view()->selectionChanged(); - view()->part()->repaintAllViews(); + view()->part()->tqrepaintAllViews(); m_state = normal; } @@ -318,23 +318,23 @@ VSelectNodesTool::mouseDragRelease() { view()->part()->document().selection()->setState( VObject::selected ); VCommand *cmd; - QPtrList<VSegment> segments; + TQPtrList<VSegment> segments; KoPoint _last = view()->canvasWidget()->snapToGrid( last() ); if( m_state == movingbezier1 || m_state == movingbezier2 ) { KoRect selrect = calcSelRect( m_first ); segments = view()->part()->document().selection()->getSegments( selrect ); cmd = new VTranslateBezierCmd( &view()->part()->document(), segments.at( 0 ), - qRound( ( _last.x() - m_first.x() ) ), - qRound( ( _last.y() - m_first.y() ) ), + tqRound( ( _last.x() - m_first.x() ) ), + tqRound( ( _last.y() - m_first.y() ) ), m_state == movingbezier2 ); } else { cmd = new VTranslatePointCmd( &view()->part()->document(), - qRound( ( _last.x() - m_first.x() ) ), - qRound( ( _last.y() - m_first.y() ) ) ); + tqRound( ( _last.x() - m_first.x() ) ), + tqRound( ( _last.y() - m_first.y() ) ) ); } view()->part()->addCommand( cmd, true ); m_state = normal; @@ -368,7 +368,7 @@ VSelectNodesTool::mouseDragRelease() false, false ); } view()->selectionChanged(); - view()->part()->repaintAllViews(); + view()->part()->tqrepaintAllViews(); m_state = normal; } } @@ -381,7 +381,7 @@ VSelectNodesTool::cancel() { draw(); m_state = normal; - view()->repaintAll( view()->part()->document().selection()->boundingBox() ); + view()->tqrepaintAll( view()->part()->document().selection()->boundingBox() ); } } @@ -398,7 +398,7 @@ VSelectNodesTool::recalc() double distx = _last.x() - m_first.x(); double disty = _last.y() - m_first.y(); // move operation - QWMatrix mat; + TQWMatrix mat; mat.translate( distx, disty ); // Copy selected objects and transform: @@ -428,7 +428,7 @@ VSelectNodesTool::setup( KActionCollection *collection ) if( m_action == 0 ) { - m_action = new KRadioAction( i18n( "Select Nodes Tool" ), "14_selectnodes", Qt::SHIFT+Qt::Key_H, this, SLOT( activate() ), collection, name() ); + m_action = new KRadioAction( i18n( "Select Nodes Tool" ), "14_selectnodes", TQt::SHIFT+TQt::Key_H, this, TQT_SLOT( activate() ), collection, name() ); m_action->setToolTip( i18n( "Select Nodes" ) ); m_action->setExclusiveGroup( "select" ); //m_ownAction = true; |