diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-12 01:36:19 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-12 01:36:19 +0000 |
commit | 99a2774ca6f1cab334de5d43fe36fc44ae889a4c (patch) | |
tree | eff34cf0762227f6baf2a93e8fef48d4bed2651c /kompare/komparepart/komparelistview.cpp | |
parent | 1c104292188541106338d4940b0f04beeb4301a0 (diff) | |
download | tdesdk-99a2774ca6f1cab334de5d43fe36fc44ae889a4c.tar.gz tdesdk-99a2774ca6f1cab334de5d43fe36fc44ae889a4c.zip |
TQt4 convert kdesdk
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1236185 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kompare/komparepart/komparelistview.cpp')
-rw-r--r-- | kompare/komparepart/komparelistview.cpp | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/kompare/komparepart/komparelistview.cpp b/kompare/komparepart/komparelistview.cpp index 7e3ee953..7dd21845 100644 --- a/kompare/komparepart/komparelistview.cpp +++ b/kompare/komparepart/komparelistview.cpp @@ -47,19 +47,19 @@ using namespace Diff2; KompareListViewFrame::KompareListViewFrame( bool isSource, ViewSettings* settings, - KompareSplitter* parent, + KompareSplitter* tqparent, const char* name ): - TQFrame ( parent, name ), + TQFrame ( tqparent, name ), m_view ( isSource, settings, this, name ), m_label ( isSource?"Source":"Dest", this ), m_layout ( this ) { - setSizePolicy ( TQSizePolicy(TQSizePolicy::Ignored, TQSizePolicy::Ignored) ); - m_label.setSizePolicy ( TQSizePolicy(TQSizePolicy::Ignored, TQSizePolicy::Fixed) ); + tqsetSizePolicy ( TQSizePolicy(TQSizePolicy::Ignored, TQSizePolicy::Ignored) ); + m_label.tqsetSizePolicy ( TQSizePolicy(TQSizePolicy::Ignored, TQSizePolicy::Fixed) ); TQFrame *bottomLine = new TQFrame(this); bottomLine->setFrameShape(TQFrame::HLine); bottomLine->setFrameShadow ( TQFrame::Plain ); - bottomLine->setSizePolicy ( TQSizePolicy(TQSizePolicy::Ignored, TQSizePolicy::Fixed) ); + bottomLine->tqsetSizePolicy ( TQSizePolicy(TQSizePolicy::Ignored, TQSizePolicy::Fixed) ); bottomLine->setFixedHeight(1); m_label.setMargin(3); m_layout.setSpacing(0); @@ -69,11 +69,11 @@ KompareListViewFrame::KompareListViewFrame( bool isSource, m_layout.addWidget(&m_view); connect( &m_view, TQT_SIGNAL(differenceClicked(const Diff2::Difference*)), - parent, TQT_SLOT(slotDifferenceClicked(const Diff2::Difference*)) ); + tqparent, TQT_SLOT(slotDifferenceClicked(const Diff2::Difference*)) ); - connect( parent, TQT_SIGNAL(scrollViewsToId(int)), &m_view, TQT_SLOT(scrollToId(int)) ); - connect( parent, TQT_SIGNAL(setXOffset(int)), &m_view, TQT_SLOT(setXOffset(int)) ); - connect( &m_view, TQT_SIGNAL(resized()), parent, TQT_SLOT(slotUpdateScrollBars()) ); + connect( tqparent, TQT_SIGNAL(scrollViewsToId(int)), &m_view, TQT_SLOT(scrollToId(int)) ); + connect( tqparent, TQT_SIGNAL(setXOffset(int)), &m_view, TQT_SLOT(setXOffset(int)) ); + connect( &m_view, TQT_SIGNAL(resized()), tqparent, TQT_SLOT(slotUpdateScrollBars()) ); } void KompareListViewFrame::slotSetModel( const DiffModel* model ) @@ -92,14 +92,14 @@ void KompareListViewFrame::slotSetModel( const DiffModel* model ) m_label.setText( model->destinationFile() ); } } else { - m_label.setText( TQString::null ); + m_label.setText( TQString() ); } } KompareListView::KompareListView( bool isSource, ViewSettings* settings, - TQWidget* parent, const char* name ) : - KListView( parent, name ), + TQWidget* tqparent, const char* name ) : + KListView( tqparent, name ), m_isSource( isSource ), m_settings( settings ), m_scrollId( -1 ), @@ -122,10 +122,10 @@ KompareListView::KompareListView( bool isSource, setFrameStyle( TQFrame::NoFrame ); setVScrollBarMode( TQScrollView::AlwaysOff ); setHScrollBarMode( TQScrollView::AlwaysOff ); - setFocusPolicy( TQWidget::NoFocus ); + setFocusPolicy( TQ_NoFocus ); setFont( m_settings->m_font ); setSpaces( m_settings->m_tabToNumberOfSpaces ); - setFocusProxy( parent->parentWidget() ); + setFocusProxy( tqparent->tqparentWidget() ); } KompareListView::~KompareListView() @@ -154,7 +154,7 @@ int KompareListView::firstVisibleDifference() } if( item ) - return m_items.findIndex( ((KompareListViewLineItem*)item)->diffItemParent() ); + return m_items.tqfindIndex( ((KompareListViewLineItem*)item)->diffItemParent() ); return -1; } @@ -177,12 +177,12 @@ int KompareListView::lastVisibleDifference() } if( item ) - return m_items.findIndex( ((KompareListViewLineItem*)item)->diffItemParent() ); + return m_items.tqfindIndex( ((KompareListViewLineItem*)item)->diffItemParent() ); return -1; } -TQRect KompareListView::itemRect( int i ) +TQRect KompareListView::tqitemRect( int i ) { TQListViewItem* item = itemAtIndex( i ); int x = 0; @@ -390,7 +390,7 @@ void KompareListView::slotApplyAllDifferences( bool apply ) TQPtrDictIterator<KompareListViewDiffItem> it ( m_itemDict ); for( ; it.current(); ++it ) it.current()->applyDifference( apply ); - repaint(); + tqrepaint(); } void KompareListView::slotApplyDifference( const Difference* diff, bool apply ) @@ -410,7 +410,7 @@ void KompareListView::setSpaces( int spaces ) void KompareListView::wheelEvent( TQWheelEvent* e ) { - e->ignore(); // we want the parent to catch wheel events + e->ignore(); // we want the tqparent to catch wheel events } void KompareListView::resizeEvent( TQResizeEvent* e ) @@ -420,28 +420,28 @@ void KompareListView::resizeEvent( TQResizeEvent* e ) kdDebug() << "resizeEvent " << endl; } -KompareListViewItem::KompareListViewItem( KompareListView* parent ) - : TQListViewItem( parent ), +KompareListViewItem::KompareListViewItem( KompareListView* tqparent ) + : TQListViewItem( tqparent ), m_scrollId( 0 ) { // kdDebug(8104) << "Created KompareListViewItem with scroll id " << m_scrollId << endl; } -KompareListViewItem::KompareListViewItem( KompareListView* parent, KompareListViewItem* after ) - : TQListViewItem( parent, after ), +KompareListViewItem::KompareListViewItem( KompareListView* tqparent, KompareListViewItem* after ) + : TQListViewItem( tqparent, after ), m_scrollId( after->scrollId() + after->maxHeight() ) { // kdDebug(8104) << "Created KompareListViewItem with scroll id " << m_scrollId << endl; } -KompareListViewItem::KompareListViewItem( KompareListViewItem* parent ) - : TQListViewItem( parent ), +KompareListViewItem::KompareListViewItem( KompareListViewItem* tqparent ) + : TQListViewItem( tqparent ), m_scrollId( 0 ) { } -KompareListViewItem::KompareListViewItem( KompareListViewItem* parent, KompareListViewItem* /*after*/ ) - : TQListViewItem( parent ), +KompareListViewItem::KompareListViewItem( KompareListViewItem* tqparent, KompareListViewItem* /*after*/ ) + : TQListViewItem( tqparent ), m_scrollId( 0 ) { } @@ -456,8 +456,8 @@ void KompareListViewItem::paintFocus( TQPainter* /* p */, const TQColorGroup& /* // Don't paint anything } -KompareListViewDiffItem::KompareListViewDiffItem( KompareListView* parent, Difference* difference ) - : KompareListViewItem( parent ), +KompareListViewDiffItem::KompareListViewDiffItem( KompareListView* tqparent, Difference* difference ) + : KompareListViewItem( tqparent ), m_difference( difference ), m_sourceItem( 0L ), m_destItem( 0L ) @@ -465,8 +465,8 @@ KompareListViewDiffItem::KompareListViewDiffItem( KompareListView* parent, Diffe init(); } -KompareListViewDiffItem::KompareListViewDiffItem( KompareListView* parent, KompareListViewItem* after, Difference* difference ) - : KompareListViewItem( parent, after ), +KompareListViewDiffItem::KompareListViewDiffItem( KompareListView* tqparent, KompareListViewItem* after, Difference* difference ) + : KompareListViewItem( tqparent, after ), m_difference( difference ), m_sourceItem( 0L ), m_destItem( 0L ) @@ -500,12 +500,12 @@ void KompareListViewDiffItem::applyDifference( bool apply ) kdDebug(8104) << "KompareListViewDiffItem::applyDifference( " << apply << " )" << endl; setVisibility(); setup(); - repaint(); + tqrepaint(); } int KompareListViewDiffItem::maxHeight() { - int lines = QMAX( m_difference->sourceLineCount(), m_difference->destinationLineCount() ); + int lines = TQMAX( m_difference->sourceLineCount(), m_difference->destinationLineCount() ); if( lines == 0 ) return BLANK_LINE_HEIGHT; else @@ -520,13 +520,13 @@ void KompareListViewDiffItem::setSelected( bool b ) m_sourceItem->firstChild() : m_destItem->firstChild(); while( item && item->isVisible() ) { - item->repaint(); + item->tqrepaint(); item = item->nextSibling(); } } -KompareListViewLineContainerItem::KompareListViewLineContainerItem( KompareListViewDiffItem* parent, bool isSource ) - : KompareListViewItem( parent ), +KompareListViewLineContainerItem::KompareListViewLineContainerItem( KompareListViewDiffItem* tqparent, bool isSource ) + : KompareListViewItem( tqparent ), m_isSource( isSource ) { // kdDebug(8104) << "isSource ? " << (isSource ? " Yes!" : " No!") << endl; @@ -554,7 +554,7 @@ void KompareListViewLineContainerItem::setup() KompareListViewDiffItem* KompareListViewLineContainerItem::diffItemParent() const { - return (KompareListViewDiffItem*)parent(); + return (KompareListViewDiffItem*)tqparent(); } int KompareListViewLineContainerItem::lineCount() const @@ -575,8 +575,8 @@ DifferenceString* KompareListViewLineContainerItem::lineAt( int i ) const diffItemParent()->difference()->destinationLineAt( i ); } -KompareListViewLineItem::KompareListViewLineItem( KompareListViewLineContainerItem* parent, int line, DifferenceString* text ) - : KompareListViewItem( parent ) +KompareListViewLineItem::KompareListViewLineItem( KompareListViewLineContainerItem* tqparent, int line, DifferenceString* text ) + : KompareListViewItem( tqparent ) { setText( COL_LINE_NO, TQString::number( line ) ); setText( COL_MAIN, text->string() ); @@ -618,7 +618,7 @@ void KompareListViewLineItem::paintCell( TQPainter * p, const TQColorGroup & cg, if ( diffItemParent()->isSelected() ) { p->setPen( bg.dark(135) ); - if ( this == parent()->firstChild() ) + if ( this == tqparent()->firstChild() ) p->drawLine( 0, 0, width, 0 ); if ( nextSibling() == 0 ) p->drawLine( 0, height() - 1, width, height() - 1 ); @@ -658,14 +658,14 @@ void KompareListViewLineItem::paintText( TQPainter* p, const TQColor& bg, int co // kdDebug(8104) << "TextChunk = \"" << textChunk << "\"" << endl; // kdDebug(8104) << "c->offset() = " << c->offset() << endl; // kdDebug(8104) << "prevValue = " << prevValue << endl; - textChunk.replace( TQChar('\t'), kompareListView()->spaces() ); + textChunk.tqreplace( TQChar('\t'), kompareListView()->spaces() ); prevValue = m->offset(); if ( m->type() == Marker::End ) { TQFont font( p->font() ); font.setBold( true ); p->setFont( font ); -// p->setPen( Qt::blue ); +// p->setPen( TQt::blue ); brush = changeBrush; } else @@ -673,7 +673,7 @@ void KompareListViewLineItem::paintText( TQPainter* p, const TQColor& bg, int co TQFont font( p->font() ); font.setBold( false ); p->setFont( font ); -// p->setPen( Qt::black ); +// p->setPen( TQt::black ); brush = normalBrush; } chunkWidth = p->fontMetrics().width( textChunk ); @@ -688,7 +688,7 @@ void KompareListViewLineItem::paintText( TQPainter* p, const TQColor& bg, int co { // Still have to draw some string without changes textChunk = m_text->string().mid( prevValue, kMax( ( unsigned int )1, m_text->string().length() - prevValue ) ); - textChunk.replace( TQChar('\t'), kompareListView()->spaces() ); + textChunk.tqreplace( TQChar('\t'), kompareListView()->spaces() ); // kdDebug(8104) << "TextChunk = \"" << textChunk << "\"" << endl; TQFont font( p->font() ); font.setBold( false ); @@ -713,12 +713,12 @@ void KompareListViewLineItem::paintText( TQPainter* p, const TQColor& bg, int co KompareListViewDiffItem* KompareListViewLineItem::diffItemParent() const { - KompareListViewLineContainerItem* p = (KompareListViewLineContainerItem*)parent(); + KompareListViewLineContainerItem* p = (KompareListViewLineContainerItem*)tqparent(); return p->diffItemParent(); } -KompareListViewBlankLineItem::KompareListViewBlankLineItem( KompareListViewLineContainerItem* parent ) - : KompareListViewLineItem( parent, 0, new DifferenceString() ) +KompareListViewBlankLineItem::KompareListViewBlankLineItem( KompareListViewLineContainerItem* tqparent ) + : KompareListViewLineItem( tqparent, 0, new DifferenceString() ) { } @@ -737,16 +737,16 @@ void KompareListViewBlankLineItem::paintText( TQPainter* p, const TQColor& bg, i } } -KompareListViewHunkItem::KompareListViewHunkItem( KompareListView* parent, DiffHunk* hunk, bool zeroHeight ) - : KompareListViewItem( parent ), +KompareListViewHunkItem::KompareListViewHunkItem( KompareListView* tqparent, DiffHunk* hunk, bool zeroHeight ) + : KompareListViewItem( tqparent ), m_zeroHeight( zeroHeight ), m_hunk( hunk ) { setSelectable( false ); } -KompareListViewHunkItem::KompareListViewHunkItem( KompareListView* parent, KompareListViewItem* after, DiffHunk* hunk, bool zeroHeight ) - : KompareListViewItem( parent, after ), +KompareListViewHunkItem::KompareListViewHunkItem( KompareListView* tqparent, KompareListViewItem* after, DiffHunk* hunk, bool zeroHeight ) + : KompareListViewItem( tqparent, after ), m_zeroHeight( zeroHeight ), m_hunk( hunk ) { |