diff options
Diffstat (limited to 'karbon/tools/vselecttool.cc')
-rw-r--r-- | karbon/tools/vselecttool.cc | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/karbon/tools/vselecttool.cc b/karbon/tools/vselecttool.cc index 19338038..0609d772 100644 --- a/karbon/tools/vselecttool.cc +++ b/karbon/tools/vselecttool.cc @@ -20,10 +20,10 @@ #include <math.h> #include <stdlib.h> -#include <qcursor.h> -#include <qlabel.h> -#include <qradiobutton.h> -#include <qbuttongroup.h> +#include <tqcursor.h> +#include <tqlabel.h> +#include <tqradiobutton.h> +#include <tqbuttongroup.h> #include <KoPoint.h> #include <KoRect.h> @@ -43,16 +43,16 @@ VSelectOptionsWidget::VSelectOptionsWidget( KarbonPart *part ) : KDialogBase( 0L, "", true, i18n( "Selection" ), Ok | Cancel ), m_part( part ) { - QButtonGroup *group = new QButtonGroup( 1, Qt::Horizontal, i18n( "Selection Mode" ), this ); + TQButtonGroup *group = new TQButtonGroup( 1, Qt::Horizontal, i18n( "Selection Mode" ), this ); - new QRadioButton( i18n( "Select in current layer" ), group ); - new QRadioButton( i18n( "Select in visible layers" ), group ); - new QRadioButton( i18n( "Select in selected layers" ), group ); + new TQRadioButton( i18n( "Select in current layer" ), group ); + new TQRadioButton( i18n( "Select in visible layers" ), group ); + new TQRadioButton( i18n( "Select in selected layers" ), group ); group->setRadioButtonExclusive( true ); group->setButton( part->document().selectionMode() ); - connect( group, SIGNAL( clicked( int ) ), this, SLOT( modeChange( int ) ) ); + connect( group, TQT_SIGNAL( clicked( int ) ), this, TQT_SLOT( modeChange( int ) ) ); group->setInsideMargin( 4 ); group->setInsideSpacing( 2 ); @@ -74,7 +74,7 @@ VSelectTool::VSelectTool( KarbonView *view ) m_objects.setAutoDelete( true ); m_optionsWidget = new VSelectOptionsWidget( view->part() ); registerTool( this ); - connect( view, SIGNAL( selectionChange() ), this, SLOT( updateStatusBar() ) ); + connect( view, TQT_SIGNAL( selectionChange() ), this, TQT_SLOT( updateStatusBar() ) ); } VSelectTool::~VSelectTool() @@ -86,24 +86,24 @@ void VSelectTool::activate() { VTool::activate(); - view()->setCursor( QCursor( Qt::arrowCursor ) ); + view()->setCursor( TQCursor( TQt::arrowCursor ) ); view()->part()->document().selection()->showHandle(); view()->part()->document().selection()->setSelectObjects(); view()->part()->document().selection()->setState( VObject::selected ); view()->part()->document().selection()->selectNodes(); - view()->repaintAll( view()->part()->document().selection()->boundingBox() ); + view()->tqrepaintAll( view()->part()->document().selection()->boundingBox() ); updateStatusBar(); } -QString +TQString VSelectTool::statusText() { return i18n( "Select" ); } -QString VSelectTool::contextHelp() +TQString VSelectTool::contextHelp() { - QString s = i18n( "<qt><b>Selection tool:</b><br>" ); + TQString s = i18n( "<qt><b>Selection tool:</b><br>" ); s += i18n( "<i>Select in current layer:</i><br>The selection is made in the layer selected in the layers docker.<br><br>" ); s += i18n( "<i>Select in visible layers:</i><br>The selection is made in the visible layers (eye in the layers docker).<br><br>" ); s += i18n( "<i>Select in selected layers:</i><br>The selection is made in the checked layers in the layers docker.<br><br>" ); @@ -116,7 +116,7 @@ VSelectTool::draw() { VPainter *painter = view()->painterFactory()->editpainter(); //painter->setZoomFactor( view()->zoom() ); - painter->setRasterOp( Qt::NotROP ); + painter->setRasterOp( TQt::NotROP ); KoRect rect = view()->part()->document().selection()->boundingBox(); @@ -130,7 +130,7 @@ VSelectTool::draw() } else if( m_state == normal ) { - painter->setPen( Qt::DotLine ); + painter->setPen( TQt::DotLine ); painter->newPath(); painter->moveTo( KoPoint( first().x(), first().y() ) ); painter->lineTo( KoPoint( m_current.x(), first().y() ) ); @@ -151,22 +151,22 @@ VSelectTool::setCursor() const { case node_lt: case node_rb: - view()->setCursor( QCursor( Qt::SizeFDiagCursor ) ); + view()->setCursor( TQCursor( TQt::SizeFDiagCursor ) ); break; case node_rt: case node_lb: - view()->setCursor( QCursor( Qt::SizeBDiagCursor ) ); + view()->setCursor( TQCursor( TQt::SizeBDiagCursor ) ); break; case node_lm: case node_rm: - view()->setCursor( QCursor( Qt::SizeHorCursor ) ); + view()->setCursor( TQCursor( TQt::SizeHorCursor ) ); break; case node_mt: case node_mb: - view()->setCursor( QCursor( Qt::SizeVerCursor ) ); + view()->setCursor( TQCursor( TQt::SizeVerCursor ) ); break; default: - view()->setCursor( QCursor( Qt::arrowCursor ) ); + view()->setCursor( TQCursor( TQt::arrowCursor ) ); } } @@ -183,14 +183,14 @@ VSelectTool::mouseButtonPress() if( m_activeNode != node_none ) m_state = scaling; - else if( rect.contains( m_current ) && m_state == normal ) + else if( rect.tqcontains( m_current ) && m_state == normal ) m_state = moving; recalc(); // undraw selection bounding box view()->part()->document().selection()->setState( VObject::edit ); - view()->repaintAll( rect ); + view()->tqrepaintAll( rect ); view()->part()->document().selection()->setState( VObject::selected ); draw(); @@ -208,7 +208,7 @@ VSelectTool::rightMouseButtonPress() // undraw selection bounding box 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(); @@ -238,14 +238,14 @@ VSelectTool::rightMouseButtonRelease() if( selector.visit( view()->part()->document() ) ) view()->part()->document().selection()->take( *newSelection.last() ); - view()->part()->repaintAllViews( view()->part()->document().selection()->boundingBox() ); + view()->part()->tqrepaintAllViews( view()->part()->document().selection()->boundingBox() ); view()->selectionChanged(); updateStatusBar(); } else if( view()->part()->document().selection()->objects().count() > 0 ) { - view()->showSelectionPopupMenu( QCursor::pos() ); + view()->showSelectionPopupMenu( TQCursor::pos() ); } } @@ -274,7 +274,7 @@ VSelectTool::mouseButtonRelease() VObjectListIterator it( newSelection ); for( ; it.current(); ++it ) { - if( oldSelection.contains( it.current() ) ) + if( oldSelection.tqcontains( it.current() ) ) lastMatched = it.current(); } @@ -282,7 +282,7 @@ VSelectTool::mouseButtonRelease() // - none is selected // - the stack's bottom object was the last selected object if( lastMatched && lastMatched != newSelection.first() ) - view()->part()->document().selection()->append( newSelection.at( newSelection.find( lastMatched )-1 ) ); + view()->part()->document().selection()->append( newSelection.at( newSelection.tqfind( lastMatched )-1 ) ); else view()->part()->document().selection()->append( newSelection.last() ); } @@ -300,7 +300,7 @@ VSelectTool::mouseButtonRelease() view()->part()->document().selection()->append( newSelection.last() ); } - view()->part()->repaintAllViews( view()->part()->document().selection()->boundingBox() ); + view()->part()->tqrepaintAllViews( view()->part()->document().selection()->boundingBox() ); view()->selectionChanged(); updateStatusBar(); @@ -322,7 +322,7 @@ VSelectTool::mouseDragRelease() view()->part()->document().selection()->append( selRect ); else view()->part()->document().selection()->take( selRect ); - view()->part()->repaintAllViews( selRect ); + view()->part()->tqrepaintAllViews( selRect ); } else if( m_state == moving ) { @@ -332,12 +332,12 @@ VSelectTool::mouseDragRelease() view()->part()->addCommand( new VTranslateCmd( &view()->part()->document(), - abs( int( m_distx ) ) >= abs( int( m_disty ) ) ? qRound( m_distx ) : 0, - abs( int( m_distx ) ) <= abs( int( m_disty ) ) ? qRound( m_disty ) : 0, altPressed() ), + abs( int( m_distx ) ) >= abs( int( m_disty ) ) ? tqRound( m_distx ) : 0, + abs( int( m_distx ) ) <= abs( int( m_disty ) ) ? tqRound( m_disty ) : 0, altPressed() ), true ); else view()->part()->addCommand( - new VTranslateCmd( &view()->part()->document(), qRound( m_distx ), qRound( m_disty ), altPressed() ), + new VTranslateCmd( &view()->part()->document(), tqRound( m_distx ), tqRound( m_disty ), altPressed() ), true ); } else if( m_state == scaling ) @@ -355,16 +355,16 @@ VSelectTool::mouseDragRelease() } void -VSelectTool::arrowKeyReleased( Qt::Key key ) +VSelectTool::arrowKeyReleased( TQt::Key key ) { int dx = 0; int dy = 0; switch( key ) { - case Qt::Key_Up: dy = 10; break; - case Qt::Key_Down: dy = -10; break; - case Qt::Key_Right: dx = 10; break; - case Qt::Key_Left: dx = -10; break; + case TQt::Key_Up: dy = 10; break; + case TQt::Key_Down: dy = -10; break; + case TQt::Key_Right: dx = 10; break; + case TQt::Key_Left: dx = -10; break; default: return; } m_state = normal; @@ -378,7 +378,7 @@ VSelectTool::arrowKeyReleased( Qt::Key key ) } bool -VSelectTool::keyReleased( Qt::Key key ) +VSelectTool::keyReleased( TQt::Key key ) { VSelection* selection = view()->part()->document().selection(); @@ -386,7 +386,7 @@ VSelectTool::keyReleased( Qt::Key key ) switch( key ) { // increase/decrease the handle size - case Qt::Key_I: + case TQt::Key_I: { uint handleSize = selection->handleSize(); if( shiftPressed() ) @@ -399,7 +399,7 @@ VSelectTool::keyReleased( Qt::Key key ) } if( view() ) - view()->repaintAll( selection->boundingBox() ); + view()->tqrepaintAll( selection->boundingBox() ); return true; } @@ -424,11 +424,11 @@ VSelectTool::updateStatusBar() const double b = KoUnit::toUserValue( rect.bottom(), view()->part()->unit() ); // print bottom-left (%1,%2), top-right (%3,%4) corner of selection bounding box and document unit (%5) - QString selectMessage = i18n( "[(left,bottom), (right,top)] (actual unit)", "Selection [(%1, %2), (%3, %4)] (%5)").arg( x, 0, 'f', 1 ).arg( y, 0, 'f', 1 ).arg( r, 0, 'f', 1 ).arg( b, 0, 'f', 1 ).arg( view()->part()->unitName() ); + TQString selectMessage = i18n( "[(left,bottom), (right,top)] (actual unit)", "Selection [(%1, %2), (%3, %4)] (%5)").tqarg( x, 0, 'f', 1 ).tqarg( y, 0, 'f', 1 ).tqarg( r, 0, 'f', 1 ).tqarg( b, 0, 'f', 1 ).tqarg( view()->part()->unitName() ); VSelectionDescription selectionDesc; selectionDesc.visit( *view()->part()->document().selection() ); - selectMessage += QString( "(%1)" ).arg( selectionDesc.description() ); + selectMessage += TQString( "(%1)" ).tqarg( selectionDesc.description() ); view()->statusMessage()->setText( selectMessage ); } @@ -476,7 +476,7 @@ VSelectTool::cancel() { draw(); m_state = normal; - view()->repaintAll( view()->part()->document().selection()->boundingBox() ); + view()->tqrepaintAll( view()->part()->document().selection()->boundingBox() ); } } @@ -587,7 +587,7 @@ VSelectTool::recalc() bool VSelectTool::showDialog() const { - return m_optionsWidget->exec() == QDialog::Accepted; + return m_optionsWidget->exec() == TQDialog::Accepted; } void @@ -603,7 +603,7 @@ VSelectTool::setup( KActionCollection *collection ) if( m_action == 0 ) { - m_action = new KRadioAction( i18n( "Select Tool" ), "14_select", Qt::SHIFT+Qt::Key_H, this, SLOT( activate() ), collection, name() ); + m_action = new KRadioAction( i18n( "Select Tool" ), "14_select", TQt::SHIFT+TQt::Key_H, this, TQT_SLOT( activate() ), collection, name() ); m_action->setToolTip( i18n( "Select" ) ); m_action->setExclusiveGroup( "select" ); //m_ownAction = true; |