summaryrefslogtreecommitdiffstats
path: root/kig/modes/moving.cc
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:44:41 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:44:41 +0000
commita374efce3a207b39514be3c52264091400ce297e (patch)
tree77bdf654b55826d4f59b53a5621310206bcaead1 /kig/modes/moving.cc
parentf81a494f3957d5cf38c787973415597941934727 (diff)
downloadtdeedu-a374efce3a207b39514be3c52264091400ce297e.tar.gz
tdeedu-a374efce3a207b39514be3c52264091400ce297e.zip
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
Diffstat (limited to 'kig/modes/moving.cc')
-rw-r--r--kig/modes/moving.cc54
1 files changed, 27 insertions, 27 deletions
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<ObjectCalcer*>& 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<ObjectCalcer*>::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<ObjectHolder*>& os, const Coordinate&
emo.push_back( ( *i )->calcer() );
d->refmap[( *i )->calcer()] = (*i)->moveReferencePoint();
objs.insert( ( *i )->calcer() );
- std::vector<ObjectCalcer*> parents = ( *i )->calcer()->movableParents();
- objs.insert( parents.begin(), parents.end() );
+ std::vector<ObjectCalcer*> tqparents = ( *i )->calcer()->movableParents();
+ objs.insert( tqparents.begin(), tqparents.end() );
};
emo = calcPath( emo );
@@ -143,8 +143,8 @@ MovingMode::MovingMode( const std::vector<ObjectHolder*>& os, const Coordinate&
std::set<ObjectCalcer*> tmp = objs;
for ( std::set<ObjectCalcer*>::const_iterator i = tmp.begin(); i != tmp.end(); ++i )
{
- std::set<ObjectCalcer*> children = getAllChildren(*i);
- objs.insert( children.begin(), children.end() );
+ std::set<ObjectCalcer*> tqchildren = getAllChildren(*i);
+ objs.insert( tqchildren.begin(), tqchildren.end() );
}
initScreen( calcPath( std::vector<ObjectCalcer*>( 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<ObjectCalcer*>::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<ObjectTypeCalcer*>( p->calcer() ) );
moldtype = static_cast<ObjectTypeCalcer*>( p->calcer() )->type();
- std::vector<ObjectCalcer*> oldparents = p->calcer()->parents();
- std::copy( oldparents.begin(), oldparents.end(), std::back_inserter( moldparents ) );
-
- std::vector<ObjectCalcer*> parents = getAllParents( mp->calcer() );
- mmon = new MonitorDataObjects( parents );
- std::vector<ObjectCalcer*> moving = parents;
- std::set<ObjectCalcer*> children = getAllChildren( mp->calcer() );
- std::copy( children.begin(), children.end(), std::back_inserter( moving ) );
+ std::vector<ObjectCalcer*> oldtqparents = p->calcer()->tqparents();
+ std::copy( oldtqparents.begin(), oldtqparents.end(), std::back_inserter( moldtqparents ) );
+
+ std::vector<ObjectCalcer*> tqparents = getAllParents( mp->calcer() );
+ mmon = new MonitorDataObjects( tqparents );
+ std::vector<ObjectCalcer*> moving = tqparents;
+ std::set<ObjectCalcer*> 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<ObjectTypeCalcer*>( mp->calcer() ) );
ObjectTypeCalcer* mpcalc = static_cast<ObjectTypeCalcer*>( mp->calcer() );
- std::vector<ObjectCalcer*> newparents = mpcalc->parents();
- std::vector<ObjectCalcer::shared_ptr> newparentsref(
- newparents.begin(), newparents.end() );
+ std::vector<ObjectCalcer*> newtqparents = mpcalc->tqparents();
+ std::vector<ObjectCalcer::shared_ptr> newtqparentsref(
+ newtqparents.begin(), newtqparents.end() );
const ObjectType* newtype = mpcalc->type();
- std::vector<ObjectCalcer*> oldparents;
- for( std::vector<ObjectCalcer::shared_ptr>::iterator i = moldparents.begin();
- i != moldparents.end(); ++i )
- oldparents.push_back( i->get() );
+ std::vector<ObjectCalcer*> oldtqparents;
+ for( std::vector<ObjectCalcer::shared_ptr>::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 );
}