From f008adb5a77e094eaf6abf3fc0f36958e66896a5 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 25 Jun 2011 05:28:35 +0000 Subject: 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 --- lib/kformula/kformulaview.cc | 78 ++++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 39 deletions(-) (limited to 'lib/kformula/kformulaview.cc') diff --git a/lib/kformula/kformulaview.cc b/lib/kformula/kformulaview.cc index 543bc727..8099f633 100644 --- a/lib/kformula/kformulaview.cc +++ b/lib/kformula/kformulaview.cc @@ -20,8 +20,8 @@ #include -#include -#include +#include +#include #include #include @@ -41,25 +41,25 @@ struct View::View_Impl { : smallCursor(false), activeCursor(true), cursorHasChanged(true), document(doc) { - connect(document, SIGNAL(elementWillVanish(BasicElement*)), - view, SLOT(slotElementWillVanish(BasicElement*))); - connect(document, SIGNAL(formulaLoaded(FormulaElement*)), - view, SLOT(slotFormulaLoaded(FormulaElement*))); - connect(document, SIGNAL(cursorMoved(FormulaCursor*)), - view, SLOT(slotCursorMoved(FormulaCursor*))); + connect(document, TQT_SIGNAL(elementWillVanish(BasicElement*)), + view, TQT_SLOT(slotElementWillVanish(BasicElement*))); + connect(document, TQT_SIGNAL(formulaLoaded(FormulaElement*)), + view, TQT_SLOT(slotFormulaLoaded(FormulaElement*))); + connect(document, TQT_SIGNAL(cursorMoved(FormulaCursor*)), + view, TQT_SLOT(slotCursorMoved(FormulaCursor*))); cursor = document->createCursor(); - blinkTimer = new QTimer( view ); - connect( blinkTimer, SIGNAL( timeout() ), - view, SLOT( slotBlinkCursor() ) ); - if ( QApplication::cursorFlashTime() > 0 ) - blinkTimer->start( QApplication::cursorFlashTime() / 2 ); + blinkTimer = new TQTimer( view ); + connect( blinkTimer, TQT_SIGNAL( timeout() ), + view, TQT_SLOT( slotBlinkCursor() ) ); + if ( TQApplication::cursorFlashTime() > 0 ) + blinkTimer->start( TQApplication::cursorFlashTime() / 2 ); } void startTimer() { - if ( QApplication::cursorFlashTime() > 0 ) - blinkTimer->start( QApplication::cursorFlashTime() / 2 ); + if ( TQApplication::cursorFlashTime() > 0 ) + blinkTimer->start( TQApplication::cursorFlashTime() / 2 ); } void stopTimer() @@ -95,7 +95,7 @@ struct View::View_Impl { /** * Timer for cursor blinking */ - QTimer *blinkTimer; + TQTimer *blinkTimer; /** * The formula we show. @@ -130,9 +130,9 @@ View::~View() } -QPoint View::getCursorPoint() const +TQPoint View::getCursorPoint() const { - return contextStyle().layoutUnitToPixel( cursor()->getCursorPoint() ); + return contextStyle().tqlayoutUnitToPixel( cursor()->getCursorPoint() ); } void View::setReadOnly(bool ro) @@ -147,7 +147,7 @@ void View::calcCursor() } -void View::draw(QPainter& painter, const QRect& rect, const QColorGroup& cg) +void View::draw(TQPainter& painter, const TQRect& rect, const TQColorGroup& cg) { // kdDebug( DEBUGID ) << "View::draw: " << rect.x() << " " << rect.y() << " " // << rect.width() << " " << rect.height() << endl; @@ -158,7 +158,7 @@ void View::draw(QPainter& painter, const QRect& rect, const QColorGroup& cg) } } -void View::draw(QPainter& painter, const QRect& rect) +void View::draw(TQPainter& painter, const TQRect& rect) { container()->draw( painter, rect, true ); if ( cursorVisible() ) { @@ -167,13 +167,13 @@ void View::draw(QPainter& painter, const QRect& rect) } } -void View::keyPressEvent( QKeyEvent* event ) +void View::keyPressEvent( TQKeyEvent* event ) { container()->input( event ); } -void View::focusInEvent(QFocusEvent*) +void View::focusInEvent(TQFocusEvent*) { //cursor()->calcCursorSize( contextStyle(), smallCursor() ); container()->setActiveCursor(cursor()); @@ -183,7 +183,7 @@ void View::focusInEvent(QFocusEvent*) emitCursorChanged(); } -void View::focusOutEvent(QFocusEvent*) +void View::focusOutEvent(TQFocusEvent*) { //container()->setActiveCursor(0); activeCursor() = false; @@ -192,96 +192,96 @@ void View::focusOutEvent(QFocusEvent*) emitCursorChanged(); } -void View::mousePressEvent( QMouseEvent* event ) +void View::mousePressEvent( TQMouseEvent* event ) { const ContextStyle& context = contextStyle(); mousePressEvent( event, context.pixelToLayoutUnit( event->pos() ) ); } -void View::mouseReleaseEvent( QMouseEvent* event ) +void View::mouseReleaseEvent( TQMouseEvent* event ) { const ContextStyle& context = contextStyle(); mouseReleaseEvent( event, context.pixelToLayoutUnit( event->pos() ) ); } -void View::mouseDoubleClickEvent( QMouseEvent* event ) +void View::mouseDoubleClickEvent( TQMouseEvent* event ) { const ContextStyle& context = contextStyle(); mouseDoubleClickEvent( event, context.pixelToLayoutUnit( event->pos() ) ); } -void View::mouseMoveEvent( QMouseEvent* event ) +void View::mouseMoveEvent( TQMouseEvent* event ) { const ContextStyle& context = contextStyle(); mouseMoveEvent( event, context.pixelToLayoutUnit( event->pos() ) ); } -void View::wheelEvent( QWheelEvent* event ) +void View::wheelEvent( TQWheelEvent* event ) { const ContextStyle& context = contextStyle(); wheelEvent( event, context.pixelToLayoutUnit( event->pos() ) ); } -void View::mousePressEvent( QMouseEvent* event, const PtPoint& pos ) +void View::mousePressEvent( TQMouseEvent* event, const PtPoint& pos ) { const ContextStyle& context = contextStyle(); mousePressEvent( event, context.ptToLayoutUnitPix( pos ) ); } -void View::mouseReleaseEvent( QMouseEvent* event, const PtPoint& pos ) +void View::mouseReleaseEvent( TQMouseEvent* event, const PtPoint& pos ) { const ContextStyle& context = contextStyle(); mouseReleaseEvent( event, context.ptToLayoutUnitPix( pos ) ); } -void View::mouseDoubleClickEvent( QMouseEvent* event, const PtPoint& pos ) +void View::mouseDoubleClickEvent( TQMouseEvent* event, const PtPoint& pos ) { const ContextStyle& context = contextStyle(); mouseDoubleClickEvent( event, context.ptToLayoutUnitPix( pos ) ); } -void View::mouseMoveEvent( QMouseEvent* event, const PtPoint& pos ) +void View::mouseMoveEvent( TQMouseEvent* event, const PtPoint& pos ) { const ContextStyle& context = contextStyle(); mouseMoveEvent( event, context.ptToLayoutUnitPix( pos ) ); } -void View::wheelEvent( QWheelEvent* event, const PtPoint& pos ) +void View::wheelEvent( TQWheelEvent* event, const PtPoint& pos ) { const ContextStyle& context = contextStyle(); wheelEvent( event, context.ptToLayoutUnitPix( pos ) ); } -void View::mousePressEvent( QMouseEvent* event, const LuPixelPoint& pos ) +void View::mousePressEvent( TQMouseEvent* event, const LuPixelPoint& pos ) { int flags = movementFlag( event->state() ); cursor()->mousePress( pos, flags ); emitCursorChanged(); } -void View::mouseReleaseEvent( QMouseEvent* event, const LuPixelPoint& pos ) +void View::mouseReleaseEvent( TQMouseEvent* event, const LuPixelPoint& pos ) { int flags = movementFlag( event->state() ); cursor()->mouseRelease( pos, flags ); emitCursorChanged(); } -void View::mouseDoubleClickEvent( QMouseEvent*, const LuPixelPoint& ) +void View::mouseDoubleClickEvent( TQMouseEvent*, const LuPixelPoint& ) { cursor()->moveRight( WordMovement ); cursor()->moveLeft( SelectMovement | WordMovement ); emitCursorChanged(); } -void View::mouseMoveEvent( QMouseEvent* event, const LuPixelPoint& pos ) +void View::mouseMoveEvent( TQMouseEvent* event, const LuPixelPoint& pos ) { int flags = movementFlag( event->state() ); cursor()->mouseMove( pos, flags ); emitCursorChanged(); } -void View::wheelEvent( QWheelEvent*, const LuPixelPoint& ) +void View::wheelEvent( TQWheelEvent*, const LuPixelPoint& ) { } @@ -378,7 +378,7 @@ void View::eraseSelection( Direction direction ) container()->performRequest( &r ); } -void View::addText( QString str ) +void View::addText( TQString str ) { TextRequest r( str ); container()->performRequest( &r ); -- cgit v1.2.1