diff options
Diffstat (limited to 'kopete/libkopete/ui/kopetelistviewitem.cpp')
-rw-r--r-- | kopete/libkopete/ui/kopetelistviewitem.cpp | 264 |
1 files changed, 132 insertions, 132 deletions
diff --git a/kopete/libkopete/ui/kopetelistviewitem.cpp b/kopete/libkopete/ui/kopetelistviewitem.cpp index e02b14b3..1b1f7b6c 100644 --- a/kopete/libkopete/ui/kopetelistviewitem.cpp +++ b/kopete/libkopete/ui/kopetelistviewitem.cpp @@ -1,5 +1,5 @@ /* - kopetelistviewitem.cpp - Kopete's modular QListViewItems + kopetelistviewitem.cpp - Kopete's modular TQListViewItems Copyright (c) 2005 by Engin AYDOGAN <engin@bzzzt.biz> Copyright (c) 2004 by Richard Smith <kde@metafoo.co.uk> @@ -76,7 +76,7 @@ Component *ComponentBase::componentAt( const TQPoint &pt ) { for ( uint n = 0; n < components(); ++n ) { - if ( component( n )->rect().contains( pt ) ) + if ( component( n )->rect().tqcontains( pt ) ) { if ( Component *comp = component( n )->componentAt( pt ) ) return comp; @@ -117,10 +117,10 @@ void ComponentBase::componentResized( Component * ) std::pair<TQString,TQRect> ComponentBase::toolTip( const TQPoint &relativePos ) { for ( uint n = 0; n < components(); ++n ) - if ( component( n )->rect().contains( relativePos ) ) + if ( component( n )->rect().tqcontains( relativePos ) ) return component( n )->toolTip( relativePos ); - return std::make_pair( TQString::null, TQRect() ); + return std::make_pair( TQString(), TQRect() ); } void ComponentBase::updateAnimationPosition( int p, int s ) @@ -144,13 +144,13 @@ void ComponentBase::updateAnimationPosition( int p, int s ) class Component::Private { public: - Private( ComponentBase *parent ) - : parent( parent ), minWidth( 0 ), minHeight( 0 ) + Private( ComponentBase *tqparent ) + : tqparent( tqparent ), minWidth( 0 ), minHeight( 0 ) , growHoriz( false ), growVert( false ) , tipSource( 0 ) { } - ComponentBase *parent; + ComponentBase *tqparent; TQRect rect; TQRect startRect, targetRect; int minWidth, minHeight; @@ -159,10 +159,10 @@ public: ToolTipSource *tipSource; }; -Component::Component( ComponentBase *parent ) - : d( new Private( parent ) ) +Component::Component( ComponentBase *tqparent ) + : d( new Private( tqparent ) ) { - d->parent->componentAdded( this ); + d->tqparent->componentAdded( this ); d->show = true; } @@ -170,7 +170,7 @@ int Component::RTTI = Rtti_Component; Component::~Component() { - d->parent->componentRemoved( this ); + d->tqparent->componentRemoved( this ); delete d; } @@ -224,7 +224,7 @@ bool Component::setMinWidth( int width ) if ( d->minWidth == width ) return false; d->minWidth = width; - d->parent->componentResized( this ); + d->tqparent->componentResized( this ); return true; } bool Component::setMinHeight( int height ) @@ -232,11 +232,11 @@ bool Component::setMinHeight( int height ) if ( d->minHeight == height ) return false; d->minHeight = height; - d->parent->componentResized( this ); + d->tqparent->componentResized( this ); return true; } -void Component::layout( const TQRect &newRect ) +void Component::tqlayout( const TQRect &newRect ) { if ( rect().isNull() ) d->startRect = TQRect( newRect.topLeft(), newRect.topLeft() ); @@ -253,7 +253,7 @@ void Component::setRect( const TQRect &rect ) void Component::paint( TQPainter *painter, const TQColorGroup &cg ) { - /*painter->setPen( Qt::red ); + /*painter->setPen( TQt::red ); painter->drawRect( rect() );*/ for ( uint n = 0; n < components(); ++n ) { @@ -262,26 +262,26 @@ void Component::paint( TQPainter *painter, const TQColorGroup &cg ) } } -void Component::repaint() +void Component::tqrepaint() { - d->parent->repaint(); + d->tqparent->tqrepaint(); } -void Component::relayout() +void Component::retqlayout() { - d->parent->relayout(); + d->tqparent->retqlayout(); } void Component::componentAdded( Component *component ) { ComponentBase::componentAdded( component ); - //update( Relayout ); + //update( Retqlayout ); } void Component::componentRemoved( Component *component ) { ComponentBase::componentRemoved( component ); - //update( Relayout ); + //update( Retqlayout ); } // BoxComponent -------- @@ -295,8 +295,8 @@ public: static const int padding = 0; }; -BoxComponent::BoxComponent( ComponentBase *parent, Direction dir ) - : Component( parent ), d( new Private( dir ) ) +BoxComponent::BoxComponent( ComponentBase *tqparent, Direction dir ) + : Component( tqparent ), d( new Private( dir ) ) { } @@ -309,11 +309,11 @@ BoxComponent::~BoxComponent() int BoxComponent::widthForHeight( int height ) { - if ( d->direction != Horizontal ) + if ( d->direction !=Qt::Horizontal ) { int width = 0; for ( uint n = 0; n < components(); ++n ) - width = QMAX( width, component( n )->widthForHeight( height ) ); + width = TQMAX( width, component( n )->widthForHeight( height ) ); return width; } else @@ -327,11 +327,11 @@ int BoxComponent::widthForHeight( int height ) int BoxComponent::heightForWidth( int width ) { - if ( d->direction == Horizontal ) + if ( d->direction ==Qt::Horizontal ) { int height = 0; for ( uint n = 0; n < components(); ++n ) - height = QMAX( height, component( n )->heightForWidth( width ) ); + height = TQMAX( height, component( n )->heightForWidth( width ) ); return height; } else @@ -349,20 +349,20 @@ void BoxComponent::calcMinSize() for ( uint n = 0; n < components(); ++n ) { Component *comp = component( n ); - if ( d->direction == Horizontal ) + if ( d->direction ==Qt::Horizontal ) { - max = QMAX( max, comp->minHeight() ); + max = TQMAX( max, comp->minHeight() ); sum += comp->minWidth(); } else { - max = QMAX( max, comp->minWidth() ); + max = TQMAX( max, comp->minWidth() ); sum += comp->minHeight(); } } bool sizeChanged = false; - if ( d->direction == Horizontal ) + if ( d->direction ==Qt::Horizontal ) { if ( setMinWidth( sum ) ) sizeChanged = true; if ( setMinHeight( max ) ) sizeChanged = true; @@ -374,16 +374,16 @@ void BoxComponent::calcMinSize() } if ( sizeChanged ) - repaint(); + tqrepaint(); else - relayout(); + retqlayout(); } -void BoxComponent::layout( const TQRect &rect ) +void BoxComponent::tqlayout( const TQRect &rect ) { - Component::layout( rect ); + Component::tqlayout( rect ); - bool horiz = (d->direction == Horizontal); + bool horiz = (d->direction ==Qt::Horizontal); int fixedSize = 0; for ( uint n = 0; n < components(); ++n ) { @@ -402,9 +402,9 @@ void BoxComponent::layout( const TQRect &rect ) // that cases we should pretend that we're wide/high enough. int total; if ( horiz ) - total = QMAX( rect.width(), minWidth() ); + total = TQMAX( rect.width(), minWidth() ); else - total = QMAX( rect.height(), minHeight() ); + total = TQMAX( rect.height(), minHeight() ); int remaining = total - fixedSize - padding * (components() - 1); @@ -422,7 +422,7 @@ void BoxComponent::layout( const TQRect &rect ) rc.setHeight( rect.height() ); int minWidth = comp->minWidth(); int desiredWidth = comp->widthForHeight( rect.height() ); - rc.setWidth( QMIN( remaining + minWidth, desiredWidth ) ); + rc.setWidth( TQMIN( remaining + minWidth, desiredWidth ) ); pos += rc.width(); remaining -= rc.width() - minWidth; } @@ -433,11 +433,11 @@ void BoxComponent::layout( const TQRect &rect ) rc.setWidth( rect.width() ); int minHeight = comp->minHeight(); int desiredHeight = comp->heightForWidth( rect.width() ); - rc.setHeight( QMIN( remaining + minHeight, desiredHeight ) ); + rc.setHeight( TQMIN( remaining + minHeight, desiredHeight ) ); pos += rc.height(); remaining -= rc.height() - minHeight; } - comp->layout( rc & rect ); + comp->tqlayout( rc & rect ); pos += padding; } } @@ -482,8 +482,8 @@ public: TQPixmap bottom_pixmap; }; -ContactBoxComponent::ContactBoxComponent(ComponentBase *parent, Direction dir) - : BoxComponent(parent, dir), d(new Private()) +ContactBoxComponent::ContactBoxComponent(ComponentBase *tqparent, Direction dir) + : BoxComponent(tqparent, dir), d(new Private()) {} ContactBoxComponent::~ContactBoxComponent() @@ -518,7 +518,7 @@ void ContactBoxComponent::reloadTheme() d->bottom_pixmap.load(str); } -void ContactBoxComponent::layout(const TQRect &rect) +void ContactBoxComponent::tqlayout(const TQRect &rect) { d->sub.setLeft(rect.left() + d->left_pixmap.width()); @@ -529,8 +529,8 @@ void ContactBoxComponent::layout(const TQRect &rect) d->sub.setBottom(rect.bottom() - d->bottom_pixmap.height()); - BoxComponent::layout(d->sub); - Component::layout(rect); + BoxComponent::tqlayout(d->sub); + Component::tqlayout(rect); } int ContactBoxComponent::widthForHeight(int height) @@ -620,8 +620,8 @@ public: TQPixmap bottom_pixmap; }; -GroupBoxComponent::GroupBoxComponent(ComponentBase *parent, Direction dir) - : BoxComponent(parent, dir), d(new Private()) +GroupBoxComponent::GroupBoxComponent(ComponentBase *tqparent, Direction dir) + : BoxComponent(tqparent, dir), d(new Private()) {} GroupBoxComponent::~GroupBoxComponent() @@ -661,7 +661,7 @@ void GroupBoxComponent::reloadTheme() d->bottom_pixmap.load(str); } -void GroupBoxComponent::layout(const TQRect &rect) +void GroupBoxComponent::tqlayout(const TQRect &rect) { d->sub.setLeft(rect.left() + d->left_pixmap.width()); @@ -672,8 +672,8 @@ void GroupBoxComponent::layout(const TQRect &rect) d->sub.setBottom(rect.bottom() - d->bottom_pixmap.height()); - BoxComponent::layout(d->sub); - Component::layout(rect); + BoxComponent::tqlayout(d->sub); + Component::tqlayout(rect); } int GroupBoxComponent::widthForHeight(int height) @@ -746,19 +746,19 @@ public: TQPixmap image; }; -ImageComponent::ImageComponent( ComponentBase *parent ) - : Component( parent ), d( new Private ) +ImageComponent::ImageComponent( ComponentBase *tqparent ) + : Component( tqparent ), d( new Private ) { } int ImageComponent::RTTI = Rtti_ImageComponent; -ImageComponent::ImageComponent( ComponentBase *parent, int minW, int minH ) - : Component( parent ), d( new Private ) +ImageComponent::ImageComponent( ComponentBase *tqparent, int minW, int minH ) + : Component( tqparent ), d( new Private ) { setMinWidth( minW ); setMinHeight( minH ); - repaint(); + tqrepaint(); } ImageComponent::~ImageComponent() @@ -777,7 +777,7 @@ void ImageComponent::setPixmap( const TQPixmap &img, bool) setMinWidth(d->image.width()); setMinHeight(d->image.height()); - repaint(); + tqrepaint(); } void ImageComponent::paint( TQPainter *painter, const TQColorGroup & ) @@ -790,7 +790,7 @@ void ImageComponent::paint( TQPainter *painter, const TQColorGroup & ) painter->drawPixmap( rc & ourRc, d->image ); } -void ImageComponent::scale( int w, int h, TQImage::ScaleMode mode ) +void ImageComponent::scale( int w, int h, TQ_ScaleMode mode ) { TQImage im = d->image.convertToImage(); setPixmap( TQPixmap( im.smoothScale( w, h, mode ) ) ); @@ -814,7 +814,7 @@ void FaceComponent::setPixmap(const TQPixmap &img, bool) setMinHeight(d->image.height() + 4); } - repaint(); + tqrepaint(); } static TQPoint operator+(const TQPoint &pt, const TQSize &sz) @@ -858,8 +858,8 @@ public: TQFont font; }; -TextComponent::TextComponent( ComponentBase *parent, const TQFont &font, const TQString &text ) - : Component( parent ), d( new Private ) +TextComponent::TextComponent( ComponentBase *tqparent, const TQFont &font, const TQString &text ) + : Component( tqparent ), d( new Private ) { setFont( font ); setText( text ); @@ -881,7 +881,7 @@ void TextComponent::setText( const TQString &text ) { if ( text == d->text ) return; d->text = text; - relayout(); + retqlayout(); calcMinSize(); } @@ -906,7 +906,7 @@ void TextComponent::calcMinSize() else setMinHeight( 0 ); - repaint(); + tqrepaint(); } int TextComponent::widthForHeight( int ) @@ -927,13 +927,13 @@ void TextComponent::setColor( const TQColor &color ) { d->color = color; d->customColor = true; - repaint(); + tqrepaint(); } void TextComponent::setDefaultColor() { d->customColor = false; - repaint(); + tqrepaint(); } void TextComponent::paint( TQPainter *painter, const TQColorGroup &cg ) @@ -944,7 +944,7 @@ void TextComponent::paint( TQPainter *painter, const TQColorGroup &cg ) painter->setPen( cg.text() ); TQString dispStr = KStringHandler::rPixelSqueeze( d->text, TQFontMetrics( font() ), rect().width() ); painter->setFont( font() ); - painter->drawText( rect(), Qt::SingleLine, dispStr ); + painter->drawText( rect(), TQt::SingleLine, dispStr ); } // DisplayNameComponent @@ -956,8 +956,8 @@ public: TQFont font; }; -DisplayNameComponent::DisplayNameComponent( ComponentBase *parent ) - : BoxComponent( parent ), d( new Private ) +DisplayNameComponent::DisplayNameComponent( ComponentBase *tqparent ) + : BoxComponent( tqparent ), d( new Private ) { } @@ -968,9 +968,9 @@ DisplayNameComponent::~DisplayNameComponent() delete d; } -void DisplayNameComponent::layout( const TQRect &rect ) +void DisplayNameComponent::tqlayout( const TQRect &rect ) { - Component::layout( rect ); + Component::tqlayout( rect ); // finally, lay everything out TQRect rc; @@ -989,7 +989,7 @@ void DisplayNameComponent::layout( const TQRect &rect ) if ( comp->rtti() == Rtti_TextComponent ) { comp->show(); - comp->layout( TQRect( usedWidth+ rect.left(), rect.top(), + comp->tqlayout( TQRect( usedWidth+ rect.left(), rect.top(), totalWidth - usedWidth, comp->heightForWidth( totalWidth - usedWidth ) ) ); } else { @@ -999,7 +999,7 @@ void DisplayNameComponent::layout( const TQRect &rect ) else { comp->show(); - comp->layout( TQRect( usedWidth+ rect.left(), rect.top(), + comp->tqlayout( TQRect( usedWidth+ rect.left(), rect.top(), comp->widthForHeight( rect.height() ), comp->heightForWidth( rect.width() ) ) ); } @@ -1052,7 +1052,7 @@ void DisplayNameComponent::redraw() case Kopete::Emoticons::Image: ic = new ImageComponent( this ); ic->setPixmap( TQPixmap( (*token).picPath ) ); - ic->scale( INT_MAX, fontHeight, TQImage::ScaleMin ); + ic->scale( INT_MAX, fontHeight, TQ_ScaleMin ); break; default: kdDebug( 14010 ) << k_funcinfo << "This should have not happened!" << endl; @@ -1092,8 +1092,8 @@ TQString DisplayNameComponent::text() // HSpacerComponent -------- -HSpacerComponent::HSpacerComponent( ComponentBase *parent ) - : Component( parent ) +HSpacerComponent::HSpacerComponent( ComponentBase *tqparent ) + : Component( tqparent ) { setMinWidth( 0 ); setMinHeight( 0 ); @@ -1108,8 +1108,8 @@ int HSpacerComponent::widthForHeight( int ) // VSpacerComponent -------- -VSpacerComponent::VSpacerComponent( ComponentBase *parent ) - : Component( parent ) +VSpacerComponent::VSpacerComponent( ComponentBase *tqparent ) + : Component( tqparent ) { setMinWidth( 0 ); setMinHeight( 0 ); @@ -1131,7 +1131,7 @@ public: int iconSize; }; -ContactComponent::ContactComponent( ComponentBase *parent, Kopete::Contact *contact, int) : ImageComponent( parent ) , d( new Private ) +ContactComponent::ContactComponent( ComponentBase *tqparent, Kopete::Contact *contact, int) : ImageComponent( tqparent ) , d( new Private ) { d->contact = contact; d->iconSize = 12; // size of the image is fixed to 12 pixels @@ -1145,7 +1145,7 @@ ContactComponent::~ContactComponent() void ContactComponent::updatePixmap() { - setPixmap( contact()->onlineStatus().iconFor( contact(), d->iconSize ) ); + setPixmap( contact()->onlinetqStatus().iconFor( contact(), d->iconSize ) ); } Kopete::Contact *ContactComponent::contact() { @@ -1160,7 +1160,7 @@ std::pair<TQString,TQRect> ContactComponent::toolTip( const TQPoint &/*relativeP ////////////////// SpacerComponent ///////////////////////// -SpacerComponent::SpacerComponent( ComponentBase *parent, int w, int h ) : Component( parent ) +SpacerComponent::SpacerComponent( ComponentBase *tqparent, int w, int h ) : Component( tqparent ) { setMinWidth(w); setMinHeight(h); @@ -1172,7 +1172,7 @@ SpacerComponent::SpacerComponent( ComponentBase *parent, int w, int h ) : Compon * A periodic timer intended to be shared amongst multiple objects. Will run only * if an object is attached to it. */ -class SharedTimer : private QTimer +class SharedTimer : private TQTimer { int period; int users; @@ -1227,17 +1227,17 @@ class Item::Private { public: Private( Item *item ) - : layoutAnimateTimer( theLayoutAnimateTimer(), item, TQT_SLOT( slotLayoutAnimateItems() ) ) + : tqlayoutAnimateTimer( theLayoutAnimateTimer(), item, TQT_SLOT( slotLayoutAnimateItems() ) ) , animateLayout( true ), opacity( 1.0 ) , visibilityTimer( theVisibilityTimer(), item, TQT_SLOT( slotUpdateVisibility() ) ) , visibilityLevel( 0 ), visibilityTarget( false ), searchMatch( true ) { } - TQTimer layoutTimer; + TQTimer tqlayoutTimer; - //TQTimer layoutAnimateTimer; - SharedTimerRef layoutAnimateTimer; + //TQTimer tqlayoutAnimateTimer; + SharedTimerRef tqlayoutAnimateTimer; SharedTimer &theLayoutAnimateTimer() { static SharedTimer timer( 10 ); @@ -1245,8 +1245,8 @@ public: } bool animateLayout; - int layoutAnimateSteps; - static const int layoutAnimateStepsTotal = 10; + int tqlayoutAnimateSteps; + static const int tqlayoutAnimateStepsTotal = 10; float opacity; @@ -1279,14 +1279,14 @@ bool Item::Private::animateChanges = true; bool Item::Private::fadeVisibility = true; bool Item::Private::foldVisibility = true; -Item::Item( TQListViewItem *parent, TQObject *owner, const char *name ) - : TQObject( owner, name ), KListViewItem( parent ), d( new Private(this) ) +Item::Item( TQListViewItem *tqparent, TQObject *owner, const char *name ) + : TQObject( owner, name ), KListViewItem( tqparent ), d( new Private(this) ) { initLVI(); } -Item::Item( TQListView *parent, TQObject *owner, const char *name ) - : TQObject( owner, name ), KListViewItem( parent ), d( new Private(this) ) +Item::Item( TQListView *tqparent, TQObject *owner, const char *name ) + : TQObject( owner, name ), KListViewItem( tqparent ), d( new Private(this) ) { initLVI(); } @@ -1306,8 +1306,8 @@ void Item::setEffects( bool animation, bool fading, bool folding ) void Item::initLVI() { connect( listView()->header(), TQT_SIGNAL( sizeChange( int, int, int ) ), TQT_SLOT( slotColumnResized() ) ); - connect( &d->layoutTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( slotLayoutItems() ) ); - //connect( &d->layoutAnimateTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( slotLayoutAnimateItems() ) ); + connect( &d->tqlayoutTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( slotLayoutItems() ) ); + //connect( &d->tqlayoutAnimateTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( slotLayoutAnimateItems() ) ); //connect( &d->visibilityTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( slotUpdateVisibility() ) ); setVisible( false ); setTargetVisibility( true ); @@ -1316,20 +1316,20 @@ void Item::initLVI() void Item::slotColumnResized() { scheduleLayout(); - // if we've been resized, don't animate the layout + // if we've been resized, don't animate the tqlayout d->animateLayout = false; } void Item::scheduleLayout() { - // perform a delayed layout in order to speed it all up - if ( ! d->layoutTimer.isActive() ) - d->layoutTimer.start( 30, true ); + // perform a delayed tqlayout in order to speed it all up + if ( ! d->tqlayoutTimer.isActive() ) + d->tqlayoutTimer.start( 30, true ); } void Item::slotLayoutItems() { - d->layoutTimer.stop(); + d->tqlayoutTimer.stop(); for ( uint n = 0; n < components(); ++n ) { @@ -1341,20 +1341,20 @@ void Item::slotLayoutItems() } int height = component( n )->heightForWidth( width ); - component( n )->layout( TQRect( 0, 0, width, height ) ); + component( n )->tqlayout( TQRect( 0, 0, width, height ) ); //kdDebug(14000) << k_funcinfo << "Component " << n << " is " << width << " x " << height << endl; } if ( Private::animateChanges && d->animateLayout && !d->visibilityTimer.isActive() ) { - d->layoutAnimateTimer.start(); - //if ( !d->layoutAnimateTimer.isActive() ) - // d->layoutAnimateTimer.start( 10 ); - d->layoutAnimateSteps = 0; + d->tqlayoutAnimateTimer.start(); + //if ( !d->tqlayoutAnimateTimer.isActive() ) + // d->tqlayoutAnimateTimer.start( 10 ); + d->tqlayoutAnimateSteps = 0; } else { - d->layoutAnimateSteps = Private::layoutAnimateStepsTotal; + d->tqlayoutAnimateSteps = Private::tqlayoutAnimateStepsTotal; d->animateLayout = true; } slotLayoutAnimateItems(); @@ -1362,15 +1362,15 @@ void Item::slotLayoutItems() void Item::slotLayoutAnimateItems() { - if ( ++d->layoutAnimateSteps >= Private::layoutAnimateStepsTotal ) - d->layoutAnimateTimer.stop(); + if ( ++d->tqlayoutAnimateSteps >= Private::tqlayoutAnimateStepsTotal ) + d->tqlayoutAnimateTimer.stop(); - const int s = Private::layoutAnimateStepsTotal; - const int p = QMIN( d->layoutAnimateSteps, s ); + const int s = Private::tqlayoutAnimateStepsTotal; + const int p = TQMIN( d->tqlayoutAnimateSteps, s ); updateAnimationPosition( p, s ); setHeight(0); - repaint(); + tqrepaint(); } float Item::opacity() @@ -1382,7 +1382,7 @@ void Item::setOpacity( float opacity ) { if ( d->opacity == opacity ) return; d->opacity = opacity; - repaint(); + tqrepaint(); } void Item::setSearchMatch( bool match ) @@ -1411,7 +1411,7 @@ void Item::setTargetVisibility( bool vis ) { if ( d->visibilityTarget == vis ) { - // in case we're getting called because our parent was shown and + // in case we're getting called because our tqparent was shown and // we need to be rehidden if ( !d->visibilityTimer.isActive() ) setVisible( vis && d->searchMatch ); @@ -1451,18 +1451,18 @@ void Item::slotUpdateVisibility() setVisible( false ); } setHeight( 0 ); - repaint(); + tqrepaint(); } -void Item::repaint() +void Item::tqrepaint() { - // if we're about to relayout, don't bother painting yet. - if ( d->layoutTimer.isActive() ) + // if we're about to retqlayout, don't bother painting yet. + if ( d->tqlayoutTimer.isActive() ) return; - listView()->repaintItem( this ); + listView()->tqrepaintItem( this ); } -void Item::relayout() +void Item::retqlayout() { scheduleLayout(); } @@ -1477,11 +1477,11 @@ void Item::setHeight( int ) { int minHeight = 0; for ( uint n = 0; n < components(); ++n ) - minHeight = QMAX( minHeight, component( n )->rect().height() ); + minHeight = TQMAX( minHeight, component( n )->rect().height() ); //kdDebug(14000) << k_funcinfo << "Height is " << minHeight << endl; if ( Private::foldVisibility && d->visibilityTimer.isActive() ) { - int vis = QMIN( d->visibilityLevel, Private::visibilityFoldSteps ); + int vis = TQMIN( d->visibilityLevel, Private::visibilityFoldSteps ); minHeight = (minHeight * vis) / Private::visibilityFoldSteps; } KListViewItem::setHeight( minHeight ); @@ -1489,7 +1489,7 @@ void Item::setHeight( int ) int Item::width( const TQFontMetrics &, const TQListView *lv, int c ) const { - // Qt computes the itemRect from this. we want the whole item to be + // TQt computes the tqitemRect from this. we want the whole item to be // clickable, so we return the widest we could possibly be. return lv->header()->sectionSize( c ); } @@ -1503,11 +1503,11 @@ void Item::paintCell( TQPainter *p, const TQColorGroup &cg, int column, int widt // 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; @@ -1519,7 +1519,7 @@ void Item::paintCell( TQPainter *p, const TQColorGroup &cg, int column, int widt // 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; @@ -1528,20 +1528,20 @@ void Item::paintCell( TQPainter *p, const TQColorGroup &cg, int column, int widt 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 ); } @@ -1552,20 +1552,20 @@ void Item::paintCell( TQPainter *p, const TQColorGroup &cg, int column, int widt (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, @@ -1589,7 +1589,7 @@ void Item::paintCell( TQPainter *p, const TQColorGroup &cg, int column, int widt float opac = 1.0; if ( d->visibilityTimer.isActive() && Private::fadeVisibility ) { - int vis = QMAX( d->visibilityLevel - Private::visibilityFoldSteps, 0 ); + int vis = TQMAX( d->visibilityLevel - Private::visibilityFoldSteps, 0 ); opac = float(vis) / Private::visibilityFadeSteps; } opac *= opacity(); |