diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
commit | 47c8a359c5276062c4bc17f0e82410f29081b502 (patch) | |
tree | 2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /ksirc/alistbox.cpp | |
parent | 6f82532777a35e0e60bbd2b290b2e93e646f349b (diff) | |
download | tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksirc/alistbox.cpp')
-rw-r--r-- | ksirc/alistbox.cpp | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/ksirc/alistbox.cpp b/ksirc/alistbox.cpp index 9b632676..779bd730 100644 --- a/ksirc/alistbox.cpp +++ b/ksirc/alistbox.cpp @@ -16,42 +16,42 @@ #include "alistbox.h" #include "nickColourMaker.h" -#include <qdragobject.h> -#include <qpainter.h> +#include <tqdragobject.h> +#include <tqpainter.h> #include <kdebug.h> #include <kglobal.h> #include <kurldrag.h> -aListBox::aListBox(QWidget *parent, const char *name ) - : QListBox(parent,name) +aListBox::aListBox(TQWidget *parent, const char *name ) + : TQListBox(parent,name) { clear(); p_scroll = palette().copy(); setAcceptDrops( true ); - connect(this, SIGNAL(selected (const QString&)), - this, SIGNAL(selectedNick(const QString&))); + connect(this, TQT_SIGNAL(selected (const TQString&)), + this, TQT_SIGNAL(selectedNick(const TQString&))); m_nickListDirty = true; updateNickPrefixWidth(); - connect( this, SIGNAL( contextMenuRequested( QListBoxItem *, const QPoint & ) ), - this, SLOT( reEmitContextMenuRequest( QListBoxItem * ) ) ); + connect( this, TQT_SIGNAL( contextMenuRequested( TQListBoxItem *, const TQPoint & ) ), + this, TQT_SLOT( reEmitContextMenuRequest( TQListBoxItem * ) ) ); } aListBox::~aListBox() { } -void aListBox::reEmitContextMenuRequest( QListBoxItem *item ) +void aListBox::reEmitContextMenuRequest( TQListBoxItem *item ) { emit contextMenuRequested( index( item ) ); } void aListBox::clear() { - QListBox::clear(); + TQListBox::clear(); } @@ -72,7 +72,7 @@ void aListBox::inSort ( nickListItem *lbi) m_nickListDirty = true; } -void aListBox::inSort ( QString text, bool top) +void aListBox::inSort ( TQString text, bool top) { nickListItem *nli = new nickListItem(); nli->setText(text); @@ -91,7 +91,7 @@ int aListBox::findSep() return i; } -int aListBox::searchFor(const QString &nick, bool &found, bool top) +int aListBox::searchFor(const TQString &nick, bool &found, bool top) { int min = 0, max = 0; int current = 0, compare = 0; @@ -198,7 +198,7 @@ bool aListBox::isTop(int index) return TRUE; } -int aListBox::findNick(const QString &str) +int aListBox::findNick(const TQString &str) { bool found; int index; @@ -213,15 +213,15 @@ int aListBox::findNick(const QString &str) } nickListItem *aListBox::item(int index){ - return (nickListItem *) QListBox::item(index); + return (nickListItem *) TQListBox::item(index); } -void aListBox::dragMoveEvent( QDragMoveEvent *e ) +void aListBox::dragMoveEvent( TQDragMoveEvent *e ) { bool ok = (count() > 0 && KURLDrag::canDecode( e )); if(!ok) - ok = QTextDrag::canDecode(e); + ok = TQTextDrag::canDecode(e); e->accept( ok ); if ( ok ) @@ -229,22 +229,22 @@ void aListBox::dragMoveEvent( QDragMoveEvent *e ) } -void aListBox::dropEvent( QDropEvent *e ) +void aListBox::dropEvent( TQDropEvent *e ) { - QListBoxItem *item = itemAt( e->pos() ); + TQListBoxItem *item = itemAt( e->pos() ); if ( !item ) return; setCurrentItem( item ); - QStringList urls; + TQStringList urls; KURLDrag::decodeLocalFiles( e, urls ); - QString text; + TQString text; if ( !urls.isEmpty() ) emit urlsDropped( urls, item->text() ); - else if(QTextDrag::decode(e, text)){ + else if(TQTextDrag::decode(e, text)){ emit textDropped( item, text); } } @@ -264,7 +264,7 @@ void aListBox::updateNeedNickPrefixFlag() const m_needNickPrefix = false; if(ksopts->useColourNickList == false){ - QListBoxItem *item = firstItem(); + TQListBoxItem *item = firstItem(); for (; item; item = item->next() ) { nickListItem *nickItem = static_cast<nickListItem *>( item ); @@ -282,15 +282,15 @@ void aListBox::updateNeedNickPrefixFlag() const m_nickListDirty = false; } -void aListBox::fontChange( const QFont &f ) +void aListBox::fontChange( const TQFont &f ) { - QListBox::fontChange( f ); + TQListBox::fontChange( f ); updateNickPrefixWidth(); } void aListBox::updateNickPrefixWidth() { - QFontMetrics metrics( font() ); + TQFontMetrics metrics( font() ); m_nickPrefixWidth = 0; @@ -320,7 +320,7 @@ void aListBox::clearAdvOps() } nickListItem::nickListItem() - : QListBoxItem() + : TQListBoxItem() { is_op = FALSE; is_voice = FALSE; @@ -330,7 +330,7 @@ nickListItem::nickListItem() } nickListItem::nickListItem(const nickListItem &old) - : QListBoxItem() + : TQListBoxItem() { is_op = old.is_op; is_voice = old.is_voice; @@ -372,20 +372,20 @@ void nickListItem::setIrcOp(bool _ircop) static_cast<aListBox *>( listBox() )->setNickListDirty(); } -void nickListItem::forceColour(const QColor *col) +void nickListItem::forceColour(const TQColor *col) { forcedCol = col; } -void nickListItem::paint(QPainter *p) +void nickListItem::paint(TQPainter *p) { - QFontMetrics fm = p->fontMetrics(); + TQFontMetrics fm = p->fontMetrics(); int yPos; // vertical text position int nickPosX = 3; yPos = fm.ascent() + fm.leading()/2; - QPen pen = p->pen(); - QFont font = p->font(); + TQPen pen = p->pen(); + TQFont font = p->font(); if(ksopts->useColourNickList == true) { if(ksopts->nickColourization){ @@ -400,25 +400,25 @@ void nickListItem::paint(QPainter *p) } if(is_voice == TRUE){ - QPen open = p->pen(); + TQPen open = p->pen(); p->setPen(ksopts->channelColor); p->drawText( nickPosX, yPos, "+" ); nickPosX += fm.width( "+" ); p->setPen(open); -// p->fillRect(0,0, listBox()->maxItemWidth(), height(listBox()), QBrush(ksopts->channelColor, Qt::Dense7Pattern)); +// p->fillRect(0,0, listBox()->maxItemWidth(), height(listBox()), TQBrush(ksopts->channelColor, Qt::Dense7Pattern)); } if(is_op == TRUE) { - QPen open = p->pen(); + TQPen open = p->pen(); p->setPen(ksopts->errorColor); p->drawText( nickPosX, yPos, "@" ); nickPosX += fm.width( "@" ); p->setPen(open); -// p->fillRect(0,0, listBox()->maxItemWidth(), height(listBox()), QBrush(ksopts->errorColor, Qt::Dense7Pattern)); +// p->fillRect(0,0, listBox()->maxItemWidth(), height(listBox()), TQBrush(ksopts->errorColor, Qt::Dense7Pattern)); } if(is_away == TRUE) p->setPen(p->pen().color().dark(150)); if(is_ircop == TRUE){ - QPen open = p->pen(); + TQPen open = p->pen(); p->setPen(ksopts->errorColor); p->drawText( nickPosX, yPos, "*" ); nickPosX += fm.width( "*" ); @@ -435,7 +435,7 @@ void nickListItem::paint(QPainter *p) if(is_away == TRUE) p->setPen(p->pen().color().dark(150)); if(is_ircop == TRUE){ - QFont bfont = font; + TQFont bfont = font; bfont.setBold(TRUE); p->setFont(bfont); } @@ -460,9 +460,9 @@ void nickListItem::paint(QPainter *p) p->setFont(font); } -QString nickListItem::nickPrefix() const +TQString nickListItem::nickPrefix() const { - QString prefix; + TQString prefix; if ( voice() ) prefix += aListBox::nickPrefixVoice(); @@ -479,19 +479,19 @@ QString nickListItem::nickPrefix() const return prefix; } -int nickListItem::height(const QListBox *lb ) const +int nickListItem::height(const TQListBox *lb ) const { return lb->fontMetrics().lineSpacing() + 1; } -int nickListItem::width(const QListBox *lb ) const +int nickListItem::width(const TQListBox *lb ) const { return static_cast<const aListBox *>( lb )->nickPrefixWidth() + lb->fontMetrics().width( text() ) + 6; } -const QPixmap* nickListItem::pixmap() const +const TQPixmap* nickListItem::pixmap() const { return 0l; } |