diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:51:49 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:51:49 +0000 |
commit | 4ae0c208b66e0f7954e194384464fe2d0a2c56dd (patch) | |
tree | b0a7cd1c184f0003c0292eb416ed27f674f9cc43 /kompare/komparepart/komparelistview.cpp | |
parent | 1964ea0fb4ab57493ca2ebb709c8d3b5395fd653 (diff) | |
download | tdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.tar.gz tdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1157652 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kompare/komparepart/komparelistview.cpp')
-rw-r--r-- | kompare/komparepart/komparelistview.cpp | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/kompare/komparepart/komparelistview.cpp b/kompare/komparepart/komparelistview.cpp index b86bdef9..7e3ee953 100644 --- a/kompare/komparepart/komparelistview.cpp +++ b/kompare/komparepart/komparelistview.cpp @@ -19,10 +19,10 @@ ** ***************************************************************************/ -#include <qheader.h> -#include <qpainter.h> -#include <qregexp.h> -#include <qtimer.h> +#include <tqheader.h> +#include <tqpainter.h> +#include <tqregexp.h> +#include <tqtimer.h> #include <kdebug.h> #include <kglobal.h> @@ -49,17 +49,17 @@ KompareListViewFrame::KompareListViewFrame( bool isSource, ViewSettings* settings, KompareSplitter* parent, const char* name ): - QFrame ( parent, name ), + TQFrame ( parent, name ), m_view ( isSource, settings, this, name ), m_label ( isSource?"Source":"Dest", this ), m_layout ( this ) { - setSizePolicy ( QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored) ); - m_label.setSizePolicy ( QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed) ); - QFrame *bottomLine = new QFrame(this); - bottomLine->setFrameShape(QFrame::HLine); - bottomLine->setFrameShadow ( QFrame::Plain ); - bottomLine->setSizePolicy ( QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed) ); + setSizePolicy ( TQSizePolicy(TQSizePolicy::Ignored, TQSizePolicy::Ignored) ); + m_label.setSizePolicy ( 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->setFixedHeight(1); m_label.setMargin(3); m_layout.setSpacing(0); @@ -68,12 +68,12 @@ KompareListViewFrame::KompareListViewFrame( bool isSource, m_layout.addWidget(bottomLine); m_layout.addWidget(&m_view); - connect( &m_view, SIGNAL(differenceClicked(const Diff2::Difference*)), - parent, SLOT(slotDifferenceClicked(const Diff2::Difference*)) ); + connect( &m_view, TQT_SIGNAL(differenceClicked(const Diff2::Difference*)), + parent, TQT_SLOT(slotDifferenceClicked(const Diff2::Difference*)) ); - connect( parent, SIGNAL(scrollViewsToId(int)), &m_view, SLOT(scrollToId(int)) ); - connect( parent, SIGNAL(setXOffset(int)), &m_view, SLOT(setXOffset(int)) ); - connect( &m_view, SIGNAL(resized()), parent, SLOT(slotUpdateScrollBars()) ); + 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()) ); } void KompareListViewFrame::slotSetModel( const DiffModel* model ) @@ -92,13 +92,13 @@ void KompareListViewFrame::slotSetModel( const DiffModel* model ) m_label.setText( model->destinationFile() ); } } else { - m_label.setText( QString::null ); + m_label.setText( TQString::null ); } } KompareListView::KompareListView( bool isSource, ViewSettings* settings, - QWidget* parent, const char* name ) : + TQWidget* parent, const char* name ) : KListView( parent, name ), m_isSource( isSource ), m_settings( settings ), @@ -119,10 +119,10 @@ KompareListView::KompareListView( bool isSource, setColumnWidthMode( COL_LINE_NO, Maximum ); setColumnWidthMode( COL_MAIN, Maximum ); setResizeMode( LastColumn ); - setFrameStyle( QFrame::NoFrame ); - setVScrollBarMode( QScrollView::AlwaysOff ); - setHScrollBarMode( QScrollView::AlwaysOff ); - setFocusPolicy( QWidget::NoFocus ); + setFrameStyle( TQFrame::NoFrame ); + setVScrollBarMode( TQScrollView::AlwaysOff ); + setHScrollBarMode( TQScrollView::AlwaysOff ); + setFocusPolicy( TQWidget::NoFocus ); setFont( m_settings->m_font ); setSpaces( m_settings->m_tabToNumberOfSpaces ); setFocusProxy( parent->parentWidget() ); @@ -139,7 +139,7 @@ KompareListViewItem* KompareListView::itemAtIndex( int i ) int KompareListView::firstVisibleDifference() { - QListViewItem* item = itemAt( QPoint( 0, 0 ) ); + TQListViewItem* item = itemAt( TQPoint( 0, 0 ) ); if( item == 0 ) { @@ -161,7 +161,7 @@ int KompareListView::firstVisibleDifference() int KompareListView::lastVisibleDifference() { - QListViewItem* item = itemAt( QPoint( 0, visibleHeight() - 1 ) ); + TQListViewItem* item = itemAt( TQPoint( 0, visibleHeight() - 1 ) ); if( item == 0 ) { @@ -182,14 +182,14 @@ int KompareListView::lastVisibleDifference() return -1; } -QRect KompareListView::itemRect( int i ) +TQRect KompareListView::itemRect( int i ) { - QListViewItem* item = itemAtIndex( i ); + TQListViewItem* item = itemAtIndex( i ); int x = 0; int y = itemPos( item ); int vx, vy; contentsToViewport( x, y, vx, vy ); - return QRect( vx, vy, 0, item->totalHeight() ); + return TQRect( vx, vy, 0, item->totalHeight() ); } int KompareListView::minScrollId() @@ -238,7 +238,7 @@ void KompareListView::scrollToId( int id ) int y = pos + (int)( r * (double)height ) - minScrollId(); // kdDebug(8104) << "scrollToID: " << endl; // kdDebug(8104) << " id = " << id << endl; -// kdDebug(8104) << " id after = " << ( item->nextSibling() ? QString::number( ((KompareListViewItem*)item->nextSibling())->scrollId() ) : "no such sibling..." ) << endl; +// kdDebug(8104) << " id after = " << ( item->nextSibling() ? TQString::number( ((KompareListViewItem*)item->nextSibling())->scrollId() ) : "no such sibling..." ) << endl; // kdDebug(8104) << " pos = " << pos << endl; // kdDebug(8104) << " itemId = " << itemId << endl; // kdDebug(8104) << " r = " << r << endl; @@ -354,9 +354,9 @@ void KompareListView::slotSetSelection( const DiffModel* model, const Difference slotSetSelection( diff ); } -void KompareListView::contentsMousePressEvent( QMouseEvent* e ) +void KompareListView::contentsMousePressEvent( TQMouseEvent* e ) { - QPoint vp = contentsToViewport( e->pos() ); + TQPoint vp = contentsToViewport( e->pos() ); KompareListViewLineItem* lineItem = dynamic_cast<KompareListViewLineItem*>( itemAt( vp ) ); if( !lineItem ) return; @@ -366,9 +366,9 @@ void KompareListView::contentsMousePressEvent( QMouseEvent* e ) } } -void KompareListView::contentsMouseDoubleClickEvent( QMouseEvent* e ) +void KompareListView::contentsMouseDoubleClickEvent( TQMouseEvent* e ) { - QPoint vp = contentsToViewport( e->pos() ); + TQPoint vp = contentsToViewport( e->pos() ); KompareListViewLineItem* lineItem = dynamic_cast<KompareListViewLineItem*>( itemAt( vp ) ); if ( !lineItem ) return; @@ -387,7 +387,7 @@ void KompareListView::slotApplyDifference( bool apply ) void KompareListView::slotApplyAllDifferences( bool apply ) { - QPtrDictIterator<KompareListViewDiffItem> it ( m_itemDict ); + TQPtrDictIterator<KompareListViewDiffItem> it ( m_itemDict ); for( ; it.current(); ++it ) it.current()->applyDifference( apply ); repaint(); @@ -408,12 +408,12 @@ void KompareListView::setSpaces( int spaces ) triggerUpdate(); } -void KompareListView::wheelEvent( QWheelEvent* e ) +void KompareListView::wheelEvent( TQWheelEvent* e ) { e->ignore(); // we want the parent to catch wheel events } -void KompareListView::resizeEvent( QResizeEvent* e ) +void KompareListView::resizeEvent( TQResizeEvent* e ) { KListView::resizeEvent(e); emit resized(); @@ -421,27 +421,27 @@ void KompareListView::resizeEvent( QResizeEvent* e ) } KompareListViewItem::KompareListViewItem( KompareListView* parent ) - : QListViewItem( parent ), + : TQListViewItem( parent ), m_scrollId( 0 ) { // kdDebug(8104) << "Created KompareListViewItem with scroll id " << m_scrollId << endl; } KompareListViewItem::KompareListViewItem( KompareListView* parent, KompareListViewItem* after ) - : QListViewItem( parent, after ), + : TQListViewItem( parent, after ), m_scrollId( after->scrollId() + after->maxHeight() ) { // kdDebug(8104) << "Created KompareListViewItem with scroll id " << m_scrollId << endl; } KompareListViewItem::KompareListViewItem( KompareListViewItem* parent ) - : QListViewItem( parent ), + : TQListViewItem( parent ), m_scrollId( 0 ) { } KompareListViewItem::KompareListViewItem( KompareListViewItem* parent, KompareListViewItem* /*after*/ ) - : QListViewItem( parent ), + : TQListViewItem( parent ), m_scrollId( 0 ) { } @@ -451,7 +451,7 @@ KompareListView* KompareListViewItem::kompareListView() const return (KompareListView*)listView(); } -void KompareListViewItem::paintFocus( QPainter* /* p */, const QColorGroup& /* cg */, const QRect& /* r */ ) +void KompareListViewItem::paintFocus( TQPainter* /* p */, const TQColorGroup& /* cg */, const TQRect& /* r */ ) { // Don't paint anything } @@ -516,7 +516,7 @@ void KompareListViewDiffItem::setSelected( bool b ) { kdDebug(8104) << "KompareListViewDiffItem::setSelected( " << b << " )" << endl; KompareListViewItem::setSelected( b ); - QListViewItem* item = m_sourceItem->isVisible() ? + TQListViewItem* item = m_sourceItem->isVisible() ? m_sourceItem->firstChild() : m_destItem->firstChild(); while( item && item->isVisible() ) { @@ -578,7 +578,7 @@ DifferenceString* KompareListViewLineContainerItem::lineAt( int i ) const KompareListViewLineItem::KompareListViewLineItem( KompareListViewLineContainerItem* parent, int line, DifferenceString* text ) : KompareListViewItem( parent ) { - setText( COL_LINE_NO, QString::number( line ) ); + setText( COL_LINE_NO, TQString::number( line ) ); setText( COL_MAIN, text->string() ); m_text = text; } @@ -589,9 +589,9 @@ void KompareListViewLineItem::setup() setHeight( listView()->fontMetrics().lineSpacing() ); } -void KompareListViewLineItem::paintCell( QPainter * p, const QColorGroup & cg, int column, int width, int align ) +void KompareListViewLineItem::paintCell( TQPainter * p, const TQColorGroup & cg, int column, int width, int align ) { - QColor bg = cg.base(); + TQColor bg = cg.base(); p->fillRect( 0, 0, width, height(), bg ); if ( diffItemParent()->difference()->type() == Difference::Unchanged ) { @@ -625,17 +625,17 @@ void KompareListViewLineItem::paintCell( QPainter * p, const QColorGroup & cg, i } } -void KompareListViewLineItem::paintText( QPainter* p, const QColor& bg, int column, int width, int align ) +void KompareListViewLineItem::paintText( TQPainter* p, const TQColor& bg, int column, int width, int align ) { if ( column == COL_MAIN ) { - QString textChunk; + TQString textChunk; int offset = listView()->itemMargin(); unsigned int prevValue = 0; int chunkWidth; - QBrush changeBrush( bg, Dense3Pattern ); - QBrush normalBrush( bg, SolidPattern ); - QBrush brush; + TQBrush changeBrush( bg, Dense3Pattern ); + TQBrush normalBrush( bg, SolidPattern ); + TQBrush brush; if ( m_text->string().isEmpty() ) { @@ -658,11 +658,11 @@ void KompareListViewLineItem::paintText( QPainter* p, const QColor& bg, int colu // kdDebug(8104) << "TextChunk = \"" << textChunk << "\"" << endl; // kdDebug(8104) << "c->offset() = " << c->offset() << endl; // kdDebug(8104) << "prevValue = " << prevValue << endl; - textChunk.replace( QChar('\t'), kompareListView()->spaces() ); + textChunk.replace( TQChar('\t'), kompareListView()->spaces() ); prevValue = m->offset(); if ( m->type() == Marker::End ) { - QFont font( p->font() ); + TQFont font( p->font() ); font.setBold( true ); p->setFont( font ); // p->setPen( Qt::blue ); @@ -670,7 +670,7 @@ void KompareListViewLineItem::paintText( QPainter* p, const QColor& bg, int colu } else { - QFont font( p->font() ); + TQFont font( p->font() ); font.setBold( false ); p->setFont( font ); // p->setPen( Qt::black ); @@ -688,9 +688,9 @@ void KompareListViewLineItem::paintText( QPainter* p, const QColor& bg, int colu { // 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( QChar('\t'), kompareListView()->spaces() ); + textChunk.replace( TQChar('\t'), kompareListView()->spaces() ); // kdDebug(8104) << "TextChunk = \"" << textChunk << "\"" << endl; - QFont font( p->font() ); + TQFont font( p->font() ); font.setBold( false ); p->setFont( font ); chunkWidth = p->fontMetrics().width( textChunk ); @@ -728,11 +728,11 @@ void KompareListViewBlankLineItem::setup() setHeight( BLANK_LINE_HEIGHT ); } -void KompareListViewBlankLineItem::paintText( QPainter* p, const QColor& bg, int column, int width, int ) +void KompareListViewBlankLineItem::paintText( TQPainter* p, const TQColor& bg, int column, int width, int ) { if ( column == COL_MAIN ) { - QBrush normalBrush( bg, SolidPattern ); + TQBrush normalBrush( bg, SolidPattern ); p->fillRect( 0, 0, width, height(), normalBrush ); } } @@ -771,7 +771,7 @@ void KompareListViewHunkItem::setup() setHeight( maxHeight() ); } -void KompareListViewHunkItem::paintCell( QPainter * p, const QColorGroup & cg, int column, int width, int align ) +void KompareListViewHunkItem::paintCell( TQPainter * p, const TQColorGroup & cg, int column, int width, int align ) { p->fillRect( 0, 0, width, height(), cg.mid() ); if( column == COL_MAIN ) { |