diff options
Diffstat (limited to 'lib/kofficeui/KoGuides.cpp')
-rw-r--r-- | lib/kofficeui/KoGuides.cpp | 216 |
1 files changed, 108 insertions, 108 deletions
diff --git a/lib/kofficeui/KoGuides.cpp b/lib/kofficeui/KoGuides.cpp index f6d375f6a..5694889c2 100644 --- a/lib/kofficeui/KoGuides.cpp +++ b/lib/kofficeui/KoGuides.cpp @@ -21,9 +21,9 @@ #include "KoGuides.h" -#include <qcursor.h> -#include <qpainter.h> -#include <qpixmap.h> +#include <tqcursor.h> +#include <tqpainter.h> +#include <tqpixmap.h> #include <klocale.h> #include <kpopupmenu.h> @@ -42,9 +42,9 @@ public: Popup( KoGuides * guides ) { m_title = insertTitle( i18n( "Guide Line" ) ); - m_delete = insertItem( i18n( "&Delete" ), guides, SLOT( slotRemove() ) ); + m_delete = insertItem( i18n( "&Delete" ), guides, TQT_SLOT( slotRemove() ) ); m_seperator = insertSeparator(); - m_pos = insertItem( i18n( "&Set Position..." ), guides, SLOT( slotChangePosition() ) ); + m_pos = insertItem( i18n( "&Set Position..." ), guides, TQT_SLOT( slotChangePosition() ) ); } void update( int count ) @@ -69,10 +69,10 @@ private: int m_pos; }; -const KoGuides::SnapStatus KoGuides::SNAP_NONE = 0; -const KoGuides::SnapStatus KoGuides::SNAP_HORIZ = 1; -const KoGuides::SnapStatus KoGuides::SNAP_VERT = 2; -const KoGuides::SnapStatus KoGuides::SNAP_BOTH = 3; +const KoGuides::SnaptqStatus KoGuides::SNAP_NONE = 0; +const KoGuides::SnaptqStatus KoGuides::SNAP_HORIZ = 1; +const KoGuides::SnaptqStatus KoGuides::SNAP_VERT = 2; +const KoGuides::SnaptqStatus KoGuides::SNAP_BOTH = 3; KoGuides::KoGuides( KoView *view, KoZoomHandler *zoomHandler ) : m_view( view ) @@ -89,26 +89,26 @@ KoGuides::~KoGuides() } -void KoGuides::paintGuides( QPainter &painter ) +void KoGuides::paintGuides( TQPainter &painter ) { //painter.setRasterOp( NotROP ); const KoPageLayout& pl = m_view->koDocument()->pageLayout(); - int width = QMAX( m_view->canvas()->width(), m_zoomHandler->zoomItX( pl.ptWidth ) ); - int height = QMAX( m_view->canvas()->height(), m_zoomHandler->zoomItY( pl.ptHeight ) ); + int width = TQMAX( m_view->canvas()->width(), m_zoomHandler->zoomItX( pl.ptWidth ) ); + int height = TQMAX( m_view->canvas()->height(), m_zoomHandler->zoomItY( pl.ptHeight ) ); for ( int i = 0; i < GL_END; ++i ) { - QValueList<KoGuideLine *>::iterator it = m_guideLines[i].begin(); + TQValueList<KoGuideLine *>::iterator it = m_guideLines[i].begin(); for ( ; it != m_guideLines[i].end(); ++it ) { if ( !( *it )->automatic || ( *it )->snapping ) // dont paint autoStyle guides when they are not snapping { if ( ( *it )->snapping ) - painter.setPen( QPen( green, 0, DotLine ) ); + painter.setPen( TQPen( green, 0, DotLine ) ); else if ( ( *it )->selected ) - painter.setPen( QPen( red, 0, DotLine ) ); + painter.setPen( TQPen( red, 0, DotLine ) ); else - painter.setPen( QPen( blue, 0, DotLine ) ); + painter.setPen( TQPen( blue, 0, DotLine ) ); painter.save(); if ( ( *it )->orientation == Qt::Vertical ) @@ -127,14 +127,14 @@ void KoGuides::paintGuides( QPainter &painter ) } } -bool KoGuides::mousePressEvent( QMouseEvent *e ) +bool KoGuides::mousePressEvent( TQMouseEvent *e ) { bool eventProcessed = true; bool changed = false; m_mouseSelected = false; KoPoint p( mapFromScreen( e->pos() ) ); - KoGuideLine * guideLine = find( p, m_zoomHandler->unzoomItY( 2 ) ); + KoGuideLine * guideLine = tqfind( p, m_zoomHandler->unzoomItY( 2 ) ); if ( guideLine ) { m_lastPoint = e->pos(); @@ -144,7 +144,7 @@ bool KoGuides::mousePressEvent( QMouseEvent *e ) { m_mouseSelected = true; } - if ( e->state() & Qt::ControlButton ) + if ( e->state() & TQt::ControlButton ) { if ( guideLine->selected ) { @@ -167,7 +167,7 @@ bool KoGuides::mousePressEvent( QMouseEvent *e ) } else { - if ( !( e->state() & Qt::ControlButton ) ) + if ( !( e->state() & TQt::ControlButton ) ) { changed = unselectAll(); } @@ -192,7 +192,7 @@ bool KoGuides::mousePressEvent( QMouseEvent *e ) if ( e->button() == Qt::RightButton && hasSelected() ) { m_popup->update( m_guideLines[GL_SELECTED].count() ); - m_popup->exec( QCursor::pos() ); + m_popup->exec( TQCursor::pos() ); emit moveGuides( false ); } @@ -200,12 +200,12 @@ bool KoGuides::mousePressEvent( QMouseEvent *e ) } -bool KoGuides::mouseMoveEvent( QMouseEvent *e ) +bool KoGuides::mouseMoveEvent( TQMouseEvent *e ) { bool eventProcessed = false; if ( m_mouseSelected ) { - QPoint p( e->pos() ); + TQPoint p( e->pos() ); p -= m_lastPoint; m_lastPoint = e->pos(); moveSelectedBy( p ); @@ -216,10 +216,10 @@ bool KoGuides::mouseMoveEvent( QMouseEvent *e ) else if ( e->state() == Qt::NoButton ) { KoPoint p( mapFromScreen( e->pos() ) ); - KoGuideLine * guideLine = find( p, m_zoomHandler->unzoomItY( 2 ) ); + KoGuideLine * guideLine = tqfind( p, m_zoomHandler->unzoomItY( 2 ) ); if ( guideLine ) { - m_view->canvas()->setCursor( guideLine->orientation == Qt::Vertical ? Qt::sizeHorCursor : Qt::sizeVerCursor ); + m_view->canvas()->setCursor( guideLine->orientation == Qt::Vertical ? TQt::sizeHorCursor : TQt::sizeVerCursor ); eventProcessed = true; } } @@ -227,7 +227,7 @@ bool KoGuides::mouseMoveEvent( QMouseEvent *e ) } -bool KoGuides::mouseReleaseEvent( QMouseEvent *e ) +bool KoGuides::mouseReleaseEvent( TQMouseEvent *e ) { bool eventProcessed = false; if ( m_mouseSelected ) @@ -236,8 +236,8 @@ bool KoGuides::mouseReleaseEvent( QMouseEvent *e ) if ( m_guideLines[GL_SELECTED].count() == 1 ) { int x1, y1, x2, y2; - m_view->canvas()->rect().coords( &x1, &y1, &x2, &y2 ); - QPoint gp( m_view->canvas()->mapFromGlobal( e->globalPos() ) ); + TQT_TQRECT_OBJECT(m_view->canvas()->rect()).coords( &x1, &y1, &x2, &y2 ); + TQPoint gp( m_view->canvas()->mapFromGlobal( e->globalPos() ) ); if ( m_guideLines[GL_SELECTED].first()->orientation == Qt::Vertical ) { if ( gp.x() < x1 || gp.x() > x2 ) @@ -249,10 +249,10 @@ bool KoGuides::mouseReleaseEvent( QMouseEvent *e ) removeSelected(); } } - KoGuideLine * guideLine = find( p, m_zoomHandler->unzoomItY( 2 ) ); + KoGuideLine * guideLine = tqfind( p, m_zoomHandler->unzoomItY( 2 ) ); if ( guideLine ) { - m_view->canvas()->setCursor( guideLine->orientation == Qt::Vertical ? Qt::sizeHorCursor : Qt::sizeVerCursor ); + m_view->canvas()->setCursor( guideLine->orientation == Qt::Vertical ? TQt::sizeHorCursor : TQt::sizeVerCursor ); } m_mouseSelected = false; eventProcessed = true; @@ -263,12 +263,12 @@ bool KoGuides::mouseReleaseEvent( QMouseEvent *e ) } -bool KoGuides::keyPressEvent( QKeyEvent *e ) +bool KoGuides::keyPressEvent( TQKeyEvent *e ) { bool eventProcessed = false; switch( e->key() ) { - case Qt::Key_Delete: + case TQt::Key_Delete: if ( hasSelected() ) { removeSelected(); @@ -283,18 +283,18 @@ bool KoGuides::keyPressEvent( QKeyEvent *e ) return eventProcessed; } -void KoGuides::setGuideLines( const QValueList<double> &horizontalPos, const QValueList<double> &verticalPos ) +void KoGuides::setGuideLines( const TQValueList<double> &horizontalPos, const TQValueList<double> &verticalPos ) { removeSelected(); - QValueList<KoGuideLine *>::iterator it = m_guideLines[GL].begin(); + TQValueList<KoGuideLine *>::iterator it = m_guideLines[GL].begin(); for ( ; it != m_guideLines[GL].end(); ++it ) { delete ( *it ); } m_guideLines[GL].clear(); - QValueList<double>::ConstIterator posIt = horizontalPos.begin(); + TQValueList<double>::ConstIterator posIt = horizontalPos.begin(); for ( ; posIt != horizontalPos.end(); ++posIt ) { KoGuideLine *guideLine = new KoGuideLine( Qt::Horizontal, *posIt, false ); @@ -309,16 +309,16 @@ void KoGuides::setGuideLines( const QValueList<double> &horizontalPos, const QVa paint(); } -void KoGuides::setAutoGuideLines( const QValueList<double> &horizontalPos, const QValueList<double> &verticalPos ) +void KoGuides::setAutoGuideLines( const TQValueList<double> &horizontalPos, const TQValueList<double> &verticalPos ) { - QValueList<KoGuideLine *>::iterator it = m_guideLines[GL_AUTOMATIC].begin(); + TQValueList<KoGuideLine *>::iterator it = m_guideLines[GL_AUTOMATIC].begin(); for ( ; it != m_guideLines[GL_AUTOMATIC].end(); ++it ) { delete ( *it ); } m_guideLines[GL_AUTOMATIC].clear(); - QValueList<double>::ConstIterator posIt = horizontalPos.begin(); + TQValueList<double>::ConstIterator posIt = horizontalPos.begin(); for ( ; posIt != horizontalPos.end(); ++posIt ) { KoGuideLine *guideLine = new KoGuideLine( Qt::Horizontal, *posIt, true ); @@ -333,12 +333,12 @@ void KoGuides::setAutoGuideLines( const QValueList<double> &horizontalPos, const } -void KoGuides::getGuideLines( QValueList<double> &horizontalPos, QValueList<double> &verticalPos ) const +void KoGuides::getGuideLines( TQValueList<double> &horizontalPos, TQValueList<double> &verticalPos ) const { horizontalPos.clear(); verticalPos.clear(); - QValueList<KoGuideLine *>::const_iterator it = m_guideLines[GL].begin(); + TQValueList<KoGuideLine *>::const_iterator it = m_guideLines[GL].begin(); for ( ; it != m_guideLines[GL].end(); ++it ) { if ( ( *it )->orientation == Qt::Horizontal ) @@ -365,123 +365,123 @@ void KoGuides::getGuideLines( QValueList<double> &horizontalPos, QValueList<doub } -void KoGuides::snapToGuideLines( KoRect &rect, int snap, SnapStatus &snapStatus, KoPoint &diff ) +void KoGuides::snapToGuideLines( KoRect &rect, int snap, SnaptqStatus &snaptqStatus, KoPoint &diff ) { - if( !(snapStatus & SNAP_VERT)) + if( !(snaptqStatus & SNAP_VERT)) diff.setX(10000); - if( !(snapStatus & SNAP_HORIZ)) + if( !(snaptqStatus & SNAP_HORIZ)) diff.setY(10000); for ( int i = 0; i < GL_END; ++i ) { - QValueList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin(); + TQValueList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin(); for ( ; it != m_guideLines[i].end(); ++it ) { if ( ( *it )->orientation == Qt::Horizontal ) { double tmp = (*it)->position - rect.top(); - if ( snapStatus & SNAP_HORIZ || QABS( tmp ) < m_zoomHandler->unzoomItY( snap ) ) + if ( snaptqStatus & SNAP_HORIZ || TQABS( tmp ) < m_zoomHandler->unzoomItY( snap ) ) { - if(QABS( tmp ) < QABS(diff.y())) + if(TQABS( tmp ) < TQABS(diff.y())) { diff.setY( tmp ); - snapStatus |= SNAP_HORIZ; + snaptqStatus |= SNAP_HORIZ; } } tmp = (*it)->position - rect.bottom(); - if ( snapStatus & SNAP_HORIZ || QABS( tmp ) < m_zoomHandler->unzoomItY( snap ) ) + if ( snaptqStatus & SNAP_HORIZ || TQABS( tmp ) < m_zoomHandler->unzoomItY( snap ) ) { - if(QABS( tmp ) < QABS(diff.y())) + if(TQABS( tmp ) < TQABS(diff.y())) { diff.setY( tmp ); - snapStatus |= SNAP_HORIZ; + snaptqStatus |= SNAP_HORIZ; } } } else { double tmp = (*it)->position - rect.left(); - if ( snapStatus & SNAP_VERT || QABS( tmp ) < m_zoomHandler->unzoomItX( snap ) ) + if ( snaptqStatus & SNAP_VERT || TQABS( tmp ) < m_zoomHandler->unzoomItX( snap ) ) { - if(QABS( tmp ) < QABS(diff.x())) + if(TQABS( tmp ) < TQABS(diff.x())) { diff.setX( tmp ); - snapStatus |= SNAP_VERT; + snaptqStatus |= SNAP_VERT; } } tmp = (*it)->position - rect.right(); - if ( snapStatus & SNAP_VERT || QABS( tmp ) < m_zoomHandler->unzoomItX( snap ) ) + if ( snaptqStatus & SNAP_VERT || TQABS( tmp ) < m_zoomHandler->unzoomItX( snap ) ) { - if(QABS( tmp ) < QABS(diff.x())) + if(TQABS( tmp ) < TQABS(diff.x())) { diff.setX( tmp ); - snapStatus |= SNAP_VERT; + snaptqStatus |= SNAP_VERT; } } } } } - if(!(snapStatus & SNAP_VERT)) + if(!(snaptqStatus & SNAP_VERT)) diff.setX( 0 ); - if(!(snapStatus & SNAP_HORIZ)) + if(!(snaptqStatus & SNAP_HORIZ)) diff.setY( 0 ); } -void KoGuides::snapToGuideLines( KoPoint &pos, int snap, SnapStatus &snapStatus, KoPoint &diff ) +void KoGuides::snapToGuideLines( KoPoint &pos, int snap, SnaptqStatus &snaptqStatus, KoPoint &diff ) { - if( !(snapStatus & SNAP_VERT)) + if( !(snaptqStatus & SNAP_VERT)) diff.setX(10000); - if( !(snapStatus & SNAP_HORIZ)) + if( !(snaptqStatus & SNAP_HORIZ)) diff.setY(10000); for ( int i = 0; i < GL_END; ++i ) { - QValueList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin(); + TQValueList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin(); for ( ; it != m_guideLines[i].end(); ++it ) { if ( ( *it )->orientation == Qt::Horizontal ) { double tmp = (*it)->position - pos.y(); - if ( snapStatus & SNAP_HORIZ || QABS( tmp ) < m_zoomHandler->unzoomItY( snap ) ) + if ( snaptqStatus & SNAP_HORIZ || TQABS( tmp ) < m_zoomHandler->unzoomItY( snap ) ) { - if(QABS( tmp ) < QABS(diff.y())) + if(TQABS( tmp ) < TQABS(diff.y())) { diff.setY( tmp ); - snapStatus |= SNAP_HORIZ; + snaptqStatus |= SNAP_HORIZ; } } } else { double tmp = (*it)->position - pos.x(); - if ( snapStatus & SNAP_VERT || QABS( tmp ) < m_zoomHandler->unzoomItX( snap ) ) + if ( snaptqStatus & SNAP_VERT || TQABS( tmp ) < m_zoomHandler->unzoomItX( snap ) ) { - if(QABS( tmp ) < QABS(diff.x())) + if(TQABS( tmp ) < TQABS(diff.x())) { diff.setX( tmp ); - snapStatus |= SNAP_VERT; + snaptqStatus |= SNAP_VERT; } } } } } - if(!(snapStatus & SNAP_VERT)) + if(!(snaptqStatus & SNAP_VERT)) diff.setX( 0 ); - if(!(snapStatus & SNAP_HORIZ)) + if(!(snaptqStatus & SNAP_HORIZ)) diff.setY( 0 ); } -void KoGuides::repaintSnapping( const KoRect &snappedRect ) +void KoGuides::tqrepaintSnapping( const KoRect &snappedRect ) { bool needRepaint = false; for ( int i = 0; i < GL_END; ++i ) { - QValueList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin(); + TQValueList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin(); for ( ; it != m_guideLines[i].end(); ++it ) { if ( ( *it )->orientation == Qt::Horizontal ) @@ -530,15 +530,15 @@ void KoGuides::repaintSnapping( const KoRect &snappedRect ) } -void KoGuides::repaintSnapping( const KoPoint &snappedPoint, SnapStatus snapStatus ) +void KoGuides::tqrepaintSnapping( const KoPoint &snappedPoint, SnaptqStatus snaptqStatus ) { bool needRepaint = false; for ( int i = 0; i < GL_END; ++i ) { - QValueList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin(); + TQValueList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin(); for ( ; it != m_guideLines[i].end(); ++it ) { - if ( ( *it )->orientation == Qt::Horizontal && ( snapStatus & SNAP_HORIZ ) ) + if ( ( *it )->orientation == Qt::Horizontal && ( snaptqStatus & SNAP_HORIZ ) ) { if( virtuallyEqual( snappedPoint.y(), (*it)->position ) ) { @@ -556,7 +556,7 @@ void KoGuides::repaintSnapping( const KoPoint &snappedPoint, SnapStatus snapStat } else { - if ( snapStatus & SNAP_VERT ) + if ( snaptqStatus & SNAP_VERT ) { if( virtuallyEqual( snappedPoint.x(), (*it)->position ) ) { @@ -585,13 +585,13 @@ void KoGuides::repaintSnapping( const KoPoint &snappedPoint, SnapStatus snapStat } -void KoGuides::repaintAfterSnapping() +void KoGuides::tqrepaintAfterSnapping() { bool needRepaint = false; for ( int i = 0; i < GL_END; ++i ) { - QValueList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin(); + TQValueList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin(); for ( ; it != m_guideLines[i].end(); ++it ) { if ( ( *it )->snapping ) @@ -615,7 +615,7 @@ void KoGuides::diffNextGuide( KoRect &rect, KoPoint &diff ) { for ( int i = 0; i < GL_END; ++i ) { - QValueList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin(); + TQValueList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin(); for ( ; it != m_guideLines[i].end(); ++it ) { if ( ( *it )->orientation == Qt::Horizontal ) @@ -677,11 +677,11 @@ void KoGuides::diffNextGuide( KoRect &rect, KoPoint &diff ) } -void KoGuides::moveGuide( const QPoint &pos, bool horizontal, int rulerWidth ) +void KoGuides::moveGuide( const TQPoint &pos, bool horizontal, int rulerWidth ) { int x = pos.x() - rulerWidth; int y = pos.y() - rulerWidth; - QPoint p( x, y ); + TQPoint p( x, y ); if ( !m_insertGuide ) { if ( ! horizontal && x > 0 ) @@ -696,25 +696,25 @@ void KoGuides::moveGuide( const QPoint &pos, bool horizontal, int rulerWidth ) } if ( m_insertGuide ) { - QMouseEvent e( QEvent::MouseButtonPress, p, Qt::LeftButton, Qt::LeftButton ); + TQMouseEvent e( TQEvent::MouseButtonPress, p, Qt::LeftButton, Qt::LeftButton ); mousePressEvent( &e ); } } else { - QMouseEvent e( QEvent::MouseMove, p, Qt::NoButton, Qt::LeftButton ); + TQMouseEvent e( TQEvent::MouseMove, p, Qt::NoButton, Qt::LeftButton ); mouseMoveEvent( &e ); } } -void KoGuides::addGuide( const QPoint &pos, bool /* horizontal */, int rulerWidth ) +void KoGuides::addGuide( const TQPoint &pos, bool /* horizontal */, int rulerWidth ) { int x = pos.x() - rulerWidth; int y = pos.y() - rulerWidth; - QPoint p( x, y ); + TQPoint p( x, y ); m_insertGuide = false; - QMouseEvent e( QEvent::MouseButtonRelease, p, Qt::LeftButton, Qt::LeftButton ); + TQMouseEvent e( TQEvent::MouseButtonRelease, p, Qt::LeftButton, Qt::LeftButton ); mouseReleaseEvent( &e ); } @@ -722,21 +722,21 @@ void KoGuides::addGuide( const QPoint &pos, bool /* horizontal */, int rulerWidt void KoGuides::slotChangePosition() { KoPoint p( mapFromScreen( m_lastPoint ) ); - KoGuideLine * guideLine = find( p, m_zoomHandler->unzoomItY( 2 ) ); + KoGuideLine * guideLine = tqfind( p, m_zoomHandler->unzoomItY( 2 ) ); const KoPageLayout& pl = m_view->koDocument()->pageLayout(); double max = 0.0; if ( guideLine->orientation == Qt::Vertical ) { - max = QMAX( pl.ptWidth, m_zoomHandler->unzoomItX( m_view->canvas()->size().width() + m_view->canvasXOffset() - 1 ) ); + max = TQMAX( pl.ptWidth, m_zoomHandler->unzoomItX( m_view->canvas()->size().width() + m_view->canvasXOffset() - 1 ) ); } else { - max = QMAX( pl.ptHeight, m_zoomHandler->unzoomItY( m_view->canvas()->size().height() + m_view->canvasYOffset() - 1 ) ); + max = TQMAX( pl.ptHeight, m_zoomHandler->unzoomItY( m_view->canvas()->size().height() + m_view->canvasYOffset() - 1 ) ); } KoGuideLineDia dia( 0, guideLine->position, 0.0, max, m_view->koDocument()->unit() ); - if ( dia.exec() == QDialog::Accepted ) + if ( dia.exec() == TQDialog::Accepted ) { guideLine->position = dia.pos(); paint(); @@ -754,11 +754,11 @@ void KoGuides::slotRemove() void KoGuides::paint() { - m_view->canvas()->repaint( false ); + m_view->canvas()->tqrepaint( false ); } -void KoGuides::add( Qt::Orientation o, QPoint &pos ) +void KoGuides::add( Qt::Orientation o, TQPoint &pos ) { KoPoint p( mapFromScreen( pos ) ); KoGuideLine *guideLine = new KoGuideLine( o, o == Qt::Vertical ? p.x(): p.y() ); @@ -790,7 +790,7 @@ bool KoGuides::unselectAll() { bool selected = m_guideLines[GL_SELECTED].empty() == false; - QValueList<KoGuideLine *>::iterator it = m_guideLines[GL_SELECTED].begin(); + TQValueList<KoGuideLine *>::iterator it = m_guideLines[GL_SELECTED].begin(); for ( ; it != m_guideLines[GL_SELECTED].end(); ++it ) { ( *it )->selected = false; @@ -804,7 +804,7 @@ bool KoGuides::unselectAll() void KoGuides::removeSelected() { - QValueList<KoGuideLine *>::iterator it = m_guideLines[GL_SELECTED].begin(); + TQValueList<KoGuideLine *>::iterator it = m_guideLines[GL_SELECTED].begin(); for ( ; it != m_guideLines[GL_SELECTED].end(); ++it ) { delete ( *it ); @@ -819,16 +819,16 @@ bool KoGuides::hasSelected() } -KoGuides::KoGuideLine * KoGuides::find( KoPoint &p, double diff ) +KoGuides::KoGuideLine * KoGuides::tqfind( KoPoint &p, double diff ) { - QValueList<KoGuideLine *>::iterator it = m_guideLines[GL_SELECTED].begin(); + TQValueList<KoGuideLine *>::iterator it = m_guideLines[GL_SELECTED].begin(); for ( ; it != m_guideLines[GL_SELECTED].end(); ++it ) { - if ( ( *it )->orientation == Qt::Vertical && QABS( ( *it )->position - p.x() ) < diff ) + if ( ( *it )->orientation == Qt::Vertical && TQABS( ( *it )->position - p.x() ) < diff ) { return *it; } - if ( ( *it )->orientation == Qt::Horizontal && QABS( ( *it )->position - p.y() ) < diff ) + if ( ( *it )->orientation == Qt::Horizontal && TQABS( ( *it )->position - p.y() ) < diff ) { return *it; } @@ -837,11 +837,11 @@ KoGuides::KoGuideLine * KoGuides::find( KoPoint &p, double diff ) it = m_guideLines[GL].begin(); for ( ; it != m_guideLines[GL].end(); ++it ) { - if ( ( *it )->orientation == Qt::Vertical && QABS( ( *it )->position - p.x() ) < diff ) + if ( ( *it )->orientation == Qt::Vertical && TQABS( ( *it )->position - p.x() ) < diff ) { return *it; } - if ( ( *it )->orientation == Qt::Horizontal && QABS( ( *it )->position - p.y() ) < diff ) + if ( ( *it )->orientation == Qt::Horizontal && TQABS( ( *it )->position - p.y() ) < diff ) { return *it; } @@ -850,16 +850,16 @@ KoGuides::KoGuideLine * KoGuides::find( KoPoint &p, double diff ) } -void KoGuides::moveSelectedBy( QPoint &p ) +void KoGuides::moveSelectedBy( TQPoint &p ) { KoPoint point( m_zoomHandler->unzoomPoint( p ) ); if ( m_guideLines[GL_SELECTED].count() > 1 ) { const KoPageLayout& pl = m_view->koDocument()->pageLayout(); - double right = QMAX( pl.ptWidth, m_zoomHandler->unzoomItX( m_view->canvas()->width() + m_view->canvasXOffset() - 1 ) ); - double bottom = QMAX( pl.ptHeight, m_zoomHandler->unzoomItY( m_view->canvas()->height() + m_view->canvasYOffset() - 1 ) ); + double right = TQMAX( pl.ptWidth, m_zoomHandler->unzoomItX( m_view->canvas()->width() + m_view->canvasXOffset() - 1 ) ); + double bottom = TQMAX( pl.ptHeight, m_zoomHandler->unzoomItY( m_view->canvas()->height() + m_view->canvasYOffset() - 1 ) ); - QValueList<KoGuideLine *>::iterator it = m_guideLines[GL_SELECTED].begin(); + TQValueList<KoGuideLine *>::iterator it = m_guideLines[GL_SELECTED].begin(); for ( ; it != m_guideLines[GL_SELECTED].end(); ++it ) { if ( ( *it )->orientation == Qt::Vertical ) @@ -888,7 +888,7 @@ void KoGuides::moveSelectedBy( QPoint &p ) } } } - QValueList<KoGuideLine *>::iterator it = m_guideLines[GL_SELECTED].begin(); + TQValueList<KoGuideLine *>::iterator it = m_guideLines[GL_SELECTED].begin(); for ( ; it != m_guideLines[GL_SELECTED].end(); ++it ) { ( *it )->snapping = false; @@ -905,7 +905,7 @@ void KoGuides::moveSelectedBy( QPoint &p ) } -KoPoint KoGuides::mapFromScreen( const QPoint & pos ) +KoPoint KoGuides::mapFromScreen( const TQPoint & pos ) { int x = pos.x() + m_view->canvasXOffset(); int y = pos.y() + m_view->canvasYOffset(); @@ -915,11 +915,11 @@ KoPoint KoGuides::mapFromScreen( const QPoint & pos ) } -QPoint KoGuides::mapToScreen( const KoPoint & pos ) +TQPoint KoGuides::mapToScreen( const KoPoint & pos ) { int x = m_zoomHandler->zoomItX( pos.x() ) - m_view->canvasXOffset(); int y = m_zoomHandler->zoomItY( pos.y() ) - m_view->canvasYOffset(); - return QPoint( x, y ); + return TQPoint( x, y ); } |