From a374efce3a207b39514be3c52264091400ce297e Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 11 Jun 2011 04:44:41 +0000 Subject: TQt4 port kdeedu This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1236073 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kig/modes/moving.cc | 54 ++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'kig/modes/moving.cc') diff --git a/kig/modes/moving.cc b/kig/modes/moving.cc index 533b15d4..980a5feb 100644 --- a/kig/modes/moving.cc +++ b/kig/modes/moving.cc @@ -55,13 +55,13 @@ void MovingModeBase::initScreen( const std::vector& in ) std::inserter( notmovingobjs, notmovingobjs.begin() ) ); mview.clearStillPix(); - KigPainter p( mview.screenInfo(), &mview.stillPix, mdoc.document() ); + KigPainter p( mview.screenInfo(), TQT_TQPAINTDEVICE(&mview.stillPix), mdoc.document() ); p.drawGrid( mdoc.document().coordinateSystem(), mdoc.document().grid(), mdoc.document().axes() ); p.drawObjects( notmovingobjs.begin(), notmovingobjs.end(), false ); mview.updateCurPix(); - KigPainter p2( mview.screenInfo(), &mview.curPix, mdoc.document() ); + KigPainter p2( mview.screenInfo(), TQT_TQPAINTDEVICE(&mview.curPix), mdoc.document() ); p2.drawObjects( drawableset.begin(), drawableset.end(), true ); } @@ -86,12 +86,12 @@ void MovingModeBase::mouseMoved( TQMouseEvent* e, KigWidget* v ) v->updateCurPix(); Coordinate c = v->fromScreen( e->pos() ); - bool snaptogrid = e->state() & Qt::ShiftButton; + bool snaptogrid = e->state() & TQt::ShiftButton; moveTo( c, snaptogrid ); for ( std::vector::iterator i = mcalcable.begin(); i != mcalcable.end(); ++i ) ( *i )->calc( mdoc.document() ); - KigPainter p( v->screenInfo(), &v->curPix, mdoc.document() ); + KigPainter p( v->screenInfo(), TQT_TQPAINTDEVICE(&v->curPix), mdoc.document() ); // TODO: only draw the explicitly moving objects as selected, the // other ones as deselected.. Needs some support from the // subclasses.. @@ -129,8 +129,8 @@ MovingMode::MovingMode( const std::vector& os, const Coordinate& emo.push_back( ( *i )->calcer() ); d->refmap[( *i )->calcer()] = (*i)->moveReferencePoint(); objs.insert( ( *i )->calcer() ); - std::vector parents = ( *i )->calcer()->movableParents(); - objs.insert( parents.begin(), parents.end() ); + std::vector tqparents = ( *i )->calcer()->movableParents(); + objs.insert( tqparents.begin(), tqparents.end() ); }; emo = calcPath( emo ); @@ -143,8 +143,8 @@ MovingMode::MovingMode( const std::vector& os, const Coordinate& std::set tmp = objs; for ( std::set::const_iterator i = tmp.begin(); i != tmp.end(); ++i ) { - std::set children = getAllChildren(*i); - objs.insert( children.begin(), children.end() ); + std::set tqchildren = getAllChildren(*i); + objs.insert( tqchildren.begin(), tqchildren.end() ); } initScreen( calcPath( std::vector( objs.begin(), objs.end() ) ) ); @@ -154,7 +154,7 @@ void MovingMode::stopMove() { TQString text = d->emo.size() == 1 ? d->emo[0]->imp()->type()->moveAStatement() : - i18n( "Move %1 Objects" ).arg( d->emo.size() ); + i18n( "Move %1 Objects" ).tqarg( d->emo.size() ); KigCommand* mc = new KigCommand( mdoc, text ); d->mon->finish( mc ); mdoc.history()->addCommand( mc ); @@ -164,7 +164,7 @@ void MovingMode::moveTo( const Coordinate& o, bool snaptogrid ) { for( std::vector::iterator i = d->emo.begin(); i != d->emo.end(); ++i ) { - assert( d->refmap.find( *i ) != d->refmap.end() ); + assert( d->refmap.tqfind( *i ) != d->refmap.end() ); Coordinate nc = d->refmap[*i] + ( o - d->pwwsm ); if ( snaptogrid ) nc = mdoc.document().coordinateSystem().snapToGrid( nc, mview ); (*i)->move( nc, mdoc.document() ); @@ -176,14 +176,14 @@ PointRedefineMode::PointRedefineMode( ObjectHolder* p, KigPart& d, KigWidget& v { assert( dynamic_cast( p->calcer() ) ); moldtype = static_cast( p->calcer() )->type(); - std::vector oldparents = p->calcer()->parents(); - std::copy( oldparents.begin(), oldparents.end(), std::back_inserter( moldparents ) ); - - std::vector parents = getAllParents( mp->calcer() ); - mmon = new MonitorDataObjects( parents ); - std::vector moving = parents; - std::set children = getAllChildren( mp->calcer() ); - std::copy( children.begin(), children.end(), std::back_inserter( moving ) ); + std::vector oldtqparents = p->calcer()->tqparents(); + std::copy( oldtqparents.begin(), oldtqparents.end(), std::back_inserter( moldtqparents ) ); + + std::vector tqparents = getAllParents( mp->calcer() ); + mmon = new MonitorDataObjects( tqparents ); + std::vector moving = tqparents; + std::set tqchildren = getAllChildren( mp->calcer() ); + std::copy( tqchildren.begin(), tqchildren.end(), std::back_inserter( moving ) ); initScreen( moving ); } @@ -224,22 +224,22 @@ void PointRedefineMode::stopMove() assert( dynamic_cast( mp->calcer() ) ); ObjectTypeCalcer* mpcalc = static_cast( mp->calcer() ); - std::vector newparents = mpcalc->parents(); - std::vector newparentsref( - newparents.begin(), newparents.end() ); + std::vector newtqparents = mpcalc->tqparents(); + std::vector newtqparentsref( + newtqparents.begin(), newtqparents.end() ); const ObjectType* newtype = mpcalc->type(); - std::vector oldparents; - for( std::vector::iterator i = moldparents.begin(); - i != moldparents.end(); ++i ) - oldparents.push_back( i->get() ); + std::vector oldtqparents; + for( std::vector::iterator i = moldtqparents.begin(); + i != moldtqparents.end(); ++i ) + oldtqparents.push_back( i->get() ); mpcalc->setType( moldtype ); - mpcalc->setParents( oldparents ); + mpcalc->setParents( oldtqparents ); mp->calc( mdoc.document() ); KigCommand* command = new KigCommand( mdoc, i18n( "Redefine Point" ) ); command->addTask( - new ChangeParentsAndTypeTask( mpcalc, newparents, newtype ) ); + new ChangeParentsAndTypeTask( mpcalc, newtqparents, newtype ) ); mmon->finish( command ); mdoc.history()->addCommand( command ); } -- cgit v1.2.1