diff -r fbb8c8560551 -r a4532e5c2ce3 flagobj.cpp --- a/flagobj.cpp Tue Jan 03 09:44:41 2006 +0000 +++ b/flagobj.cpp Mon Nov 20 12:12:05 2006 +0000 @@ -1,4 +1,6 @@ #include "flagobj.h" +//Added by qt3to4: +#include ///////////////////////////////////////////////////////////////// // FlagObj @@ -9,7 +11,7 @@ init (); } -FlagObj::FlagObj(QCanvas* c):MapObj(c) +FlagObj::FlagObj(Q3Canvas* c):MapObj(c) { // cout << "Const FlagObj canvas="<move (absPos.x(), absPos.y() ); - button=NULL; state=false; + action=NULL; } void FlagObj::copy (FlagObj* other) @@ -46,10 +48,8 @@ tooltip=other->tooltip; state=other->state; icon->copy(other->icon); + action=other->action; setVisibility (other->isVisibleObj() ); - // button is not copied, because - // we won't copy to a parentRow and - // all others don't need a button } void FlagObj::move(double x, double y) @@ -117,24 +117,21 @@ return tooltip; } -void FlagObj::setButton(QAction* b) -{ - button=b; -} - -void FlagObj::updateButton() -{ - if (button) - button->setOn(state); - else - qWarning ("FlagObj::updateButton no button defined"); -} - QPixmap FlagObj::getPixmap() { return icon->getPixmap(); } +void FlagObj::setAction (QAction* a) +{ + action=a; +} + +void FlagObj::updateAction () +{ + if (action) action->setChecked(state); +} + bool FlagObj::isActive() { return state; @@ -170,12 +167,6 @@ } } -void FlagObj::setEnabled(bool b) -{ - button->setEnabled (b); -} - - void FlagObj::setUsed (bool b) { used=b;