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/komparesplitter.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/komparesplitter.cpp')
-rw-r--r-- | kompare/komparepart/komparesplitter.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/kompare/komparepart/komparesplitter.cpp b/kompare/komparepart/komparesplitter.cpp index 59106ffb..e962730a 100644 --- a/kompare/komparepart/komparesplitter.cpp +++ b/kompare/komparepart/komparesplitter.cpp @@ -34,37 +34,37 @@ using namespace Diff2; -KompareSplitter::KompareSplitter( ViewSettings *settings, TQWidget * parent, +KompareSplitter::KompareSplitter( ViewSettings *settings, TQWidget * tqparent, const char *name) : - TQSplitter( Horizontal, parent, name ), + QSplitter(Qt::Horizontal, tqparent, name ), m_settings( settings ) { - TQFrame *scrollFrame = new TQFrame( parent, "scrollFrame" ); + TQFrame *scrollFrame = new TQFrame( tqparent, "scrollFrame" ); reparent( scrollFrame, *(new TQPoint()), false ); // Set up the scrollFrame scrollFrame->setFrameStyle( TQFrame::NoFrame | TQFrame::Plain ); - scrollFrame->setLineWidth(scrollFrame->style().pixelMetric(TQStyle::PM_DefaultFrameWidth)); - TQGridLayout *pairlayout = new TQGridLayout(scrollFrame, 2, 2, 0); - m_vScroll = new TQScrollBar( TQScrollBar::Vertical, scrollFrame ); - pairlayout->addWidget( m_vScroll, 0, 1 ); - m_hScroll = new TQScrollBar( TQScrollBar::Horizontal, scrollFrame ); - pairlayout->addWidget( m_hScroll, 1, 0 ); + scrollFrame->setLineWidth(scrollFrame->tqstyle().tqpixelMetric(TQStyle::PM_DefaultFrameWidth)); + TQGridLayout *pairtqlayout = new TQGridLayout(scrollFrame, 2, 2, 0); + m_vScroll = new TQScrollBar( Qt::Vertical, scrollFrame ); + pairtqlayout->addWidget( m_vScroll, 0, 1 ); + m_hScroll = new TQScrollBar( Qt::Horizontal, scrollFrame ); + pairtqlayout->addWidget( m_hScroll, 1, 0 ); new KompareListViewFrame(true, m_settings, this, "source"); new KompareListViewFrame(false, m_settings, this, "destination"); - pairlayout->addWidget( this, 0, 0 ); + pairtqlayout->addWidget( this, 0, 0 ); // set up our looks setFrameStyle( TQFrame::StyledPanel | TQFrame::Sunken ); - setLineWidth( style().pixelMetric( TQStyle::PM_DefaultFrameWidth ) ); + setLineWidth( tqstyle().tqpixelMetric( TQStyle::PM_DefaultFrameWidth ) ); setHandleWidth(50); setChildrenCollapsible( false ); setFrameStyle( TQFrame::NoFrame ); - setSizePolicy( TQSizePolicy (TQSizePolicy::Ignored, TQSizePolicy::Ignored )); + tqsetSizePolicy( TQSizePolicy (TQSizePolicy::Ignored, TQSizePolicy::Ignored )); setOpaqueResize( true ); - setFocusPolicy( TQWidget::WheelFocus ); + setFocusPolicy( TQ_WheelFocus ); connect( this, TQT_SIGNAL(configChanged()), TQT_SLOT(slotConfigChanged()) ); connect( this, TQT_SIGNAL(configChanged()), TQT_SLOT(slotDelayedRepaintHandles()) ); @@ -121,7 +121,7 @@ QSplitterLayoutStruct *KompareSplitter::addWidget( KompareListViewFrame *w, bool s->wid = newHandle; newHandle->setId( d->list.count() ); s->isHandle = TRUE; - s->sizer = pick( newHandle->sizeHint() ); + s->sizer = pick( newHandle->tqsizeHint() ); if ( prepend ) d->list.prepend( s ); else @@ -184,7 +184,7 @@ void KompareSplitter::childEvent( TQChildEvent *c ) } } -// This is from a private qt header (kernel/qlayoutengine_p.h). sorry. +// This is from a private qt header (kernel/qtqlayoutengine_p.h). sorry. TQSize qSmartMinSize( TQWidget *w ); static TQPoint toggle( TQWidget *w, TQPoint pos ) @@ -212,11 +212,11 @@ static TQPoint bottomRight( TQWidget *w ) if ( isCollapsed(w) ) { return toggle( w, w->pos() ) - TQPoint( 1, 1 ); } else { - return w->geometry().bottomRight(); + return w->tqgeometry().bottomRight(); } } -void KompareSplitter::moveSplitter( QCOORD p, int id ) +void KompareSplitter::moveSplitter( TQCOORD p, int id ) { QSplitterLayoutStruct *s = d->list.at( id ); int farMin; @@ -229,7 +229,7 @@ void KompareSplitter::moveSplitter( QCOORD p, int id ) int* ws = new int[d->list.count()]; TQWidget *w = 0; bool upLeft; - if ( TQApplication::reverseLayout() && orient == Horizontal ) { + if ( TQApplication::reverseLayout() && orient ==Qt::Horizontal ) { int q = p + s->wid->width(); doMove( FALSE, q, id - 1, -1, (p > max), poss, ws ); doMove( TRUE, q, id, -1, (p < min), poss, ws ); @@ -278,8 +278,8 @@ void KompareSplitter::doMove( bool backwards, int pos, int id, int delta, int dd = backwards ? pos - pick( topLeft(w) ) : pick( bottomRight(w) ) - pos + 1; if ( dd > 0 || (!isCollapsed(w) && !mayCollapse) ) { - dd = QMAX( pick(qSmartMinSize(w)), - QMIN(dd, pick(w->maximumSize())) ); + dd = TQMAX( pick(qSmartMinSize(w)), + TQMIN(dd, pick(w->tqmaximumSize())) ); } else { dd = 0; } @@ -391,12 +391,12 @@ void KompareSplitter::slotDelayedRepaintHandles() ((KompareConnectWidgetFrame*)curr->wid)->wid()->slotDelayedRepaint(); } -void KompareSplitter::repaintHandles() +void KompareSplitter::tqrepaintHandles() { QSplitterLayoutStruct *curr; for ( curr = d->list.first(); curr; curr = d->list.next() ) if ( curr->isHandle ) - ((KompareConnectWidgetFrame*)curr->wid)->wid()->repaint(); + ((KompareConnectWidgetFrame*)curr->wid)->wid()->tqrepaint(); } // Scrolling stuff @@ -410,7 +410,7 @@ void KompareSplitter::wheelEvent( TQWheelEvent* e ) // scroll lines... if ( e->orientation() == Qt::Vertical ) { - if ( e->state() & Qt::ControlButton ) + if ( e->state() & TQt::ControlButton ) if ( e->delta() < 0 ) // scroll down one page m_vScroll->addPage(); else // scroll up one page @@ -423,7 +423,7 @@ void KompareSplitter::wheelEvent( TQWheelEvent* e ) } else { - if ( e->state() & Qt::ControlButton ) + if ( e->state() & TQt::ControlButton ) if ( e->delta() < 0 ) // scroll right one page m_hScroll->addPage(); else // scroll left one page @@ -435,7 +435,7 @@ void KompareSplitter::wheelEvent( TQWheelEvent* e ) m_hScroll->subtractLine(); } e->accept(); - repaintHandles(); + tqrepaintHandles(); } void KompareSplitter::keyPressEvent( TQKeyEvent* e ) @@ -466,7 +466,7 @@ void KompareSplitter::keyPressEvent( TQKeyEvent* e ) break; } e->accept(); - repaintHandles(); + tqrepaintHandles(); } void KompareSplitter::timerTimeout() |