diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:49:52 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:49:52 +0000 |
commit | cfc42a28c327b96c6a2afee92af3bac1a479eb8a (patch) | |
tree | e3219edf5f827eaa4db3feb509a17846a1a5a752 /kworldwatch/flags.cpp | |
parent | a73fc4d7e66fe0824313aa4e9a650c4cddef6e9f (diff) | |
download | tdetoys-cfc42a28c327b96c6a2afee92af3bac1a479eb8a.tar.gz tdetoys-cfc42a28c327b96c6a2afee92af3bac1a479eb8a.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdetoys@1157650 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kworldwatch/flags.cpp')
-rw-r--r-- | kworldwatch/flags.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/kworldwatch/flags.cpp b/kworldwatch/flags.cpp index dd60330..273f8a0 100644 --- a/kworldwatch/flags.cpp +++ b/kworldwatch/flags.cpp @@ -38,8 +38,8 @@ FlagList::FlagList() { _flags.setAutoDelete(true); - _flagPixmap = QPixmap(locate("data", "kworldclock/pics/flag.png")); - _flagMask = QPixmap(locate("data", "kworldclock/pics/flag-mask.xpm"), 0, QPixmap::ThresholdDither); + _flagPixmap = TQPixmap(locate("data", "kworldclock/pics/flag.png")); + _flagMask = TQPixmap(locate("data", "kworldclock/pics/flag-mask.xpm"), 0, TQPixmap::ThresholdDither); _flagMask.setMask(_flagMask.createHeuristicMask()); } @@ -50,31 +50,31 @@ void FlagList::addFlag(Flag *f) } -QPoint FlagList::getPosition(double la, double lo, int w, int h, int offset) +TQPoint FlagList::getPosition(double la, double lo, int w, int h, int offset) { int x = (int)((double)w * (180.0 + lo) / 360.0); int y = (int)((double)h * (90.0 - la) / 180.0); x = (x + offset + w/2) % w; - return QPoint(x,y); + return TQPoint(x,y); } -void FlagList::paint(QPainter *p, int width, int height, int offset) +void FlagList::paint(TQPainter *p, int width, int height, int offset) { p->setPen(Qt::black); - QPtrListIterator<Flag> it(_flags); + TQPtrListIterator<Flag> it(_flags); for ( ; it.current(); ++it) { - QPoint pos = getPosition(it.current()->latitude(), it.current()->longitude(), width, height, offset); + TQPoint pos = getPosition(it.current()->latitude(), it.current()->longitude(), width, height, offset); p->setPen(it.current()->color()); p->setBrush(it.current()->color()); if (width > 100) { - pos -= QPoint(5,15); + pos -= TQPoint(5,15); p->drawPixmap(pos,_flagMask); p->drawPixmap(pos,_flagPixmap); @@ -85,14 +85,14 @@ void FlagList::paint(QPainter *p, int width, int height, int offset) } -void FlagList::removeNearestFlag(const QPoint &target, int w, int h, int offset) +void FlagList::removeNearestFlag(const TQPoint &target, int w, int h, int offset) { Flag *flag = 0; - QPoint diff; + TQPoint diff; int dist = INT_MAX; - QPtrListIterator<Flag> it(_flags); + TQPtrListIterator<Flag> it(_flags); for ( ; it.current(); ++it) { diff = getPosition(it.current()->latitude(), it.current()->longitude(), w, h, offset); @@ -117,13 +117,13 @@ void FlagList::save(KConfig *config) { config->writeEntry("Flags", _flags.count()); - QPtrListIterator<Flag> it(_flags); + TQPtrListIterator<Flag> it(_flags); int cnt=0; for ( ; it.current(); ++it) { - config->writeEntry(QString("Flag_%1_Color").arg(cnt), it.current()->color()); - config->writeEntry(QString("Flag_%1_Latitude").arg(cnt), it.current()->latitude()); - config->writeEntry(QString("Flag_%1_Longitude").arg(cnt), it.current()->longitude()); + config->writeEntry(TQString("Flag_%1_Color").arg(cnt), it.current()->color()); + config->writeEntry(TQString("Flag_%1_Latitude").arg(cnt), it.current()->latitude()); + config->writeEntry(TQString("Flag_%1_Longitude").arg(cnt), it.current()->longitude()); cnt++; } } @@ -136,9 +136,9 @@ void FlagList::load(KConfig *config) for (int i=0; i<num; ++i) { - addFlag(new Flag(config->readDoubleNumEntry(QString("Flag_%1_Longitude").arg(i)), - config->readDoubleNumEntry(QString("Flag_%1_Latitude").arg(i)), - config->readColorEntry(QString("Flag_%1_Color").arg(i)))); + addFlag(new Flag(config->readDoubleNumEntry(TQString("Flag_%1_Longitude").arg(i)), + config->readDoubleNumEntry(TQString("Flag_%1_Latitude").arg(i)), + config->readColorEntry(TQString("Flag_%1_Color").arg(i)))); } } |