diff options
Diffstat (limited to 'knode/headerview.cpp')
-rw-r--r-- | knode/headerview.cpp | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/knode/headerview.cpp b/knode/headerview.cpp index aef02f13a..ede75bb66 100644 --- a/knode/headerview.cpp +++ b/knode/headerview.cpp @@ -12,10 +12,10 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US */ -#include <qcursor.h> -#include <qheader.h> -#include <qstylesheet.h> -#include <qtimer.h> +#include <tqcursor.h> +#include <tqheader.h> +#include <tqstylesheet.h> +#include <tqtimer.h> #include <klocale.h> #include <kdebug.h> @@ -32,7 +32,7 @@ #include "knmainwidget.h" -KNHeaderView::KNHeaderView(QWidget *parent, const char *name) : +KNHeaderView::KNHeaderView(TQWidget *parent, const char *name) : KListView(parent,name), mSortCol( -1 ), mSortAsc( true ), @@ -55,7 +55,7 @@ KNHeaderView::KNHeaderView(QWidget *parent, const char *name) : setAcceptDrops( false ); setDragEnabled( true ); setAllColumnsShowFocus( true ); - setSelectionMode( QListView::Extended ); + setSelectionMode( TQListView::Extended ); setShowSortIndicator( true ); setShadeSortColumn ( true ); setRootIsDecorated( true ); @@ -65,9 +65,9 @@ KNHeaderView::KNHeaderView(QWidget *parent, const char *name) : setColumnAlignment( mPaintInfo.scoreCol, Qt::AlignRight ); // due to our own column text squeezing we need to repaint on column resizing - disconnect( header(), SIGNAL(sizeChange(int, int, int)) ); - connect( header(), SIGNAL(sizeChange(int, int, int)), - SLOT(slotSizeChanged(int, int, int)) ); + disconnect( header(), TQT_SIGNAL(sizeChange(int, int, int)) ); + connect( header(), TQT_SIGNAL(sizeChange(int, int, int)), + TQT_SLOT(slotSizeChanged(int, int, int)) ); // column selection RMB menu mPopup = new KPopupMenu( this ); @@ -76,11 +76,11 @@ KNHeaderView::KNHeaderView(QWidget *parent, const char *name) : mPopup->insertItem( i18n("Line Count"), KPaintInfo::COL_SIZE ); mPopup->insertItem( i18n("Score"), KPaintInfo::COL_SCORE ); - connect( mPopup, SIGNAL(activated(int)), this, SLOT(toggleColumn(int)) ); + connect( mPopup, TQT_SIGNAL(activated(int)), this, TQT_SLOT(toggleColumn(int)) ); // connect to the article manager - connect( knGlobals.articleManager(), SIGNAL(aboutToShowGroup()), SLOT(prepareForGroup()) ); - connect( knGlobals.articleManager(), SIGNAL(aboutToShowFolder()), SLOT(prepareForFolder()) ); + connect( knGlobals.articleManager(), TQT_SIGNAL(aboutToShowGroup()), TQT_SLOT(prepareForGroup()) ); + connect( knGlobals.articleManager(), TQT_SIGNAL(aboutToShowFolder()), TQT_SLOT(prepareForFolder()) ); new KNHeaderViewToolTip( this ); @@ -114,9 +114,9 @@ void KNHeaderView::readConfig() mDateFormatter.setFormat( rngConf->dateFormat() ); KNConfig::Appearance *app = knGlobals.configManager()->appearance(); - QPalette p = palette(); - p.setColor( QColorGroup::Base, app->backgroundColor() ); - p.setColor( QColorGroup::Text, app->textColor() ); + TQPalette p = palette(); + p.setColor( TQColorGroup::Base, app->backgroundColor() ); + p.setColor( TQColorGroup::Text, app->textColor() ); setPalette( p ); setAlternateBackground( app->alternateBackgroundColor() ); setFont( app->articleListFont() ); @@ -137,7 +137,7 @@ void KNHeaderView::writeConfig() } -void KNHeaderView::setActive( QListViewItem *i ) +void KNHeaderView::setActive( TQListViewItem *i ) { KNHdrViewItem *item = static_cast<KNHdrViewItem*>( i ); @@ -162,16 +162,16 @@ void KNHeaderView::setActive( QListViewItem *i ) void KNHeaderView::clear() { mActiveItem = 0; - QListView::clear(); + TQListView::clear(); } -void KNHeaderView::ensureItemVisibleWithMargin( const QListViewItem *i ) +void KNHeaderView::ensureItemVisibleWithMargin( const TQListViewItem *i ) { if ( !i ) return; - QListViewItem *parent = i->parent(); + TQListViewItem *parent = i->parent(); while ( parent ) { if ( !parent->isOpen() ) parent->setOpen( true ); @@ -188,7 +188,7 @@ void KNHeaderView::ensureItemVisibleWithMargin( const QListViewItem *i ) { ensureVisible( contentsX(), y + h/2, 0, h/2 ); mDelayedCenter = y + h/2; - QTimer::singleShot( 300, this, SLOT(slotCenterDelayed()) ); + TQTimer::singleShot( 300, this, TQT_SLOT(slotCenterDelayed()) ); } else { ensureVisible( contentsX(), y + h/2, 0, h/2 ); } @@ -267,7 +267,7 @@ void KNHeaderView::prevArticle() void KNHeaderView::incCurrentArticle() { - QListViewItem *lvi = currentItem(); + TQListViewItem *lvi = currentItem(); if ( lvi && lvi->isExpandable() ) lvi->setOpen( true ); if ( lvi && lvi->itemBelow() ) { @@ -279,7 +279,7 @@ void KNHeaderView::incCurrentArticle() void KNHeaderView::decCurrentArticle() { - QListViewItem *lvi = currentItem(); + TQListViewItem *lvi = currentItem(); if ( lvi && lvi->itemAbove() ) { if ( lvi->itemAbove()->isExpandable() ) lvi->itemAbove()->setOpen( true ); @@ -451,24 +451,24 @@ void KNHeaderView::prepareForFolder() } -bool KNHeaderView::event( QEvent *e ) +bool KNHeaderView::event( TQEvent *e ) { // we don't want to have the alternate list background restored // to the system defaults! - if (e->type() == QEvent::ApplicationPaletteChange) - return QListView::event(e); + if (e->type() == TQEvent::ApplicationPaletteChange) + return TQListView::event(e); else return KListView::event(e); } -void KNHeaderView::contentsMousePressEvent( QMouseEvent *e ) +void KNHeaderView::contentsMousePressEvent( TQMouseEvent *e ) { if (!e) return; bool selectMode=(( e->state() & ShiftButton ) || ( e->state() & ControlButton )); - QPoint vp = contentsToViewport(e->pos()); - QListViewItem *i = itemAt(vp); + TQPoint vp = contentsToViewport(e->pos()); + TQListViewItem *i = itemAt(vp); KListView::contentsMousePressEvent( e ); @@ -485,11 +485,11 @@ void KNHeaderView::contentsMousePressEvent( QMouseEvent *e ) } -void KNHeaderView::contentsMouseDoubleClickEvent( QMouseEvent *e ) +void KNHeaderView::contentsMouseDoubleClickEvent( TQMouseEvent *e ) { if (!e) return; - QListViewItem *i = itemAt( contentsToViewport(e->pos()) ); + TQListViewItem *i = itemAt( contentsToViewport(e->pos()) ); if (i) { emit doubleClick( i ); return; @@ -499,11 +499,11 @@ void KNHeaderView::contentsMouseDoubleClickEvent( QMouseEvent *e ) } -void KNHeaderView::keyPressEvent(QKeyEvent *e) +void KNHeaderView::keyPressEvent(TQKeyEvent *e) { if (!e) return; - QListViewItem *i = currentItem(); + TQListViewItem *i = currentItem(); switch(e->key()) { case Key_Space: @@ -522,9 +522,9 @@ void KNHeaderView::keyPressEvent(QKeyEvent *e) } -QDragObject* KNHeaderView::dragObject() +TQDragObject* KNHeaderView::dragObject() { - KNHdrViewItem *item = static_cast<KNHdrViewItem*>( itemAt(viewport()->mapFromGlobal(QCursor::pos())) ); + KNHdrViewItem *item = static_cast<KNHdrViewItem*>( itemAt(viewport()->mapFromGlobal(TQCursor::pos())) ); if (item) return item->dragObject(); else @@ -538,20 +538,20 @@ void KNHeaderView::slotSizeChanged( int section, int, int newSize ) } -bool KNHeaderView::eventFilter(QObject *o, QEvent *e) +bool KNHeaderView::eventFilter(TQObject *o, TQEvent *e) { - if ((e->type() == QEvent::KeyPress) && (static_cast<QKeyEvent*>(e)->key() == Key_Tab)) { + if ((e->type() == TQEvent::KeyPress) && (static_cast<TQKeyEvent*>(e)->key() == Key_Tab)) { emit(focusChangeRequest(this)); if (!hasFocus()) // focusChangeRequest was successful return true; } // right click on header - if ( e->type() == QEvent::MouseButtonPress && - static_cast<QMouseEvent*>(e)->button() == RightButton && - o->isA("QHeader") ) + if ( e->type() == TQEvent::MouseButtonPress && + static_cast<TQMouseEvent*>(e)->button() == RightButton && + o->isA("TQHeader") ) { - mPopup->popup( static_cast<QMouseEvent*>(e)->globalPos() ); + mPopup->popup( static_cast<TQMouseEvent*>(e)->globalPos() ); return true; } @@ -559,16 +559,16 @@ bool KNHeaderView::eventFilter(QObject *o, QEvent *e) } -void KNHeaderView::focusInEvent(QFocusEvent *e) +void KNHeaderView::focusInEvent(TQFocusEvent *e) { - QListView::focusInEvent(e); + TQListView::focusInEvent(e); emit focusChanged(e); } -void KNHeaderView::focusOutEvent(QFocusEvent *e) +void KNHeaderView::focusOutEvent(TQFocusEvent *e) { - QListView::focusOutEvent(e); + TQListView::focusOutEvent(e); emit focusChanged(e); } @@ -576,20 +576,20 @@ void KNHeaderView::focusOutEvent(QFocusEvent *e) void KNHeaderView::resetCurrentTime() { mDateFormatter.reset(); - QTimer::singleShot( 1000, this, SLOT(resetCurrentTime()) ); + TQTimer::singleShot( 1000, this, TQT_SLOT(resetCurrentTime()) ); } //BEGIN: KNHeaderViewToolTip ================================================== KNHeaderViewToolTip::KNHeaderViewToolTip( KNHeaderView *parent ) : - QToolTip( parent->viewport() ), + TQToolTip( parent->viewport() ), listView( parent ) { } -void KNHeaderViewToolTip::maybeTip( const QPoint &p ) +void KNHeaderViewToolTip::maybeTip( const TQPoint &p ) { const KNHdrViewItem *item = static_cast<KNHdrViewItem*>( listView->itemAt( p ) ); if ( !item ) @@ -601,15 +601,15 @@ void KNHeaderViewToolTip::maybeTip( const QPoint &p ) if ( !item->showToolTip( column ) ) return; - const QRect itemRect = listView->itemRect( item ); + const TQRect itemRect = listView->itemRect( item ); if ( !itemRect.isValid() ) return; - const QRect headerRect = listView->header()->sectionRect( column ); + const TQRect headerRect = listView->header()->sectionRect( column ); if ( !headerRect.isValid() ) return; - tip( QRect( headerRect.left(), itemRect.top(), headerRect.width(), itemRect.height() ), - QStyleSheet::escape( item->text( column ) ) ); + tip( TQRect( headerRect.left(), itemRect.top(), headerRect.width(), itemRect.height() ), + TQStyleSheet::escape( item->text( column ) ) ); } //END: KNHeaderViewToolTip ==================================================== |