From 69cac65817d949cda2672ec4f0aa73d5e66a0ba1 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 22 Jun 2011 00:30:31 +0000 Subject: TQt4 port kdenetwork This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1237912 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- ksirc/KSTicker/ksticker.cpp | 46 ++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'ksirc/KSTicker/ksticker.cpp') diff --git a/ksirc/KSTicker/ksticker.cpp b/ksirc/KSTicker/ksticker.cpp index e6199427..bedc0328 100644 --- a/ksirc/KSTicker/ksticker.cpp +++ b/ksirc/KSTicker/ksticker.cpp @@ -21,8 +21,8 @@ #include #include -KSTicker::KSTicker(TQWidget * parent, const char * name, WFlags f) -: TQFrame(parent, name, f) +KSTicker::KSTicker(TQWidget * tqparent, const char * name, WFlags f) +: TQFrame(tqparent, name, f) { pHeight = 1; @@ -90,7 +90,7 @@ KSTicker::KSTicker(TQWidget * parent, const char * name, WFlags f) KSTicker::~KSTicker() { - killTimers(); + TQT_TQOBJECT(this)->killTimers(); delete pic; } @@ -110,26 +110,26 @@ void KSTicker::show() if(currentStr.length() != 0) startTicker(); currentChar = 0; - repaint(TRUE); + tqrepaint(TRUE); } void KSTicker::hide() { - killTimers(); + TQT_TQOBJECT(this)->killTimers(); TQFrame::hide(); } void KSTicker::iconify() { TQFrame::showMinimized(); - killTimers(); + TQT_TQOBJECT(this)->killTimers(); } void KSTicker::setString(TQString str) { strlist.clear(); strlist.append(str); - repaint(TRUE); + tqrepaint(TRUE); startTicker(); } @@ -138,7 +138,7 @@ void KSTicker::mergeString(TQString str, TQColor c) int num = KSPainter::colour2num(c); if(num != -1){ - str.prepend(TQString("~%1").arg(num)); + str.prepend(TQString("~%1").tqarg(num)); } mergeString(str); @@ -150,8 +150,8 @@ void KSTicker::mergeString(TQString str) if(rx.search(str) >= 0){ int value = nickColourMaker::colourMaker()->findIdx(rx.cap(1)); if(value >= 0){ - TQString newText = TQString("~%1\\1~c").arg(value); - str.replace(rx, newText); + TQString newText = TQString("~%1\\1~c").tqarg(value); + str.tqreplace(rx, newText); } } @@ -162,8 +162,8 @@ void KSTicker::mergeString(TQString str) int found = 0; TQStringList::Iterator it = strlist.begin(); for(; it != strlist.end(); it++){ - if(((*it).find(ksopts->server["global"].nick, 0, FALSE) == -1) && - ((*it).find(ksopts->server["global"].altNick, 0, FALSE) == -1)){ + if(((*it).tqfind(ksopts->server["global"].nick, 0, FALSE) == -1) && + ((*it).tqfind(ksopts->server["global"].altNick, 0, FALSE) == -1)){ strlist.remove(it); found = 1; break; @@ -231,7 +231,7 @@ void KSTicker::timerEvent(TQTimerEvent *) } bAtEnd = FALSE; - static BGMode bgmode = TransparentMode; + static Qt::BGMode bgmode = Qt::TransparentMode; bitBlt(pic, -tickStep, 0, pic); TQPainter p(pic); @@ -275,12 +275,12 @@ void KSTicker::timerEvent(TQTimerEvent *) int col = buf.toInt(); if((col >= 0) || (col <= KSPainter::maxcolour)){ bg = KSPainter::num2colour[col]; - bgmode = OpaqueMode; + bgmode = Qt::OpaqueMode; } } } else{ - bgmode = TransparentMode; + bgmode = Qt::TransparentMode; } } else { @@ -352,7 +352,7 @@ void KSTicker::timerEvent(TQTimerEvent *) p.setPen(fg); p.setBackgroundColor(bg); - p.setBackgroundMode(OpaqueMode); + p.setBackgroundMode(Qt::OpaqueMode); p.drawText(this->width() - cOffset + onechar, // remove -onechar. this->height() / 4 + p.fontMetrics().height() / 2, currentStr.mid(currentChar, 1), @@ -376,12 +376,12 @@ void KSTicker::resizeEvent( TQResizeEvent *e) TQFrame::resizeEvent(e); onechar = fontMetrics().width("X"); chars = this->width() / onechar; - killTimers(); + TQT_TQOBJECT(this)->killTimers(); TQPixmap *new_pic = new TQPixmap(width() + onechar, height()); new_pic->fill(backgroundColor()); - bitBlt(new_pic, + bitBlt(TQT_TQPAINTDEVICE(new_pic), new_pic->width() - pic->width(), 0, - pic, 0, 0, + TQT_TQPAINTDEVICE(pic), 0, 0, pic->width(), pic->height(), CopyROP, TRUE); delete pic; @@ -393,19 +393,19 @@ void KSTicker::resizeEvent( TQResizeEvent *e) void KSTicker::closeEvent( TQCloseEvent *) { emit closing(); - killTimers(); + TQT_TQOBJECT(this)->killTimers(); // delete this; } void KSTicker::startTicker() { - killTimers(); + TQT_TQOBJECT(this)->killTimers(); startTimer(tickRate); } void KSTicker::stopTicker() { - killTimers(); + TQT_TQOBJECT(this)->killTimers(); } void KSTicker::mouseDoubleClickEvent( TQMouseEvent * ) @@ -415,7 +415,7 @@ void KSTicker::mouseDoubleClickEvent( TQMouseEvent * ) void KSTicker::mousePressEvent( TQMouseEvent *e) { - if(e->button() == RightButton){ + if(e->button() == Qt::RightButton){ popup->popup(this->cursor().pos()); } else{ -- cgit v1.2.1