diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-19 19:03:33 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-19 19:03:33 +0000 |
commit | e69e8b1d09fb579316595b4e6a850e717358a8b1 (patch) | |
tree | a24fc20865f65772f530d16177520190594ffdd2 /kpdf/ui | |
parent | eecec9afb81fdebb0f22e9da22635874c403f854 (diff) | |
download | tdegraphics-e69e8b1d09fb579316595b4e6a850e717358a8b1.tar.gz tdegraphics-e69e8b1d09fb579316595b4e6a850e717358a8b1.zip |
TQt4 port kdegraphics
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1237557 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kpdf/ui')
-rw-r--r-- | kpdf/ui/minibar.cpp | 60 | ||||
-rw-r--r-- | kpdf/ui/minibar.h | 3 | ||||
-rw-r--r-- | kpdf/ui/pagepainter.cpp | 30 | ||||
-rw-r--r-- | kpdf/ui/pageview.cpp | 254 | ||||
-rw-r--r-- | kpdf/ui/pageview.h | 7 | ||||
-rw-r--r-- | kpdf/ui/pageviewutils.cpp | 66 | ||||
-rw-r--r-- | kpdf/ui/pageviewutils.h | 10 | ||||
-rw-r--r-- | kpdf/ui/presentationwidget.cpp | 156 | ||||
-rw-r--r-- | kpdf/ui/presentationwidget.h | 5 | ||||
-rw-r--r-- | kpdf/ui/propertiesdialog.cpp | 30 | ||||
-rw-r--r-- | kpdf/ui/propertiesdialog.h | 2 | ||||
-rw-r--r-- | kpdf/ui/searchwidget.cpp | 20 | ||||
-rw-r--r-- | kpdf/ui/searchwidget.h | 5 | ||||
-rw-r--r-- | kpdf/ui/thumbnaillist.cpp | 40 | ||||
-rw-r--r-- | kpdf/ui/thumbnaillist.h | 11 | ||||
-rw-r--r-- | kpdf/ui/toc.cpp | 20 | ||||
-rw-r--r-- | kpdf/ui/toc.h | 5 |
17 files changed, 365 insertions, 359 deletions
diff --git a/kpdf/ui/minibar.cpp b/kpdf/ui/minibar.cpp index be3c9383..df3ebfce 100644 --- a/kpdf/ui/minibar.cpp +++ b/kpdf/ui/minibar.cpp @@ -25,10 +25,10 @@ #include "minibar.h" // [private widget] show progress -class ProgressWidget : public QWidget +class ProgressWidget : public TQWidget { public: - ProgressWidget( MiniBar * parent ); + ProgressWidget( MiniBar * tqparent ); void setProgress( float percentage ); protected: @@ -43,10 +43,10 @@ class ProgressWidget : public QWidget }; // [private widget] lineEdit for entering/validating page numbers -class PagesEdit : public QLineEdit +class PagesEdit : public TQLineEdit { public: - PagesEdit( MiniBar * parent ); + PagesEdit( MiniBar * tqparent ); void setPagesNumber( int pages ); void setText( const TQString & ); @@ -64,10 +64,10 @@ class PagesEdit : public QLineEdit }; // [private widget] a flat qpushbutton that enlights on hover -class HoverButton : public QPushButton +class HoverButton : public TQPushButton { public: - HoverButton( TQWidget * parent ); + HoverButton( TQWidget * tqparent ); protected: void paintEvent( TQPaintEvent * e ); @@ -78,8 +78,8 @@ class HoverButton : public QPushButton /** MiniBar **/ -MiniBar::MiniBar( TQWidget * parent, KPDFDocument * document ) - : TQFrame( parent, "miniBar" ), m_document( document ), +MiniBar::MiniBar( TQWidget * tqparent, KPDFDocument * document ) + : TQFrame( tqparent, "miniBar" ), m_document( document ), m_currentPage( -1 ) { // left spacer @@ -87,7 +87,7 @@ MiniBar::MiniBar( TQWidget * parent, KPDFDocument * document ) TQSpacerItem * spacerL = new TQSpacerItem( 20, 10, TQSizePolicy::Expanding ); horLayout->addItem( spacerL ); - // central 2r by 3c grid layout that contains all components + // central 2r by 3c grid tqlayout that contains all components TQGridLayout * gridLayout = new TQGridLayout( 0, 3,5, 2,1 ); // top spacer 6x6 px // TQSpacerItem * spacerTop = new TQSpacerItem( 6, 6, TQSizePolicy::Fixed, TQSizePolicy::Fixed ); @@ -127,7 +127,7 @@ MiniBar::MiniBar( TQWidget * parent, KPDFDocument * document ) connect( m_nextButton, TQT_SIGNAL( clicked() ), this, TQT_SIGNAL( nextPage() ) ); // widget starts hidden (will be shown after opening a document) - parent->hide(); + tqparent->hide(); } MiniBar::~MiniBar() @@ -146,7 +146,7 @@ void MiniBar::notifySetup( const TQValueVector< KPDFPage * > & pageVector, bool if ( pages < 1 ) { m_currentPage = -1; - static_cast<TQWidget*>( parent() )->hide(); + TQT_TQWIDGET( tqparent() )->hide(); return; } @@ -171,7 +171,7 @@ void MiniBar::notifySetup( const TQValueVector< KPDFPage * > & pageVector, bool m_pagesButton->setText( TQString::number( pages ) ); m_prevButton->setEnabled( false ); m_nextButton->setEnabled( false ); - static_cast<TQWidget*>( parent() )->show(); + TQT_TQWIDGET( tqparent() )->show(); } void MiniBar::notifyViewportChanged( bool /*smoothMove*/ ) @@ -198,7 +198,7 @@ void MiniBar::notifyViewportChanged( bool /*smoothMove*/ ) void MiniBar::resizeEvent( TQResizeEvent * e ) { // auto-hide 'prev' and 'next' buttons if not enough space - const TQSize & myHint = minimumSizeHint(); + const TQSize & myHint = tqminimumSizeHint(); bool shown = m_prevButton->isVisible() && m_nextButton->isVisible(); if ( shown && e->size().width() < myHint.width() ) { @@ -208,7 +208,7 @@ void MiniBar::resizeEvent( TQResizeEvent * e ) } else if ( !shown ) { - int histeresis = m_prevButton->sizeHint().width() * 2 + 2; + int histeresis = m_prevButton->tqsizeHint().width() * 2 + 2; if ( e->size().width() > (myHint.width() + histeresis) ) { m_prevButton->show(); @@ -259,9 +259,9 @@ void MiniBar::slotEmitPrevPage() /** ProgressWidget **/ -ProgressWidget::ProgressWidget( MiniBar * parent ) - : TQWidget( parent, "progress", WNoAutoErase ), - m_miniBar( parent ), m_progressPercentage( -1 ) +ProgressWidget::ProgressWidget( MiniBar * tqparent ) + : TQWidget( tqparent, "progress", WNoAutoErase ), + m_miniBar( tqparent ), m_progressPercentage( -1 ) { setFixedHeight( 4 ); setMouseTracking( true ); @@ -308,36 +308,36 @@ void ProgressWidget::paintEvent( TQPaintEvent * e ) // paint rects and a separator line TQPainter p( this ); if ( cRect.isValid() ) - p.fillRect( cRect, palette().active().highlightedText() ); + p.fillRect( cRect, tqpalette().active().highlightedText() ); if ( fRect.isValid() ) - p.fillRect( fRect, palette().active().highlight() ); + p.fillRect( fRect, tqpalette().active().highlight() ); if ( l && l != w ) { - p.setPen( palette().active().highlight().dark( 120 ) ); + p.setPen( tqpalette().active().highlight().dark( 120 ) ); int delta = TQApplication::reverseLayout() ? w - l : l; p.drawLine( delta, 0, delta, h ); } // draw a frame-like outline - //p.setPen( palette().active().mid() ); + //p.setPen( tqpalette().active().mid() ); //p.drawRect( 0,0, w, h ); } /** PagesEdit **/ -PagesEdit::PagesEdit( MiniBar * parent ) - : TQLineEdit( parent ), m_miniBar( parent ), m_eatClick( false ) +PagesEdit::PagesEdit( MiniBar * tqparent ) + : TQLineEdit( tqparent ), m_miniBar( tqparent ), m_eatClick( false ) { // customize look setFrameShadow( TQFrame::Raised ); focusOutEvent( 0 ); // use an integer validator - m_validator = new TQIntValidator( 1, 1, this ); + m_validator = new TQIntValidator( 1, 1, TQT_TQOBJECT(this) ); setValidator( m_validator ); // customize text properties - setAlignment( Qt::AlignCenter ); + tqsetAlignment( TQt::AlignCenter ); setMaxLength( 4 ); } @@ -363,7 +363,7 @@ void PagesEdit::focusInEvent( TQFocusEvent * e ) m_eatClick = true; // change background color to the default 'edit' color setLineWidth( 2 ); - setPaletteBackgroundColor( Qt::white ); + setPaletteBackgroundColor( TQt::white ); // call default handler TQLineEdit::focusInEvent( e ); } @@ -372,7 +372,7 @@ void PagesEdit::focusOutEvent( TQFocusEvent * e ) { // change background color to a dark tone setLineWidth( 1 ); - setPaletteBackgroundColor( palette().active().background().light( 105 ) ); + setPaletteBackgroundColor( tqpalette().active().background().light( 105 ) ); // restore text TQLineEdit::setText( backString ); // call default handler @@ -398,8 +398,8 @@ void PagesEdit::wheelEvent( TQWheelEvent * e ) /** HoverButton **/ -HoverButton::HoverButton( TQWidget * parent ) - : TQPushButton( parent ) +HoverButton::HoverButton( TQWidget * tqparent ) + : TQPushButton( tqparent ) { setMouseTracking( true ); #if KDE_IS_VERSION(3,3,90) @@ -428,7 +428,7 @@ void HoverButton::paintEvent( TQPaintEvent * e ) else { TQPainter p( this ); - p.fillRect(e->rect(), parentWidget() ? parentWidget()->palette().brush(TQPalette::Active, TQColorGroup::Background) : paletteBackgroundColor()); + p.fillRect(e->rect(), tqparentWidget() ? tqparentWidget()->tqpalette().brush(TQPalette::Active, TQColorGroup::Background) : paletteBackgroundColor()); drawButtonLabel( &p ); } } diff --git a/kpdf/ui/minibar.h b/kpdf/ui/minibar.h index f532999c..99bc13aa 100644 --- a/kpdf/ui/minibar.h +++ b/kpdf/ui/minibar.h @@ -25,8 +25,9 @@ class ProgressWidget; class MiniBar : public TQFrame, public DocumentObserver { Q_OBJECT + TQ_OBJECT public: - MiniBar( TQWidget *parent, KPDFDocument * document ); + MiniBar( TQWidget *tqparent, KPDFDocument * document ); ~MiniBar(); // [INHERITED] from DocumentObserver diff --git a/kpdf/ui/pagepainter.cpp b/kpdf/ui/pagepainter.cpp index 899be054..96fb1edf 100644 --- a/kpdf/ui/pagepainter.cpp +++ b/kpdf/ui/pagepainter.cpp @@ -26,7 +26,7 @@ void PagePainter::paintPageOnPainter( const KPDFPage * page, int id, int flags, TQPixmap * pixmap = 0; // if a pixmap is present for given id, use it - if ( page->m_pixmaps.contains( id ) ) + if ( page->m_pixmaps.tqcontains( id ) ) pixmap = page->m_pixmaps[ id ]; // else find the closest match using pixmaps of other IDs (great optim!) @@ -49,13 +49,13 @@ void PagePainter::paintPageOnPainter( const KPDFPage * page, int id, int flags, // if have no pixmap, draw blank page with gray cross and exit if ( !pixmap ) { - TQColor color = Qt::white; + TQColor color = TQt::white; if ( KpdfSettings::changeColors() ) { switch ( KpdfSettings::renderMode() ) { case KpdfSettings::EnumRenderMode::Inverted: - color = Qt::black; + color = TQt::black; break; case KpdfSettings::EnumRenderMode::Paper: color = KpdfSettings::paperColor(); @@ -70,7 +70,7 @@ void PagePainter::paintPageOnPainter( const KPDFPage * page, int id, int flags, // draw a cross (to that the pixmap as not yet been loaded) // helps a lot on pages that take much to render - destPainter->setPen( Qt::gray ); + destPainter->setPen( TQt::gray ); destPainter->drawLine( 0, 0, width-1, height-1 ); destPainter->drawLine( 0, height-1, width-1, 0 ); // idea here: draw a hourglass (or kpdf icon :-) on top-left corner @@ -122,7 +122,7 @@ void PagePainter::paintPageOnPainter( const KPDFPage * page, int id, int flags, else { p->save(); - // TODO paint only the needed part (note: hope that Qt4 transforms are faster) + // TODO paint only the needed part (note: hope that TQt4 transforms are faster) p->scale( width / (double)pixmap->width(), height / (double)pixmap->height() ); p->drawPixmap( 0,0, *pixmap, 0,0, pixmap->width(), pixmap->height() ); p->restore(); @@ -139,7 +139,7 @@ void PagePainter::paintPageOnPainter( const KPDFPage * page, int id, int flags, { case KpdfSettings::EnumRenderMode::Inverted: // Invert image pixels using TQImage internal function - backImage.invertPixels(false); + backImage.tqinvertPixels(false); break; case KpdfSettings::EnumRenderMode::Recolor: // Recolor image using KImageEffect::flatten with dither:0 @@ -152,7 +152,7 @@ void PagePainter::paintPageOnPainter( const KPDFPage * page, int id, int flags, con = KpdfSettings::bWContrast(), thr = 255 - KpdfSettings::bWThreshold(); for( int i = 0; i < pixels; ++i ) { - val = qGray( data[i] ); + val = tqGray( data[i] ); if ( val > thr ) val = 128 + (127 * (val - thr)) / (255 - thr); else if ( val < thr ) @@ -165,7 +165,7 @@ void PagePainter::paintPageOnPainter( const KPDFPage * page, int id, int flags, else if ( val < 0 ) val = 0; } - data[i] = qRgba( val, val, val, 255 ); + data[i] = tqRgba( val, val, val, 255 ); } break; } @@ -178,7 +178,7 @@ void PagePainter::paintPageOnPainter( const KPDFPage * page, int id, int flags, for ( ; hIt != hEnd; ++hIt ) { HighlightRect * r = *hIt; - TQRect highlightRect = r->geometry( width, height ); + TQRect highlightRect = r->tqgeometry( width, height ); if ( highlightRect.isValid() && highlightRect.intersects( limits ) ) { // find out the rect to highlight on pixmap @@ -197,10 +197,10 @@ void PagePainter::paintPageOnPainter( const KPDFPage * page, int id, int flags, for( int x = highlightRect.left(); x <= highlightRect.right(); ++x ) { val = data[ x + offset ]; - newR = (qRed(val) * rh) / 255; - newG = (qGreen(val) * gh) / 255; - newB = (qBlue(val) * bh) / 255; - data[ x + offset ] = qRgba( newR, newG, newB, 255 ); + newR = (tqRed(val) * rh) / 255; + newG = (tqGreen(val) * gh) / 255; + newB = (tqBlue(val) * bh) / 255; + data[ x + offset ] = tqRgba( newR, newG, newB, 255 ); } offset += backImage.width(); } @@ -213,7 +213,7 @@ void PagePainter::paintPageOnPainter( const KPDFPage * page, int id, int flags, // 3. visually enchance links and images if requested if ( enhanceLinks || enhanceImages ) { - TQColor normalColor = TQApplication::palette().active().highlight(); + TQColor normalColor = TQApplication::tqpalette().active().highlight(); TQColor lightColor = normalColor.light( 140 ); // enlarging limits for intersection is like growing the 'rectGeometry' below TQRect limitsEnlarged = limits; @@ -226,7 +226,7 @@ void PagePainter::paintPageOnPainter( const KPDFPage * page, int id, int flags, if ( (enhanceLinks && rect->objectType() == ObjectRect::Link) || (enhanceImages && rect->objectType() == ObjectRect::Image) ) { - TQRect rectGeometry = rect->geometry( width, height ); + TQRect rectGeometry = rect->tqgeometry( width, height ); if ( rectGeometry.intersects( limitsEnlarged ) ) { // expand rect and draw inner border diff --git a/kpdf/ui/pageview.cpp b/kpdf/ui/pageview.cpp index 3b0baecd..7172c6d3 100644 --- a/kpdf/ui/pageview.cpp +++ b/kpdf/ui/pageview.cpp @@ -68,7 +68,7 @@ public: TQValueVector< PageViewItem * > items; TQValueList< PageViewItem * > visibleItems; - // view layout (columns and continuous in Settings), zoom and mouse + // view tqlayout (columns and continuous in Settings), zoom and mouse PageView::ZoomMode zoomMode; float zoomFactor; int rotation; @@ -80,7 +80,7 @@ public: TQRect mouseSelectionRect; TQColor selectionRectColor; - // type ahead find + // type ahead tqfind bool typeAheadActive; TQString typeAheadString; TQTimer * findTimeoutTimer; @@ -119,7 +119,7 @@ public: -class PageViewTip : public QToolTip +class PageViewTip : public TQToolTip { public: PageViewTip( PageView * view ) @@ -146,8 +146,8 @@ void PageViewTip::maybeTip( const TQPoint &_p ) PageViewItem * pageItem = m_view->pickItemOnPoint( p.x(), p.y() ); if ( pageItem && m_view->d->mouseMode == PageView::MouseNormal ) { - double nX = (double)(p.x() - pageItem->geometry().left()) / (double)pageItem->width(), - nY = (double)(p.y() - pageItem->geometry().top()) / (double)pageItem->height(); + double nX = (double)(p.x() - pageItem->tqgeometry().left()) / (double)pageItem->width(), + nY = (double)(p.y() - pageItem->tqgeometry().top()) / (double)pageItem->height(); // if over a ObjectRect (of type Link) change cursor to hand const ObjectRect * object = pageItem->page()->hasObject( ObjectRect::Link, nX, nY ); @@ -158,8 +158,8 @@ void PageViewTip::maybeTip( const TQPoint &_p ) TQString strtip = link->linkTip(); if ( !strtip.isEmpty() ) { - TQRect linkRect = object->geometry( pageItem->width(), pageItem->height() ); - linkRect.moveBy( - m_view->contentsX() + pageItem->geometry().left(), - m_view->contentsY() + pageItem->geometry().top() ); + TQRect linkRect = object->tqgeometry( pageItem->width(), pageItem->height() ); + linkRect.moveBy( - m_view->contentsX() + pageItem->tqgeometry().left(), - m_view->contentsY() + pageItem->tqgeometry().top() ); tip( linkRect, strtip ); } } @@ -173,13 +173,13 @@ void PageViewTip::maybeTip( const TQPoint &_p ) * 160 - constructor and creating actions plus their connected slots (empty stuff) * 70 - DocumentObserver inherited methodes (important) * 550 - events: mouse, keyboard, drag/drop - * 170 - slotRelayoutPages: set contents of the scrollview on continuous/single modes + * 170 - slotRetqlayoutPages: set contents of the scrollview on continuous/single modes * 100 - zoom: zooming pages in different ways, keeping update the toolbar actions, etc.. * other misc functions: only slotRequestVisiblePixmaps and pickItemOnPoint noticeable, * and many insignificant stuff like this comment :-) */ -PageView::PageView( TQWidget *parent, KPDFDocument *document ) - : TQScrollView( parent, "KPDF::pageView", WStaticContents | WNoAutoErase ) +PageView::PageView( TQWidget *tqparent, KPDFDocument *document ) + : TQScrollView( tqparent, "KPDF::pageView", WStaticContents | WNoAutoErase ) { // create and initialize private storage structure d = new PageViewPrivate(); @@ -206,9 +206,9 @@ PageView::PageView( TQWidget *parent, KPDFDocument *document ) // widget setup: setup focus, accept drops and track mouse viewport()->setFocusProxy( this ); - viewport()->setFocusPolicy( StrongFocus ); - //viewport()->setPaletteBackgroundColor( Qt::white ); - viewport()->setBackgroundMode( Qt::NoBackground ); + viewport()->setFocusPolicy( TQ_StrongFocus ); + //viewport()->setPaletteBackgroundColor( TQt::white ); + viewport()->setBackgroundMode( TQt::NoBackground ); setResizePolicy( Manual ); setAcceptDrops( true ); setDragAutoScroll( false ); @@ -245,16 +245,16 @@ PageView::~PageView() void PageView::setupActions( KActionCollection * ac ) { // Zoom actions ( higher scales takes lots of memory! ) - d->aZoom = new KSelectAction( i18n( "Zoom" ), "viewmag", 0, this, TQT_SLOT( slotZoom() ), ac, "zoom_to" ); + d->aZoom = new KSelectAction( i18n( "Zoom" ), "viewmag", 0, TQT_TQOBJECT(this), TQT_SLOT( slotZoom() ), ac, "zoom_to" ); d->aZoom->setEditable( true ); #if KDE_IS_VERSION(3,4,89) d->aZoom->setMaxComboViewCount( 13 ); #endif updateZoomText(); - KStdAction::zoomIn( this, TQT_SLOT( slotZoomIn() ), ac, "zoom_in" ); + KStdAction::zoomIn( TQT_TQOBJECT(this), TQT_SLOT( slotZoomIn() ), ac, "zoom_in" ); - KStdAction::zoomOut( this, TQT_SLOT( slotZoomOut() ), ac, "zoom_out" ); + KStdAction::zoomOut( TQT_TQOBJECT(this), TQT_SLOT( slotZoomOut() ), ac, "zoom_out" ); d->aZoomFitWidth = new KToggleAction( i18n("Fit to Page &Width"), "view_fit_width", 0, ac, "zoom_fit_width" ); connect( d->aZoomFitWidth, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( slotFitToWidthToggled( bool ) ) ); @@ -268,10 +268,10 @@ void PageView::setupActions( KActionCollection * ac ) // rotate actions KAction *action; action = new KAction( i18n("Rotate Right"), "rotate_cw", KShortcut( "Ctrl+Shift++" ), - this, TQT_SLOT( slotRotateRight() ), ac, "rotate_right" ); + TQT_TQOBJECT(this), TQT_SLOT( slotRotateRight() ), ac, "rotate_right" ); action = new KAction( i18n("Rotate Left"), "rotate_ccw", KShortcut( "Ctrl+Shift+-" ), - this, TQT_SLOT( slotRotateLeft() ), ac, "rotate_left" ); + TQT_TQOBJECT(this), TQT_SLOT( slotRotateLeft() ), ac, "rotate_left" ); // View-Layout actions d->aViewTwoPages = new KToggleAction( i18n("&Two Pages"), "view_left_right", 0, ac, "view_twopages" ); @@ -283,25 +283,25 @@ void PageView::setupActions( KActionCollection * ac ) d->aViewContinuous->setChecked( KpdfSettings::viewContinuous() ); // Mouse-Mode actions - d->aMouseNormal = new KRadioAction( i18n("&Browse Tool"), "mouse", 0, this, TQT_SLOT( slotSetMouseNormal() ), ac, "mouse_drag" ); + d->aMouseNormal = new KRadioAction( i18n("&Browse Tool"), "mouse", 0, TQT_TQOBJECT(this), TQT_SLOT( slotSetMouseNormal() ), ac, "mouse_drag" ); d->aMouseNormal->setExclusiveGroup( "MouseType" ); d->aMouseNormal->setChecked( true ); - KToggleAction * mz = new KRadioAction( i18n("&Zoom Tool"), "viewmag", 0, this, TQT_SLOT( slotSetMouseZoom() ), ac, "mouse_zoom" ); + KToggleAction * mz = new KRadioAction( i18n("&Zoom Tool"), "viewmag", 0, TQT_TQOBJECT(this), TQT_SLOT( slotSetMouseZoom() ), ac, "mouse_zoom" ); mz->setExclusiveGroup( "MouseType" ); - d->aMouseSelect = new KRadioAction( i18n("&Select Tool"), "frame_edit", 0, this, TQT_SLOT( slotSetMouseSelect() ), ac, "mouse_select" ); + d->aMouseSelect = new KRadioAction( i18n("&Select Tool"), "frame_edit", 0, TQT_TQOBJECT(this), TQT_SLOT( slotSetMouseSelect() ), ac, "mouse_select" ); d->aMouseSelect->setExclusiveGroup( "MouseType" ); -/* d->aMouseEdit = new KRadioAction( i18n("Draw"), "edit", 0, this, TQT_SLOT( slotSetMouseDraw() ), ac, "mouse_draw" ); +/* d->aMouseEdit = new KRadioAction( i18n("Draw"), "edit", 0, TQT_TQOBJECT(this), TQT_SLOT( slotSetMouseDraw() ), ac, "mouse_draw" ); d->aMouseEdit->setExclusiveGroup("MouseType"); d->aMouseEdit->setEnabled( false ); // implement feature before removing this line*/ // Other actions - KAction * su = new KAction( i18n("Scroll Up"), 0, this, TQT_SLOT( slotScrollUp() ), ac, "view_scroll_up" ); + KAction * su = new KAction( i18n("Scroll Up"), 0, TQT_TQOBJECT(this), TQT_SLOT( slotScrollUp() ), ac, "view_scroll_up" ); su->setShortcut( "Shift+Up" ); - KAction * sd = new KAction( i18n("Scroll Down"), 0, this, TQT_SLOT( slotScrollDown() ), ac, "view_scroll_down" ); + KAction * sd = new KAction( i18n("Scroll Down"), 0, TQT_TQOBJECT(this), TQT_SLOT( slotScrollDown() ), ac, "view_scroll_down" ); sd->setShortcut( "Shift+Down" ); } @@ -337,18 +337,18 @@ void PageView::notifySetup( const TQValueVector< KPDFPage * > & pageSet, bool do d->items.clear(); d->visibleItems.clear(); - // create children widgets + // create tqchildren widgets TQValueVector< KPDFPage * >::const_iterator setIt = pageSet.begin(), setEnd = pageSet.end(); for ( ; setIt != setEnd; ++setIt ) d->items.push_back( new PageViewItem( *setIt ) ); if ( pageSet.count() > 0 ) - // TODO for Enrico: Check if doing always the slotRelayoutPages() is not + // TODO for Enrico: Check if doing always the slotRetqlayoutPages() is not // suboptimal in some cases, i'd say it is not but a recheck will not hurt - // Need slotRelayoutPages() here instead of d->dirtyLayout = true + // Need slotRetqlayoutPages() here instead of d->dirtyLayout = true // because opening a pdf from another pdf will not trigger a viewportchange - // so pages are never relayouted - TQTimer::singleShot(0, this, TQT_SLOT(slotRelayoutPages())); + // so pages are never retqlayouted + TQTimer::singleShot(0, this, TQT_SLOT(slotRetqlayoutPages())); else { // update the mouse cursor when closing because we may have close through a link and @@ -392,13 +392,13 @@ void PageView::notifyViewportChanged( bool smoothMove ) return; } - // relayout in "Single Pages" mode or if a relayout is pending + // retqlayout in "Single Pages" mode or if a retqlayout is pending d->blockPixmapsRequest = true; if ( !KpdfSettings::viewContinuous() || d->dirtyLayout ) - slotRelayoutPages(); + slotRetqlayoutPages(); - // restore viewport center or use default {x-center,v-top} alignment - const TQRect & r = item->geometry(); + // restore viewport center or use default {x-center,v-top} tqalignment + const TQRect & r = item->tqgeometry(); int newCenterX = r.left(), newCenterY = r.top(); if ( vp.rePos.enabled ) @@ -462,18 +462,18 @@ void PageView::notifyPageChanged( int pageNumber, int changedFlags ) if ( changedFlags & DocumentObserver::Bookmark ) return; - // iterate over visible items: if page(pageNumber) is one of them, repaint it + // iterate over visible items: if page(pageNumber) is one of them, tqrepaint it TQValueList< PageViewItem * >::iterator iIt = d->visibleItems.begin(), iEnd = d->visibleItems.end(); for ( ; iIt != iEnd; ++iIt ) if ( (*iIt)->pageNumber() == pageNumber ) { // update item's rectangle plus the little outline - TQRect expandedRect = (*iIt)->geometry(); + TQRect expandedRect = (*iIt)->tqgeometry(); expandedRect.addCoords( -1, -1, 3, 3 ); updateContents( expandedRect ); // if we were "zoom-dragging" do not overwrite the "zoom-drag" cursor - if ( cursor().shape() != Qt::SizeVerCursor ) + if ( cursor().shape() != TQt::SizeVerCursor ) { // since the page has been regenerated below cursor, update it updateCursor( viewportToContents( mapFromGlobal( TQCursor::pos() ) ) ); @@ -532,10 +532,10 @@ void PageView::viewportPaintEvent( TQPaintEvent * pe ) selectionRectInternal.addCoords( 1, 1, -1, -1 ); // color for blending TQColor selBlendColor = (selectionRect.width() > 8 || selectionRect.height() > 8) ? - d->selectionRectColor : Qt::red; + d->selectionRectColor : TQt::red; // subdivide region into rects - TQMemArray<TQRect> allRects = pe->region().rects(); + TQMemArray<TQRect> allRects = TQRegion(pe->region()).tqrects(); uint numRects = allRects.count(); // preprocess rects area to see if it worths or not using subdivision @@ -577,7 +577,7 @@ void PageView::viewportPaintEvent( TQPaintEvent * pe ) // 2) Layer 1: pixmap manipulated areas // 3) Layer 2: paint (blend) transparent selection if ( !selectionRect.isNull() && selectionRect.intersects( contentsRect ) && - !selectionRectInternal.contains( contentsRect ) ) + !selectionRectInternal.tqcontains( contentsRect ) ) { TQRect blendRect = selectionRectInternal.intersect( contentsRect ); // skip rectangles covered by the selection's border @@ -592,7 +592,7 @@ void PageView::viewportPaintEvent( TQPaintEvent * pe ) TQImage blendedImage = blendedPixmap.convertToImage(); KImageEffect::blend( selBlendColor.dark(140), blendedImage, 0.2 ); // copy the blended pixmap back to its place - pixmapPainter.drawPixmap( blendRect.left(), blendRect.top(), blendedImage ); + pixmapPainter.tqdrawPixmap( blendRect.left(), blendRect.top(), blendedImage ); } // draw border (red if the selection is too small) pixmapPainter.setPen( selBlendColor ); @@ -601,7 +601,7 @@ void PageView::viewportPaintEvent( TQPaintEvent * pe ) // 4) Layer 3: overlays if ( KpdfSettings::debugDrawBoundaries() ) { - pixmapPainter.setPen( Qt::blue ); + pixmapPainter.setPen( TQt::blue ); pixmapPainter.drawRect( contentsRect ); } @@ -616,15 +616,15 @@ void PageView::viewportPaintEvent( TQPaintEvent * pe ) // 2) Layer 1: opaque manipulated ares (filled / contours) // 3) Layer 2: paint opaque selection if ( !selectionRect.isNull() && selectionRect.intersects( contentsRect ) && - !selectionRectInternal.contains( contentsRect ) ) + !selectionRectInternal.tqcontains( contentsRect ) ) { - screenPainter.setPen( palette().active().highlight().dark(110) ); + screenPainter.setPen( tqpalette().active().highlight().dark(110) ); screenPainter.drawRect( selectionRect ); } // 4) Layer 3: overlays if ( KpdfSettings::debugDrawBoundaries() ) { - screenPainter.setPen( Qt::red ); + screenPainter.setPen( TQt::red ); screenPainter.drawRect( contentsRect ); } } @@ -637,7 +637,7 @@ void PageView::viewportResizeEvent( TQResizeEvent * ) if ( !d->delayResizeTimer ) { d->delayResizeTimer = new TQTimer( this ); - connect( d->delayResizeTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotRelayoutPages() ) ); + connect( d->delayResizeTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotRetqlayoutPages() ) ); } d->delayResizeTimer->start( 333, true ); } @@ -647,7 +647,7 @@ void PageView::keyPressEvent( TQKeyEvent * e ) e->accept(); // if performing a selection or dyn zooming, disable keys handling - if ( ( !d->mouseSelectionRect.isNull() && e->key() != Qt::Key_Escape ) || d->mouseMidStartY != -1 ) + if ( ( !d->mouseSelectionRect.isNull() && e->key() != TQt::Key_Escape ) || d->mouseMidStartY != -1 ) return; // handle 'find as you type' (based on khtml/khtmlview.cpp) @@ -660,9 +660,9 @@ void PageView::keyPressEvent( TQKeyEvent * e ) { d->typeAheadString = d->typeAheadString.left( d->typeAheadString.length() - 1 ); bool found = d->document->searchText( PAGEVIEW_SEARCH_ID, d->typeAheadString, true, false, - KPDFDocument::NextMatch, true, qRgb( 128, 255, 128 ), true ); + KPDFDocument::NextMatch, true, tqRgb( 128, 255, 128 ), true ); TQString status = found ? i18n("Text found: \"%1\".") : i18n("Text not found: \"%1\"."); - d->messageWindow->display( status.arg(d->typeAheadString.lower()), + d->messageWindow->display( status.tqarg(d->typeAheadString.lower()), found ? PageViewMessage::Find : PageViewMessage::Warning, 4000 ); d->findTimeoutTimer->start( 3000, true ); } @@ -682,7 +682,7 @@ void PageView::keyPressEvent( TQKeyEvent * e ) // because it activates the accel releaseKeyboard(); if ( d->document->continueSearch( PAGEVIEW_SEARCH_ID ) ) - d->messageWindow->display( i18n("Text found: \"%1\".").arg(d->typeAheadString.lower()), + d->messageWindow->display( i18n("Text found: \"%1\".").tqarg(d->typeAheadString.lower()), PageViewMessage::Find, 3000 ); d->findTimeoutTimer->start( 3000, true ); // it is needed to grab the keyboard becase people may have Space assigned to a @@ -784,7 +784,7 @@ void PageView::keyPressEvent( TQKeyEvent * e ) case Key_Right: horizontalScrollBar()->addLine(); break; - case Qt::Key_Escape: + case TQt::Key_Escape: selectionClear(); d->mousePressPos = TQPoint(); if ( d->aPrevAction ) @@ -840,19 +840,19 @@ void PageView::contentsMouseMoveEvent( TQMouseEvent * e ) return; // if holding mouse mid button, perform zoom - if ( (e->state() & MidButton) && d->mouseMidStartY >= 0 ) + if ( (e->state() & Qt::MidButton) && d->mouseMidStartY >= 0 ) { int deltaY = d->mouseMidStartY - e->globalPos().y(); d->mouseMidStartY = e->globalPos().y(); d->zoomFactor *= ( 1.0 + ( (double)deltaY / 500.0 ) ); updateZoom( ZoomRefreshCurrent ); // uncomment following line to force a complete redraw - viewport()->repaint( false ); + viewport()->tqrepaint( false ); return; } - bool leftButton = e->state() & LeftButton, - rightButton = e->state() & RightButton; + bool leftButton = e->state() & Qt::LeftButton, + rightButton = e->state() & Qt::RightButton; switch ( d->mouseMode ) { case MouseNormal: @@ -876,7 +876,7 @@ void PageView::contentsMouseMoveEvent( TQMouseEvent * e ) { d->aPrevAction = d->aMouseNormal; d->aMouseSelect->activate(); - TQColor selColor = palette().active().highlight().light( 120 ); + TQColor selColor = tqpalette().active().highlight().light( 120 ); selectionStart( e->x() + deltaX, e->y() + deltaY, selColor, false ); selectionEndPoint( e->x(), e->y() ); break; @@ -920,7 +920,7 @@ void PageView::contentsMousePressEvent( TQMouseEvent * e ) } // if pressing mid mouse button while not doing other things, begin 'comtinous zoom' mode - if ( e->button() & MidButton ) + if ( e->button() & Qt::MidButton ) { d->mouseMidStartY = e->globalPos().y(); setCursor( KCursor::sizeVerCursor() ); @@ -931,8 +931,8 @@ void PageView::contentsMousePressEvent( TQMouseEvent * e ) d->mousePressPos = e->globalPos(); // handle mode dependant mouse press actions - bool leftButton = e->button() & LeftButton, - rightButton = e->button() & RightButton; + bool leftButton = e->button() & Qt::LeftButton, + rightButton = e->button() & Qt::RightButton; switch ( d->mouseMode ) { case MouseNormal: // drag start / click / link following @@ -946,7 +946,7 @@ void PageView::contentsMousePressEvent( TQMouseEvent * e ) case MouseZoom: // set first corner of the zoom rect if ( leftButton ) - selectionStart( e->x(), e->y(), palette().active().highlight(), false ); + selectionStart( e->x(), e->y(), tqpalette().active().highlight(), false ); else if ( rightButton ) updateZoom( ZoomOut ); break; @@ -954,7 +954,7 @@ void PageView::contentsMousePressEvent( TQMouseEvent * e ) case MouseSelect: // set first corner of the selection rect if ( leftButton ) { - TQColor selColor = palette().active().highlight().light( 120 ); + TQColor selColor = tqpalette().active().highlight().light( 120 ); selectionStart( e->x(), e->y(), selColor, false ); } break; @@ -973,7 +973,7 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e ) if ( d->items.isEmpty() ) { // ..except for right Clicks (emitted even it viewport is empty) - if ( e->button() == RightButton ) + if ( e->button() == Qt::RightButton ) emit rightClick( 0, e->globalPos() ); return; } @@ -983,7 +983,7 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e ) return; // handle mode indepent mid buttom zoom - bool midButton = e->button() & MidButton; + bool midButton = e->button() & Qt::MidButton; if ( midButton && d->mouseMidStartY > 0 ) { d->mouseMidStartY = -1; @@ -992,13 +992,13 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e ) return; } - bool leftButton = e->button() & LeftButton, - rightButton = e->button() & RightButton; + bool leftButton = e->button() & Qt::LeftButton, + rightButton = e->button() & Qt::RightButton; switch ( d->mouseMode ) { case MouseNormal:{ // return the cursor to its normal state after dragging - if ( cursor().shape() == Qt::SizeAllCursor ) + if ( cursor().shape() == TQt::SizeAllCursor ) updateCursor( e->pos() ); PageViewItem * pageItem = pickItemOnPoint( e->x(), e->y() ); @@ -1006,8 +1006,8 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e ) // if the mouse has not moved since the press, that's a -click- if ( leftButton && pageItem && d->mousePressPos == e->globalPos()) { - double nX = (double)(e->x() - pageItem->geometry().left()) / (double)pageItem->width(), - nY = (double)(e->y() - pageItem->geometry().top()) / (double)pageItem->height(); + double nX = (double)(e->x() - pageItem->tqgeometry().left()) / (double)pageItem->width(), + nY = (double)(e->y() - pageItem->tqgeometry().top()) / (double)pageItem->height(); const ObjectRect * linkRect, * imageRect; linkRect = pageItem->page()->hasObject( ObjectRect::Link, nX, nY ); if ( linkRect ) @@ -1052,7 +1052,7 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e ) } // find out new zoom ratio and normalized view center (relative to the contentsRect) - double zoom = QMIN( (double)visibleWidth() / (double)selRect.width(), (double)visibleHeight() / (double)selRect.height() ); + double zoom = TQMIN( (double)visibleWidth() / (double)selRect.width(), (double)visibleHeight() / (double)selRect.height() ); double nX = (double)(selRect.left() + selRect.right()) / (2.0 * (double)contentsWidth()); double nY = (double)(selRect.top() + selRect.bottom()) / (2.0 * (double)contentsHeight()); @@ -1105,16 +1105,16 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e ) for ( ; iIt != iEnd; ++iIt ) { PageViewItem * item = *iIt; - const TQRect & itemRect = item->geometry(); - if ( selectionRect.intersects( itemRect ) ) + const TQRect & tqitemRect = item->tqgeometry(); + if ( selectionRect.intersects( tqitemRect ) ) { // request the textpage if there isn't one const KPDFPage * kpdfPage = item->page(); if ( !kpdfPage->hasSearchPage() ) d->document->requestTextPage( kpdfPage->number() ); - // grab text in the rect that intersects itemRect - TQRect relativeRect = selectionRect.intersect( itemRect ); - relativeRect.moveBy( -itemRect.left(), -itemRect.top() ); + // grab text in the rect that intersects tqitemRect + TQRect relativeRect = selectionRect.intersect( tqitemRect ); + relativeRect.moveBy( -tqitemRect.left(), -tqitemRect.top() ); NormalizedRect normRect( relativeRect, item->width(), item->height() ); selectedText += kpdfPage->getText( normRect ); } @@ -1131,7 +1131,7 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e ) if ( KpdfSettings::useKTTSD() ) menu.insertItem( SmallIcon("kttsd"), i18n( "Speak Text" ), 2 ); } - menu.insertTitle( i18n( "Image (%1 by %2 pixels)" ).arg( selectionRect.width() ).arg( selectionRect.height() ) ); + menu.insertTitle( i18n( "Image (%1 by %2 pixels)" ).tqarg( selectionRect.width() ).tqarg( selectionRect.height() ) ); menu.insertItem( SmallIcon("image"), i18n( "Copy to Clipboard" ), 3 ); menu.insertItem( SmallIcon("filesave"), i18n( "Save to File..." ), 4 ); int choice = menu.exec( e->globalPos() ); @@ -1147,16 +1147,16 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e ) if ( choice == 3 ) { // [2] copy pixmap to clipboard - QClipboard *cb = TQApplication::clipboard(); - cb->setPixmap( copyPix, QClipboard::Clipboard ); + TQClipboard *cb = TQApplication::tqclipboard(); + cb->setPixmap( copyPix, TQClipboard::Clipboard ); if ( cb->supportsSelection() ) - cb->setPixmap( copyPix, QClipboard::Selection ); - d->messageWindow->display( i18n( "Image [%1x%2] copied to clipboard." ).arg( copyPix.width() ).arg( copyPix.height() ) ); + cb->setPixmap( copyPix, TQClipboard::Selection ); + d->messageWindow->display( i18n( "Image [%1x%2] copied to clipboard." ).tqarg( copyPix.width() ).tqarg( copyPix.height() ) ); } else if ( choice == 4 ) { // [3] save pixmap to file - TQString fileName = KFileDialog::getSaveFileName( TQString::null, "image/png image/jpeg", this ); + TQString fileName = KFileDialog::getSaveFileName( TQString(), "image/png image/jpeg", this ); if ( fileName.isNull() ) d->messageWindow->display( i18n( "File not saved." ), PageViewMessage::Warning ); else @@ -1165,7 +1165,7 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e ) if ( type.isNull() ) type = "PNG"; copyPix.save( fileName, type.latin1() ); - d->messageWindow->display( i18n( "Image [%1x%2] saved to %3 file." ).arg( copyPix.width() ).arg( copyPix.height() ).arg( type ) ); + d->messageWindow->display( i18n( "Image [%1x%2] saved to %3 file." ).tqarg( copyPix.width() ).tqarg( copyPix.height() ).tqarg( type ) ); } } } @@ -1175,10 +1175,10 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e ) if ( choice == 1 ) { // [1] copy text to clipboard - QClipboard *cb = TQApplication::clipboard(); - cb->setText( selectedText, QClipboard::Clipboard ); + TQClipboard *cb = TQApplication::tqclipboard(); + cb->setText( selectedText, TQClipboard::Clipboard ); if ( cb->supportsSelection() ) - cb->setText( selectedText, QClipboard::Selection ); + cb->setText( selectedText, TQClipboard::Selection ); } else if ( choice == 2 ) { @@ -1194,7 +1194,7 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e ) TQString error; if (KApplication::startServiceByDesktopName("kttsd", TQStringList(), &error)) { - d->messageWindow->display( i18n("Starting KTTSD Failed: %1").arg(error) ); + d->messageWindow->display( i18n("Starting KTTSD Failed: %1").tqarg(error) ); KpdfSettings::setUseKTTSD(false); KpdfSettings::writeConfig(); } @@ -1221,7 +1221,7 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e ) } } - // clear widget selection and invalidate rect + // clear widget selection and tqinvalidate rect selectionClear(); // restore previous action if came from it using right button @@ -1323,39 +1323,39 @@ void PageView::paintItems( TQPainter * p, const TQRect & contentsRect ) for ( ; iIt != iEnd; ++iIt ) { // check if a piece of the page intersects the contents rect - if ( !(*iIt)->geometry().intersects( checkRect ) ) + if ( !(*iIt)->tqgeometry().intersects( checkRect ) ) continue; PageViewItem * item = *iIt; - TQRect pixmapGeometry = item->geometry(); + TQRect pixmapGeometry = item->tqgeometry(); // translate the painter so we draw top-left pixmap corner in 0,0 p->save(); p->translate( pixmapGeometry.left(), pixmapGeometry.top() ); - // item pixmap and outline geometry + // item pixmap and outline tqgeometry TQRect outlineGeometry = pixmapGeometry; outlineGeometry.addCoords( -1, -1, 3, 3 ); // draw the page outline (little black border and 2px shadow) - if ( !pixmapGeometry.contains( contentsRect ) ) + if ( !pixmapGeometry.tqcontains( contentsRect ) ) { int pixmapWidth = pixmapGeometry.width(), pixmapHeight = pixmapGeometry.height(); // draw simple outline - p->setPen( Qt::black ); + p->setPen( TQt::black ); p->drawRect( -1, -1, pixmapWidth + 2, pixmapHeight + 2 ); // draw bottom/right gradient int levels = 2; - int r = Qt::gray.red() / (levels + 2), - g = Qt::gray.green() / (levels + 2), - b = Qt::gray.blue() / (levels + 2); + int r = TQt::gray.red() / (levels + 2), + g = TQt::gray.green() / (levels + 2), + b = TQt::gray.blue() / (levels + 2); for ( int i = 0; i < levels; i++ ) { p->setPen( TQColor( r * (i+2), g * (i+2), b * (i+2) ) ); p->drawLine( i, i + pixmapHeight + 1, i + pixmapWidth + 1, i + pixmapHeight + 1 ); p->drawLine( i + pixmapWidth + 1, i, i + pixmapWidth + 1, i + pixmapHeight ); - p->setPen( Qt::gray ); + p->setPen( TQt::gray ); p->drawLine( -1, i + pixmapHeight + 1, i - 1, i + pixmapHeight + 1 ); p->drawLine( i + pixmapWidth + 1, -1, i + pixmapWidth + 1, i - 1 ); } @@ -1378,10 +1378,10 @@ void PageView::paintItems( TQPainter * p, const TQRect & contentsRect ) } // paint with background color the unpainted area - TQMemArray<TQRect> backRects = remainingArea.rects(); + TQMemArray<TQRect> backRects = remainingArea.tqrects(); uint backRectsNumber = backRects.count(); for ( uint jr = 0; jr < backRectsNumber; jr++ ) - p->fillRect( backRects[ jr ], Qt::gray ); + p->fillRect( backRects[ jr ], TQt::gray ); } void PageView::updateItemSize( PageViewItem * item, int colWidth, int rowHeight ) @@ -1407,7 +1407,7 @@ void PageView::updateItemSize( PageViewItem * item, int colWidth, int rowHeight { double scaleW = (double)colWidth / (double)width; double scaleH = (double)rowHeight / (double)height; - zoom = QMIN( scaleW, scaleH ); + zoom = TQMIN( scaleW, scaleH ); item->setWHZ( (int)(zoom * width), (int)(zoom * height), zoom ); d->zoomFactor = zoom; } @@ -1424,7 +1424,7 @@ PageViewItem * PageView::pickItemOnPoint( int x, int y ) for ( ; iIt != iEnd; ++iIt ) { PageViewItem * i = *iIt; - const TQRect & r = i->geometry(); + const TQRect & r = i->tqgeometry(); if ( x < r.right() && x > r.left() && y < r.bottom() ) { if ( y > r.top() ) @@ -1465,8 +1465,8 @@ void PageView::selectionEndPoint( int x, int y ) // clip selection to the viewport TQRect viewportRect( contentsX(), contentsY(), visibleWidth(), visibleHeight() ); - x = QMAX( QMIN( x, viewportRect.right() ), viewportRect.left() ); - y = QMAX( QMIN( y, viewportRect.bottom() ), viewportRect.top() ); + x = TQMAX( TQMIN( x, viewportRect.right() ), viewportRect.left() ); + y = TQMAX( TQMIN( y, viewportRect.bottom() ), viewportRect.top() ); // if selection changed update rect if ( d->mouseSelectionRect.right() != x || d->mouseSelectionRect.bottom() != y ) { @@ -1485,7 +1485,7 @@ void PageView::selectionEndPoint( int x, int y ) compoundRegion -= intersection; } // tassellate region with rects and enqueue paint events - TQMemArray<TQRect> rects = compoundRegion.rects(); + TQMemArray<TQRect> rects = compoundRegion.tqrects(); for ( uint i = 0; i < rects.count(); i++ ) updateContents( rects[i] ); } @@ -1513,7 +1513,7 @@ void PageView::updateZoom( ZoomMode newZoomMode ) { case ZoomFixed:{ //ZoomFixed case TQString z = d->aZoom->currentText(); - newFactor = KGlobal::locale()->readNumber( z.remove( z.find( '%' ), 1 ) ) / 100.0; + newFactor = KGlobal::locale()->readNumber( z.remove( z.tqfind( '%' ), 1 ) ) / 100.0; }break; case ZoomIn: newFactor += (newFactor > 0.99) ? ( newFactor > 1.99 ? 0.5 : 0.2 ) : 0.1; @@ -1544,13 +1544,13 @@ void PageView::updateZoom( ZoomMode newZoomMode ) if ( newZoomMode != d->zoomMode || (newZoomMode == ZoomFixed && newFactor != d->zoomFactor ) ) { - // rebuild layout and update the whole viewport + // rebuild tqlayout and update the whole viewport d->zoomMode = newZoomMode; d->zoomFactor = newFactor; // be sure to block updates to document's viewport bool prevState = d->blockViewport; d->blockViewport = true; - slotRelayoutPages(); + slotRetqlayoutPages(); d->blockViewport = prevState; // request pixmaps slotRequestVisiblePixmaps(); @@ -1572,7 +1572,7 @@ void PageView::updateZoomText() { // use current page zoom as zoomFactor if in ZoomFit/* mode if ( d->zoomMode != ZoomFixed && d->items.count() > 0 ) - d->zoomFactor = d->items[ QMAX( 0, (int)d->document->currentPage() ) ]->zoomFactor(); + d->zoomFactor = d->items[ TQMAX( 0, (int)d->document->currentPage() ) ]->zoomFactor(); float newFactor = d->zoomFactor; d->aZoom->clear(); @@ -1599,7 +1599,7 @@ void PageView::updateZoomText() selIdx++; TQString localValue( KGlobal::locale()->formatNumber( value * 100.0, 2 ) ); localValue.remove( KGlobal::locale()->decimalSymbol() + double_oh ); - translated << TQString( "%1%" ).arg( localValue ); + translated << TQString( "%1%" ).tqarg( localValue ); } d->aZoom->setItems( translated ); @@ -1619,8 +1619,8 @@ void PageView::updateCursor( const TQPoint &p ) PageViewItem * pageItem = pickItemOnPoint( p.x(), p.y() ); if ( pageItem && d->mouseMode == MouseNormal ) { - double nX = (double)(p.x() - pageItem->geometry().left()) / (double)pageItem->width(), - nY = (double)(p.y() - pageItem->geometry().top()) / (double)pageItem->height(); + double nX = (double)(p.x() - pageItem->tqgeometry().left()) / (double)pageItem->width(), + nY = (double)(p.y() - pageItem->tqgeometry().top()) / (double)pageItem->height(); // if over a ObjectRect (of type Link) change cursor to hand d->mouseOnRect = pageItem->page()->hasObject( ObjectRect::Link, nX, nY ); @@ -1641,15 +1641,15 @@ void PageView::updateCursor( const TQPoint &p ) void PageView::doTypeAheadSearch() { bool found = d->document->searchText( PAGEVIEW_SEARCH_ID, d->typeAheadString, false, false, - KPDFDocument::NextMatch, true, qRgb( 128, 255, 128 ), true ); + KPDFDocument::NextMatch, true, tqRgb( 128, 255, 128 ), true ); TQString status = found ? i18n("Text found: \"%1\".") : i18n("Text not found: \"%1\"."); - d->messageWindow->display( status.arg(d->typeAheadString.lower()), + d->messageWindow->display( status.tqarg(d->typeAheadString.lower()), found ? PageViewMessage::Find : PageViewMessage::Warning, 4000 ); d->findTimeoutTimer->start( 3000, true ); } //BEGIN private SLOTS -void PageView::slotRelayoutPages() +void PageView::slotRetqlayoutPages() // called by: notifySetup, viewportResizeEvent, slotTwoPagesToggled, slotContinuousToggled, updateZoom { // set an empty container if we have no pages @@ -1677,7 +1677,7 @@ void PageView::slotRelayoutPages() fullHeight = 0; TQRect viewportRect( contentsX(), contentsY(), viewportWidth, viewportHeight ); - // set all items geometry and resize contents. handle 'continuous' and 'single' modes separately + // set all items tqgeometry and resize contents. handle 'continuous' and 'single' modes separately if ( KpdfSettings::viewContinuous() ) { // Here we find out column's width and row's height to compute a table @@ -1746,7 +1746,7 @@ void PageView::slotRelayoutPages() } else // viewContinuous is FALSE { - PageViewItem * currentItem = d->items[ QMAX( 0, (int)d->document->currentPage() ) ]; + PageViewItem * currentItem = d->items[ TQMAX( 0, (int)d->document->currentPage() ) ]; // setup varialbles for a 1(row) x N(columns) grid int nCols = KpdfSettings::viewColumns(), @@ -1816,11 +1816,11 @@ void PageView::slotRelayoutPages() { int prevX = contentsX(), prevY = contentsY(); - const TQRect & geometry = d->items[ vp.pageNumber ]->geometry(); + const TQRect & tqgeometry = d->items[ vp.pageNumber ]->tqgeometry(); double nX = vp.rePos.enabled ? vp.rePos.normalizedX : 0.5, nY = vp.rePos.enabled ? vp.rePos.normalizedY : 0.0; - center( geometry.left() + ROUND( nX * (double)geometry.width() ), - geometry.top() + ROUND( nY * (double)geometry.height() ) ); + center( tqgeometry.left() + ROUND( nX * (double)tqgeometry.width() ), + tqgeometry.top() + ROUND( nY * (double)tqgeometry.height() ) ); // center() usually moves the viewport, that requests pixmaps too. // if that doesn't happen we have to request them by hand if ( prevX == contentsX() && prevY == contentsY() ) @@ -1867,7 +1867,7 @@ void PageView::slotRequestVisiblePixmaps( int newLeft, int newTop ) PageViewItem * i = *iIt; // if the item doesn't intersect the viewport, skip it - if ( !viewportRect.intersects( i->geometry() ) ) + if ( !viewportRect.intersects( i->tqgeometry() ) ) continue; // add the item to the 'visible list' @@ -1885,18 +1885,18 @@ void PageView::slotRequestVisiblePixmaps( int newLeft, int newTop ) // position between the item and the viewport center if ( isEvent ) { - const TQRect & geometry = i->geometry(); + const TQRect & tqgeometry = i->tqgeometry(); // compute distance between item center and viewport center - double distance = hypot( (geometry.left() + geometry.right()) / 2 - viewportCenterX, - (geometry.top() + geometry.bottom()) / 2 - viewportCenterY ); + double distance = hypot( (tqgeometry.left() + tqgeometry.right()) / 2 - viewportCenterX, + (tqgeometry.top() + tqgeometry.bottom()) / 2 - viewportCenterY ); if ( distance >= minDistance && nearPageNumber != -1 ) continue; nearPageNumber = i->pageNumber(); minDistance = distance; - if ( geometry.height() > 0 && geometry.width() > 0 ) + if ( tqgeometry.height() > 0 && tqgeometry.width() > 0 ) { - focusedX = ( viewportCenterX - (double)geometry.left() ) / (double)geometry.width(); - focusedY = ( viewportCenterY - (double)geometry.top() ) / (double)geometry.height(); + focusedX = ( viewportCenterX - (double)tqgeometry.left() ) / (double)tqgeometry.width(); + focusedY = ( viewportCenterY - (double)tqgeometry.top() ) / (double)tqgeometry.height(); } } } @@ -2070,7 +2070,7 @@ void PageView::slotRotateRight() // be sure to block updates to document's viewport bool prevState = d->blockViewport; d->blockViewport = true; - slotRelayoutPages(); + slotRetqlayoutPages(); d->blockViewport = prevState; // request pixmaps slotRequestVisiblePixmaps(); @@ -2094,7 +2094,7 @@ void PageView::slotRotateLeft() // be sure to block updates to document's viewport bool prevState = d->blockViewport; d->blockViewport = true; - slotRelayoutPages(); + slotRetqlayoutPages(); d->blockViewport = prevState; // request pixmaps slotRequestVisiblePixmaps(); @@ -2108,7 +2108,7 @@ void PageView::slotTwoPagesToggled( bool on ) KpdfSettings::setViewColumns( newColumns ); KpdfSettings::writeConfig(); if ( d->document->pages() > 0 ) - slotRelayoutPages(); + slotRetqlayoutPages(); } } @@ -2119,7 +2119,7 @@ void PageView::slotContinuousToggled( bool on ) KpdfSettings::setViewContinuous( on ); KpdfSettings::writeConfig(); if ( d->document->pages() > 0 ) - slotRelayoutPages(); + slotRetqlayoutPages(); } } diff --git a/kpdf/ui/pageview.h b/kpdf/ui/pageview.h index 3742e804..97114dcc 100644 --- a/kpdf/ui/pageview.h +++ b/kpdf/ui/pageview.h @@ -39,11 +39,12 @@ class PageViewTip; class PageView : public TQScrollView, public DocumentObserver { Q_OBJECT + TQ_OBJECT friend class PageViewTip; public: - PageView( TQWidget *parent, KPDFDocument *document ); + PageView( TQWidget *tqparent, KPDFDocument *document ); ~PageView(); // Zoom mode ( last 4 are internally used only! ) @@ -100,7 +101,7 @@ class PageView : public TQScrollView, public DocumentObserver void selectionStart( int x, int y, const TQColor & color, bool aboveAll = false ); void selectionEndPoint( int x, int y ); void selectionClear(); - // update internal zoom values and end in a slotRelayoutPages(); + // update internal zoom values and end in a slotRetqlayoutPages(); void updateZoom( ZoomMode newZm ); // update the text on the label using global zoom value or current page's one void updateZoomText(); @@ -114,7 +115,7 @@ class PageView : public TQScrollView, public DocumentObserver private slots: // activated either directly or via TQTimer on the viewportResizeEvent - void slotRelayoutPages(); + void slotRetqlayoutPages(); // activated either directly or via the contentsMoving(int,int) signal void slotRequestVisiblePixmaps( int left = -1, int top = -1 ); // activated by the viewport move timer diff --git a/kpdf/ui/pageviewutils.cpp b/kpdf/ui/pageviewutils.cpp index eaf5fc95..ed5c637a 100644 --- a/kpdf/ui/pageviewutils.cpp +++ b/kpdf/ui/pageviewutils.cpp @@ -21,13 +21,13 @@ #include "core/page.h" #include "conf/settings.h" -PageViewMessage::PageViewMessage( TQWidget * parent ) - : TQWidget( parent, "pageViewMessage" ), m_timer( 0 ) +PageViewMessage::PageViewMessage( TQWidget * tqparent ) + : TQWidget( tqparent, "pageViewMessage" ), m_timer( 0 ) { - setFocusPolicy( NoFocus ); + setFocusPolicy( TQ_NoFocus ); setBackgroundMode( NoBackground ); setPaletteBackgroundColor(kapp->palette().color(TQPalette::Active, TQColorGroup::Background)); - // if the layout is LtR, we can safely place it in the right position + // if the tqlayout is LtR, we can safely place it in the right position if ( !TQApplication::reverseLayout() ) move( 10, 10 ); resize( 0, 0 ); @@ -54,7 +54,7 @@ void PageViewMessage::display( const TQString & message, Icon icon, int duration iconXOffset = 0, shadowOffset = 1; - // load icon (if set) and update geometry + // load icon (if set) and update tqgeometry TQPixmap symbol; if ( icon != None ) { @@ -82,46 +82,46 @@ void PageViewMessage::display( const TQString & message, Icon icon, int duration textXOffset = 2 + symbol.width(); } width += 2 + symbol.width(); - height = QMAX( height, symbol.height() ); + height = TQMAX( height, symbol.height() ); } - TQRect geometry( 0, 0, width + 10, height + 8 ); + TQRect tqgeometry( 0, 0, width + 10, height + 8 ); - // resize pixmap, mask and widget - static TQBitmap mask; - mask.resize( geometry.size() ); - m_pixmap.resize( geometry.size() ); - resize( geometry.size() ); + // resize pixmap, tqmask and widget + static TQBitmap tqmask; + tqmask.resize( tqgeometry.size() ); + m_pixmap.resize( tqgeometry.size() ); + resize( tqgeometry.size() ); - // create and set transparency mask - TQPainter maskPainter( &mask); - mask.fill( Qt::black ); - maskPainter.setBrush( Qt::white ); - maskPainter.drawRoundRect( geometry, 1600 / geometry.width(), 1600 / geometry.height() ); - setMask( mask ); + // create and set transparency tqmask + TQPainter tqmaskPainter( &tqmask); + tqmask.fill( TQt::black ); + tqmaskPainter.setBrush( TQt::white ); + tqmaskPainter.drawRoundRect( tqgeometry, 1600 / tqgeometry.width(), 1600 / tqgeometry.height() ); + setMask( tqmask ); // draw background TQPainter bufferPainter( &m_pixmap ); - bufferPainter.setPen( Qt::black ); + bufferPainter.setPen( TQt::black ); bufferPainter.setBrush( paletteBackgroundColor() ); - bufferPainter.drawRoundRect( geometry, 1600 / geometry.width(), 1600 / geometry.height() ); + bufferPainter.drawRoundRect( tqgeometry, 1600 / tqgeometry.width(), 1600 / tqgeometry.height() ); // draw icon if present if ( !symbol.isNull() ) bufferPainter.drawPixmap( 5 + iconXOffset, 4, symbol, 0, 0, symbol.width(), symbol.height() ); // draw shadow and text - int yText = geometry.height() - height / 2; + int yText = tqgeometry.height() - height / 2; bufferPainter.setPen( paletteBackgroundColor().dark( 115 ) ); bufferPainter.drawText( 5 + textXOffset + shadowOffset, yText + 1, message ); bufferPainter.setPen( foregroundColor() ); bufferPainter.drawText( 5 + textXOffset, yText, message ); - // if the layout is RtL, we can move it to the right place only after we + // if the tqlayout is RtL, we can move it to the right place only after we // know how much size it will take if ( TQApplication::reverseLayout() ) - move( parentWidget()->width() - geometry.width() - 10, 10 ); + move( tqparentWidget()->width() - tqgeometry.width() - 10, 10 ); - // show widget and schedule a repaint + // show widget and schedule a tqrepaint show(); update(); @@ -168,19 +168,19 @@ int PageViewItem::pageNumber() const return m_page->number(); } -const TQRect& PageViewItem::geometry() const +const TQRect& PageViewItem::tqgeometry() const { - return m_geometry; + return m_tqgeometry; } int PageViewItem::width() const { - return m_geometry.width(); + return m_tqgeometry.width(); } int PageViewItem::height() const { - return m_geometry.height(); + return m_tqgeometry.height(); } double PageViewItem::zoomFactor() const @@ -190,18 +190,18 @@ double PageViewItem::zoomFactor() const void PageViewItem::setGeometry( int x, int y, int width, int height ) { - m_geometry.setRect( x, y, width, height ); + m_tqgeometry.setRect( x, y, width, height ); } void PageViewItem::setWHZ( int w, int h, double z ) { - m_geometry.setWidth( w ); - m_geometry.setHeight( h ); + m_tqgeometry.setWidth( w ); + m_tqgeometry.setHeight( h ); m_zoomFactor = z; } void PageViewItem::moveTo( int x, int y ) { - m_geometry.moveLeft( x ); - m_geometry.moveTop( y ); + m_tqgeometry.moveLeft( x ); + m_tqgeometry.moveTop( y ); } diff --git a/kpdf/ui/pageviewutils.h b/kpdf/ui/pageviewutils.h index d1e5cecf..0bd6bd32 100644 --- a/kpdf/ui/pageviewutils.h +++ b/kpdf/ui/pageviewutils.h @@ -23,7 +23,7 @@ class KPDFPage; /** * @short PageViewItem represents graphically a kpdfpage into the PageView. * - * It has methods for settings Item's geometry and other visual properties such + * It has methods for settings Item's tqgeometry and other visual properties such * as the individual zoom factor. */ class PageViewItem @@ -33,7 +33,7 @@ class PageViewItem const KPDFPage * page() const; int pageNumber() const; - const TQRect& geometry() const; + const TQRect& tqgeometry() const; int width() const; int height() const; double zoomFactor() const; @@ -45,17 +45,17 @@ class PageViewItem private: const KPDFPage * m_page; double m_zoomFactor; - TQRect m_geometry; + TQRect m_tqgeometry; }; /** * @short A widget that displays messages in the top-left corner. */ -class PageViewMessage : public QWidget +class PageViewMessage : public TQWidget { public: - PageViewMessage( TQWidget * parent ); + PageViewMessage( TQWidget * tqparent ); enum Icon { None, Info, Warning, Error, Find }; void display( const TQString & message, Icon icon = Info, int durationMs = 4000 ); diff --git a/kpdf/ui/presentationwidget.cpp b/kpdf/ui/presentationwidget.cpp index 450f25df..6767db2c 100644 --- a/kpdf/ui/presentationwidget.cpp +++ b/kpdf/ui/presentationwidget.cpp @@ -43,25 +43,25 @@ #define ENABLE_PROGRESS_OVERLAY -// a frame contains a pointer to the page object, its geometry and the +// a frame contains a pointer to the page object, its tqgeometry and the // transition effect to the next frame struct PresentationFrame { const KPDFPage * page; - TQRect geometry; + TQRect tqgeometry; }; -PresentationWidget::PresentationWidget( TQWidget * parent, KPDFDocument * doc ) - : TQDialog( parent, "presentationWidget", true, WDestructiveClose | WStyle_NoBorder), +PresentationWidget::PresentationWidget( TQWidget * tqparent, KPDFDocument * doc ) + : TQDialog( tqparent, "presentationWidget", true, WDestructiveClose | WStyle_NoBorder), m_pressedLink( 0 ), m_handCursor( false ), m_document( doc ), m_frameIndex( -1 ) { - // set look and geometry - setBackgroundMode( Qt::NoBackground ); + // set look and tqgeometry + setBackgroundMode( TQt::NoBackground ); m_width = -1; - m_accel = new KAccel( this, this, "presentationmode-accel" ); + m_accel = new KAccel( this, TQT_TQOBJECT(this), "presentationmode-accel" ); // show widget and take control showFullScreen(); @@ -100,11 +100,11 @@ PresentationWidget::~PresentationWidget() void PresentationWidget::setupActions( KActionCollection * ac ) { - m_accel->insert( "previous_page", ac->action( "previous_page" )->shortcut(), this, TQT_SLOT( slotPrevPage() ), false, true ); - m_accel->insert( "next_page", ac->action( "next_page" )->shortcut(), this, TQT_SLOT( slotNextPage() ), false, true ); - m_accel->insert( "first_page", ac->action( "first_page" )->shortcut(), this, TQT_SLOT( slotFirstPage() ), false, true ); - m_accel->insert( "last_page", ac->action( "last_page" )->shortcut(), this, TQT_SLOT( slotLastPage() ), false, true ); - m_accel->insert( "presentation", ac->action( "presentation" )->shortcut(), this, TQT_SLOT( close() ), false, true ); + m_accel->insert( "previous_page", ac->action( "previous_page" )->shortcut(), TQT_TQOBJECT(this), TQT_SLOT( slotPrevPage() ), false, true ); + m_accel->insert( "next_page", ac->action( "next_page" )->shortcut(), TQT_TQOBJECT(this), TQT_SLOT( slotNextPage() ), false, true ); + m_accel->insert( "first_page", ac->action( "first_page" )->shortcut(), TQT_TQOBJECT(this), TQT_SLOT( slotFirstPage() ), false, true ); + m_accel->insert( "last_page", ac->action( "last_page" )->shortcut(), TQT_TQOBJECT(this), TQT_SLOT( slotLastPage() ), false, true ); + m_accel->insert( "presentation", ac->action( "presentation" )->shortcut(), TQT_TQOBJECT(this), TQT_SLOT( close() ), false, true ); } void PresentationWidget::notifySetup( const TQValueVector< KPDFPage * > & pageSet, bool /*documentChanged*/ ) @@ -124,7 +124,7 @@ void PresentationWidget::notifySetup( const TQValueVector< KPDFPage * > & pageSe { PresentationFrame * frame = new PresentationFrame(); frame->page = *setIt; - // calculate frame geometry keeping constant aspect ratio + // calculate frame tqgeometry keeping constant aspect ratio float pageRatio = frame->page->ratio(); int pageWidth = m_width, pageHeight = m_height; @@ -132,7 +132,7 @@ void PresentationWidget::notifySetup( const TQValueVector< KPDFPage * > & pageSe pageWidth = (int)( (float)pageHeight / pageRatio ); else pageHeight = (int)( (float)pageWidth * pageRatio ); - frame->geometry.setRect( (m_width - pageWidth) / 2, + frame->tqgeometry.setRect( (m_width - pageWidth) / 2, (m_height - pageHeight) / 2, pageWidth, pageHeight ); // add the frame to the vector @@ -145,11 +145,11 @@ void PresentationWidget::notifySetup( const TQValueVector< KPDFPage * > & pageSe if ( info ) { if ( !info->get( "title" ).isNull() ) - m_metaStrings += i18n( "Title: %1" ).arg( info->get( "title" ) ); + m_metaStrings += i18n( "Title: %1" ).tqarg( info->get( "title" ) ); if ( !info->get( "author" ).isNull() ) - m_metaStrings += i18n( "Author: %1" ).arg( info->get( "author" ) ); + m_metaStrings += i18n( "Author: %1" ).tqarg( info->get( "author" ) ); } - m_metaStrings += i18n( "Pages: %1" ).arg( m_document->pages() ); + m_metaStrings += i18n( "Pages: %1" ).tqarg( m_document->pages() ); m_metaStrings += i18n( "Click to begin" ); } @@ -242,7 +242,7 @@ void PresentationWidget::mousePressEvent( TQMouseEvent * e ) return; // handle clicking on top-right overlay - if ( m_overlayGeometry.contains( e->pos() ) ) + if ( m_overlayGeometry.tqcontains( e->pos() ) ) { overlayClick( e->pos() ); return; @@ -287,10 +287,10 @@ void PresentationWidget::mouseMoveEvent( TQMouseEvent * e ) else { // show the bar if reaching top 2 pixels - if ( e->y() <= (geometry().top() + 1) ) + if ( e->y() <= (tqgeometry().top() + 1) ) m_topBar->show(); - // handle "dragging the wheel" if clicking on its geometry - else if ( e->state() == Qt::LeftButton && m_overlayGeometry.contains( e->pos() ) ) + // handle "dragging the wheel" if clicking on its tqgeometry + else if ( e->state() == Qt::LeftButton && m_overlayGeometry.tqcontains( e->pos() ) ) overlayClick( e->pos() ); } } @@ -307,16 +307,16 @@ void PresentationWidget::paintEvent( TQPaintEvent * pe ) m_topBar = new KToolBar( this, "presentationBar" ); m_topBar->setIconSize( 32 ); m_topBar->setMovingEnabled( false ); - m_topBar->insertButton( TQApplication::reverseLayout() ? "1rightarrow" : "1leftarrow", 2, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotPrevPage() ) ); - m_topBar->insertButton( TQApplication::reverseLayout() ? "1leftarrow" : "1rightarrow", 3, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotNextPage() ) ); - m_topBar->insertButton( "exit", 1, TQT_SIGNAL( clicked() ), this, TQT_SLOT( close() ) ); + m_topBar->insertButton( TQApplication::reverseLayout() ? "1rightarrow" : "1leftarrow", 2, TQT_SIGNAL( clicked() ), TQT_TQOBJECT(this), TQT_SLOT( slotPrevPage() ) ); + m_topBar->insertButton( TQApplication::reverseLayout() ? "1leftarrow" : "1rightarrow", 3, TQT_SIGNAL( clicked() ), TQT_TQOBJECT(this), TQT_SLOT( slotNextPage() ) ); + m_topBar->insertButton( "exit", 1, TQT_SIGNAL( clicked() ), TQT_TQOBJECT(this), TQT_SLOT( close() ) ); m_topBar->setGeometry( 0, 0, m_width, 32 + 10 ); m_topBar->alignItemRight( 1 ); m_topBar->hide(); // change topbar background color - TQPalette p = m_topBar->palette(); - p.setColor( TQPalette::Active, TQColorGroup::Button, Qt::gray ); - p.setColor( TQPalette::Active, TQColorGroup::Background, Qt::darkGray ); + TQPalette p = m_topBar->tqpalette(); + p.setColor( TQPalette::Active, TQColorGroup::Button, TQt::gray ); + p.setColor( TQPalette::Active, TQColorGroup::Background, TQt::darkGray ); m_topBar->setPalette( p ); // register this observer in document. events will come immediately @@ -326,16 +326,16 @@ void PresentationWidget::paintEvent( TQPaintEvent * pe ) if ( KpdfSettings::slidesShowSummary() ) generatePage(); - KMessageBox::information(this, i18n("There are two ways of exiting presentation mode, you can press either ESC key or click with the quit button that appears when placing the mouse in the top-right corner. Of course you can cycle windows (Alt+TAB by default)"), TQString::null, "presentationInfo"); + KMessageBox::information(this, i18n("There are two ways of exiting presentation mode, you can press either ESC key or click with the quit button that appears when placing the mouse in the top-right corner. Of course you can cycle windows (Alt+TAB by default)"), TQString(), "presentationInfo"); } // check painting rect consistancy - TQRect r = pe->rect().intersect( geometry() ); + TQRect r = pe->rect().intersect( tqgeometry() ); if ( r.isNull() || m_lastRenderedPixmap.isNull() ) return; // blit the pixmap to the screen - TQMemArray<TQRect> allRects = pe->region().rects(); + TQMemArray<TQRect> allRects = TQRegion(pe->region()).tqrects(); uint numRects = allRects.count(); for ( uint i = 0; i < numRects; i++ ) { @@ -370,18 +370,18 @@ void PresentationWidget::paintEvent( TQPaintEvent * pe ) // </widget events> -const KPDFLink * PresentationWidget::getLink( int x, int y, TQRect * geometry ) const +const KPDFLink * PresentationWidget::getLink( int x, int y, TQRect * tqgeometry ) const { // no links on invalid pages - if ( geometry && !geometry->isNull() ) - geometry->setRect( 0, 0, -1, -1 ); + if ( tqgeometry && !tqgeometry->isNull() ) + tqgeometry->setRect( 0, 0, -1, -1 ); if ( m_frameIndex < 0 || m_frameIndex >= (int)m_frames.size() ) return 0; - // get frame, page and geometry + // get frame, page and tqgeometry const PresentationFrame * frame = m_frames[ m_frameIndex ]; const KPDFPage * page = frame->page; - const TQRect & frameGeometry = frame->geometry; + const TQRect & frameGeometry = frame->tqgeometry; // compute normalized x and y double nx = (double)(x - frameGeometry.left()) / (double)frameGeometry.width(); @@ -396,11 +396,11 @@ const KPDFLink * PresentationWidget::getLink( int x, int y, TQRect * geometry ) if ( !object ) return 0; - // compute link geometry if destination rect present - if ( geometry ) + // compute link tqgeometry if destination rect present + if ( tqgeometry ) { - *geometry = object->geometry( frameGeometry.width(), frameGeometry.height() ); - geometry->moveBy( frameGeometry.left(), frameGeometry.top() ); + *tqgeometry = object->tqgeometry( frameGeometry.width(), frameGeometry.height() ); + tqgeometry->moveBy( frameGeometry.left(), frameGeometry.top() ); } // return the link pointer @@ -416,12 +416,12 @@ void PresentationWidget::testCursorOnLink( int x, int y ) // only react on changes (in/out from a link) if ( (link && !m_handCursor) || (!link && m_handCursor) ) { - // change cursor shape + // change cursor tqshape m_handCursor = link != 0; setCursor( m_handCursor ? KCursor::handCursor() : KCursor::arrowCursor()); // set tooltip over link's rect - TQString tip = link ? link->linkTip() : TQString::null; + TQString tip = link ? link->linkTip() : TQString(); if ( m_handCursor && !tip.isEmpty() ) TQToolTip::add( this, linkRect, tip ); } @@ -451,8 +451,8 @@ void PresentationWidget::changePage( int newPage ) // check if pixmap exists or else request it m_frameIndex = newPage; PresentationFrame * frame = m_frames[ m_frameIndex ]; - int pixW = frame->geometry.width(); - int pixH = frame->geometry.height(); + int pixW = frame->tqgeometry.width(); + int pixH = frame->tqgeometry.height(); // if pixmap not inside the KPDFPage we request it and wait for // notifyPixmapChanged call or else we can proceed to pixmap generation @@ -470,16 +470,16 @@ void PresentationWidget::changePage( int newPage ) if (newPage + 1 < (int)m_document->pages()) { PresentationFrame *nextFrame = m_frames[ newPage + 1 ]; - pixW = nextFrame->geometry.width(); - pixH = nextFrame->geometry.height(); + pixW = nextFrame->tqgeometry.width(); + pixH = nextFrame->tqgeometry.height(); if ( !nextFrame->page->hasPixmap( PRESENTATION_ID, pixW, pixH ) ) requests.push_back( new PixmapRequest( PRESENTATION_ID, newPage + 1, pixW, pixH, PRESENTATION_PRELOAD_PRIO, true ) ); } if (newPage - 1 >= 0) { PresentationFrame *prevFrame = m_frames[ newPage - 1 ]; - pixW = prevFrame->geometry.width(); - pixH = prevFrame->geometry.height(); + pixW = prevFrame->tqgeometry.width(); + pixH = prevFrame->tqgeometry.height(); if ( !prevFrame->page->hasPixmap( PRESENTATION_ID, pixW, pixH ) ) requests.push_back( new PixmapRequest( PRESENTATION_ID, newPage - 1, pixW, pixH, PRESENTATION_PRELOAD_PRIO, true ) ); } @@ -542,7 +542,7 @@ void PresentationWidget::generateIntroPage( TQPainter & p ) // use a vertical gray gradient background int blend1 = m_height / 10, blend2 = 9 * m_height / 10; - int baseTint = Qt::gray.red(); + int baseTint = TQt::gray.red(); for ( int i = 0; i < m_height; i++ ) { int k = baseTint; @@ -580,7 +580,7 @@ void PresentationWidget::generateIntroPage( TQPainter & p ) p.setFont( f ); // text shadow - p.setPen( Qt::darkGray ); + p.setPen( TQt::darkGray ); p.drawText( 2, m_height / 4 + strHeight * i + 2, m_width, strHeight, AlignHCenter | AlignVCenter, m_metaStrings[i] ); // text body @@ -595,7 +595,7 @@ void PresentationWidget::generateContentsPage( int pageNum, TQPainter & p ) PresentationFrame * frame = m_frames[ pageNum ]; // translate painter and contents rect - TQRect geom( frame->geometry ); + TQRect geom( frame->tqgeometry ); p.translate( geom.left(), geom.top() ); geom.moveBy( -geom.left(), -geom.top() ); @@ -605,11 +605,11 @@ void PresentationWidget::generateContentsPage( int pageNum, TQPainter & p ) &p, geom, geom.width(), geom.height() ); // restore painter - p.translate( -frame->geometry.left(), -frame->geometry.top() ); + p.translate( -frame->tqgeometry.left(), -frame->tqgeometry.top() ); // fill unpainted areas with background color TQRegion unpainted( TQRect( 0, 0, m_width, m_height ) ); - TQMemArray<TQRect> rects = unpainted.subtract( frame->geometry ).rects(); + TQMemArray<TQRect> rects = TQRegion(unpainted.subtract( frame->tqgeometry )).tqrects(); for ( uint i = 0; i < rects.count(); i++ ) { const TQRect & r = rects[i]; @@ -617,12 +617,12 @@ void PresentationWidget::generateContentsPage( int pageNum, TQPainter & p ) } } -// from Arthur - Qt4 - (is defined elsewhere as 'qt_div_255' to not break final compilation) +// from Arthur - TQt4 - (is defined elsewhere as 'qt_div_255' to not break final compilation) inline int qt_div255(int x) { return (x + (x>>8) + 0x80) >> 8; } void PresentationWidget::generateOverlay() { #ifdef ENABLE_PROGRESS_OVERLAY - // calculate overlay geometry and resize pixmap if needed + // calculate overlay tqgeometry and resize pixmap if needed int side = m_width / 16; m_overlayGeometry.setRect( m_width - side - 4, 4, side, side ); if ( m_lastRenderedOverlay.width() != side ) @@ -633,7 +633,7 @@ void PresentationWidget::generateOverlay() // painter on the double sized pixmap. side *= 2; TQPixmap doublePixmap( side, side ); - doublePixmap.fill( Qt::black ); + doublePixmap.fill( TQt::black ); TQPainter pixmapPainter( &doublePixmap ); // draw PIE SLICES in blue levels (the levels will then be the alpha component) @@ -642,10 +642,10 @@ void PresentationWidget::generateOverlay() { // draw continuous slices int degrees = (int)( 360 * (float)(m_frameIndex + 1) / (float)pages ); pixmapPainter.setPen( 0x05 ); - pixmapPainter.setBrush( 0x40 ); + pixmapPainter.setBrush( TQBrush(0x40) ); pixmapPainter.drawPie( 2, 2, side - 4, side - 4, 90*16, (360-degrees)*16 ); pixmapPainter.setPen( 0x40 ); - pixmapPainter.setBrush( 0xF0 ); + pixmapPainter.setBrush( TQBrush(0xF0) ); pixmapPainter.drawPie( 2, 2, side - 4, side - 4, 90*16, -degrees*16 ); } else @@ -655,15 +655,15 @@ void PresentationWidget::generateOverlay() { float newCoord = -90 + 360 * (float)(i + 1) / (float)pages; pixmapPainter.setPen( i <= m_frameIndex ? 0x40 : 0x05 ); - pixmapPainter.setBrush( i <= m_frameIndex ? 0xF0 : 0x40 ); + pixmapPainter.setBrush( TQBrush(i <= m_frameIndex ? 0xF0 : 0x40) ); pixmapPainter.drawPie( 2, 2, side - 4, side - 4, (int)( -16*(oldCoord + 1) ), (int)( -16*(newCoord - (oldCoord + 2)) ) ); oldCoord = newCoord; } } int circleOut = side / 4; - pixmapPainter.setPen( Qt::black ); - pixmapPainter.setBrush( Qt::black ); + pixmapPainter.setPen( TQt::black ); + pixmapPainter.setBrush( TQBrush(TQt::black) ); pixmapPainter.drawEllipse( circleOut, circleOut, side - 2*circleOut, side - 2*circleOut ); // draw TEXT using maximum opacity @@ -672,7 +672,7 @@ void PresentationWidget::generateOverlay() pixmapPainter.setFont( f ); pixmapPainter.setPen( 0xFF ); // use a little offset to prettify output - pixmapPainter.drawText( 2, 2, side, side, Qt::AlignCenter, TQString::number( m_frameIndex + 1 ) ); + pixmapPainter.drawText( 2, 2, side, side, TQt::AlignCenter, TQString::number( m_frameIndex + 1 ) ); // end drawing pixmap and halve image pixmapPainter.end(); @@ -680,19 +680,19 @@ void PresentationWidget::generateOverlay() image.setAlphaBuffer( true ); // draw circular shadow using the same technique - doublePixmap.fill( Qt::black ); + doublePixmap.fill( TQt::black ); pixmapPainter.begin( &doublePixmap ); pixmapPainter.setPen( 0x40 ); - pixmapPainter.setBrush( 0x80 ); + pixmapPainter.setBrush( TQBrush(0x80) ); pixmapPainter.drawEllipse( 0, 0, side, side ); pixmapPainter.end(); TQImage shadow( doublePixmap.convertToImage().smoothScale( side / 2, side / 2 ) ); // generate a 2 colors pixmap using mixing shadow (made with highlight color) // and image (made with highlightedText color) - TQColor color = palette().active().highlightedText(); + TQColor color = tqpalette().active().highlightedText(); int red = color.red(), green = color.green(), blue = color.blue(); - color = palette().active().highlight(); + color = tqpalette().active().highlight(); int sRed = color.red(), sGreen = color.green(), sBlue = color.blue(); // pointers unsigned int * data = (unsigned int *)image.bits(), @@ -712,7 +712,7 @@ void PresentationWidget::generateOverlay() c1 = srcAlpha; c2 = shadowAlpha; // fuse color components and alpha value of image over shadow - data[i] = qRgba( + data[i] = tqRgba( cR = qt_div255( srcAlpha * red + (255 - srcAlpha) * sRed ), cG = qt_div255( srcAlpha * green + (255 - srcAlpha) * sGreen ), cB = qt_div255( srcAlpha * blue + (255 - srcAlpha) * sBlue ), @@ -720,12 +720,12 @@ void PresentationWidget::generateOverlay() ); } else - data[i] = qRgba( cR, cG, cB, cA ); + data[i] = tqRgba( cR, cG, cB, cA ); } m_lastRenderedOverlay.convertFromImage( image ); // start the autohide timer - repaint( m_overlayGeometry, false /*clear*/ ); // toggle with next line + tqrepaint( m_overlayGeometry, false /*clear*/ ); // toggle with next line //update( m_overlayGeometry ); m_overlayHideTimer->start( 2500, true ); #endif @@ -837,14 +837,14 @@ const KPDFPageTransition PresentationWidget::defaultTransition( int type ) const case KpdfSettings::EnumSlidesTransition::BlindsHorizontal: { KPDFPageTransition transition( KPDFPageTransition::Blinds ); - transition.setAlignment( KPDFPageTransition::Horizontal ); + transition.tqsetAlignment( KPDFPageTransition::Horizontal ); return transition; break; } case KpdfSettings::EnumSlidesTransition::BlindsVertical: { KPDFPageTransition transition( KPDFPageTransition::Blinds ); - transition.setAlignment( KPDFPageTransition::Vertical ); + transition.tqsetAlignment( KPDFPageTransition::Vertical ); return transition; break; } @@ -896,7 +896,7 @@ const KPDFPageTransition PresentationWidget::defaultTransition( int type ) const case KpdfSettings::EnumSlidesTransition::SplitHorizontalIn: { KPDFPageTransition transition( KPDFPageTransition::Split ); - transition.setAlignment( KPDFPageTransition::Horizontal ); + transition.tqsetAlignment( KPDFPageTransition::Horizontal ); transition.setDirection( KPDFPageTransition::Inward ); return transition; break; @@ -904,7 +904,7 @@ const KPDFPageTransition PresentationWidget::defaultTransition( int type ) const case KpdfSettings::EnumSlidesTransition::SplitHorizontalOut: { KPDFPageTransition transition( KPDFPageTransition::Split ); - transition.setAlignment( KPDFPageTransition::Horizontal ); + transition.tqsetAlignment( KPDFPageTransition::Horizontal ); transition.setDirection( KPDFPageTransition::Outward ); return transition; break; @@ -912,7 +912,7 @@ const KPDFPageTransition PresentationWidget::defaultTransition( int type ) const case KpdfSettings::EnumSlidesTransition::SplitVerticalIn: { KPDFPageTransition transition( KPDFPageTransition::Split ); - transition.setAlignment( KPDFPageTransition::Vertical ); + transition.tqsetAlignment( KPDFPageTransition::Vertical ); transition.setDirection( KPDFPageTransition::Inward ); return transition; break; @@ -920,7 +920,7 @@ const KPDFPageTransition PresentationWidget::defaultTransition( int type ) const case KpdfSettings::EnumSlidesTransition::SplitVerticalOut: { KPDFPageTransition transition( KPDFPageTransition::Split ); - transition.setAlignment( KPDFPageTransition::Vertical ); + transition.tqsetAlignment( KPDFPageTransition::Vertical ); transition.setDirection( KPDFPageTransition::Outward ); return transition; break; @@ -963,7 +963,7 @@ const KPDFPageTransition PresentationWidget::defaultTransition( int type ) const /** ONLY the TRANSITIONS GENERATION function from here on **/ void PresentationWidget::initTransition( const KPDFPageTransition *transition ) { - // if it's just a 'replace' transition, repaint the screen + // if it's just a 'tqreplace' transition, tqrepaint the screen if ( transition->type() == KPDFPageTransition::Replace ) { update(); @@ -971,7 +971,7 @@ void PresentationWidget::initTransition( const KPDFPageTransition *transition ) } const bool isInward = transition->direction() == KPDFPageTransition::Inward; - const bool isHorizontal = transition->alignment() == KPDFPageTransition::Horizontal; + const bool isHorizontal = transition->tqalignment() == KPDFPageTransition::Horizontal; const float totalTime = transition->duration(); m_transitionRects.clear(); @@ -1175,7 +1175,7 @@ void PresentationWidget::initTransition( const KPDFPageTransition *transition ) m_transitionDelay = (int)( (totalTime * 1000) / steps ); } break; - // dissolve: replace 'random' rects + // dissolve: tqreplace 'random' rects case KPDFPageTransition::Dissolve: { const int gridXsteps = 50; @@ -1183,7 +1183,7 @@ void PresentationWidget::initTransition( const KPDFPageTransition *transition ) const int steps = gridXsteps * gridYsteps; int oldX = 0; int oldY = 0; - // create a grid of gridXstep by gridYstep QRects + // create a grid of gridXstep by gridYstep TQRects for ( int y = 0; y < gridYsteps; y++ ) { int newY = (int)( m_height * ((float)(y+1) / (float)gridYsteps) ); diff --git a/kpdf/ui/presentationwidget.h b/kpdf/ui/presentationwidget.h index 00ff5b35..00ae2bfb 100644 --- a/kpdf/ui/presentationwidget.h +++ b/kpdf/ui/presentationwidget.h @@ -35,8 +35,9 @@ class PresentationFrame; class PresentationWidget : public TQDialog, public DocumentObserver { Q_OBJECT + TQ_OBJECT public: - PresentationWidget( TQWidget * parent, KPDFDocument * doc ); + PresentationWidget( TQWidget * tqparent, KPDFDocument * doc ); ~PresentationWidget(); void setupActions( KActionCollection * ac ); @@ -59,7 +60,7 @@ class PresentationWidget : public TQDialog, public DocumentObserver void paintEvent( TQPaintEvent * e ); private: - const KPDFLink * getLink( int x, int y, TQRect * geometry = 0 ) const; + const KPDFLink * getLink( int x, int y, TQRect * tqgeometry = 0 ) const; void testCursorOnLink( int x, int y ); void overlayClick( const TQPoint & position ); void changePage( int newPage ); diff --git a/kpdf/ui/propertiesdialog.cpp b/kpdf/ui/propertiesdialog.cpp index df03422e..02743ccb 100644 --- a/kpdf/ui/propertiesdialog.cpp +++ b/kpdf/ui/propertiesdialog.cpp @@ -19,23 +19,23 @@ #include "propertiesdialog.h" #include "core/document.h" -PropertiesDialog::PropertiesDialog(TQWidget *parent, KPDFDocument *doc) - : KDialogBase( Tabbed, i18n( "Unknown File" ), Ok, Ok, parent, 0, true, true ) +PropertiesDialog::PropertiesDialog(TQWidget *tqparent, KPDFDocument *doc) + : KDialogBase( Tabbed, i18n( "Unknown File" ), Ok, Ok, tqparent, 0, true, true ) { // Properties TQFrame *page = addPage(i18n("Properties")); - TQGridLayout *layout = new TQGridLayout( page, 2, 2, marginHint(), spacingHint() ); + TQGridLayout *tqlayout = new TQGridLayout( page, 2, 2, marginHint(), spacingHint() ); // get document info, if not present display blank data and a warning const DocumentInfo * info = doc->documentInfo(); if ( !info ) { - layout->addWidget( new TQLabel( i18n( "No document opened." ), page ), 0, 0 ); + tqlayout->addWidget( new TQLabel( i18n( "No document opened." ), page ), 0, 0 ); return; } // mime name based on mimetype id TQString mimeName = info->get( "mimeType" ).section( '/', -1 ).upper(); - setCaption( i18n("%1 Properties").arg( mimeName ) ); + setCaption( i18n("%1 Properties").tqarg( mimeName ) ); TQDomElement docElement = info->documentElement(); @@ -49,15 +49,15 @@ PropertiesDialog::PropertiesDialog(TQWidget *parent, KPDFDocument *doc) if ( titleString.isEmpty() || valueString.isEmpty() ) continue; - // create labels and layout them - TQLabel *key = new TQLabel( i18n( "%1:" ).arg( titleString ), page ); + // create labels and tqlayout them + TQLabel *key = new TQLabel( i18n( "%1:" ).tqarg( titleString ), page ); TQLabel *value = new KSqueezedTextLabel( valueString, page ); - layout->addWidget( key, row, 0, AlignRight ); - layout->addWidget( value, row, 1 ); + tqlayout->addWidget( key, row, 0, AlignRight ); + tqlayout->addWidget( value, row, 1 ); row++; // refine maximum width of 'value' labels - valMaxWidth = QMAX( valMaxWidth, fontMetrics().width( valueString ) ); + valMaxWidth = TQMAX( valMaxWidth, fontMetrics().width( valueString ) ); } // add the number of pages if the generator hasn't done it already @@ -66,8 +66,8 @@ PropertiesDialog::PropertiesDialog(TQWidget *parent, KPDFDocument *doc) TQLabel *key = new TQLabel( i18n( "Pages:" ), page ); TQLabel *value = new TQLabel( TQString::number( doc->pages() ), page ); - layout->addWidget( key, row, 0 ); - layout->addWidget( value, row, 1 ); + tqlayout->addWidget( key, row, 0 ); + tqlayout->addWidget( value, row, 1 ); } // Fonts @@ -82,13 +82,13 @@ PropertiesDialog::PropertiesDialog(TQWidget *parent, KPDFDocument *doc) } // current width: left column + right column + dialog borders - int width = layout->minimumSize().width() + valMaxWidth + marginHint() + spacingHint() + marginHint() + 30; + int width = tqlayout->tqminimumSize().width() + valMaxWidth + marginHint() + spacingHint() + marginHint() + 30; if (page2Layout) { - width = QMAX( width, page2Layout->sizeHint().width() + marginHint() + spacingHint() + 31 ); + width = TQMAX( width, page2Layout->tqsizeHint().width() + marginHint() + spacingHint() + 31 ); } // stay inside the 2/3 of the screen width TQRect screenContainer = KGlobalSettings::desktopGeometry( this ); - width = QMIN( width, 2*screenContainer.width()/3 ); + width = TQMIN( width, 2*screenContainer.width()/3 ); resize(width, 1); } diff --git a/kpdf/ui/propertiesdialog.h b/kpdf/ui/propertiesdialog.h index d5e3229a..f5541e34 100644 --- a/kpdf/ui/propertiesdialog.h +++ b/kpdf/ui/propertiesdialog.h @@ -17,7 +17,7 @@ class KPDFDocument; class PropertiesDialog : public KDialogBase { public: - PropertiesDialog( TQWidget *parent, KPDFDocument *doc ); + PropertiesDialog( TQWidget *tqparent, KPDFDocument *doc ); }; #endif diff --git a/kpdf/ui/searchwidget.cpp b/kpdf/ui/searchwidget.cpp index 36b8dd19..116df031 100644 --- a/kpdf/ui/searchwidget.cpp +++ b/kpdf/ui/searchwidget.cpp @@ -28,8 +28,8 @@ #define LEDIT_ID 2 #define FIND_ID 3 -SearchWidget::SearchWidget( TQWidget * parent, KPDFDocument * document ) - : KToolBar( parent, "iSearchBar" ), m_document( document ), +SearchWidget::SearchWidget( TQWidget * tqparent, KPDFDocument * document ) + : KToolBar( tqparent, "iSearchBar" ), m_document( document ), m_searchType( 0 ), m_caseSensitive( false ) { // change toolbar appearance @@ -44,14 +44,14 @@ SearchWidget::SearchWidget( TQWidget * parent, KPDFDocument * document ) this, TQT_SLOT( startSearch() ) ); // 1. text line - insertLined( TQString::null, LEDIT_ID, TQT_SIGNAL( textChanged(const TQString &) ), - this, TQT_SLOT( slotTextChanged(const TQString &) ), true, + insertLined( TQString(), LEDIT_ID, TQT_SIGNAL( textChanged(const TQString &) ), + TQT_TQOBJECT(this), TQT_SLOT( slotTextChanged(const TQString &) ), true, i18n( "Enter at least 3 letters to filter pages" ), 0/*size*/, 1 ); // 2. clear button (uses a lineEdit slot, so it must be created after) insertButton( TQApplication::reverseLayout() ? "clear_left" : "locationbar_erase", CLEAR_ID, TQT_SIGNAL( clicked() ), - getLined( LEDIT_ID ), TQT_SLOT( clear() ), true, + TQT_TQOBJECT(getLined( LEDIT_ID )), TQT_SLOT( clear() ), true, i18n( "Clear filter" ), 0/*index*/ ); // 3.1. create the popup menu for changing filtering features @@ -79,10 +79,10 @@ void SearchWidget::clearText() void SearchWidget::slotTextChanged( const TQString & text ) { // if 0<length<3 set 'red' text and send a blank string to document - TQColor color = text.length() > 0 && text.length() < 3 ? Qt::darkRed : palette().active().text(); + TQColor color = text.length() > 0 && text.length() < 3 ? TQt::darkRed : tqpalette().active().text(); KLineEdit * lineEdit = getLined( LEDIT_ID ); lineEdit->setPaletteForegroundColor( color ); - lineEdit->setPaletteBackgroundColor( palette().active().base() ); + lineEdit->setPaletteBackgroundColor( tqpalette().active().base() ); m_inputDelayTimer->stop(); m_inputDelayTimer->start(333, true); } @@ -119,7 +119,7 @@ void SearchWidget::startSearch() ( (m_searchType > 1) ? KPDFDocument::GoogleAny : KPDFDocument::GoogleAll ); ok = m_document->searchText( SW_SEARCH_ID, text, true, m_caseSensitive, - type, false, qRgb( 0, 183, 255 ) ); + type, false, tqRgb( 0, 183, 255 ) ); } else m_document->resetSearch( SW_SEARCH_ID ); @@ -127,8 +127,8 @@ void SearchWidget::startSearch() if ( !ok ) { KLineEdit * lineEdit = getLined( LEDIT_ID ); - lineEdit->setPaletteForegroundColor( Qt::white ); - lineEdit->setPaletteBackgroundColor( Qt::red ); + lineEdit->setPaletteForegroundColor( TQt::white ); + lineEdit->setPaletteBackgroundColor( TQt::red ); } } diff --git a/kpdf/ui/searchwidget.h b/kpdf/ui/searchwidget.h index 33fb1459..45ecae99 100644 --- a/kpdf/ui/searchwidget.h +++ b/kpdf/ui/searchwidget.h @@ -20,7 +20,7 @@ class m_inputDelayTimer; #define SW_SEARCH_ID 3 /** - * @short A widget for find-as-you-type search. Outputs to the Document. + * @short A widget for tqfind-as-you-type search. Outputs to the Document. * * This widget accepts keyboard input and performs a call to findTextAll(..) * in the KPDFDocument class when there are 3 or more chars to search for. @@ -30,8 +30,9 @@ class m_inputDelayTimer; class SearchWidget : public KToolBar { Q_OBJECT + TQ_OBJECT public: - SearchWidget( TQWidget *parent, KPDFDocument *document ); + SearchWidget( TQWidget *tqparent, KPDFDocument *document ); void clearText(); private: diff --git a/kpdf/ui/thumbnaillist.cpp b/kpdf/ui/thumbnaillist.cpp index 49d22ee3..8c6ab951 100644 --- a/kpdf/ui/thumbnaillist.cpp +++ b/kpdf/ui/thumbnaillist.cpp @@ -27,10 +27,10 @@ #include "conf/settings.h" // ThumbnailWidget represents a single thumbnail in the ThumbnailList -class ThumbnailWidget : public QWidget +class ThumbnailWidget : public TQWidget { public: - ThumbnailWidget( TQWidget * parent, const KPDFPage * page, ThumbnailList * tl ); + ThumbnailWidget( TQWidget * tqparent, const KPDFPage * page, ThumbnailList * tl ); // set internal parameters to fit the page in the given width void resizeFitWidth( int width ); @@ -63,8 +63,8 @@ class ThumbnailWidget : public QWidget /** ThumbnailList implementation **/ -ThumbnailList::ThumbnailList( TQWidget *parent, KPDFDocument *document ) - : TQScrollView( parent, "KPDF::Thumbnails", WNoAutoErase | WStaticContents ), +ThumbnailList::ThumbnailList( TQWidget *tqparent, KPDFDocument *document ) + : TQScrollView( tqparent, "KPDF::Thumbnails", WNoAutoErase | WStaticContents ), m_document( document ), m_selected( 0 ), m_delayTimer( 0 ), m_bookmarkOverlay( 0 ) { // set scrollbars @@ -76,13 +76,13 @@ ThumbnailList::ThumbnailList( TQWidget *parent, KPDFDocument *document ) // widget setup: can be focused by tab and mouse click (not wheel) viewport()->setFocusProxy( this ); - viewport()->setFocusPolicy( StrongFocus ); + viewport()->setFocusPolicy( TQ_StrongFocus ); setResizePolicy( Manual ); setAcceptDrops( true ); setDragAutoScroll( false ); // set contents background to the 'base' color - viewport()->setPaletteBackgroundColor( palette().active().base() ); + viewport()->setPaletteBackgroundColor( tqpalette().active().base() ); setFrameStyle( StyledPanel | Raised ); connect( this, TQT_SIGNAL(contentsMoving(int, int)), this, TQT_SLOT(slotRequestVisiblePixmaps(int, int)) ); @@ -184,7 +184,7 @@ void ThumbnailList::notifyViewportChanged( bool /*smoothMove*/ ) m_selected->setSelected( true ); if ( KpdfSettings::syncThumbnailsViewport() ) { - int yOffset = QMAX( visibleHeight() / 4, m_selected->height() / 2 ); + int yOffset = TQMAX( visibleHeight() / 4, m_selected->height() / 2 ); ensureVisible( 0, childY( m_selected ) + m_selected->height()/2, 0, yOffset ); } break; @@ -199,7 +199,7 @@ void ThumbnailList::notifyPageChanged( int pageNumber, int /*changedFlags*/ ) //if ( !(changedFlags & DocumentObserver::Pixmap) ) // return; - // iterate over visible items: if page(pageNumber) is one of them, repaint it + // iterate over visible items: if page(pageNumber) is one of them, tqrepaint it TQValueList<ThumbnailWidget *>::iterator vIt = m_visibleThumbnails.begin(), vEnd = m_visibleThumbnails.end(); for ( ; vIt != vEnd; ++vIt ) if ( (*vIt)->pageNumber() == pageNumber ) @@ -362,7 +362,7 @@ void ThumbnailList::viewportResizeEvent( TQResizeEvent * e ) else if ( e->size().height() <= e->oldSize().height() ) return; - // invalidate the bookmark overlay + // tqinvalidate the bookmark overlay if ( m_bookmarkOverlay ) { delete m_bookmarkOverlay; @@ -452,8 +452,8 @@ void ThumbnailList::delayedRequestVisiblePixmaps( int delayMs ) /** ThumbnailWidget implementation **/ -ThumbnailWidget::ThumbnailWidget( TQWidget * parent, const KPDFPage * kp, ThumbnailList * tl ) - : TQWidget( parent, 0, WNoAutoErase ), m_tl( tl ), m_page( kp ), +ThumbnailWidget::ThumbnailWidget( TQWidget * tqparent, const KPDFPage * kp, ThumbnailList * tl ) + : TQWidget( tqparent, 0, WNoAutoErase ), m_tl( tl ), m_page( kp ), m_selected( false ), m_pixmapWidth( 10 ), m_pixmapHeight( 10 ) { m_labelNumber = m_page->number() + 1; @@ -495,10 +495,10 @@ void ThumbnailWidget::paintEvent( TQPaintEvent * e ) TQPainter p( this ); // draw the bottom label + highlight mark - TQColor fillColor = m_selected ? palette().active().highlight() : palette().active().base(); + TQColor fillColor = m_selected ? tqpalette().active().highlight() : tqpalette().active().base(); p.fillRect( 0, 0, width, height, fillColor ); - p.setPen( m_selected ? palette().active().highlightedText() : palette().active().text() ); - p.drawText( 0, m_pixmapHeight + m_margin, width, m_labelHeight, Qt::AlignCenter, TQString::number( m_labelNumber ) ); + p.setPen( m_selected ? tqpalette().active().highlightedText() : tqpalette().active().text() ); + p.drawText( 0, m_pixmapHeight + m_margin, width, m_labelHeight, TQt::AlignCenter, TQString::number( m_labelNumber ) ); // draw page outline and pixmap if ( clipRect.top() < m_pixmapHeight + m_margin ) @@ -506,10 +506,10 @@ void ThumbnailWidget::paintEvent( TQPaintEvent * e ) // if page is bookmarked draw a colored border bool isBookmarked = m_page->hasBookmark(); // draw the inner rect - p.setPen( isBookmarked ? TQColor( 0xFF8000 ) : Qt::black ); + p.setPen( isBookmarked ? TQColor( 0xFF8000 ) : TQt::black ); p.drawRect( m_margin/2 - 1, m_margin/2 - 1, m_pixmapWidth + 2, m_pixmapHeight + 2 ); // draw the clear rect - p.setPen( isBookmarked ? TQColor( 0x804000 ) : palette().active().base() ); + p.setPen( isBookmarked ? TQColor( 0x804000 ) : tqpalette().active().base() ); // draw the bottom and right shadow edges if ( !isBookmarked ) { @@ -518,7 +518,7 @@ void ThumbnailWidget::paintEvent( TQPaintEvent * e ) right = m_margin/2 + m_pixmapWidth + 1; bottom = m_pixmapHeight + m_margin/2 + 1; top = m_margin/2 + 1; - p.setPen( Qt::gray ); + p.setPen( TQt::gray ); p.drawLine( left, bottom, right, bottom ); p.drawLine( right, top, right, bottom ); } @@ -552,8 +552,8 @@ void ThumbnailWidget::paintEvent( TQPaintEvent * e ) #define FILTERB_ID 1 -ThumbnailController::ThumbnailController( TQWidget * parent, ThumbnailList * list ) - : KToolBar( parent, "ThumbsControlBar" ) +ThumbnailController::ThumbnailController( TQWidget * tqparent, ThumbnailList * list ) + : KToolBar( tqparent, "ThumbsControlBar" ) { // change toolbar appearance setMargin( 3 ); @@ -564,7 +564,7 @@ ThumbnailController::ThumbnailController( TQWidget * parent, ThumbnailList * lis // insert a togglebutton [show only bookmarked pages] //insertSeparator(); insertButton( "bookmark", FILTERB_ID, TQT_SIGNAL( toggled( bool ) ), - list, TQT_SLOT( slotFilterBookmarks( bool ) ), + TQT_TQOBJECT(list), TQT_SLOT( slotFilterBookmarks( bool ) ), true, i18n( "Show bookmarked pages only" ) ); setToggle( FILTERB_ID ); setButton( FILTERB_ID, KpdfSettings::filterBookmarks() ); diff --git a/kpdf/ui/thumbnaillist.h b/kpdf/ui/thumbnaillist.h index a3f81b11..b28bd741 100644 --- a/kpdf/ui/thumbnaillist.h +++ b/kpdf/ui/thumbnaillist.h @@ -30,8 +30,9 @@ class ThumbnailWidget; class ThumbnailList : public TQScrollView, public DocumentObserver { Q_OBJECT + TQ_OBJECT public: - ThumbnailList(TQWidget *parent, KPDFDocument *document); + ThumbnailList(TQWidget *tqparent, KPDFDocument *document); ~ThumbnailList(); // inherited: return thumbnails observer id @@ -97,11 +98,11 @@ Q_OBJECT /** * @short A vertical boxed container with zero size hint (for insertion on left toolbox) */ -class ThumbnailsBox : public QVBox +class ThumbnailsBox : public TQVBox { public: - ThumbnailsBox( TQWidget * parent ) : TQVBox( parent ) {}; - TQSize sizeHint() const { return TQSize(); } + ThumbnailsBox( TQWidget * tqparent ) : TQVBox( tqparent ) {}; + TQSize tqsizeHint() const { return TQSize(); } }; /** @@ -115,7 +116,7 @@ class ThumbnailsBox : public QVBox class ThumbnailController : public KToolBar { public: - ThumbnailController( TQWidget * parent, ThumbnailList * thumbnailList ); + ThumbnailController( TQWidget * tqparent, ThumbnailList * thumbnailList ); }; #endif diff --git a/kpdf/ui/toc.cpp b/kpdf/ui/toc.cpp index 015ba313..a453f20d 100644 --- a/kpdf/ui/toc.cpp +++ b/kpdf/ui/toc.cpp @@ -25,8 +25,8 @@ class TOCItem : public KListViewItem { public: - TOCItem( KListView *parent, TOCItem *after, const TQDomElement & e ) - : KListViewItem( parent, after, e.tagName() ), m_element( e ) + TOCItem( KListView *tqparent, TOCItem *after, const TQDomElement & e ) + : KListViewItem( tqparent, after, e.tagName() ), m_element( e ) { #ifdef TOC_ENABLE_PAGE_COLUMN if ( e.hasAttribute( "Page" ) ) @@ -35,8 +35,8 @@ class TOCItem : public KListViewItem setMultiLinesEnabled(true); } - TOCItem( KListViewItem *parent, TOCItem *after, const TQDomElement & e ) - : KListViewItem( parent, after, e.tagName() ), m_element( e ) + TOCItem( KListViewItem *tqparent, TOCItem *after, const TQDomElement & e ) + : KListViewItem( tqparent, after, e.tagName() ), m_element( e ) { #ifdef TOC_ENABLE_PAGE_COLUMN if ( e.hasAttribute( "Page" ) ) @@ -54,7 +54,7 @@ class TOCItem : public KListViewItem TQDomElement m_element; }; -TOC::TOC(TQWidget *parent, KPDFDocument *document) : KListView(parent), m_document(document) +TOC::TOC(TQWidget *tqparent, KPDFDocument *document) : KListView(tqparent), m_document(document) { addColumn( i18n("Topic") ); #ifdef TOC_ENABLE_PAGE_COLUMN @@ -104,21 +104,21 @@ void TOC::notifySetup( const TQValueVector< KPDFPage * > & /*pages*/, bool docum emit hasTOC( true ); } -void TOC::addChildren( const TQDomNode & parentNode, KListViewItem * parentItem ) +void TOC::addChildren( const TQDomNode & tqparentNode, KListViewItem * tqparentItem ) { // keep track of the current listViewItem TOCItem * currentItem = 0; - TQDomNode n = parentNode.firstChild(); + TQDomNode n = tqparentNode.firstChild(); while( !n.isNull() ) { // convert the node to an element (sure it is) TQDomElement e = n.toElement(); - // insert the entry as top level (listview parented) or 2nd+ level - if ( !parentItem ) + // insert the entry as top level (listview tqparented) or 2nd+ level + if ( !tqparentItem ) currentItem = new TOCItem( this, currentItem, e ); else - currentItem = new TOCItem( parentItem, currentItem, e ); + currentItem = new TOCItem( tqparentItem, currentItem, e ); // descend recursively and advance to the next node if ( e.hasChildNodes() ) diff --git a/kpdf/ui/toc.h b/kpdf/ui/toc.h index 0f2915fd..2d0c76d7 100644 --- a/kpdf/ui/toc.h +++ b/kpdf/ui/toc.h @@ -20,8 +20,9 @@ class KPDFDocument; class TOC : public KListView, public DocumentObserver { Q_OBJECT + TQ_OBJECT public: - TOC(TQWidget *parent, KPDFDocument *document); + TOC(TQWidget *tqparent, KPDFDocument *document); ~TOC(); // inherited from DocumentObserver @@ -35,7 +36,7 @@ Q_OBJECT void slotExecuted(TQListViewItem *i); private: - void addChildren( const TQDomNode & parentNode, KListViewItem * parentItem = 0 ); + void addChildren( const TQDomNode & tqparentNode, KListViewItem * tqparentItem = 0 ); DocumentViewport getViewport( const TQDomElement &e ) const; KPDFDocument *m_document; }; |