diff options
Diffstat (limited to 'kompare/komparepart/komparesplitter.cpp')
-rw-r--r-- | kompare/komparepart/komparesplitter.cpp | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/kompare/komparepart/komparesplitter.cpp b/kompare/komparepart/komparesplitter.cpp index fcf014cb..59106ffb 100644 --- a/kompare/komparepart/komparesplitter.cpp +++ b/kompare/komparepart/komparesplitter.cpp @@ -17,9 +17,9 @@ #include "komparesplitter.h" -#include <qstyle.h> -#include <qstring.h> -#include <qtimer.h> +#include <tqstyle.h> +#include <tqstring.h> +#include <tqtimer.h> #include <kdebug.h> #include <kapplication.h> @@ -34,21 +34,21 @@ using namespace Diff2; -KompareSplitter::KompareSplitter( ViewSettings *settings, QWidget * parent, +KompareSplitter::KompareSplitter( ViewSettings *settings, TQWidget * parent, const char *name) : - QSplitter( Horizontal, parent, name ), + TQSplitter( Horizontal, parent, name ), m_settings( settings ) { - QFrame *scrollFrame = new QFrame( parent, "scrollFrame" ); - reparent( scrollFrame, *(new QPoint()), false ); + TQFrame *scrollFrame = new TQFrame( parent, "scrollFrame" ); + reparent( scrollFrame, *(new TQPoint()), false ); // Set up the scrollFrame - scrollFrame->setFrameStyle( QFrame::NoFrame | QFrame::Plain ); - scrollFrame->setLineWidth(scrollFrame->style().pixelMetric(QStyle::PM_DefaultFrameWidth)); - QGridLayout *pairlayout = new QGridLayout(scrollFrame, 2, 2, 0); - m_vScroll = new QScrollBar( QScrollBar::Vertical, 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 QScrollBar( QScrollBar::Horizontal, scrollFrame ); + m_hScroll = new TQScrollBar( TQScrollBar::Horizontal, scrollFrame ); pairlayout->addWidget( m_hScroll, 1, 0 ); new KompareListViewFrame(true, m_settings, this, "source"); @@ -56,33 +56,33 @@ KompareSplitter::KompareSplitter( ViewSettings *settings, QWidget * parent, pairlayout->addWidget( this, 0, 0 ); // set up our looks - setFrameStyle( QFrame::StyledPanel | QFrame::Sunken ); - setLineWidth( style().pixelMetric( QStyle::PM_DefaultFrameWidth ) ); + setFrameStyle( TQFrame::StyledPanel | TQFrame::Sunken ); + setLineWidth( style().pixelMetric( TQStyle::PM_DefaultFrameWidth ) ); setHandleWidth(50); setChildrenCollapsible( false ); - setFrameStyle( QFrame::NoFrame ); - setSizePolicy( QSizePolicy (QSizePolicy::Ignored, QSizePolicy::Ignored )); + setFrameStyle( TQFrame::NoFrame ); + setSizePolicy( TQSizePolicy (TQSizePolicy::Ignored, TQSizePolicy::Ignored )); setOpaqueResize( true ); - setFocusPolicy( QWidget::WheelFocus ); + setFocusPolicy( TQWidget::WheelFocus ); - connect( this, SIGNAL(configChanged()), SLOT(slotConfigChanged()) ); - connect( this, SIGNAL(configChanged()), SLOT(slotDelayedRepaintHandles()) ); - connect( this, SIGNAL(configChanged()), SLOT(slotDelayedUpdateScrollBars()) ); + connect( this, TQT_SIGNAL(configChanged()), TQT_SLOT(slotConfigChanged()) ); + connect( this, TQT_SIGNAL(configChanged()), TQT_SLOT(slotDelayedRepaintHandles()) ); + connect( this, TQT_SIGNAL(configChanged()), TQT_SLOT(slotDelayedUpdateScrollBars()) ); // scrolling - connect( m_vScroll, SIGNAL(valueChanged(int)), SLOT(scrollToId(int)) ); - connect( m_vScroll, SIGNAL(sliderMoved(int)), SLOT(scrollToId(int)) ); - connect( m_hScroll, SIGNAL(valueChanged(int)), SIGNAL(setXOffset(int)) ); - connect( m_hScroll, SIGNAL(sliderMoved(int)), SIGNAL(setXOffset(int)) ); + connect( m_vScroll, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(scrollToId(int)) ); + connect( m_vScroll, TQT_SIGNAL(sliderMoved(int)), TQT_SLOT(scrollToId(int)) ); + connect( m_hScroll, TQT_SIGNAL(valueChanged(int)), TQT_SIGNAL(setXOffset(int)) ); + connect( m_hScroll, TQT_SIGNAL(sliderMoved(int)), TQT_SIGNAL(setXOffset(int)) ); - m_scrollTimer=new QTimer(); + m_scrollTimer=new TQTimer(); restartTimer = false; - connect (m_scrollTimer, SIGNAL(timeout()), SLOT(timerTimeout()) ); + connect (m_scrollTimer, TQT_SIGNAL(timeout()), TQT_SLOT(timerTimeout()) ); // we need to receive childEvents now so that d->list is ready for when // slotSetSelection(...) arrives - kapp->sendPostedEvents(this, QEvent::ChildInserted); + kapp->sendPostedEvents(this, TQEvent::ChildInserted); // init stuff slotUpdateScrollBars(); @@ -111,7 +111,7 @@ QSplitterLayoutStruct *KompareSplitter::addWidget( KompareListViewFrame *w, bool if ( d->list.count() > 0 ) { s = new QSplitterLayoutStruct; s->resizeMode = KeepSize; - QString tmp = "qt_splithandle_"; + TQString tmp = "qt_splithandle_"; tmp += w->name(); KompareListView *lw = ((KompareListViewFrame*)(prepend?w:d->list.last()->wid))->view(); @@ -144,13 +144,13 @@ QSplitterLayoutStruct *KompareSplitter::addWidget( KompareListViewFrame *w, bool been inserted or removed. */ -void KompareSplitter::childEvent( QChildEvent *c ) +void KompareSplitter::childEvent( TQChildEvent *c ) { - if ( c->type() == QEvent::ChildInserted ) { + if ( c->type() == TQEvent::ChildInserted ) { if ( !c->child()->isWidgetType() ) return; - if ( ((QWidget*)c->child())->testWFlags( WType_TopLevel ) ) + if ( ((TQWidget*)c->child())->testWFlags( WType_TopLevel ) ) return; QSplitterLayoutStruct *s = d->list.first(); @@ -161,7 +161,7 @@ void KompareSplitter::childEvent( QChildEvent *c ) } addWidget( (KompareListViewFrame*)c->child() ); recalc( isVisible() ); - } else if ( c->type() == QEvent::ChildRemoved ) { + } else if ( c->type() == TQEvent::ChildRemoved ) { QSplitterLayoutStruct *prev = 0; if ( d->list.count() > 1 ) prev = d->list.at( 1 ); // yes, this is correct @@ -170,7 +170,7 @@ void KompareSplitter::childEvent( QChildEvent *c ) if ( curr->wid == c->child() ) { d->list.removeRef( curr ); if ( prev && prev->isHandle ) { - QWidget *w = prev->wid; + TQWidget *w = prev->wid; d->list.removeRef( prev ); delete w; // will call childEvent() } @@ -185,20 +185,20 @@ void KompareSplitter::childEvent( QChildEvent *c ) } // This is from a private qt header (kernel/qlayoutengine_p.h). sorry. -QSize qSmartMinSize( QWidget *w ); +TQSize qSmartMinSize( TQWidget *w ); -static QPoint toggle( QWidget *w, QPoint pos ) +static TQPoint toggle( TQWidget *w, TQPoint pos ) { - QSize minS = qSmartMinSize( w ); - return -pos - QPoint( minS.width(), minS.height() ); + TQSize minS = qSmartMinSize( w ); + return -pos - TQPoint( minS.width(), minS.height() ); } -static bool isCollapsed( QWidget *w ) +static bool isCollapsed( TQWidget *w ) { return w->x() < 0 || w->y() < 0; } -static QPoint topLeft( QWidget *w ) +static TQPoint topLeft( TQWidget *w ) { if ( isCollapsed(w) ) { return toggle( w, w->pos() ); @@ -207,10 +207,10 @@ static QPoint topLeft( QWidget *w ) } } -static QPoint bottomRight( QWidget *w ) +static TQPoint bottomRight( TQWidget *w ) { if ( isCollapsed(w) ) { - return toggle( w, w->pos() ) - QPoint( 1, 1 ); + return toggle( w, w->pos() ) - TQPoint( 1, 1 ); } else { return w->geometry().bottomRight(); } @@ -227,9 +227,9 @@ void KompareSplitter::moveSplitter( QCOORD p, int id ) int oldP = pick( s->wid->pos() ); int* poss = new int[d->list.count()]; int* ws = new int[d->list.count()]; - QWidget *w = 0; + TQWidget *w = 0; bool upLeft; - if ( QApplication::reverseLayout() && orient == Horizontal ) { + if ( TQApplication::reverseLayout() && orient == 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 ); @@ -260,7 +260,7 @@ void KompareSplitter::doMove( bool backwards, int pos, int id, int delta, bool mayCollapse, int* positions, int* widths ) { QSplitterLayoutStruct *s; - QWidget *w; + TQWidget *w; for ( ; id >= 0 && id < (int)d->list.count(); id = backwards ? id - delta : id + delta ) { s = d->list.at( id ); @@ -405,7 +405,7 @@ void KompareSplitter::repaintHandles() * FIXME: i'm a nasty hack */ -void KompareSplitter::wheelEvent( QWheelEvent* e ) +void KompareSplitter::wheelEvent( TQWheelEvent* e ) { // scroll lines... if ( e->orientation() == Qt::Vertical ) @@ -438,7 +438,7 @@ void KompareSplitter::wheelEvent( QWheelEvent* e ) repaintHandles(); } -void KompareSplitter::keyPressEvent( QKeyEvent* e ) +void KompareSplitter::keyPressEvent( TQKeyEvent* e ) { //keyboard scrolling switch ( e->key() ) { @@ -502,7 +502,7 @@ void KompareSplitter::scrollToId( int id ) void KompareSplitter::slotDelayedUpdateScrollBars() { - QTimer::singleShot( 0, this, SLOT( slotUpdateScrollBars() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( slotUpdateScrollBars() ) ); } void KompareSplitter::slotUpdateScrollBars() @@ -543,7 +543,7 @@ void KompareSplitter::slotUpdateScrollBars() void KompareSplitter::slotDelayedUpdateVScrollValue() { - QTimer::singleShot( 0, this, SLOT( slotUpdateVScrollValue() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( slotUpdateVScrollValue() ) ); } void KompareSplitter::slotUpdateVScrollValue() @@ -582,7 +582,7 @@ int KompareSplitter::pageSize() if ( !curr->isHandle ) { KompareListView *view = ((KompareListViewFrame*) curr->wid)->view(); - return view->visibleHeight() - QStyle::PM_ScrollBarExtent; + return view->visibleHeight() - TQStyle::PM_ScrollBarExtent; } } return 1; |