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 --- kopete/protocols/irc/ui/channellist.cpp | 58 ++++++++++++++++----------------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'kopete/protocols/irc/ui/channellist.cpp') diff --git a/kopete/protocols/irc/ui/channellist.cpp b/kopete/protocols/irc/ui/channellist.cpp index ea085db8..67916d4d 100644 --- a/kopete/protocols/irc/ui/channellist.cpp +++ b/kopete/protocols/irc/ui/channellist.cpp @@ -41,16 +41,16 @@ class ChannelListItem : public KListViewItem { public: - ChannelListItem( KListView *parent, TQString arg1, TQString arg2, TQString arg3 ); + ChannelListItem( KListView *tqparent, TQString arg1, TQString arg2, TQString arg3 ); virtual int compare( TQListViewItem *i, int col, bool ascending ) const; virtual void paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int align ); private: - KListView *parentList; + KListView *tqparentList; }; -ChannelListItem::ChannelListItem( KListView *parent, TQString arg1, TQString arg2, TQString arg3 ) : - KListViewItem( parent, parent->lastItem() ), parentList( parent ) +ChannelListItem::ChannelListItem( KListView *tqparent, TQString arg1, TQString arg2, TQString arg3 ) : + KListViewItem( tqparent, tqparent->lastItem() ), tqparentList( tqparent ) { setText(0, arg1); setText(1, arg2); @@ -81,11 +81,11 @@ void ChannelListItem::paintCell( TQPainter *p, const TQColorGroup &cg, int colum // set the alternate cell background colour if necessary TQColorGroup _cg = cg; if (isAlternate()) - if (listView()->viewport()->backgroundMode()==Qt::FixedColor) + if (listView()->viewport()->backgroundMode()==TQt::FixedColor) _cg.setColor(TQColorGroup::Background, static_cast< KListView* >(listView())->alternateBackground()); else _cg.setColor(TQColorGroup::Base, static_cast< KListView* >(listView())->alternateBackground()); - // PASTED FROM QLISTVIEWITEM + // PASTED FROM TQLISTVIEWITEM { TQPainter *p = &paint; @@ -97,7 +97,7 @@ void ChannelListItem::paintCell( TQPainter *p, const TQColorGroup &cg, int colum // any text we render is done by the Components, not by this class, so make sure we've nothing to write TQString t; - // removed text truncating code from Qt - we do that differently, further on + // removed text truncating code from TQt - we do that differently, further on int marg = lv->itemMargin(); int r = marg; @@ -106,20 +106,20 @@ void ChannelListItem::paintCell( TQPainter *p, const TQColorGroup &cg, int colum const BackgroundMode bgmode = lv->viewport()->backgroundMode(); const TQColorGroup::ColorRole crole = TQPalette::backgroundRoleFromMode( bgmode ); - if ( _cg.brush( crole ) != lv->colorGroup().brush( crole ) ) + if ( _cg.brush( crole ) != lv->tqcolorGroup().brush( crole ) ) p->fillRect( 0, 0, width, height(), _cg.brush( crole ) ); else { // all copied from TQListView::paintEmptyArea //lv->paintEmptyArea( p, TQRect( 0, 0, width, height() ) ); - TQStyleOption opt( lv->sortColumn(), 0 ); // ### hack; in 3.1, add a property in TQListView and QHeader + TQStyleOption opt( lv->sortColumn(), 0 ); // ### hack; in 3.1, add a property in TQListView and TQHeader TQStyle::SFlags how = TQStyle::Style_Default; if ( lv->isEnabled() ) how |= TQStyle::Style_Enabled; - lv->style().drawComplexControl( TQStyle::CC_ListView, - p, lv, TQRect( 0, 0, width, height() ), lv->colorGroup(), + lv->tqstyle().tqdrawComplexControl( TQStyle::CC_ListView, + p, lv, TQRect( 0, 0, width, height() ), lv->tqcolorGroup(), how, TQStyle::SC_ListView, TQStyle::SC_None, opt ); } @@ -130,20 +130,20 @@ void ChannelListItem::paintCell( TQPainter *p, const TQColorGroup &cg, int colum (column == 0 || lv->allColumnsShowFocus()) ) { p->fillRect( r - marg, 0, width - r + marg, height(), _cg.brush( TQColorGroup::Highlight ) ); - // removed text pen setting code from Qt + // removed text pen setting code from TQt } - // removed icon drawing code from Qt + // removed icon drawing code from TQt // draw the tree gubbins if ( multiLinesEnabled() && column == 0 && isOpen() && childCount() ) { int textheight = fm.size( align, t ).height() + 2 * lv->itemMargin(); - textheight = QMAX( textheight, TQApplication::globalStrut().height() ); + textheight = TQMAX( textheight, TQApplication::globalStrut().height() ); if ( textheight % 2 > 0 ) textheight++; if ( textheight < height() ) { int w = lv->treeStepSize() / 2; - lv->style().drawComplexControl( TQStyle::CC_ListView, p, lv, + lv->tqstyle().tqdrawComplexControl( TQStyle::CC_ListView, p, lv, TQRect( 0, textheight, w + 1, height() - textheight + 1 ), _cg, lv->isEnabled() ? TQStyle::Style_Enabled : TQStyle::Style_Default, TQStyle::SC_ListViewExpand, @@ -165,26 +165,26 @@ void ChannelListItem::paintCell( TQPainter *p, const TQColorGroup &cg, int colum p->drawPixmap( 0, 0, back ); } -ChannelList::ChannelList( TQWidget* parent, KIRC::Engine *engine ) - : TQWidget( parent ), m_engine( engine ) +ChannelList::ChannelList( TQWidget* tqparent, KIRC::Engine *engine ) + : TQWidget( tqparent ), m_engine( engine ) { ChannelListLayout = new TQVBoxLayout( this, 11, 6, "ChannelListLayout"); - layout72_2 = new TQHBoxLayout( 0, 0, 6, "layout72_2"); + tqlayout72_2 = new TQHBoxLayout( 0, 0, 6, "tqlayout72_2"); textLabel1_2 = new TQLabel( this, "textLabel1_2" ); - layout72_2->addWidget( textLabel1_2 ); + tqlayout72_2->addWidget( textLabel1_2 ); channelSearch = new TQLineEdit( this, "channelSearch" ); - layout72_2->addWidget( channelSearch ); + tqlayout72_2->addWidget( channelSearch ); numUsers = new TQSpinBox( 0, 32767, 1, this, "num_users" ); numUsers->setSuffix( i18n(" members") ); - layout72_2->addWidget( numUsers ); + tqlayout72_2->addWidget( numUsers ); mSearchButton = new TQPushButton( this, "mSearchButton" ); - layout72_2->addWidget( mSearchButton ); - ChannelListLayout->addLayout( layout72_2 ); + tqlayout72_2->addWidget( mSearchButton ); + ChannelListLayout->addLayout( tqlayout72_2 ); mChannelList = new KListView( this, "mChannelList" ); mChannelList->addColumn( i18n( "Channel" ) ); @@ -226,8 +226,8 @@ ChannelList::ChannelList( TQWidget* parent, KIRC::Engine *engine ) connect( m_engine, TQT_SIGNAL( incomingEndOfList() ), this, TQT_SLOT( slotListEnd() ) ); - connect( m_engine, TQT_SIGNAL( statusChanged(KIRC::Engine::Status) ), - this, TQT_SLOT( slotStatusChanged(KIRC::Engine::Status) ) ); + connect( m_engine, TQT_SIGNAL( statusChanged(KIRC::Engine::tqStatus) ), + this, TQT_SLOT( slotStatusChanged(KIRC::Engine::tqStatus) ) ); show(); } @@ -242,9 +242,9 @@ void ChannelList::slotItemSelected( TQListViewItem *i ) emit channelSelected( i->text(0) ); } -void ChannelList::slotStatusChanged(KIRC::Engine::Status newStatus) +void ChannelList::slotStatusChanged(KIRC::Engine::tqStatus newtqStatus) { - switch(newStatus) { + switch(newtqStatus) { case KIRC::Engine::Connected: this->reset(); break; @@ -309,13 +309,13 @@ void ChannelList::search() void ChannelList::slotChannelListed( const TQString &channel, uint users, const TQString &topic ) { checkSearchResult( channel, users, topic ); - channelCache.insert( channel, QPair< uint, TQString >( users, topic ) ); + channelCache.insert( channel, TQPair< uint, TQString >( users, topic ) ); } void ChannelList::checkSearchResult( const TQString &channel, uint users, const TQString &topic ) { if( ( mUsers == 0 || mUsers <= users ) && - ( mSearch.isEmpty() || channel.contains( mSearch, false ) || topic.contains( mSearch, false ) ) + ( mSearch.isEmpty() || channel.tqcontains( mSearch, false ) || topic.tqcontains( mSearch, false ) ) ) { new ChannelListItem( mChannelList, channel, TQString::number(users), topic ); -- cgit v1.2.1