diff options
Diffstat (limited to 'kpresenter/KPrSideBar.cpp')
-rw-r--r-- | kpresenter/KPrSideBar.cpp | 294 |
1 files changed, 147 insertions, 147 deletions
diff --git a/kpresenter/KPrSideBar.cpp b/kpresenter/KPrSideBar.cpp index 281c7929c..51db3f4eb 100644 --- a/kpresenter/KPrSideBar.cpp +++ b/kpresenter/KPrSideBar.cpp @@ -22,12 +22,12 @@ * Boston, MA 02110-1301, USA. */ -#include <qheader.h> -#include <qtimer.h> -#include <qpopupmenu.h> -#include <qimage.h> -#include <qtabwidget.h> -#include <qtooltip.h> +#include <tqheader.h> +#include <tqtimer.h> +#include <tqpopupmenu.h> +#include <tqimage.h> +#include <tqtabwidget.h> +#include <tqtooltip.h> #include <kwordwrap.h> #include <kmessagebox.h> @@ -43,9 +43,9 @@ #include "KPrCanvas.h" #include "KPrPage.h" #include "KPrObject.h" -#include <qapplication.h> +#include <tqapplication.h> #include "KPrCommand.h" -#include <qvalidator.h> +#include <tqvalidator.h> #include "KPrFreehandObject.h" #include "KPrBezierCurveObject.h" #include "KPrTextObject.h" @@ -54,31 +54,31 @@ #include "KPrGroupObject.h" -QValidator::State KPrRenamePageValidator::validate( QString & input, int& ) const +TQValidator::State KPrRenamePageValidator::validate( TQString & input, int& ) const { - QString str = input.stripWhiteSpace(); + TQString str = input.stripWhiteSpace(); if ( str.isEmpty() ) // we want to allow empty titles. Empty == automatic. return Acceptable; - if ( mStringList.find( str ) == mStringList.end() ) + if ( mStringList.tqfind( str ) == mStringList.end() ) return Acceptable; else return Intermediate; } -class ThumbToolTip : public QToolTip +class ThumbToolTip : public TQToolTip { public: - ThumbToolTip( KPrThumbBar *parent ) - : QToolTip( parent->viewport() ) - , m_thumbBar( parent ) + ThumbToolTip( KPrThumbBar *tqparent ) + : TQToolTip( tqparent->viewport() ) + , m_thumbBar( tqparent ) {} protected: - void maybeTip(const QPoint &pos) + void maybeTip(const TQPoint &pos) { - QString title; - QRect r( m_thumbBar->tip( pos, title ) ); + TQString title; + TQRect r( m_thumbBar->tip( pos, title ) ); if (!r.isValid()) return; @@ -92,8 +92,8 @@ private: class OutlineSlideItem: public KListViewItem { public: - OutlineSlideItem( KListView * parent, KPrPage* page, bool _masterPage ); - OutlineSlideItem( KListView * parent, OutlineSlideItem *after, KPrPage* page, bool _masterPage ); + OutlineSlideItem( KListView * tqparent, KPrPage* page, bool _masterPage ); + OutlineSlideItem( KListView * tqparent, OutlineSlideItem *after, KPrPage* page, bool _masterPage ); KPrPage* page() const { return m_page; } @@ -110,8 +110,8 @@ private: class OutlineObjectItem: public KListViewItem { public: - OutlineObjectItem( OutlineSlideItem * parent, KPrObject* object, - const QString& name = QString::null ); + OutlineObjectItem( OutlineSlideItem * tqparent, KPrObject* object, + const TQString& name = TQString() ); KPrObject* object() const { return m_object; } @@ -121,14 +121,14 @@ private: KPrObject* m_object; }; -class ThumbItem : public QIconViewItem +class ThumbItem : public TQIconViewItem { public: - ThumbItem( QIconView *parent, const QString & text, const QPixmap & icon ) - : QIconViewItem( parent, text, icon ) + ThumbItem( TQIconView *tqparent, const TQString & text, const TQPixmap & icon ) + : TQIconViewItem( tqparent, text, icon ) { uptodate = true; } - ThumbItem( QIconView *parent, QIconViewItem *after, const QString & text, const QPixmap & icon ) - : QIconViewItem( parent, after, text, icon ) + ThumbItem( TQIconView *tqparent, TQIconViewItem *after, const TQString & text, const TQPixmap & icon ) + : TQIconViewItem( tqparent, after, text, icon ) { uptodate = true; } virtual bool isUptodate() { return uptodate; }; @@ -138,11 +138,11 @@ private: bool uptodate; }; -KPrSideBar::KPrSideBar(QWidget *parent, KPrDocument *d, KPrView *v) - :QTabWidget(parent), m_doc(d), m_view(v) +KPrSideBar::KPrSideBar(TQWidget *tqparent, KPrDocument *d, KPrView *v) + :TQTabWidget(tqparent), m_doc(d), m_view(v) { - setTabPosition(QTabWidget::Top); - setTabShape(QTabWidget::Triangular); + setTabPosition(TQTabWidget::Top); + setTabShape(TQTabWidget::Triangular); m_outline = new KPrOutline(this, m_doc, m_view); addTab(m_outline, i18n("Structure of the presentation", "Outline")); @@ -152,24 +152,24 @@ KPrSideBar::KPrSideBar(QWidget *parent, KPrDocument *d, KPrView *v) //TODO find a better way - connect(m_outline, SIGNAL(showPage(int)), - this, SIGNAL(showPage(int))); + connect(m_outline, TQT_SIGNAL(showPage(int)), + this, TQT_SIGNAL(showPage(int))); - connect(m_thb, SIGNAL(showPage(int)), - this, SIGNAL(showPage(int))); + connect(m_thb, TQT_SIGNAL(showPage(int)), + this, TQT_SIGNAL(showPage(int))); - connect(m_outline, SIGNAL(movePage(int,int)), - this, SIGNAL(movePage(int,int))); + connect(m_outline, TQT_SIGNAL(movePage(int,int)), + this, TQT_SIGNAL(movePage(int,int))); - connect(m_outline, SIGNAL(selectPage(int,bool)), - this, SIGNAL(selectPage(int,bool))); + connect(m_outline, TQT_SIGNAL(selectPage(int,bool)), + this, TQT_SIGNAL(selectPage(int,bool))); - connect(this, SIGNAL(currentChanged(QWidget *)), - this, SLOT(currentChanged(QWidget *))); + connect(this, TQT_SIGNAL(currentChanged(TQWidget *)), + this, TQT_SLOT(currentChanged(TQWidget *))); } -void KPrSideBar::currentChanged(QWidget *tab) +void KPrSideBar::currentChanged(TQWidget *tab) { if (tab == m_thb) { if (!m_thb->uptodate && m_thb->isVisible()) @@ -208,7 +208,7 @@ void KPrSideBar::updateItem( KPrPage *page ) } else { - pos = m_doc->pageList().findRef( page ); + pos = m_doc->pageList().tqfindRef( page ); } m_outline->updateItem( pos, sticky ); @@ -233,25 +233,25 @@ void KPrSideBarBase::setViewMasterPage( bool _b ) m_viewMasterPage = _b; } -KPrThumbBar::KPrThumbBar(QWidget *parent, KPrDocument *d, KPrView *v) - :KIconView(parent), KPrSideBarBase( d,v) +KPrThumbBar::KPrThumbBar(TQWidget *tqparent, KPrDocument *d, KPrView *v) + :KIconView(tqparent), KPrSideBarBase( d,v) { uptodate = false; m_offsetX = 0; m_offsetY = 0; - setArrangement(QIconView::LeftToRight); + setArrangement(TQIconView::LeftToRight); setAutoArrange(true); setSorting(false); setItemsMovable(false); - setResizeMode(QIconView::Adjust); + setResizeMode(TQIconView::Adjust); m_thumbTip = new ThumbToolTip(this); - connect(this, SIGNAL(currentChanged(QIconViewItem *)), - this, SLOT(itemClicked(QIconViewItem *))); - connect(this, SIGNAL(contentsMoving(int, int)), - this, SLOT(slotContentsMoving(int, int))); + connect(this, TQT_SIGNAL(currentChanged(TQIconViewItem *)), + this, TQT_SLOT(itemClicked(TQIconViewItem *))); + connect(this, TQT_SIGNAL(contentsMoving(int, int)), + this, TQT_SLOT(slotContentsMoving(int, int))); } KPrThumbBar::~KPrThumbBar() @@ -261,7 +261,7 @@ KPrThumbBar::~KPrThumbBar() void KPrThumbBar::setCurrentPage( int pg ) { - for ( QIconViewItem *it = firstItem(); it; it = it->nextItem() ) + for ( TQIconViewItem *it = firstItem(); it; it = it->nextItem() ) { if ( it->text().toInt() - 1 == pg ) { blockSignals( true ); @@ -275,17 +275,17 @@ void KPrThumbBar::setCurrentPage( int pg ) } } -QRect KPrThumbBar::tip(const QPoint &pos, QString &title) +TQRect KPrThumbBar::tip(const TQPoint &pos, TQString &title) { - QIconViewItem *item = findItem(viewportToContents(pos)); + TQIconViewItem *item = tqfindItem(viewportToContents(pos)); if (!item) - return QRect(0, 0, -1, -1); + return TQRect(0, 0, -1, -1); int pagenr = item->index(); title = m_doc->pageList().at(pagenr)->pageTitle(); - QRect r = item->pixmapRect(FALSE); - r = QRect(contentsToViewport(QPoint(r.x(), r.y())), QSize(r.width(), r.height())); + TQRect r = item->pixmapRect(FALSE); + r = TQRect(contentsToViewport(TQPoint(r.x(), r.y())), TQSize(r.width(), r.height())); return r; } @@ -296,7 +296,7 @@ void KPrThumbBar::rebuildItems() return; kdDebug(33001) << "KPrThumbBar::rebuildItems" << endl; - QApplication::setOverrideCursor( Qt::waitCursor ); + TQApplication::setOverrideCursor( TQt::waitCursor ); clear(); if ( m_viewMasterPage ) @@ -306,7 +306,7 @@ void KPrThumbBar::rebuildItems() { for ( unsigned int i = 0; i < m_doc->getPageNums(); i++ ) { // calculate the size of the thumb - QRect rect = m_doc->pageList().at(i)->getZoomPageRect( ); + TQRect rect = m_doc->pageList().at(i)->getZoomPageRect( ); int w = rect.width(); int h = rect.height(); @@ -336,34 +336,34 @@ void KPrThumbBar::rebuildItems() } // draw an empty thumb - QPixmap pix(w, h); - pix.fill( Qt::white ); + TQPixmap pix(w, h); + pix.fill( TQt::white ); - QPainter p(&pix); - p.setPen(Qt::black); + TQPainter p(&pix); + p.setPen(TQt::black); p.drawRect(pix.rect()); - ThumbItem *item = new ThumbItem(static_cast<QIconView *>(this), QString::number(i+1), pix); + ThumbItem *item = new ThumbItem(static_cast<TQIconView *>(this), TQString::number(i+1), pix); item->setUptodate( false ); item->setDragEnabled(false); //no dragging for now } - QTimer::singleShot( 10, this, SLOT( slotRefreshItems() ) ); + TQTimer::singleShot( 10, this, TQT_SLOT( slotRefreshItems() ) ); } uptodate = true; - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } void KPrThumbBar::refreshItems(bool offset) { - QRect vRect = visibleRect(); + TQRect vRect = visibleRect(); if ( offset ) vRect.moveBy( m_offsetX, m_offsetY ); else vRect.moveBy( contentsX(), contentsY() ); - QIconViewItem *it = findFirstVisibleItem( vRect ); + TQIconViewItem *it = tqfindFirstVisibleItem( vRect ); while ( it ) { kdDebug(33001) << "visible page = " << it->text().toInt() << endl; @@ -373,7 +373,7 @@ void KPrThumbBar::refreshItems(bool offset) static_cast<ThumbItem *>(it)->setUptodate( true ); } - if ( it == findLastVisibleItem( vRect ) ) + if ( it == tqfindLastVisibleItem( vRect ) ) break; it = it->nextItem(); } @@ -390,14 +390,14 @@ void KPrThumbBar::updateItem( int pagenr /* 0-based */, bool sticky ) return; int pagecnt = 0; // calculate rect of visible objects - QRect vRect = visibleRect(); + TQRect vRect = visibleRect(); vRect.moveBy( contentsX(), contentsY() ); // Find icon - QIconViewItem *it = firstItem(); + TQIconViewItem *it = firstItem(); do { - if ( it == findFirstVisibleItem( vRect ) ) { + if ( it == tqfindFirstVisibleItem( vRect ) ) { do { if ( sticky || it->text().toInt() == pagenr + 1 ) { @@ -407,7 +407,7 @@ void KPrThumbBar::updateItem( int pagenr /* 0-based */, bool sticky ) if ( !sticky ) return; } - if ( it == findLastVisibleItem( vRect ) ) + if ( it == tqfindLastVisibleItem( vRect ) ) break; pagecnt++; it = it->nextItem(); @@ -431,24 +431,24 @@ void KPrThumbBar::addItem( int pos ) { kdDebug(33001)<< "KPrThumbBar::addItem" << endl; int page = 0; - for ( QIconViewItem *it = firstItem(); it; it = it->nextItem() ) { + for ( TQIconViewItem *it = firstItem(); it; it = it->nextItem() ) { // find page which should move // do stuff because a item can not be insert at the beginning if ( pos == 0 && page == pos ){ - ThumbItem *item = new ThumbItem(static_cast<QIconView *>(this), it, QString::number(2), getSlideThumb(1)); + ThumbItem *item = new ThumbItem(static_cast<TQIconView *>(this), it, TQString::number(2), getSlideThumb(1)); item->setDragEnabled(false); //no dragging for now it->setPixmap(getSlideThumb( 0 )); // move on to next item as we have inserted one it = it->nextItem(); } else if ( (page + 1) == pos ) { - ThumbItem *item = new ThumbItem(static_cast<QIconView *>(this), it, QString::number(pos+1), getSlideThumb(pos)); + ThumbItem *item = new ThumbItem(static_cast<TQIconView *>(this), it, TQString::number(pos+1), getSlideThumb(pos)); item->setDragEnabled(false); //no dragging for now it = it->nextItem(); } // update page numbers if ( page >= pos ) - it->setText( QString::number(page+2) ); + it->setText( TQString::number(page+2) ); page++; } } @@ -458,9 +458,9 @@ void KPrThumbBar::moveItem( int oldPos, int newPos ) { kdDebug(33001)<< "KPrThumbBar::moveItem " << oldPos << " to " << newPos << endl; int page = 0; - QIconViewItem *after = 0; - QIconViewItem *take = 0; - for ( QIconViewItem *it = firstItem(); it; it = it->nextItem() ) { + TQIconViewItem *after = 0; + TQIconViewItem *take = 0; + for ( TQIconViewItem *it = firstItem(); it; it = it->nextItem() ) { // find page which should move if ( page == oldPos ) take = it; @@ -479,7 +479,7 @@ void KPrThumbBar::moveItem( int oldPos, int newPos ) // TODO remove workaround when qt 3.1.2 comes out tz //takeItem( take ); //insertItem( take, after); - ThumbItem *item = new ThumbItem( static_cast<QIconView *>(this), after, QString::number( newPos ), *(take->pixmap()) ); + ThumbItem *item = new ThumbItem( static_cast<TQIconView *>(this), after, TQString::number( newPos ), *(take->pixmap()) ); item->setDragEnabled(false); //no dragging for now delete take; // update the thumbs if new pos was 0 @@ -495,9 +495,9 @@ void KPrThumbBar::moveItem( int oldPos, int newPos ) int lowPage = oldPos > newPos ? newPos : oldPos; int highPage = oldPos < newPos ? newPos : oldPos; page = 0; - for ( QIconViewItem *it = firstItem(); it; it = it->nextItem() ) { + for ( TQIconViewItem *it = firstItem(); it; it = it->nextItem() ) { if ( page >= lowPage && page <= highPage) - it->setText( QString::number(page+1) ); + it->setText( TQString::number(page+1) ); page++; } } @@ -507,9 +507,9 @@ void KPrThumbBar::removeItem( int pos ) kdDebug(33001)<< "KPrThumbBar::removeItem" << endl; int page = 0; bool change = false; - QIconViewItem *itemToDelete = 0; + TQIconViewItem *itemToDelete = 0; - for ( QIconViewItem *it = firstItem(); it; it = it->nextItem() ) { + for ( TQIconViewItem *it = firstItem(); it; it = it->nextItem() ) { if ( page == pos ) { itemToDelete = it; if ( it->nextItem() ) @@ -517,16 +517,16 @@ void KPrThumbBar::removeItem( int pos ) change = true; } if ( change ) - it->setText( QString::number( page + 1 ) ); + it->setText( TQString::number( page + 1 ) ); page++; } delete itemToDelete; } -QPixmap KPrThumbBar::getSlideThumb(int slideNr) const +TQPixmap KPrThumbBar::getSlideThumb(int slideNr) const { //kdDebug(33001) << "KPrThumbBar::getSlideThumb: " << slideNr << endl; - QPixmap pix( 10, 10 ); + TQPixmap pix( 10, 10 ); m_view->getCanvas()->drawPageInPix( pix, slideNr, 60 ); @@ -546,18 +546,18 @@ QPixmap KPrThumbBar::getSlideThumb(int slideNr) const h = 130; } - const QImage img(pix.convertToImage().smoothScale( w, h, QImage::ScaleMin )); + const TQImage img(pix.convertToImage().smoothScale( w, h, TQ_ScaleMin )); pix.convertFromImage(img); // draw a frame around the thumb to show its size - QPainter p(&pix); - p.setPen(Qt::black); + TQPainter p(&pix); + p.setPen(TQt::black); p.drawRect(pix.rect()); return pix; } -void KPrThumbBar::itemClicked(QIconViewItem *i) +void KPrThumbBar::itemClicked(TQIconViewItem *i) { if ( !i ) return; @@ -577,16 +577,16 @@ void KPrThumbBar::slotRefreshItems() refreshItems(); } -OutlineSlideItem::OutlineSlideItem( KListView* parent, KPrPage* _page, bool _masterPage ) - : KListViewItem( parent ), m_page( _page ), m_masterPage( _masterPage ) +OutlineSlideItem::OutlineSlideItem( KListView* tqparent, KPrPage* _page, bool _masterPage ) + : KListViewItem( tqparent ), m_page( _page ), m_masterPage( _masterPage ) { setDragEnabled(true); setPage( _page ); setPixmap( 0, KPBarIcon( "slide" ) ); } -OutlineSlideItem::OutlineSlideItem( KListView* parent, OutlineSlideItem * after, KPrPage* _page, bool _masterPage ) - : KListViewItem( parent, after ), m_page( _page ), m_masterPage( _masterPage ) +OutlineSlideItem::OutlineSlideItem( KListView* tqparent, OutlineSlideItem * after, KPrPage* _page, bool _masterPage ) + : KListViewItem( tqparent, after ), m_page( _page ), m_masterPage( _masterPage ) { setDragEnabled(true); setPage( _page ); @@ -614,7 +614,7 @@ void OutlineSlideItem::update() // keep selected object ooi = 0; - QPtrListIterator<KPrObject> it( m_page->objectList() ); + TQPtrListIterator<KPrObject> it( m_page->objectList() ); if ( !m_masterPage ) { @@ -670,20 +670,20 @@ void OutlineSlideItem::update() void OutlineSlideItem::updateTitle() { - QString title = m_page->pageTitle(); + TQString title = m_page->pageTitle(); if ( ! m_page->isSlideSelected() ) - title = i18n( "(%1)" ).arg( title ); + title = i18n( "(%1)" ).tqarg( title ); setText( 0, title ); } -OutlineObjectItem::OutlineObjectItem( OutlineSlideItem* parent, KPrObject* _object, - const QString& name ) - : KListViewItem( parent ), m_object( _object ) +OutlineObjectItem::OutlineObjectItem( OutlineSlideItem* tqparent, KPrObject* _object, + const TQString& name ) + : KListViewItem( tqparent ), m_object( _object ) { setObject( m_object ); setDragEnabled( false ); - QString objectName = name.isEmpty() ? m_object->getObjectName() : name; + TQString objectName = name.isEmpty() ? m_object->getObjectName() : name; //if( sticky ) objectName += i18n(" (Sticky)" ); setText( 0, objectName ); } @@ -727,7 +727,7 @@ void OutlineObjectItem::setObject( KPrObject* object ) case OT_POLYLINE: setPixmap( 0, KPBarIcon( "polyline" ) ); break; - case OT_QUADRICBEZIERCURVE: + case OT_TQUADRICBEZIERCURVE: setPixmap( 0, KPBarIcon( "quadricbeziercurve" ) ); break; case OT_CUBICBEZIERCURVE: @@ -737,7 +737,7 @@ void OutlineObjectItem::setObject( KPrObject* object ) setPixmap( 0, KPBarIcon( "mini_polygon" ) ); break; case OT_CLOSED_LINE: { - QString name = m_object->getTypeString(); + TQString name = m_object->getTypeString(); if ( name == i18n( "Closed Freehand" ) ) setPixmap( 0, KPBarIcon( "closed_freehand" ) ); else if ( name == i18n( "Closed Polyline" ) ) @@ -755,25 +755,25 @@ void OutlineObjectItem::setObject( KPrObject* object ) } } -KPrOutline::KPrOutline( QWidget *parent, KPrDocument *d, KPrView *v ) - : KListView( parent ), KPrSideBarBase( d, v) +KPrOutline::KPrOutline( TQWidget *tqparent, KPrDocument *d, KPrView *v ) + : KListView( tqparent ), KPrSideBarBase( d, v) { rebuildItems(); setSorting( -1 ); header()->hide(); addColumn( i18n( "Slide" ) ); - setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ) ); + tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Expanding ) ); - connect( this, SIGNAL( currentChanged( QListViewItem * ) ), this, SLOT( itemClicked( QListViewItem * ) ) ); - connect( this, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ), - this, SLOT( rightButtonPressed( QListViewItem *, const QPoint &, int ) ) ); - connect( this, SIGNAL( contextMenu( KListView*, QListViewItem*, const QPoint& ) ), - this, SLOT( slotContextMenu( KListView*, QListViewItem*, const QPoint&) ) ); + connect( this, TQT_SIGNAL( currentChanged( TQListViewItem * ) ), this, TQT_SLOT( itemClicked( TQListViewItem * ) ) ); + connect( this, TQT_SIGNAL( rightButtonPressed( TQListViewItem *, const TQPoint &, int ) ), + this, TQT_SLOT( rightButtonPressed( TQListViewItem *, const TQPoint &, int ) ) ); + connect( this, TQT_SIGNAL( contextMenu( KListView*, TQListViewItem*, const TQPoint& ) ), + this, TQT_SLOT( slotContextMenu( KListView*, TQListViewItem*, const TQPoint&) ) ); - connect( this, SIGNAL( doubleClicked ( QListViewItem * )), - this, SLOT(renamePageTitle())); - connect( this, SIGNAL( dropped( QDropEvent*, QListViewItem*, QListViewItem* ) ), - this, SLOT( slotDropped( QDropEvent*, QListViewItem*, QListViewItem* ) )); + connect( this, TQT_SIGNAL( doubleClicked ( TQListViewItem * )), + this, TQT_SLOT(renamePageTitle())); + connect( this, TQT_SIGNAL( dropped( TQDropEvent*, TQListViewItem*, TQListViewItem* ) ), + this, TQT_SLOT( slotDropped( TQDropEvent*, TQListViewItem*, TQListViewItem* ) )); setItemsMovable( false ); setDragEnabled( true ); @@ -809,7 +809,7 @@ void KPrOutline::rebuildItems() // returns 0 upon stupid things (e.g. invalid page number) OutlineSlideItem* KPrOutline::slideItem( int pageNumber ) { - QListViewItem* item = firstChild(); + TQListViewItem* item = firstChild(); for( int index = 0; item; ++index, item = item->nextSibling() ) { if( index == pageNumber ) return dynamic_cast<OutlineSlideItem*>( item ); @@ -831,7 +831,7 @@ void KPrOutline::updateItem( int pagenr /* 0-based */, bool sticky ) } } else { blockSignals(true); - for( QListViewItem *item = this->firstChild(); item; item = item->nextSibling() ) + for( TQListViewItem *item = this->firstChild(); item; item = item->nextSibling() ) dynamic_cast<OutlineSlideItem*>(item)->update(); blockSignals(false); } @@ -866,8 +866,8 @@ void KPrOutline::moveItem( int oldPos, int newPos ) int highPage = oldPos < newPos ? newPos : oldPos; OutlineSlideItem *item = dynamic_cast<OutlineSlideItem*>( firstChild() ); - QListViewItem *itemToMove = 0; - QListViewItem *itemAfter = 0; + TQListViewItem *itemToMove = 0; + TQListViewItem *itemAfter = 0; // moving backwards if ( newPos < oldPos ) @@ -900,7 +900,7 @@ void KPrOutline::removeItem( int pos ) item->updateTitle(); } -void KPrOutline::itemClicked( QListViewItem *item ) +void KPrOutline::itemClicked( TQListViewItem *item ) { if( !item ) return; @@ -911,7 +911,7 @@ void KPrOutline::itemClicked( QListViewItem *item ) KPrPage* page = slideItem->page(); if( !page ) return; if ( !m_viewMasterPage ) - emit showPage( m_doc->pageList().findRef( page ) ); + emit showPage( m_doc->pageList().tqfindRef( page ) ); } // check if we need to show chosen object @@ -922,20 +922,20 @@ void KPrOutline::itemClicked( QListViewItem *item ) if( !object ) return; // ensure the owner slide is shown first - OutlineSlideItem* slideItem = dynamic_cast<OutlineSlideItem*>(objectItem->parent()); + OutlineSlideItem* slideItem = dynamic_cast<OutlineSlideItem*>(objectItem->tqparent()); if( slideItem && m_doc->activePage() != slideItem->page() ) { KPrPage* page = slideItem->page(); if( !page ) return; if ( !m_viewMasterPage ) - emit showPage( m_doc->pageList().findRef( page ) ); + emit showPage( m_doc->pageList().tqfindRef( page ) ); } // select the object, make sure it's visible m_doc->deSelectAllObj(); m_view->getCanvas()->selectObj( object ); m_view->showObjectRect( object ); - m_doc->repaint( false ); + m_doc->tqrepaint( false ); } } @@ -946,16 +946,16 @@ void KPrOutline::itemClicked( QListViewItem *item ) * When an item is about to move (using drag-and-drop), it makes shure that * it's not moved right after an object. */ -void KPrOutline::slotDropped( QDropEvent * /* e */, QListViewItem *parent, QListViewItem *target ) +void KPrOutline::slotDropped( TQDropEvent * /* e */, TQListViewItem *tqparent, TQListViewItem *target ) { kdDebug(33001) << "slotDropped" << endl; - /* slide doesn't have parent (always 0) + /* slide doesn't have tqparent (always 0) * Only slides can move at the moment, objects can't. */ - if ( parent ) + if ( tqparent ) return; // This code is taken from KListView - for (QListViewItem *i = firstChild(), *iNext = 0; i != 0; i = iNext) + for (TQListViewItem *i = firstChild(), *iNext = 0; i != 0; i = iNext) { iNext = i->itemBelow(); if ( !i->isSelected() ) @@ -969,7 +969,7 @@ void KPrOutline::slotDropped( QDropEvent * /* e */, QListViewItem *parent, QList i->setSelected( false ); // don't move the item as it is allready - moveItem(i, parent, target ); + moveItem(i, tqparent, target ); // Only one item can be moved break; @@ -978,7 +978,7 @@ void KPrOutline::slotDropped( QDropEvent * /* e */, QListViewItem *parent, QList // We have to overwrite this method as it checks if an item is movable // and we have disabled it. -bool KPrOutline::acceptDrag( QDropEvent* e ) const +bool KPrOutline::acceptDrag( TQDropEvent* e ) const { return acceptDrops() && (e->source()==viewport()); } @@ -987,7 +987,7 @@ bool KPrOutline::acceptDrag( QDropEvent* e ) const void KPrOutline::setCurrentPage( int pg ) { OutlineSlideItem *item = slideItem( pg ); - if( item && ( item!=currentItem()->parent() ) ) + if( item && ( item!=currentItem()->tqparent() ) ) { blockSignals( true ); setCurrentItem( item ); @@ -997,20 +997,20 @@ void KPrOutline::setCurrentPage( int pg ) } } -void KPrOutline::contentsDropEvent( QDropEvent *e ) +void KPrOutline::contentsDropEvent( TQDropEvent *e ) { - disconnect( this, SIGNAL( currentChanged( QListViewItem * ) ), this, SLOT( itemClicked( QListViewItem * ) ) ); + disconnect( this, TQT_SIGNAL( currentChanged( TQListViewItem * ) ), this, TQT_SLOT( itemClicked( TQListViewItem * ) ) ); KListView::contentsDropEvent( e ); - connect( this, SIGNAL( currentChanged( QListViewItem * ) ), this, SLOT( itemClicked( QListViewItem * ) ) ); + connect( this, TQT_SIGNAL( currentChanged( TQListViewItem * ) ), this, TQT_SLOT( itemClicked( TQListViewItem * ) ) ); } -void KPrOutline::moveItem( QListViewItem *i, QListViewItem *, QListViewItem *newAfter ) +void KPrOutline::moveItem( TQListViewItem *i, TQListViewItem *, TQListViewItem *newAfter ) { OutlineSlideItem* srcItem = dynamic_cast<OutlineSlideItem*>( i ); if ( !srcItem ) return; - int num = m_doc->pageList().findRef( srcItem->page() ); + int num = m_doc->pageList().tqfindRef( srcItem->page() ); int numNow = 0; if ( newAfter ) @@ -1019,7 +1019,7 @@ void KPrOutline::moveItem( QListViewItem *i, QListViewItem *, QListViewItem *new if( !dstItem ) return; - numNow = m_doc->pageList().findRef( dstItem->page() ); + numNow = m_doc->pageList().tqfindRef( dstItem->page() ); if ( numNow < num ) numNow++; } @@ -1028,11 +1028,11 @@ void KPrOutline::moveItem( QListViewItem *i, QListViewItem *, QListViewItem *new m_doc->movePage( num, numNow ); } -void KPrOutline::rightButtonPressed( QListViewItem *, const QPoint &pnt, int ) +void KPrOutline::rightButtonPressed( TQListViewItem *, const TQPoint &pnt, int ) { if ( !m_doc->isReadWrite() || m_viewMasterPage ) return; - QListViewItem *item = QListView::selectedItem(); + TQListViewItem *item = TQListView::selectedItem(); if( !item ) return; OutlineSlideItem* slideItem = dynamic_cast<OutlineSlideItem*>(item); @@ -1058,14 +1058,14 @@ void KPrOutline::rightButtonPressed( QListViewItem *, const QPoint &pnt, int ) } } -void KPrOutline::slotContextMenu( KListView*, QListViewItem* item, const QPoint& p ) +void KPrOutline::slotContextMenu( KListView*, TQListViewItem* item, const TQPoint& p ) { rightButtonPressed( item, p, 0 ); } void KPrOutline::renamePageTitle() { - QListViewItem *item = QListView::selectedItem(); + TQListViewItem *item = TQListView::selectedItem(); if( !item || m_viewMasterPage) return; OutlineSlideItem* slideItem = dynamic_cast<OutlineSlideItem*>(item); @@ -1075,16 +1075,16 @@ void KPrOutline::renamePageTitle() if( !page ) return; bool ok = false; - QString activeTitle = item->text( 0 ); + TQString activeTitle = item->text( 0 ); - QStringList page_titles; + TQStringList page_titles; KPrPage *it; for ( it = m_doc->pageList().first(); it; it = m_doc->pageList().next() ) if ( it->pageTitle() != activeTitle ) page_titles.append( it->pageTitle() ); KPrRenamePageValidator validator( page_titles ); - QString newTitle = KInputDialog::getText( i18n("Rename Slide"), + TQString newTitle = KInputDialog::getText( i18n("Rename Slide"), i18n("Slide title:"), activeTitle, &ok, this, 0, &validator ); @@ -1099,7 +1099,7 @@ void KPrOutline::renamePageTitle() } } -QDragObject* KPrOutline::dragObject() +TQDragObject* KPrOutline::dragObject() { if( !selectedItem()->dragEnabled() ) { return 0; |