summaryrefslogtreecommitdiffstats
path: root/lib/kofficeui/KoGuides.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kofficeui/KoGuides.cpp')
-rw-r--r--lib/kofficeui/KoGuides.cpp68
1 files changed, 34 insertions, 34 deletions
diff --git a/lib/kofficeui/KoGuides.cpp b/lib/kofficeui/KoGuides.cpp
index 95fcddbf..cb25ace9 100644
--- a/lib/kofficeui/KoGuides.cpp
+++ b/lib/kofficeui/KoGuides.cpp
@@ -110,7 +110,7 @@ void KoGuides::paintGuides( TQPainter &painter )
painter.setPen( TQPen( blue, 0, DotLine ) );
painter.save();
- if ( ( *it )->orientation == Qt::Vertical )
+ if ( ( *it )->orientation == TQt::Vertical )
{
painter.translate( m_zoomHandler->zoomItX( ( *it )->position ), 0 );
painter.drawLine( 0, 0, 0, height );
@@ -137,9 +137,9 @@ bool KoGuides::mousePressEvent( TQMouseEvent *e )
if ( guideLine )
{
m_lastPoint = e->pos();
- if ( e->button() == Qt::LeftButton || e->button() == Qt::RightButton )
+ if ( e->button() == TQt::LeftButton || e->button() == TQt::RightButton )
{
- if ( e->button() == Qt::LeftButton )
+ if ( e->button() == TQt::LeftButton )
{
m_mouseSelected = true;
}
@@ -188,7 +188,7 @@ bool KoGuides::mousePressEvent( TQMouseEvent *e )
emit moveGuides( false );
}
- if ( e->button() == Qt::RightButton && hasSelected() )
+ if ( e->button() == TQt::RightButton && hasSelected() )
{
m_popup->update( m_guideLines[GL_SELECTED].count() );
m_popup->exec( TQCursor::pos() );
@@ -212,13 +212,13 @@ bool KoGuides::mouseMoveEvent( TQMouseEvent *e )
emit guideLinesChanged( m_view );
eventProcessed = true;
}
- else if ( e->state() == Qt::NoButton )
+ else if ( e->state() == TQt::NoButton )
{
KoPoint p( mapFromScreen( e->pos() ) );
KoGuideLine * guideLine = find( p, m_zoomHandler->unzoomItY( 2 ) );
if ( guideLine )
{
- m_view->canvas()->setCursor( guideLine->orientation == Qt::Vertical ? TQt::sizeHorCursor : TQt::sizeVerCursor );
+ m_view->canvas()->setCursor( guideLine->orientation == TQt::Vertical ? TQt::sizeHorCursor : TQt::sizeVerCursor );
eventProcessed = true;
}
}
@@ -237,7 +237,7 @@ bool KoGuides::mouseReleaseEvent( TQMouseEvent *e )
int x1, y1, x2, y2;
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 ( m_guideLines[GL_SELECTED].first()->orientation == TQt::Vertical )
{
if ( gp.x() < x1 || gp.x() > x2 )
removeSelected();
@@ -251,7 +251,7 @@ bool KoGuides::mouseReleaseEvent( TQMouseEvent *e )
KoGuideLine * guideLine = find( p, m_zoomHandler->unzoomItY( 2 ) );
if ( guideLine )
{
- m_view->canvas()->setCursor( guideLine->orientation == Qt::Vertical ? TQt::sizeHorCursor : TQt::sizeVerCursor );
+ m_view->canvas()->setCursor( guideLine->orientation == TQt::Vertical ? TQt::sizeHorCursor : TQt::sizeVerCursor );
}
m_mouseSelected = false;
eventProcessed = true;
@@ -296,13 +296,13 @@ void KoGuides::setGuideLines( const TQValueList<double> &horizontalPos, const TQ
TQValueList<double>::ConstIterator posIt = horizontalPos.begin();
for ( ; posIt != horizontalPos.end(); ++posIt )
{
- KoGuideLine *guideLine = new KoGuideLine( Qt::Horizontal, *posIt, false );
+ KoGuideLine *guideLine = new KoGuideLine( TQt::Horizontal, *posIt, false );
m_guideLines[GL].append( guideLine );
}
posIt = verticalPos.begin();
for ( ; posIt != verticalPos.end(); ++posIt )
{
- KoGuideLine *guideLine = new KoGuideLine( Qt::Vertical, *posIt, false );
+ KoGuideLine *guideLine = new KoGuideLine( TQt::Vertical, *posIt, false );
m_guideLines[GL].append( guideLine );
}
paint();
@@ -320,13 +320,13 @@ void KoGuides::setAutoGuideLines( const TQValueList<double> &horizontalPos, cons
TQValueList<double>::ConstIterator posIt = horizontalPos.begin();
for ( ; posIt != horizontalPos.end(); ++posIt )
{
- KoGuideLine *guideLine = new KoGuideLine( Qt::Horizontal, *posIt, true );
+ KoGuideLine *guideLine = new KoGuideLine( TQt::Horizontal, *posIt, true );
m_guideLines[GL_AUTOMATIC].append( guideLine );
}
posIt = verticalPos.begin();
for ( ; posIt != verticalPos.end(); ++posIt )
{
- KoGuideLine *guideLine = new KoGuideLine( Qt::Vertical, *posIt, true );
+ KoGuideLine *guideLine = new KoGuideLine( TQt::Vertical, *posIt, true );
m_guideLines[GL_AUTOMATIC].append( guideLine );
}
}
@@ -340,7 +340,7 @@ void KoGuides::getGuideLines( TQValueList<double> &horizontalPos, TQValueList<do
TQValueList<KoGuideLine *>::const_iterator it = m_guideLines[GL].begin();
for ( ; it != m_guideLines[GL].end(); ++it )
{
- if ( ( *it )->orientation == Qt::Horizontal )
+ if ( ( *it )->orientation == TQt::Horizontal )
{
horizontalPos.append( ( *it )->position );
}
@@ -352,7 +352,7 @@ void KoGuides::getGuideLines( TQValueList<double> &horizontalPos, TQValueList<do
it = m_guideLines[GL_SELECTED].begin();
for ( ; it != m_guideLines[GL_SELECTED].end(); ++it )
{
- if ( ( *it )->orientation == Qt::Horizontal )
+ if ( ( *it )->orientation == TQt::Horizontal )
{
horizontalPos.append( ( *it )->position );
}
@@ -376,7 +376,7 @@ void KoGuides::snapToGuideLines( KoRect &rect, int snap, SnapStatus &snapStatus,
TQValueList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin();
for ( ; it != m_guideLines[i].end(); ++it )
{
- if ( ( *it )->orientation == Qt::Horizontal )
+ if ( ( *it )->orientation == TQt::Horizontal )
{
double tmp = (*it)->position - rect.top();
if ( snapStatus & SNAP_HORIZ || TQABS( tmp ) < m_zoomHandler->unzoomItY( snap ) )
@@ -440,7 +440,7 @@ void KoGuides::snapToGuideLines( KoPoint &pos, int snap, SnapStatus &snapStatus,
TQValueList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin();
for ( ; it != m_guideLines[i].end(); ++it )
{
- if ( ( *it )->orientation == Qt::Horizontal )
+ if ( ( *it )->orientation == TQt::Horizontal )
{
double tmp = (*it)->position - pos.y();
if ( snapStatus & SNAP_HORIZ || TQABS( tmp ) < m_zoomHandler->unzoomItY( snap ) )
@@ -483,7 +483,7 @@ void KoGuides::repaintSnapping( const KoRect &snappedRect )
TQValueList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin();
for ( ; it != m_guideLines[i].end(); ++it )
{
- if ( ( *it )->orientation == Qt::Horizontal )
+ if ( ( *it )->orientation == TQt::Horizontal )
{
if ( virtuallyEqual( snappedRect.top(), (*it)->position )
|| virtuallyEqual( snappedRect.bottom(), ( *it )->position ) )
@@ -537,7 +537,7 @@ void KoGuides::repaintSnapping( const KoPoint &snappedPoint, SnapStatus snapStat
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 == TQt::Horizontal && ( snapStatus & SNAP_HORIZ ) )
{
if( virtuallyEqual( snappedPoint.y(), (*it)->position ) )
{
@@ -617,7 +617,7 @@ void KoGuides::diffNextGuide( KoRect &rect, KoPoint &diff )
TQValueList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin();
for ( ; it != m_guideLines[i].end(); ++it )
{
- if ( ( *it )->orientation == Qt::Horizontal )
+ if ( ( *it )->orientation == TQt::Horizontal )
{
double moveyl = ( *it )->position - rect.top();
double moveyr = ( *it )->position - rect.bottom();
@@ -686,22 +686,22 @@ void KoGuides::moveGuide( const TQPoint &pos, bool horizontal, int rulerWidth )
if ( ! horizontal && x > 0 )
{
m_insertGuide = true;
- add( Qt::Vertical, p );
+ add( TQt::Vertical, p );
}
else if ( horizontal && y > 0 )
{
m_insertGuide = true;
- add( Qt::Horizontal, p );
+ add( TQt::Horizontal, p );
}
if ( m_insertGuide )
{
- TQMouseEvent e( TQEvent::MouseButtonPress, p, Qt::LeftButton, Qt::LeftButton );
+ TQMouseEvent e( TQEvent::MouseButtonPress, p, TQt::LeftButton, TQt::LeftButton );
mousePressEvent( &e );
}
}
else
{
- TQMouseEvent e( TQEvent::MouseMove, p, Qt::NoButton, Qt::LeftButton );
+ TQMouseEvent e( TQEvent::MouseMove, p, TQt::NoButton, TQt::LeftButton );
mouseMoveEvent( &e );
}
}
@@ -713,7 +713,7 @@ void KoGuides::addGuide( const TQPoint &pos, bool /* horizontal */, int rulerWid
int y = pos.y() - rulerWidth;
TQPoint p( x, y );
m_insertGuide = false;
- TQMouseEvent e( TQEvent::MouseButtonRelease, p, Qt::LeftButton, Qt::LeftButton );
+ TQMouseEvent e( TQEvent::MouseButtonRelease, p, TQt::LeftButton, TQt::LeftButton );
mouseReleaseEvent( &e );
}
@@ -725,7 +725,7 @@ void KoGuides::slotChangePosition()
const KoPageLayout& pl = m_view->koDocument()->pageLayout();
double max = 0.0;
- if ( guideLine->orientation == Qt::Vertical )
+ if ( guideLine->orientation == TQt::Vertical )
{
max = TQMAX( pl.ptWidth, m_zoomHandler->unzoomItX( m_view->canvas()->size().width() + m_view->canvasXOffset() - 1 ) );
}
@@ -757,10 +757,10 @@ void KoGuides::paint()
}
-void KoGuides::add( Qt::Orientation o, TQPoint &pos )
+void KoGuides::add( TQt::Orientation o, TQPoint &pos )
{
KoPoint p( mapFromScreen( pos ) );
- KoGuideLine *guideLine = new KoGuideLine( o, o == Qt::Vertical ? p.x(): p.y() );
+ KoGuideLine *guideLine = new KoGuideLine( o, o == TQt::Vertical ? p.x(): p.y() );
m_guideLines[GL].append( guideLine );
}
@@ -823,11 +823,11 @@ KoGuides::KoGuideLine * KoGuides::find( KoPoint &p, double diff )
TQValueList<KoGuideLine *>::iterator it = m_guideLines[GL_SELECTED].begin();
for ( ; it != m_guideLines[GL_SELECTED].end(); ++it )
{
- if ( ( *it )->orientation == Qt::Vertical && TQABS( ( *it )->position - p.x() ) < diff )
+ if ( ( *it )->orientation == TQt::Vertical && TQABS( ( *it )->position - p.x() ) < diff )
{
return *it;
}
- if ( ( *it )->orientation == Qt::Horizontal && TQABS( ( *it )->position - p.y() ) < diff )
+ if ( ( *it )->orientation == TQt::Horizontal && TQABS( ( *it )->position - p.y() ) < diff )
{
return *it;
}
@@ -836,11 +836,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 && TQABS( ( *it )->position - p.x() ) < diff )
+ if ( ( *it )->orientation == TQt::Vertical && TQABS( ( *it )->position - p.x() ) < diff )
{
return *it;
}
- if ( ( *it )->orientation == Qt::Horizontal && TQABS( ( *it )->position - p.y() ) < diff )
+ if ( ( *it )->orientation == TQt::Horizontal && TQABS( ( *it )->position - p.y() ) < diff )
{
return *it;
}
@@ -861,7 +861,7 @@ void KoGuides::moveSelectedBy( TQPoint &p )
TQValueList<KoGuideLine *>::iterator it = m_guideLines[GL_SELECTED].begin();
for ( ; it != m_guideLines[GL_SELECTED].end(); ++it )
{
- if ( ( *it )->orientation == Qt::Vertical )
+ if ( ( *it )->orientation == TQt::Vertical )
{
double tmp = ( *it )->position + point.x();
if ( tmp < 0 )
@@ -892,11 +892,11 @@ void KoGuides::moveSelectedBy( TQPoint &p )
{
( *it )->snapping = false;
- if ( ( *it )->orientation == Qt::Vertical && p.x() != 0 )
+ if ( ( *it )->orientation == TQt::Vertical && p.x() != 0 )
{
( *it )->position = ( *it )->position + point.x();
}
- else if ( ( *it )->orientation == Qt::Horizontal && p.y() != 0 )
+ else if ( ( *it )->orientation == TQt::Horizontal && p.y() != 0 )
{
( *it )->position = ( *it )->position + point.y();
}