diff options
Diffstat (limited to 'kviewshell')
67 files changed, 1145 insertions, 1145 deletions
diff --git a/kviewshell/bookmark.h b/kviewshell/bookmark.h index 1df245fb..a1a310fb 100644 --- a/kviewshell/bookmark.h +++ b/kviewshell/bookmark.h @@ -24,8 +24,8 @@ #include "anchor.h" -#include <qptrlist.h> -#include <qstring.h> +#include <tqptrlist.h> +#include <tqstring.h> /** \brief Bookmark @@ -54,13 +54,13 @@ class Bookmark { @param pos an Anchor that specifies the position of the bookmark */ - Bookmark(const QString &text, const Anchor &pos) { + Bookmark(const TQString &text, const Anchor &pos) { Bookmark(); bookmarkText = text; position = pos; } - /** Convenience funtion, behaves as Bookmark(const QString &text, const Anchor &pos) + /** Convenience funtion, behaves as Bookmark(const TQString &text, const Anchor &pos) @param text name of the bookmark, as it appears in the GUI @@ -70,7 +70,7 @@ class Bookmark { @param distance_from_top position on the page, distance from top of the page */ - Bookmark(const QString& text, const PageNumber& page, const Length& distance_from_top) { + Bookmark(const TQString& text, const PageNumber& page, const Length& distance_from_top) { Bookmark(); bookmarkText = text; position.page = page; @@ -79,7 +79,7 @@ class Bookmark { /** Label of the bookmark as it will appear in the GUI to the user, such as "Section 1", "Theorem 12", etc. */ - QString bookmarkText; + TQString bookmarkText; /** The anchor that specifies the position of the bookmark */ Anchor position; @@ -95,7 +95,7 @@ class Bookmark { true. Thus, extra care must be taken when copying this list. Otherwise, a segfault could result. */ - QPtrList<Bookmark> subordinateBookmarks; + TQPtrList<Bookmark> subordinateBookmarks; // Returns true if the bookmark is valid, false otherwise. A // bookmark is valid if the text is not empty and the anchor is diff --git a/kviewshell/documentPageCache.cpp b/kviewshell/documentPageCache.cpp index 2c9a46a5..b2322321 100644 --- a/kviewshell/documentPageCache.cpp +++ b/kviewshell/documentPageCache.cpp @@ -9,7 +9,7 @@ #include <config.h> #include <kdebug.h> -#include <qapplication.h> +#include <tqapplication.h> #include "documentPageCache.h" #include "documentRenderer.h" @@ -79,16 +79,16 @@ void DocumentPageCache::setResolution(double res) resolutionInDPI = res; } -QSize DocumentPageCache::sizeOfPageInPixel(const PageNumber& pg) const +TQSize DocumentPageCache::sizeOfPageInPixel(const PageNumber& pg) const { // Paranoid safety checks if (renderer.isNull()) { kdError(1223) << "DocumentPageCache::sizeOfPageInPixel( " << pg << " ) called but no renderer was set" << endl; - return QSize(); + return TQSize(); } if (!pg.isValid()) { kdError(1223) << "DocumentPageCache::sizeOfPageInPixel( " << pg << " ) called with invalid argument" << endl; - return QSize(); + return TQSize(); } SimplePageSize ps = sizeOfPage(pg); @@ -98,7 +98,7 @@ QSize DocumentPageCache::sizeOfPageInPixel(const PageNumber& pg) const } -bool DocumentPageCache::isPageCached(const PageNumber& pageNumber, const QSize& size) +bool DocumentPageCache::isPageCached(const PageNumber& pageNumber, const TQSize& size) { // Paranoid checks if (renderer.isNull()) { @@ -115,7 +115,7 @@ bool DocumentPageCache::isPageCached(const PageNumber& pageNumber, const QSize& return false; } - QString key = createKey(pageNumber, size); + TQString key = createKey(pageNumber, size); // Check if the page that we are looking for is in the cache. // We are not accessing the page, so we don't want it to be moved into the front. @@ -127,24 +127,24 @@ bool DocumentPageCache::isPageCached(const PageNumber& pageNumber, const QSize& return false; } -QString DocumentPageCache::createKey(const PageNumber& pageNumber, const QSize& size) +TQString DocumentPageCache::createKey(const PageNumber& pageNumber, const TQSize& size) { - QString key; + TQString key; - key = QString::number(pageNumber) + ":" + - QString::number(size.width()) + ":" + QString::number(size.height()); + key = TQString::number(pageNumber) + ":" + + TQString::number(size.width()) + ":" + TQString::number(size.height()); return key; } -QString DocumentPageCache::createKey(const PageNumber& pageNumber) +TQString DocumentPageCache::createKey(const PageNumber& pageNumber) { - QSize pageSize = sizeOfPageInPixel(pageNumber); + TQSize pageSize = sizeOfPageInPixel(pageNumber); - QString key; + TQString key; - key = QString::number(pageNumber) + ":" + - QString::number(pageSize.width()) + ":" + QString::number(pageSize.height()); + key = TQString::number(pageNumber) + ":" + + TQString::number(pageSize.width()) + ":" + TQString::number(pageSize.height()); return key; } @@ -214,9 +214,9 @@ RenderedDocumentPagePixmap* DocumentPageCache::getPage(const PageNumber& pageNr) if (resolutionInDPI > 0.0) { page->resize(sizeOfPageInPixel(pageNr)); - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); renderer->drawPage(resolutionInDPI, page); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); // We always set the cache capacity to be at least n times the cost of the page we want to insert. // Where n is the number of pages that can be visible at the same time at very high zoomlevels. @@ -284,7 +284,7 @@ void DocumentPageCache::setUseDocumentSpecifiedSize(bool b) } -QPixmap DocumentPageCache::createThumbnail(const PageNumber& pageNr, int width) +TQPixmap DocumentPageCache::createThumbnail(const PageNumber& pageNr, int width) { // Paranoid checks if (renderer.isNull()) { diff --git a/kviewshell/documentPageCache.h b/kviewshell/documentPageCache.h index c885123a..8477d152 100644 --- a/kviewshell/documentPageCache.h +++ b/kviewshell/documentPageCache.h @@ -15,12 +15,12 @@ #include "pageSize.h" #include "selection.h" -#include <qcache.h> -#include <qguardedptr.h> -#include <qobject.h> +#include <tqcache.h> +#include <tqguardedptr.h> +#include <tqobject.h> class DocumentRenderer; -class QPixmap; +class TQPixmap; class RenderedDocumentPage; @@ -56,7 +56,7 @@ class DocumentPageCache: public QObject set with setResolution(). If the document does not specify a size (which happens, e.g., for some DVI-files), the userPreferredSize is used. */ - QSize sizeOfPageInPixel(const PageNumber& page) const; + TQSize sizeOfPageInPixel(const PageNumber& page) const; /** Returns a pointer to a documentPage structure, or 0, if the documentPage could not be generated for some reason (e.g., @@ -64,16 +64,16 @@ class DocumentPageCache: public QObject RenderedDocumentPagePixmap* getPage(const PageNumber& pageNr); /** Checks if the given page is already in the cache. */ - bool isPageCached(const PageNumber& pageNumber, const QSize& size); + bool isPageCached(const PageNumber& pageNumber, const TQSize& size); /** Checks if the given page is already in the cache. Here we don't care about the size of the page. */ bool isPageCached(const PageNumber& pageNumber); /** Returns a "width" pixels width thumbnail of the given page. This - method returns an empty QPixmap if one of the arguments is + method returns an empty TQPixmap if one of the arguments is invalid, or if the page cannot be rendered for any reason. */ - QPixmap createThumbnail(const PageNumber& pageNr, int width); + TQPixmap createThumbnail(const PageNumber& pageNr, int width); signals: /** This signal is emitted when setUserPreferredSize() or @@ -102,13 +102,13 @@ class DocumentPageCache: public QObject virtual RenderedDocumentPagePixmap* createDocumentPagePixmap() const; /** Creates the hashing key for the cache. */ - QString createKey(const PageNumber& pageNumber, const QSize& size); + TQString createKey(const PageNumber& pageNumber, const TQSize& size); /** Creates the hashing function. The size of the page is calculated based on the current resolution. */ - QString createKey(const PageNumber& pageNumber); + TQString createKey(const PageNumber& pageNumber); - QGuardedPtr<DocumentRenderer> renderer; + TQGuardedPtr<DocumentRenderer> renderer; private: /** The maximum of memory used by the cache. (32MB) @@ -132,7 +132,7 @@ class DocumentPageCache: public QObject /** This list holds the cache. */ - QCache<RenderedDocumentPagePixmap> LRUCache; + TQCache<RenderedDocumentPagePixmap> LRUCache; /** This is a dummy documentPage structure which is used internally by the 'createThumbnail' method. */ diff --git a/kviewshell/documentRenderer.cpp b/kviewshell/documentRenderer.cpp index f9837fa2..34bf59ac 100644 --- a/kviewshell/documentRenderer.cpp +++ b/kviewshell/documentRenderer.cpp @@ -16,9 +16,9 @@ #include "renderedDocumentPage.h" -DocumentRenderer::DocumentRenderer(QWidget* par) +DocumentRenderer::DocumentRenderer(TQWidget* par) : mutex(true), parentWidget(par), accessibilityBackground(false), - accessibilityBackgroundColor(QColor(255,255,255)) + accessibilityBackgroundColor(TQColor(255,255,255)) { numPages = 0; _isModified = false; @@ -28,7 +28,7 @@ DocumentRenderer::DocumentRenderer(QWidget* par) DocumentRenderer::~DocumentRenderer() { // Wait for all access to this DocumentRenderer to finish - QMutexLocker lock(&mutex); + TQMutexLocker lock(&mutex); clear(); } @@ -37,7 +37,7 @@ DocumentRenderer::~DocumentRenderer() void DocumentRenderer::clear() { // Wait for all access to this DocumentRenderer to finish - QMutexLocker lock(&mutex); + TQMutexLocker lock(&mutex); numPages = 0; pageSizes.clear(); @@ -46,10 +46,10 @@ void DocumentRenderer::clear() _isModified = false; } -void DocumentRenderer::setAccessibleBackground(bool accessibleMode, const QColor& background) +void DocumentRenderer::setAccessibleBackground(bool accessibleMode, const TQColor& background) { // Wait for all access to this DocumentRenderer to finish - QMutexLocker lock(&mutex); + TQMutexLocker lock(&mutex); accessibilityBackground = accessibleMode; accessibilityBackgroundColor = background; @@ -58,7 +58,7 @@ void DocumentRenderer::setAccessibleBackground(bool accessibleMode, const QColor SimplePageSize DocumentRenderer::sizeOfPage(const PageNumber& page) { // Wait for all access to this DocumentRenderer to finish - QMutexLocker locker(&mutex); + TQMutexLocker locker(&mutex); if (!page.isValid()) return SimplePageSize(); @@ -74,7 +74,7 @@ SimplePageSize DocumentRenderer::sizeOfPage(const PageNumber& page) void DocumentRenderer::drawThumbnail(double resolution, RenderedDocumentPage* page) { // Wait for all access to this DocumentRenderer to finish - QMutexLocker locker(&mutex); + TQMutexLocker locker(&mutex); drawPage(resolution, page); } @@ -85,16 +85,16 @@ void DocumentRenderer::getText(RenderedDocumentPage* page) drawPage(100.0, page); } -bool DocumentRenderer::isValidFile(const QString&) const +bool DocumentRenderer::isValidFile(const TQString&) const { return true; } -Anchor DocumentRenderer::parseReference(const QString &reference) +Anchor DocumentRenderer::parseReference(const TQString &reference) { // Wait for all access to this documentRenderer to finish - QMutexLocker locker(&mutex); + TQMutexLocker locker(&mutex); if (isEmpty()) return Anchor(); @@ -117,12 +117,12 @@ Anchor DocumentRenderer::parseReference(const QString &reference) return Anchor(); } -Anchor DocumentRenderer::findAnchor(const QString &locallink) +Anchor DocumentRenderer::findAnchor(const TQString &locallink) { // Wait for all access to this DocumentRenderer to finish - QMutexLocker locker(&mutex); + TQMutexLocker locker(&mutex); - QMap<QString,Anchor>::Iterator it = anchorList.find(locallink); + TQMap<TQString,Anchor>::Iterator it = anchorList.find(locallink); if (it != anchorList.end()) return *it; else diff --git a/kviewshell/documentRenderer.h b/kviewshell/documentRenderer.h index a8a87410..9282d005 100644 --- a/kviewshell/documentRenderer.h +++ b/kviewshell/documentRenderer.h @@ -16,11 +16,11 @@ #include "pageNumber.h" #include "pageSize.h" -#include <qguardedptr.h> -#include <qcolor.h> -#include <qmutex.h> -#include <qobject.h> -#include <qvaluevector.h> +#include <tqguardedptr.h> +#include <tqcolor.h> +#include <tqmutex.h> +#include <tqobject.h> +#include <tqvaluevector.h> class Anchor; class KURL; @@ -54,7 +54,7 @@ class DocumentRenderer : public QObject public: /** \brief default constructor */ - DocumentRenderer(QWidget* parent); + DocumentRenderer(TQWidget* parent); virtual ~DocumentRenderer(); @@ -123,7 +123,7 @@ public: method returns 'false' the class must act reasonably, i.e. by clear()ing the document */ - virtual bool setFile(const QString &fname, const KURL &base) = 0; + virtual bool setFile(const TQString &fname, const KURL &base) = 0; /** \brief clearing the document renderer @@ -162,7 +162,7 @@ public: current document is empty. */ PageNumber totalPages() const {return numPages; } - QPtrList<Bookmark> getBookmarks() const { return bookmarks; } + TQPtrList<Bookmark> getBookmarks() const { return bookmarks; } /* Returns the size of page 'page'. If the document is empty, if the page specified is not a page of the document or if the document @@ -190,10 +190,10 @@ public: and the do all of the following, in no particular order - - obtain the pointer to the QPaintDevice from the documentPage using + - obtain the pointer to the TQPaintDevice from the documentPage using the documentPage::getPaintDevice() method and draw a graphical representation of the page number page->getPageNumber() into the - QPaintDevice, using the given resolution. If the member + TQPaintDevice, using the given resolution. If the member accessibilityBackground is true, the accessibilityBackgroundColor should be used for a background color, if possible. Otherwise, white should be used, if possible. If you need to compute the size @@ -321,12 +321,12 @@ public: section of the DVI file can be found. If so, it returns an anchor to that section. If not, it returns an invalid anchor. */ - virtual Anchor parseReference(const QString &reference); + virtual Anchor parseReference(const TQString &reference); /* Looks up a anchor in the "anchorList". Returns the anchor found, or an invalid anchor otherwise. */ - Anchor findAnchor(const QString &); + Anchor findAnchor(const TQString &); /* Quick file validity check @@ -352,9 +352,9 @@ public: true otherwise. The default implementation always returns 'true'. */ - virtual bool isValidFile(const QString& fileName) const; + virtual bool isValidFile(const TQString& fileName) const; - void setAccessibleBackground(bool accessibleMode, const QColor& background = QColor(255, 255, 255)); + void setAccessibleBackground(bool accessibleMode, const TQColor& background = TQColor(255, 255, 255)); signals: /** signals that the document is changed @@ -377,7 +377,7 @@ signals: via the status bar. Since the status bar is not always visible, and since the duration that the message is shown is not quite specified, this should not be used for important information. */ - void setStatusBarText( const QString& ); + void setStatusBarText( const TQString& ); protected: /** mutex used to make method thread-safe @@ -389,7 +389,7 @@ protected: implementation is THREAD-SAFE, if not, this can result in infrequent and very hard-to-find crashes of your programm. */ - QMutex mutex; + TQMutex mutex; /** number of pages in the document @@ -417,7 +417,7 @@ protected: @warning Only the constructor and the methods setFile() and clear() may write to this member. */ - QValueVector<SimplePageSize> pageSizes; + TQValueVector<SimplePageSize> pageSizes; /** bookmarks @@ -428,7 +428,7 @@ protected: @warning Only the constructor and the methods setFile() and clear() may write to this member. */ - QPtrList<Bookmark> bookmarks; + TQPtrList<Bookmark> bookmarks; /** map of anchors in a document. @@ -439,14 +439,14 @@ protected: @warning Only the constructor and the methods setFile() and clear() may write to this member. */ - QMap<QString, Anchor> anchorList; + TQMap<TQString, Anchor> anchorList; /** pointer to the parent widget This pointer can be used by implementations e.g. to display error messages. This pointer can well be zero. */ - QGuardedPtr<QWidget> parentWidget; + TQGuardedPtr<TQWidget> parentWidget; /** specifies if accessibilityBackgroundColor should be used @@ -462,7 +462,7 @@ protected: drawThumbnail() methods should use this color as the backgroundcolor of the pages. */ - QColor accessibilityBackgroundColor; + TQColor accessibilityBackgroundColor; /** Flag if document is modified diff --git a/kviewshell/documentWidget.cpp b/kviewshell/documentWidget.cpp index 95b6f771..59316d7a 100644 --- a/kviewshell/documentWidget.cpp +++ b/kviewshell/documentWidget.cpp @@ -17,11 +17,11 @@ #include <kglobalsettings.h> #include <kiconloader.h> #include <klocale.h> -#include <qclipboard.h> -#include <qcursor.h> -#include <qimage.h> -#include <qpainter.h> -#include <qpixmap.h> +#include <tqclipboard.h> +#include <tqcursor.h> +#include <tqimage.h> +#include <tqpainter.h> +#include <tqpixmap.h> #include "documentWidget.h" #include "pageView.h" @@ -49,24 +49,24 @@ const int DocumentWidget::bottom_left_corner[16] = const int DocumentWidget::shadow_strip[4] = { 56, 67, 83, 94 }; -QColor DocumentWidget::backgroundColorForCorners; +TQColor DocumentWidget::backgroundColorForCorners; namespace { /** Holds the icon used as a overlay on pages which are not drawn yet. */ -QPixmap* busyIcon = 0; +TQPixmap* busyIcon = 0; /** Internal storages used in the shadow drawing routines in the drawContents method.*/ -QPixmap* URShadow = 0; -QPixmap* BRShadow = 0; -QPixmap* BLShadow = 0; +TQPixmap* URShadow = 0; +TQPixmap* BRShadow = 0; +TQPixmap* BLShadow = 0; } // namespace anon -DocumentWidget::DocumentWidget(QWidget *parent, PageView *sv, DocumentPageCache *cache, const char *name ) - : QWidget( parent, name ), indexOfUnderlinedLink(-1) +DocumentWidget::DocumentWidget(TQWidget *parent, PageView *sv, DocumentPageCache *cache, const char *name ) + : TQWidget( parent, name ), indexOfUnderlinedLink(-1) { moveTool = true; @@ -83,18 +83,18 @@ DocumentWidget::DocumentWidget(QWidget *parent, PageView *sv, DocumentPageCache scrollGuide = -1; setMouseTracking(true); - setFocusPolicy(QWidget::ClickFocus); + setFocusPolicy(TQWidget::ClickFocus); - connect(&clearStatusBarTimer, SIGNAL(timeout()), this, SLOT(clearStatusBar())); + connect(&clearStatusBarTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(clearStatusBar())); setBackgroundMode(Qt::NoBackground); if (!busyIcon) { - busyIcon = new QPixmap(KGlobal::iconLoader()->loadIcon("gear", KIcon::NoGroup, KIcon::SizeMedium)); + busyIcon = new TQPixmap(KGlobal::iconLoader()->loadIcon("gear", KIcon::NoGroup, KIcon::SizeMedium)); - URShadow = new QPixmap(); - BRShadow = new QPixmap(); - BLShadow = new QPixmap(); + URShadow = new TQPixmap(); + BRShadow = new TQPixmap(); + BLShadow = new TQPixmap(); URShadow->resize(4,4); BRShadow->resize(4,4); @@ -114,7 +114,7 @@ void DocumentWidget::setPageNumber(Q_UINT16 nr) indexOfUnderlinedLink = -1; // Resize Widget if the size of the new page is different than the size of the old page. - QSize _pageSize = documentCache->sizeOfPageInPixel(pageNr); + TQSize _pageSize = documentCache->sizeOfPageInPixel(pageNr); if (_pageSize != pageSize()) { setPageSize(_pageSize); @@ -122,14 +122,14 @@ void DocumentWidget::setPageNumber(Q_UINT16 nr) update(); } -QRect DocumentWidget::linkFlashRect() +TQRect DocumentWidget::linkFlashRect() { int width = pageSize().width()/(11 - animationCounter); int height = pageSize().height()/(60 - 4 * animationCounter); - return QRect((pageSize().width()-width)/2, flashOffset - height/2, width, height); + return TQRect((pageSize().width()-width)/2, flashOffset - height/2, width, height); } -void DocumentWidget::timerEvent( QTimerEvent *e ) +void DocumentWidget::timerEvent( TQTimerEvent *e ) { if (animationCounter == 0) { killTimer(e->timerId()); @@ -138,7 +138,7 @@ void DocumentWidget::timerEvent( QTimerEvent *e ) animationCounter++; - QRect flashRect = linkFlashRect(); + TQRect flashRect = linkFlashRect(); flashRect.addCoords(-1, -1, 1, 1); if (animationCounter >= 10) { @@ -158,7 +158,7 @@ void DocumentWidget::flash(int fo) killTimer(timerIdent); // Delete old flash rectangle animationCounter = 10; - QRect flashRect = linkFlashRect(); + TQRect flashRect = linkFlashRect(); flashRect.addCoords(-1, -1, 1, 1); repaint(flashRect, false); } @@ -168,7 +168,7 @@ void DocumentWidget::flash(int fo) } -void DocumentWidget::paintEvent(QPaintEvent *e) +void DocumentWidget::paintEvent(TQPaintEvent *e) { #ifdef DEBUG_DOCUMENTWIDGET kdDebug(1223) << "DocumentWidget::paintEvent() called" << endl; @@ -191,25 +191,25 @@ void DocumentWidget::paintEvent(QPaintEvent *e) return; } - QPainter p(this); + TQPainter p(this); p.setClipRegion(e->region()); // Paint a black border around the widget p.setRasterOp(Qt::CopyROP); p.setBrush(NoBrush); p.setPen(Qt::black); - QRect outlineRect = pageRect(); + TQRect outlineRect = pageRect(); outlineRect.addCoords(-1, -1, 1, 1); p.drawRect(outlineRect); // Paint page shadow - QColor backgroundColor = colorGroup().mid(); + TQColor backgroundColor = colorGroup().mid(); // (Re-)generate the Pixmaps for the shadow corners, if necessary if (backgroundColor != backgroundColorForCorners) { backgroundColorForCorners = backgroundColor; - QImage tmp(4, 4, 32); + TQImage tmp(4, 4, 32); for(int x=0; x<4; x++) for(int y=0; y<4; y++) tmp.setPixel(x, y, backgroundColor.light(bottom_right_corner[x+4*y]).rgb() ); @@ -243,7 +243,7 @@ void DocumentWidget::paintEvent(QPaintEvent *e) if (!documentCache->isPageCached(pageNr, pageSize())) { - QRect destRect = e->rect().intersect(pageRect()); + TQRect destRect = e->rect().intersect(pageRect()); if (KVSPrefs::changeColors() && KVSPrefs::renderMode() == KVSPrefs::EnumRenderMode::Paper) p.fillRect(destRect, KVSPrefs::paperColor()); else @@ -260,7 +260,7 @@ void DocumentWidget::paintEvent(QPaintEvent *e) { // Request page pixmap. pixmapRequested = true; - QTimer::singleShot(50, this, SLOT(delayedRequestPage())); + TQTimer::singleShot(50, this, TQT_SLOT(delayedRequestPage())); } return; } @@ -273,15 +273,15 @@ void DocumentWidget::paintEvent(QPaintEvent *e) return; } - QMemArray<QRect> damagedRects = e->region().rects(); + TQMemArray<TQRect> damagedRects = e->region().rects(); for (unsigned int i = 0; i < damagedRects.count(); i++) { // Paint the page where it intersects with the damaged area. - QRect destRect = damagedRects[i].intersect(pageRect()); + TQRect destRect = damagedRects[i].intersect(pageRect()); // The actual page starts at point (1,1) because of the outline. // Therefore we need to shift the destination rectangle. - QRect pixmapRect = destRect; + TQRect pixmapRect = destRect; pixmapRect.moveBy(-1,-1); if (KVSPrefs::changeColors() && KVSPrefs::renderMode() != KVSPrefs::EnumRenderMode::Paper) @@ -309,7 +309,7 @@ void DocumentWidget::paintEvent(QPaintEvent *e) int w = pageData->hyperLinkList[i].box.width(); int y = pageData->hyperLinkList[i].baseline; - QRect hyperLinkRect(x, y, w, h); + TQRect hyperLinkRect(x, y, w, h); if (hyperLinkRect.intersects(e->rect())) { #ifdef DEBUG_DOCUMENTWIDGET @@ -324,7 +324,7 @@ void DocumentWidget::paintEvent(QPaintEvent *e) if (animationCounter > 0 && animationCounter < 10) { int gbChannel = 255 - (9-animationCounter)*28; - p.setPen(QPen(QColor(255, gbChannel, gbChannel), 3)); + p.setPen(TQPen(TQColor(255, gbChannel, gbChannel), 3)); p.drawRect(linkFlashRect()); } @@ -344,7 +344,7 @@ void DocumentWidget::paintEvent(QPaintEvent *e) p.setBrush(white); p.setRasterOp(Qt::XorROP); - QMemArray<QRect> selectionRects = selectedRegion.rects(); + TQMemArray<TQRect> selectionRects = selectedRegion.rects(); for (unsigned int i = 0; i < selectionRects.count(); i++) p.drawRect(selectionRects[i]); @@ -365,8 +365,8 @@ void DocumentWidget::drawScrollGuide(int ycoord) { //kdDebug() << "draw scroll guide for page " << pageNr << " at y = " << ycoord << endl; scrollGuide = ycoord; - update(QRect(1, scrollGuide, pageSize().width(), 1)); - QTimer::singleShot(1000, this, SLOT(clearScrollGuide())); + update(TQRect(1, scrollGuide, pageSize().width(), 1)); + TQTimer::singleShot(1000, this, TQT_SLOT(clearScrollGuide())); } void DocumentWidget::clearScrollGuide() @@ -374,7 +374,7 @@ void DocumentWidget::clearScrollGuide() //kdDebug() << "clear scroll guide for page " << pageNr << " at y = " << scrollGuide << endl; int temp = scrollGuide; scrollGuide = -1; - update(QRect(1, temp, pageSize().width(), 1)); + update(TQRect(1, temp, pageSize().width(), 1)); } void DocumentWidget::select(const TextSelection& newSelection) @@ -410,7 +410,7 @@ void DocumentWidget::selectAll() TextSelection selection; // mark everything as selected - QString selectedText(""); + TQString selectedText(""); for(unsigned int i = 0; i < pageData->textBoxList.size(); i++) { selectedText += pageData->textBoxList[i].text; selectedText += "\n"; @@ -426,7 +426,7 @@ void DocumentWidget::selectAll() } -void DocumentWidget::mousePressEvent ( QMouseEvent * e ) +void DocumentWidget::mousePressEvent ( TQMouseEvent * e ) { #ifdef DEBUG_DOCUMENTWIDGET kdDebug(1223) << "DocumentWidget::mousePressEvent(...) called" << endl; @@ -471,15 +471,15 @@ void DocumentWidget::mousePressEvent ( QMouseEvent * e ) if (!(e->state() & ShiftButton)) { firstSelectedPoint = e->pos(); - selectedRectangle = QRect(); - selectedRegion = QRegion(); + selectedRectangle = TQRect(); + selectedRegion = TQRegion(); emit clearSelection(); } } } -void DocumentWidget::mouseReleaseEvent ( QMouseEvent *e ) +void DocumentWidget::mouseReleaseEvent ( TQMouseEvent *e ) { // Make sure the event is passed on to the higher-level widget; // otherwise the mouse cursor in the centeringScrollview is wrong @@ -512,7 +512,7 @@ void DocumentWidget::mouseReleaseEvent ( QMouseEvent *e ) } -void DocumentWidget::mouseMoveEvent ( QMouseEvent * e ) +void DocumentWidget::mouseMoveEvent ( TQMouseEvent * e ) { #ifdef DEBUG_DOCUMENTWIDGET kdDebug(1223) << "DocumentWidget::mouseMoveEvent(...) called" << endl; @@ -540,7 +540,7 @@ void DocumentWidget::mouseMoveEvent ( QMouseEvent * e ) if (pageData->hyperLinkList[i].box.contains(e->pos())) { clearStatusBarTimer.stop(); setCursor(pointingHandCursor); - QString link = pageData->hyperLinkList[i].linkText; + TQString link = pageData->hyperLinkList[i].linkText; if ( link.startsWith("#") ) link = link.remove(0,1); @@ -550,7 +550,7 @@ void DocumentWidget::mouseMoveEvent ( QMouseEvent * e ) if (KVSPrefs::underlineLinks() == KVSPrefs::EnumUnderlineLinks::OnlyOnHover && indexOfUnderlinedLink != lastUnderlinedLink) { - QRect newUnderline = pageData->hyperLinkList[i].box; + TQRect newUnderline = pageData->hyperLinkList[i].box; // Increase Rectangle so that the whole line really lines in it. newUnderline.addCoords(0, 0, 0, 2); // Redraw widget @@ -559,7 +559,7 @@ void DocumentWidget::mouseMoveEvent ( QMouseEvent * e ) if (lastUnderlinedLink != -1 && lastUnderlinedLink < pageData->hyperLinkList.size()) { // Erase old underline - QRect oldUnderline = pageData->hyperLinkList[lastUnderlinedLink].box; + TQRect oldUnderline = pageData->hyperLinkList[lastUnderlinedLink].box; oldUnderline.addCoords(0, 0, 0, 2); update(oldUnderline); } @@ -573,7 +573,7 @@ void DocumentWidget::mouseMoveEvent ( QMouseEvent * e ) lastUnderlinedLink != -1 && lastUnderlinedLink < pageData->hyperLinkList.size()) { // Erase old underline - QRect oldUnderline = pageData->hyperLinkList[lastUnderlinedLink].box; + TQRect oldUnderline = pageData->hyperLinkList[lastUnderlinedLink].box; // Increase Rectangle so that the whole line really lines in it. oldUnderline.addCoords(0, 0, 0, 2); // Redraw widget @@ -626,8 +626,8 @@ void DocumentWidget::updateSelection(const TextSelection& newTextSelection) { // Clear selection documentCache->deselectText(); - selectedRectangle = QRect(); - selectedRegion = QRegion(); + selectedRectangle = TQRect(); + selectedRegion = TQRegion(); update(); } else @@ -645,10 +645,10 @@ void DocumentWidget::updateSelection(const TextSelection& newTextSelection) documentCache->selectText(newTextSelection); - QRegion newlySelectedRegion = pageData->selectedRegion(documentCache->selectedText()); + TQRegion newlySelectedRegion = pageData->selectedRegion(documentCache->selectedText()); // Compute the region that needs to be updated - QRegion updateRegion; + TQRegion updateRegion; if(!selectedRegion.isEmpty()) { updateRegion = newlySelectedRegion.eor(selectedRegion); @@ -660,7 +660,7 @@ void DocumentWidget::updateSelection(const TextSelection& newTextSelection) selectedRegion = newlySelectedRegion; - QMemArray<QRect> rectangles = updateRegion.rects(); + TQMemArray<TQRect> rectangles = updateRegion.rects(); for (unsigned int i = 0; i < rectangles.count(); i++) { repaint(rectangles[i]); @@ -672,7 +672,7 @@ void DocumentWidget::updateSelection(const TextSelection& newTextSelection) void DocumentWidget::clearStatusBar() { - emit setStatusBarText( QString::null ); + emit setStatusBarText( TQString::null ); } @@ -701,21 +701,21 @@ void DocumentWidget::delayedRequestPage() kapp->processEvents(); } -QSize DocumentWidget::pageSize() const +TQSize DocumentWidget::pageSize() const { // Substract size of the shadow. - return size() - QSize(6, 6); + return size() - TQSize(6, 6); } -QRect DocumentWidget::pageRect() const +TQRect DocumentWidget::pageRect() const { - QRect boundingRect = rect(); + TQRect boundingRect = rect(); // Substract the shadow. boundingRect.addCoords(1,1,-5,-5); return boundingRect; } -void DocumentWidget::setPageSize(const QSize& pageSize) +void DocumentWidget::setPageSize(const TQSize& pageSize) { // When the page size changes this means either the paper size // has been changed, or the zoomlevel has been changed. @@ -724,12 +724,12 @@ void DocumentWidget::setPageSize(const QSize& pageSize) selectionNeedsUpdating = true; // Add size of the shadow. - resize(pageSize + QSize(6,6)); + resize(pageSize + TQSize(6,6)); } void DocumentWidget::setPageSize(int width, int height) { - setPageSize(QSize(width, height)); + setPageSize(TQSize(width, height)); } @@ -756,8 +756,8 @@ void DocumentWidget::setStandardCursor() bool DocumentWidget::isVisible() { - QRect visibleRect(scrollView->contentsX(), scrollView->contentsY(), scrollView->visibleWidth(), scrollView->visibleHeight()); - QRect widgetRect(scrollView->childX(this), scrollView->childY(this), width(), height()); + TQRect visibleRect(scrollView->contentsX(), scrollView->contentsY(), scrollView->visibleWidth(), scrollView->visibleHeight()); + TQRect widgetRect(scrollView->childX(this), scrollView->childY(this), width(), height()); return widgetRect.intersects(visibleRect); } diff --git a/kviewshell/documentWidget.h b/kviewshell/documentWidget.h index 50f2ee44..c568d11c 100644 --- a/kviewshell/documentWidget.h +++ b/kviewshell/documentWidget.h @@ -15,14 +15,14 @@ #include "selection.h" -#include <qregion.h> -#include <qtimer.h> -#include <qwidget.h> +#include <tqregion.h> +#include <tqtimer.h> +#include <tqwidget.h> class DocumentPageCache; class PageView; -class QMouseEvent; -class QPaintEvent; +class TQMouseEvent; +class TQPaintEvent; /* DocumentWidget */ @@ -32,15 +32,15 @@ class DocumentWidget : public QWidget Q_OBJECT public: - DocumentWidget(QWidget *parent, PageView *sv, DocumentPageCache *cache, const char *name); + DocumentWidget(TQWidget *parent, PageView *sv, DocumentPageCache *cache, const char *name); void setPageNumber(Q_UINT16 pageNr); Q_UINT16 getPageNumber() const {return pageNr;} /** Returns the size of the widget without the page shadow. */ - QSize pageSize() const; + TQSize pageSize() const; /** Returns the bounding rectangle of the widget without the page shadow. */ - QRect pageRect() const; + TQRect pageRect() const; /** Draw a red vertical line at y-coordinate ycoord. The line is removed again after one second. This is used to make it easier to regain reading focus if @@ -59,13 +59,13 @@ public slots: /** Sets the size of the widget so that the page is of the given size. The widget gets slightly bigger because of the page shadow. */ - void setPageSize(const QSize&); + void setPageSize(const TQSize&); void setPageSize(int width, int height); signals: /** Passed through to the top-level kpart. */ - void setStatusBarText( const QString& ); - void localLink( const QString& ); + void setStatusBarText( const TQString& ); + void localLink( const TQString& ); /** This signal is emitted when the widget resizes itself */ void resized(); @@ -74,9 +74,9 @@ signals: void clearSelection(); protected: - virtual void paintEvent (QPaintEvent *); - virtual void mousePressEvent ( QMouseEvent * e ); - virtual void mouseReleaseEvent (QMouseEvent *); + virtual void paintEvent (TQPaintEvent *); + virtual void mousePressEvent ( TQMouseEvent * e ); + virtual void mouseReleaseEvent (TQMouseEvent *); /** This method is used by the DocumentWidget to find out of the mouse pointer hovers over a hyperlink, and to update the @@ -91,7 +91,7 @@ protected: DocumentWidget::mouseMoveEvent(e); - 2) Ignore the QMouseEvent if a mouse button is pressed + 2) Ignore the TQMouseEvent if a mouse button is pressed 3) If no mouse button is pressed, analyze the mouse movement and take appropriate actions. To set statusbar text, do @@ -109,7 +109,7 @@ protected: areas in the widget. */ - virtual void mouseMoveEvent (QMouseEvent *); + virtual void mouseMoveEvent (TQMouseEvent *); protected: void updateSelection(const TextSelection& newTextSelection); @@ -117,7 +117,7 @@ protected: /** Methods and counters used for the animation to mark the target of an hyperlink. */ int timerIdent; - void timerEvent( QTimerEvent *e ); + void timerEvent( TQTimerEvent *e ); int animationCounter; int flashOffset; @@ -128,11 +128,11 @@ protected: moves over a block of text that contains source hyperlinks. The signal timeout() is connected to the method clearStatusBar() of *this. */ - QTimer clearStatusBarTimer; + TQTimer clearStatusBarTimer; /* Data structures used for marking text with the mouse */ - QPoint firstSelectedPoint; - QRect selectedRectangle; + TQPoint firstSelectedPoint; + TQRect selectedRectangle; /** Pointer to the PageView that contains this widget. This pointer is used in the re-implementation of the @@ -141,7 +141,7 @@ protected: DocumentPageCache *documentCache; /** Currently selected Region */ - QRegion selectedRegion; + TQRegion selectedRegion; /** This is set to the index of the link over which the mouse pointer currently resides, and -1 if the no link is hovered. @@ -156,7 +156,7 @@ protected: virtual void setStandardCursor(); private slots: - /** This slot emits the signal setStatusBarText(QString::null) to + /** This slot emits the signal setStatusBarText(TQString::null) to clear the status bar. It is connected to the timeout slot of the clearStatusBarTimer. */ void clearStatusBar(); @@ -167,13 +167,13 @@ private slots: void clearScrollGuide(); private: - QRect linkFlashRect(); + TQRect linkFlashRect(); /** If this variable is positive draw a vertical line at this y-coordinate. */ int scrollGuide; /** Color used by in the shadow drawing to check if the background color has been changed. */ - static QColor backgroundColorForCorners; + static TQColor backgroundColorForCorners; /** The following tables store grey values for roundish shadow corners. They were shamelessly stolen from kdelibs/kdefx/kstyle.cpp. */ diff --git a/kviewshell/emptyRenderer.cpp b/kviewshell/emptyRenderer.cpp index e89ffd6e..deeef488 100644 --- a/kviewshell/emptyRenderer.cpp +++ b/kviewshell/emptyRenderer.cpp @@ -21,7 +21,7 @@ #include "emptyRenderer.h" -EmptyRenderer::EmptyRenderer(QWidget* parent) +EmptyRenderer::EmptyRenderer(TQWidget* parent) : DocumentRenderer(parent) { } diff --git a/kviewshell/emptyRenderer.h b/kviewshell/emptyRenderer.h index 62fd46f7..71cf30aa 100644 --- a/kviewshell/emptyRenderer.h +++ b/kviewshell/emptyRenderer.h @@ -31,9 +31,9 @@ class EmptyRenderer : public DocumentRenderer Q_OBJECT public: - EmptyRenderer(QWidget* parent); + EmptyRenderer(TQWidget* parent); - virtual bool setFile(const QString &, const KURL &) { return false; } + virtual bool setFile(const TQString &, const KURL &) { return false; } void drawPage(double res, RenderedDocumentPage* page) { Q_UNUSED(res); Q_UNUSED(page); } }; diff --git a/kviewshell/empty_multipage.cpp b/kviewshell/empty_multipage.cpp index 39de90a3..8fc1a0f8 100644 --- a/kviewshell/empty_multipage.cpp +++ b/kviewshell/empty_multipage.cpp @@ -26,8 +26,8 @@ K_EXPORT_COMPONENT_FACTORY(emptymultipagepart, EmptyMultiPageFactory) -EmptyMultiPage::EmptyMultiPage(QWidget* parentWidget, const char* widgetName, QObject* parent, const char* name, - const QStringList& args) +EmptyMultiPage::EmptyMultiPage(TQWidget* parentWidget, const char* widgetName, TQObject* parent, const char* name, + const TQStringList& args) : KMultiPage(parentWidget, widgetName, parent, name), emptyRenderer(parentWidget) { Q_UNUSED(args); diff --git a/kviewshell/empty_multipage.h b/kviewshell/empty_multipage.h index 92d824b7..455474f1 100644 --- a/kviewshell/empty_multipage.h +++ b/kviewshell/empty_multipage.h @@ -32,10 +32,10 @@ class EmptyMultiPage : public KMultiPage Q_OBJECT public: - EmptyMultiPage(QWidget* parentWidget, const char* widgetName, QObject* parent, const char* name, - const QStringList& args = QStringList()); + EmptyMultiPage(TQWidget* parentWidget, const char* widgetName, TQObject* parent, const char* name, + const TQStringList& args = TQStringList()); - virtual QStringList fileFormats() const { return QString::null; } + virtual TQStringList fileFormats() const { return TQString::null; } /// opens a file virtual bool openFile() { return false; } diff --git a/kviewshell/history.cpp b/kviewshell/history.cpp index a8765220..0452efc1 100644 --- a/kviewshell/history.cpp +++ b/kviewshell/history.cpp @@ -47,7 +47,7 @@ void History::add(Q_UINT32 page, Q_UINT32 ypos) currentItem = historyList.insert(currentItem, item); } // Delete items starting after currentItem to the end of the list. - QValueList<HistoryItem>::iterator deleteItemsStart = currentItem; + TQValueList<HistoryItem>::iterator deleteItemsStart = currentItem; deleteItemsStart++; historyList.erase(deleteItemsStart, historyList.end()); diff --git a/kviewshell/history.h b/kviewshell/history.h index 2c651475..822e31d7 100644 --- a/kviewshell/history.h +++ b/kviewshell/history.h @@ -7,8 +7,8 @@ // (C) 2001 Stefan Kebekus // Distributed under the GPL -#include <qobject.h> -#include <qvaluelist.h> +#include <tqobject.h> +#include <tqvaluelist.h> #define HISTORYLENGTH 10 @@ -50,9 +50,9 @@ signals: private: // List of history items. First item is the oldest. - QValueList<HistoryItem> historyList; + TQValueList<HistoryItem> historyList; - QValueList<HistoryItem>::iterator currentItem; + TQValueList<HistoryItem>::iterator currentItem; }; #endif diff --git a/kviewshell/hyperlink.h b/kviewshell/hyperlink.h index bd07fef5..66de5c6f 100644 --- a/kviewshell/hyperlink.h +++ b/kviewshell/hyperlink.h @@ -9,8 +9,8 @@ #ifndef _hyperlink_h_ #define _hyperlink_h_ -#include <qrect.h> -#include <qstring.h> +#include <tqrect.h> +#include <tqstring.h> /** Represents a named, rectangular region in a rendered documentPage @@ -39,7 +39,7 @@ public: @param re value for the box @param lT valus for the text field */ - Hyperlink(Q_UINT32 bl, const QRect& re, const QString& lT): baseline(bl), box(re), linkText(lT) {} + Hyperlink(Q_UINT32 bl, const TQRect& re, const TQString& lT): baseline(bl), box(re), linkText(lT) {} /** \brief Base line of a hyperlink @@ -62,7 +62,7 @@ public: documentRenderer.drawPage() method. The box is used to determine if the mouse pointer hovers over the link. */ - QRect box; + TQRect box; /** \brief Name of the region @@ -70,7 +70,7 @@ public: e.g. "http://www.kde.org". If the Hyperlink class is used to represent text, then the text is stored here. */ - QString linkText; + TQString linkText; }; diff --git a/kviewshell/kmultipage.cpp b/kviewshell/kmultipage.cpp index b747ce0f..679b0dcf 100644 --- a/kviewshell/kmultipage.cpp +++ b/kviewshell/kmultipage.cpp @@ -10,14 +10,14 @@ #include <kmessagebox.h> #include <kprinter.h> #include <kstdaction.h> -#include <qobject.h> -#include <qlayout.h> -#include <qpaintdevicemetrics.h> -#include <qprogressdialog.h> -#include <qsplitter.h> -#include <qurl.h> -#include <qtoolbox.h> -#include <qvbox.h> +#include <tqobject.h> +#include <tqlayout.h> +#include <tqpaintdevicemetrics.h> +#include <tqprogressdialog.h> +#include <tqsplitter.h> +#include <tqurl.h> +#include <tqtoolbox.h> +#include <tqvbox.h> #include "documentWidget.h" #include "marklist.h" @@ -34,7 +34,7 @@ //#define DEBUG_KMULTIPAGE -KMultiPage::KMultiPage(QWidget *parentWidget, const char *widgetName, QObject *parent, const char *name) +KMultiPage::KMultiPage(TQWidget *parentWidget, const char *widgetName, TQObject *parent, const char *name) : DCOPObject("kmultipage"), KParts::ReadOnlyPart(parent, name) { // For reasons which I don't understand, the initialization of the @@ -48,56 +48,56 @@ KMultiPage::KMultiPage(QWidget *parentWidget, const char *widgetName, QObject *p timer_id = -1; searchInProgress = false; - QVBox* verticalBox = new QVBox(parentWidget); - verticalBox->setFocusPolicy(QWidget::StrongFocus); + TQVBox* verticalBox = new TQVBox(parentWidget); + verticalBox->setFocusPolicy(TQWidget::StrongFocus); setWidget(verticalBox); - splitterWidget = new QSplitter(verticalBox, widgetName); + splitterWidget = new TQSplitter(verticalBox, widgetName); splitterWidget->setOpaqueResize(false); - splitterWidget->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + splitterWidget->setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding); // Create SideBar - sideBar = new QToolBox(splitterWidget, "sidebar"); + sideBar = new TQToolBox(splitterWidget, "sidebar"); // Create ContentsList tableOfContents = new TableOfContents(sideBar); - sideBar->addItem(tableOfContents, QIconSet(SmallIcon("contents")), i18n("Contents")); + sideBar->addItem(tableOfContents, TQIconSet(SmallIcon("contents")), i18n("Contents")); - connect(tableOfContents, SIGNAL(gotoPage(const Anchor&)), this, SLOT(gotoPage(const Anchor&))); + connect(tableOfContents, TQT_SIGNAL(gotoPage(const Anchor&)), this, TQT_SLOT(gotoPage(const Anchor&))); // Create MarkList _markList = new MarkList(sideBar, "marklist"); - sideBar->addItem(_markList, QIconSet(SmallIcon("thumbnail")), i18n("Thumbnails")); + sideBar->addItem(_markList, TQIconSet(SmallIcon("thumbnail")), i18n("Thumbnails")); // Restore state of the sidebar sideBar->setCurrentItem(sideBar->item(KVSPrefs::sideBarItem())); - splitterWidget->setResizeMode(sideBar, QSplitter::KeepSize); + splitterWidget->setResizeMode(sideBar, TQSplitter::KeepSize); - connect(_markList, SIGNAL(selected(const PageNumber&)), this, SLOT(gotoPage(const PageNumber&))); + connect(_markList, TQT_SIGNAL(selected(const PageNumber&)), this, TQT_SLOT(gotoPage(const PageNumber&))); _scrollView = new PageView(splitterWidget, widgetName); // Create Search Panel searchWidget = new SearchWidget(verticalBox); searchWidget->hide(); - connect(searchWidget, SIGNAL(findNextText()), this, SLOT(findNextText())); - connect(searchWidget, SIGNAL(findPrevText()), this, SLOT(findPrevText())); + connect(searchWidget, TQT_SIGNAL(findNextText()), this, TQT_SLOT(findNextText())); + connect(searchWidget, TQT_SIGNAL(findPrevText()), this, TQT_SLOT(findPrevText())); sideBar->setMinimumWidth(80); sideBar->setMaximumWidth(300); - connect(_scrollView, SIGNAL(currentPageChanged(const PageNumber&)), this, SLOT(setCurrentPageNumber(const PageNumber&))); - connect(_scrollView, SIGNAL(viewSizeChanged(const QSize&)), scrollView(), SLOT(calculateCurrentPageNumber())); - connect(_scrollView, SIGNAL(wheelEventReceived(QWheelEvent *)), this, SLOT(wheelEvent(QWheelEvent*))); + connect(_scrollView, TQT_SIGNAL(currentPageChanged(const PageNumber&)), this, TQT_SLOT(setCurrentPageNumber(const PageNumber&))); + connect(_scrollView, TQT_SIGNAL(viewSizeChanged(const TQSize&)), scrollView(), TQT_SLOT(calculateCurrentPageNumber())); + connect(_scrollView, TQT_SIGNAL(wheelEventReceived(TQWheelEvent *)), this, TQT_SLOT(wheelEvent(TQWheelEvent*))); - connect(this, SIGNAL(enableMoveTool(bool)), _scrollView, SLOT(slotEnableMoveTool(bool))); + connect(this, TQT_SIGNAL(enableMoveTool(bool)), _scrollView, TQT_SLOT(slotEnableMoveTool(bool))); splitterWidget->setCollapsible(sideBar, false); splitterWidget->setSizes(KVSPrefs::guiLayout()); - connect(searchWidget, SIGNAL(searchEnabled(bool)), this, SIGNAL(searchEnabled(bool))); - connect(searchWidget, SIGNAL(stopSearch()), this, SLOT(stopSearch())); + connect(searchWidget, TQT_SIGNAL(searchEnabled(bool)), this, TQT_SIGNAL(searchEnabled(bool))); + connect(searchWidget, TQT_SIGNAL(stopSearch()), this, TQT_SLOT(stopSearch())); } @@ -126,12 +126,12 @@ void KMultiPage::writeSettings() KVSPrefs::writeConfig(); } -QString KMultiPage::name_of_current_file() +TQString KMultiPage::name_of_current_file() { return m_file; } -bool KMultiPage::is_file_loaded(const QString& filename) +bool KMultiPage::is_file_loaded(const TQString& filename) { return (filename == m_file); } @@ -144,18 +144,18 @@ void KMultiPage::slotSave_defaultFilename() void KMultiPage::slotSave() { // Try to guess the proper ending... - QString formats; - QString ending; + TQString formats; + TQString ending; int rindex = m_file.findRev("."); if (rindex == -1) { - ending = QString::null; - formats = QString::null; + ending = TQString::null; + formats = TQString::null; } else { ending = m_file.mid(rindex); // e.g. ".dvi" formats = fileFormats().grep(ending).join("\n"); } - QString fileName = KFileDialog::getSaveFileName(QString::null, formats, 0, i18n("Save File As")); + TQString fileName = KFileDialog::getSaveFileName(TQString::null, formats, 0, i18n("Save File As")); if (fileName.isEmpty()) return; @@ -165,7 +165,7 @@ void KMultiPage::slotSave() if (!ending.isEmpty() && fileName.find(ending) == -1) fileName = fileName+ending; - if (QFile(fileName).exists()) { + if (TQFile(fileName).exists()) { int r = KMessageBox::warningContinueCancel (0, i18n("The file %1\nexists. Shall I overwrite that file?").arg(fileName), i18n("Overwrite File"), i18n("Overwrite")); if (r == KMessageBox::Cancel) @@ -173,7 +173,7 @@ void KMultiPage::slotSave() } KIO::Job *job = KIO::file_copy( KURL( m_file ), KURL( fileName ), 0600, true, false, true ); - connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotIOJobFinished ( KIO::Job * ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job * ) ), this, TQT_SLOT( slotIOJobFinished ( KIO::Job * ) ) ); return; } @@ -198,7 +198,7 @@ bool KMultiPage::closeURL() document_history.clear(); // Close the file. - renderer->setFile(QString::null, KURL()); + renderer->setFile(TQString::null, KURL()); renderer->clear(); // Delete Page Widgets. @@ -217,7 +217,7 @@ bool KMultiPage::closeURL() tableOfContents->clear(); // Clear Status Bar - emit setStatusBarText(QString::null); + emit setStatusBarText(TQString::null); return true; } @@ -352,8 +352,8 @@ void KMultiPage::initializePageCache() DocumentWidget* KMultiPage::createDocumentWidget() { DocumentWidget* documentWidget = new DocumentWidget(scrollView()->viewport(), scrollView(), pageCache, "singlePageWidget"); - connect(documentWidget, SIGNAL(clearSelection()), this, SLOT(clearSelection())); - connect(this, SIGNAL(enableMoveTool(bool)), documentWidget, SLOT(slotEnableMoveTool(bool))); + connect(documentWidget, TQT_SIGNAL(clearSelection()), this, TQT_SLOT(clearSelection())); + connect(this, TQT_SIGNAL(enableMoveTool(bool)), documentWidget, TQT_SLOT(slotEnableMoveTool(bool))); return documentWidget; } @@ -436,8 +436,8 @@ void KMultiPage::generateDocumentWidgets(const PageNumber& _startPage) widgetList.insert(i, documentWidget); documentWidget->show(); - connect(documentWidget, SIGNAL(localLink(const QString &)), this, SLOT(handleLocalLink(const QString &))); - connect(documentWidget, SIGNAL(setStatusBarText(const QString&)), this, SIGNAL(setStatusBarText(const QString&)) ); + connect(documentWidget, TQT_SIGNAL(localLink(const TQString &)), this, TQT_SLOT(handleLocalLink(const TQString &))); + connect(documentWidget, TQT_SIGNAL(setStatusBarText(const TQString&)), this, TQT_SIGNAL(setStatusBarText(const TQString&)) ); } } @@ -606,7 +606,7 @@ bool KMultiPage::gotoPage(const PageNumber& page, int y, bool isLink) } -void KMultiPage::handleLocalLink(const QString &linkText) +void KMultiPage::handleLocalLink(const TQString &linkText) { #ifdef DEBUG_SPECIAL kdDebug(4300) << "hit: local link to " << linkText << endl; @@ -617,7 +617,7 @@ void KMultiPage::handleLocalLink(const QString &linkText) return; } - QString locallink; + TQString locallink; if (linkText[0] == '#' ) locallink = linkText.mid(1); // Drop the '#' at the beginning else @@ -633,10 +633,10 @@ void KMultiPage::handleLocalLink(const QString &linkText) // it is perhaps not a very good idea to allow a DVI-file to // specify arbitrary commands, such as "rm -rvf /". Using // the kfmclient seems to be MUCH safer. - QUrl DVI_Url(m_file); - QUrl Link_Url(DVI_Url, linkText, true); + TQUrl DVI_Url(m_file); + TQUrl Link_Url(DVI_Url, linkText, true); - QStringList args; + TQStringList args; args << "openURL"; args << Link_Url.toString(); kapp->kdeinitExec("kfmclient", args); @@ -720,7 +720,7 @@ void KMultiPage::repaintAllVisibleWidgets() continue; // Resize, if necessary - QSize pageSize = pageCache->sizeOfPageInPixel(documentWidget->getPageNumber()); + TQSize pageSize = pageCache->sizeOfPageInPixel(documentWidget->getPageNumber()); if (pageSize != documentWidget->pageSize()) { documentWidget->setPageSize(pageSize); @@ -747,7 +747,7 @@ double KMultiPage::setZoom(double zoom) if (zoom > ZoomLimits::MaxZoom/1000.0) zoom = ZoomLimits::MaxZoom/1000.0; - pageCache->setResolution(QPaintDevice::x11AppDpiX()*zoom); + pageCache->setResolution(TQPaintDevice::x11AppDpiX()*zoom); emit zoomChanged(); return zoom; } @@ -769,7 +769,7 @@ void KMultiPage::print() // initialize the printer using the print dialog if ( printer->setup(parentWdg, i18n("Print %1").arg(m_file.section('/', -1))) ) { // Now do the printing. - QValueList<int> pageList = printer->pageList(); + TQValueList<int> pageList = printer->pageList(); if (pageList.isEmpty()) printer->abort(); else { @@ -780,11 +780,11 @@ void KMultiPage::print() // Obtain papersize information that is required to perform // the resizing and centering, if this is wanted by the user. Length paperWidth, paperHeight; - QPaintDeviceMetrics pdm(printer); + TQPaintDeviceMetrics pdm(printer); paperWidth.setLength_in_mm(pdm.widthMM()); paperHeight.setLength_in_mm(pdm.heightMM()); - QValueList<int>::ConstIterator it = pageList.begin(); + TQValueList<int>::ConstIterator it = pageList.begin(); while (true) { SimplePageSize paper_s(paperWidth, paperHeight); @@ -792,7 +792,7 @@ void KMultiPage::print() // updated. qApp->processEvents(); - QPainter *paint = rdpp.getPainter(); + TQPainter *paint = rdpp.getPainter(); if (paint != 0) { // Before drawing the page, we figure out the zoom-value, // taking the "page sizes and placement" options from the @@ -868,11 +868,11 @@ void KMultiPage::setRenderer(DocumentRenderer* _renderer) widgetList.resize(0); // Relay signals. - connect(renderer, SIGNAL(setStatusBarText(const QString&)), this, SIGNAL(setStatusBarText(const QString&))); - connect(pageCache, SIGNAL(paperSizeChanged()), this, SLOT(renderModeChanged())); - connect(pageCache, SIGNAL(textSelected(bool)), this, SIGNAL(textSelected(bool))); - connect(renderer, SIGNAL(documentIsChanged()), this, SLOT(renderModeChanged())); - connect(this, SIGNAL(zoomChanged()), this, SLOT(repaintAllVisibleWidgets())); + connect(renderer, TQT_SIGNAL(setStatusBarText(const TQString&)), this, TQT_SIGNAL(setStatusBarText(const TQString&))); + connect(pageCache, TQT_SIGNAL(paperSizeChanged()), this, TQT_SLOT(renderModeChanged())); + connect(pageCache, TQT_SIGNAL(textSelected(bool)), this, TQT_SIGNAL(textSelected(bool))); + connect(renderer, TQT_SIGNAL(documentIsChanged()), this, TQT_SLOT(renderModeChanged())); + connect(this, TQT_SIGNAL(zoomChanged()), this, TQT_SLOT(repaintAllVisibleWidgets())); } @@ -887,7 +887,7 @@ void KMultiPage::updateWidgetSize(const PageNumber& pageNumber) if (documentWidget->getPageNumber() == pageNumber) { // Resize, if necessary - QSize pageSize = pageCache->sizeOfPageInPixel(documentWidget->getPageNumber()); + TQSize pageSize = pageCache->sizeOfPageInPixel(documentWidget->getPageNumber()); if (pageSize != documentWidget->pageSize()) { documentWidget->setPageSize(pageSize); @@ -1119,7 +1119,7 @@ void KMultiPage::lastPage() void KMultiPage::scroll(Q_INT32 deltaInPixel) { - QScrollBar* scrollBar = scrollView()->verticalScrollBar(); + TQScrollBar* scrollBar = scrollView()->verticalScrollBar(); if (scrollBar == 0) { kdError(4300) << "KMultiPage::scroll called without scrollBar" << endl; return; @@ -1168,7 +1168,7 @@ void KMultiPage::scroll(Q_INT32 deltaInPixel) void KMultiPage::scrollUp() { - QScrollBar* scrollBar = scrollView()->verticalScrollBar(); + TQScrollBar* scrollBar = scrollView()->verticalScrollBar(); if (scrollBar == 0) return; @@ -1178,7 +1178,7 @@ void KMultiPage::scrollUp() void KMultiPage::scrollDown() { - QScrollBar* scrollBar = scrollView()->verticalScrollBar(); + TQScrollBar* scrollBar = scrollView()->verticalScrollBar(); if (scrollBar == 0) return; @@ -1187,7 +1187,7 @@ void KMultiPage::scrollDown() void KMultiPage::scrollLeft() { - QScrollBar* scrollBar = scrollView()->horizontalScrollBar(); + TQScrollBar* scrollBar = scrollView()->horizontalScrollBar(); if (scrollBar) scrollBar->subtractLine(); } @@ -1195,7 +1195,7 @@ void KMultiPage::scrollLeft() void KMultiPage::scrollRight() { - QScrollBar* scrollBar = scrollView()->horizontalScrollBar(); + TQScrollBar* scrollBar = scrollView()->horizontalScrollBar(); if (scrollBar) scrollBar->addLine(); } @@ -1203,7 +1203,7 @@ void KMultiPage::scrollRight() void KMultiPage::scrollUpPage() { - QScrollBar* scrollBar = scrollView()->verticalScrollBar(); + TQScrollBar* scrollBar = scrollView()->verticalScrollBar(); if (scrollBar) scrollBar->subtractPage(); } @@ -1211,7 +1211,7 @@ void KMultiPage::scrollUpPage() void KMultiPage::scrollDownPage() { - QScrollBar* scrollBar = scrollView()->verticalScrollBar(); + TQScrollBar* scrollBar = scrollView()->verticalScrollBar(); if (scrollBar) scrollBar->addPage(); } @@ -1219,7 +1219,7 @@ void KMultiPage::scrollDownPage() void KMultiPage::scrollLeftPage() { - QScrollBar* scrollBar = scrollView()->horizontalScrollBar(); + TQScrollBar* scrollBar = scrollView()->horizontalScrollBar(); if (scrollBar) scrollBar->subtractPage(); } @@ -1227,7 +1227,7 @@ void KMultiPage::scrollLeftPage() void KMultiPage::scrollRightPage() { - QScrollBar* scrollBar = scrollView()->horizontalScrollBar(); + TQScrollBar* scrollBar = scrollView()->horizontalScrollBar(); if (scrollBar) scrollBar->addPage(); } @@ -1273,7 +1273,7 @@ void KMultiPage::readUp() } -void KMultiPage::jumpToReference(const QString& reference) +void KMultiPage::jumpToReference(const TQString& reference) { if (renderer.isNull()) return; @@ -1379,7 +1379,7 @@ void KMultiPage::findNextText() // If not we need to delete it manually to avoid a memory leak. bool cachedPage = false; - QString searchText = searchWidget->getText(); + TQString searchText = searchWidget->getText(); if (searchText.isEmpty()) { @@ -1479,7 +1479,7 @@ void KMultiPage::findNextText() if (answ != KMessageBox::Yes) { - setStatusBarText(QString::null); + setStatusBarText(TQString::null); searchInProgress = false; if (!cachedPage) delete searchPage; @@ -1491,7 +1491,7 @@ void KMultiPage::findNextText() { pageCache->selectText(foundSelection); gotoPage(pageCache->selectedText()); - setStatusBarText(QString::null); + setStatusBarText(TQString::null); searchInProgress = false; if (!cachedPage) delete searchPage; @@ -1500,7 +1500,7 @@ void KMultiPage::findNextText() } KMessageBox::sorry(scrollView(), i18n("<qt>The search string <strong>%1</strong> could not be found.</qt>").arg(searchText)); - setStatusBarText(QString::null); + setStatusBarText(TQString::null); searchInProgress = false; if (!cachedPage) delete searchPage; @@ -1519,7 +1519,7 @@ void KMultiPage::findPrevText() // If not we need to delete it manually to avoid a memory leak. bool cachedPage = false; - QString searchText = searchWidget->getText(); + TQString searchText = searchWidget->getText(); if (searchText.isEmpty()) { @@ -1621,7 +1621,7 @@ void KMultiPage::findPrevText() if (answ != KMessageBox::Yes) { - setStatusBarText(QString::null); + setStatusBarText(TQString::null); searchInProgress = false; if (!cachedPage) delete searchPage; @@ -1633,7 +1633,7 @@ void KMultiPage::findPrevText() { pageCache->selectText(foundSelection); gotoPage(pageCache->selectedText()); - setStatusBarText(QString::null); + setStatusBarText(TQString::null); searchInProgress = false; if (!cachedPage) delete searchPage; @@ -1642,7 +1642,7 @@ void KMultiPage::findPrevText() } KMessageBox::sorry(scrollView(), i18n("<qt>The search string <strong>%1</strong> could not be found.</qt>").arg(searchText)); - setStatusBarText(QString::null); + setStatusBarText(TQString::null); searchInProgress = false; if (!cachedPage) delete searchPage; @@ -1686,7 +1686,7 @@ void KMultiPage::copyText() pageCache->selectedText().copyText(); } -void KMultiPage::timerEvent( QTimerEvent * ) +void KMultiPage::timerEvent( TQTimerEvent * ) { #ifdef KMULTIPAGE_DEBUG kdDebug(4300) << "Timer Event " << endl; @@ -1728,7 +1728,7 @@ void KMultiPage::reload() setCurrentPageNumber(pg); setFile(r); - emit setStatusBarText(QString::null); + emit setStatusBarText(TQString::null); } else { if (timer_id == -1) timer_id = startTimer(1000); @@ -1758,25 +1758,25 @@ bool KMultiPage::openFile() markList()->clear(); markList()->setNumberOfPages(numberOfPages(), KVSPrefs::showThumbnails()); - QString reference = url().ref(); + TQString reference = url().ref(); if (!reference.isEmpty()) gotoPage(renderer->parseReference(reference)); // Set Table of Contents tableOfContents->setContents(renderer->getBookmarks()); } else - m_file = QString::null; + m_file = TQString::null; setFile(r); // Clear Statusbar - emit setStatusBarText(QString::null); + emit setStatusBarText(TQString::null); return r; } -bool KMultiPage::openURL(const QString &filename, const KURL &base_url) +bool KMultiPage::openURL(const TQString &filename, const KURL &base_url) { m_file = filename; m_url = base_url; @@ -1794,9 +1794,9 @@ void KMultiPage::enableActions(bool fileLoaded) Q_UNUSED(fileLoaded); } -void KMultiPage::wheelEvent(QWheelEvent *e) +void KMultiPage::wheelEvent(TQWheelEvent *e) { - QScrollBar *sb = scrollView()->verticalScrollBar(); + TQScrollBar *sb = scrollView()->verticalScrollBar(); if (sb == 0) return; @@ -1858,22 +1858,22 @@ KPrinter *KMultiPage::getPrinter(bool enablePageSizeFeatures) // printer. We try to be smart and optimize the list by using ranges // ("5-11") wherever possible. The user will be tankful for // that. Complicated? Yeah, but that's life. - QValueList<int> selectedPageNo = selectedPages(); + TQValueList<int> selectedPageNo = selectedPages(); if (selectedPageNo.isEmpty() == true) printer->setOption( "kde-range", "" ); else { int commaflag = 0; - QString range; - QValueList<int>::ConstIterator it = selectedPageNo.begin(); + TQString range; + TQValueList<int>::ConstIterator it = selectedPageNo.begin(); do{ int val = *it; if (commaflag == 1) - range += QString(", "); + range += TQString(", "); else commaflag = 1; int endval = val; if (it != selectedPageNo.end()) { - QValueList<int>::ConstIterator jt = it; + TQValueList<int>::ConstIterator jt = it; jt++; do{ int val2 = *jt; @@ -1887,9 +1887,9 @@ KPrinter *KMultiPage::getPrinter(bool enablePageSizeFeatures) } else it++; if (endval == val) - range += QString("%1").arg(val); + range += TQString("%1").arg(val); else - range += QString("%1-%2").arg(val).arg(endval); + range += TQString("%1-%2").arg(val).arg(endval); } while (it != selectedPageNo.end() ); printer->setOption( "kde-range", range ); } @@ -1900,15 +1900,15 @@ KPrinter *KMultiPage::getPrinter(bool enablePageSizeFeatures) void KMultiPage::doExportText() { // Generate a suggestion for a reasonable file name - QString suggestedName = url().filename(); + TQString suggestedName = url().filename(); suggestedName = suggestedName.left(suggestedName.find(".")) + ".txt"; - QString fileName = KFileDialog::getSaveFileName(suggestedName, i18n("*.txt|Plain Text (Latin 1) (*.txt)"), scrollView(), i18n("Export File As")); + TQString fileName = KFileDialog::getSaveFileName(suggestedName, i18n("*.txt|Plain Text (Latin 1) (*.txt)"), scrollView(), i18n("Export File As")); if (fileName.isEmpty()) return; - QFileInfo finfo(fileName); + TQFileInfo finfo(fileName); if (finfo.exists()) { int r = KMessageBox::warningContinueCancel (scrollView(), @@ -1919,11 +1919,11 @@ void KMultiPage::doExportText() return; } - QFile textFile(fileName); + TQFile textFile(fileName); textFile.open(IO_WriteOnly); - QTextStream stream(&textFile); + TQTextStream stream(&textFile); - QProgressDialog progress(i18n("Exporting to text..."), i18n("Abort"), renderer->totalPages(), + TQProgressDialog progress(i18n("Exporting to text..."), i18n("Abort"), renderer->totalPages(), scrollView(), "export_text_progress", true); progress.setMinimumDuration(300); diff --git a/kviewshell/kmultipage.h b/kviewshell/kmultipage.h index 7f24a809..285031ca 100644 --- a/kviewshell/kmultipage.h +++ b/kviewshell/kmultipage.h @@ -10,7 +10,7 @@ #include "marklist.h" #include <kparts/part.h> -#include <qtimer.h> +#include <tqtimer.h> class Anchor; class DocumentWidget; @@ -18,9 +18,9 @@ class KConfigDialog; class KPrintDialogPage_PageOptions; class KPrinter; class PageView; -class QPainter; -class QSplitter; -class QToolBox; +class TQPainter; +class TQSplitter; +class TQToolBox; class simplePageSize; class TableOfContents; class PageNumber; @@ -39,25 +39,25 @@ class KMultiPage : public KParts::ReadOnlyPart, virtual public kmultipageInterfa Q_OBJECT public: - KMultiPage(QWidget *parentWidget, const char *widgetName, QObject *parent, const char *name); + KMultiPage(TQWidget *parentWidget, const char *widgetName, TQObject *parent, const char *name); virtual ~KMultiPage(); /* returns the scrollview used for the display */ - virtual QWidget* mainWidget() {return _scrollView;} + virtual TQWidget* mainWidget() {return _scrollView;} /* Methods which are associated with the DCOP functionality of the kmultipage. This method returns the file name (not the URL) of the currently loaded file. */ - QString name_of_current_file(); + TQString name_of_current_file(); /* Methods which are associated with the DCOP functionality of the kmultipage. This method can be implemented by the multipage, e.g. to jump to a certain location. */ - virtual ASYNC jumpToReference(const QString& /*reference*/); + virtual ASYNC jumpToReference(const TQString& /*reference*/); /* Methods which are associated with the DCOP functionality of the kmultipage. This method checks if a given file is loaded. */ - bool is_file_loaded(const QString& filename); + bool is_file_loaded(const TQString& filename); /* Opens file and sets URL @@ -78,7 +78,7 @@ public: @returns true on success, false on failure */ - virtual bool openURL(const QString &filename, const KURL &base_url); + virtual bool openURL(const TQString &filename, const KURL &base_url); /** Prints a document @@ -130,7 +130,7 @@ public: printer->pageList() gives a list of pages to be printed, where "1" denotes the first page, "2" the second, etc.> ... - printer->printFiles( QStringList(tmpPSFile), true ); + printer->printFiles( TQStringList(tmpPSFile), true ); delete printer; @endcode @@ -173,7 +173,7 @@ public: printer->pageList() gives a list of pages to be printed, where "1" denotes the first page, "2" the second, etc.> ... - printer->printFiles( QStringList(tmpPSFile), true ); + printer->printFiles( TQStringList(tmpPSFile), true ); delete printer; @endcode @@ -214,7 +214,7 @@ public: kviewshell will not allow the user to see and select compressed dvi-files. */ - virtual QStringList fileFormats() const = 0; + virtual TQStringList fileFormats() const = 0; /// closes a file virtual bool closeURL(); @@ -262,7 +262,7 @@ public: @returns a list with the numbers of the currently selected pages. */ - virtual QValueList<int> selectedPages() {return markList()->selectedPages();} + virtual TQValueList<int> selectedPages() {return markList()->selectedPages();} virtual History* history() { return &document_history; } @@ -361,7 +361,7 @@ protected: virtual void initializePageCache(); /* Returns a pointer to the renderer. */ - virtual QGuardedPtr<DocumentRenderer> getRenderer() const { return renderer; } + virtual TQGuardedPtr<DocumentRenderer> getRenderer() const { return renderer; } PageView* scrollView() { return _scrollView; } @@ -496,7 +496,7 @@ protected slots: void gotoPage(const TextSelection&); private slots: - void handleLocalLink(const QString &linkText); + void handleLocalLink(const TQString &linkText); signals: /** Emitted with argument "true" when the move tool is selected, and @@ -539,7 +539,7 @@ public slots: from the multipage/scrollview. This method calles scroll, a delta-value of 120 (i.e. one notch on a standard wheel mouse) scrolls by two 'lines'. */ - void wheelEvent(QWheelEvent *); + void wheelEvent(TQWheelEvent *); protected: /** Allocates and initializes a KPrinter structure @@ -568,9 +568,9 @@ protected: This pointer is automatically set by the constructor. */ - QGuardedPtr<QWidget> parentWdg; + TQGuardedPtr<TQWidget> parentWdg; - QPtrVector<DocumentWidget> widgetList; + TQPtrVector<DocumentWidget> widgetList; History document_history; @@ -614,7 +614,7 @@ private: timer. It may well happen that KDirWatch calls us several times while we are waiting for the file to become good, but that does not do any harm. */ - void timerEvent( QTimerEvent *e ); + void timerEvent( TQTimerEvent *e ); /* This method opens a file and sets up the GUI when the file is loaded. It calls setFile() so that implementations of kmultipage @@ -622,16 +622,16 @@ private: bool openFile(); /* Is set by setRenderer. */ - QGuardedPtr<DocumentRenderer> renderer; + TQGuardedPtr<DocumentRenderer> renderer; PageView *_scrollView; SearchWidget* searchWidget; - QToolBox* sideBar; + TQToolBox* sideBar; MarkList* _markList; TableOfContents* tableOfContents; - QSplitter* splitterWidget; + TQSplitter* splitterWidget; /* This timer is used to implement a brief delay when the user scrolls past the beginning or the end of the page before a the @@ -639,7 +639,7 @@ private: the user to scroll with the mouse wheel or the keyboard without involuntarily moving to another page. The timer is used in the scroll() method. */ - QTimer changePageDelayTimer; + TQTimer changePageDelayTimer; // This is set to true while a text search is performed. // If set to false the search is interrupted. diff --git a/kviewshell/kmultipageInterface.h b/kviewshell/kmultipageInterface.h index 0ad6e914..4c498900 100644 --- a/kviewshell/kmultipageInterface.h +++ b/kviewshell/kmultipageInterface.h @@ -9,9 +9,9 @@ class kmultipageInterface : virtual public DCOPObject K_DCOP k_dcop: - virtual ASYNC jumpToReference(const QString& reference) = 0; - virtual QString name_of_current_file() = 0; - virtual bool is_file_loaded(const QString& filename) = 0; + virtual ASYNC jumpToReference(const TQString& reference) = 0; + virtual TQString name_of_current_file() = 0; + virtual bool is_file_loaded(const TQString& filename) = 0; }; #endif diff --git a/kviewshell/kprintDialogPage_pageoptions.cpp b/kviewshell/kprintDialogPage_pageoptions.cpp index dbadd759..c0c4b15e 100644 --- a/kviewshell/kprintDialogPage_pageoptions.cpp +++ b/kviewshell/kprintDialogPage_pageoptions.cpp @@ -10,17 +10,17 @@ #include <config.h> #include <klocale.h> -#include <qbuttongroup.h> -#include <qcheckbox.h> -#include <qlayout.h> -#include <qtooltip.h> -#include <qwhatsthis.h> +#include <tqbuttongroup.h> +#include <tqcheckbox.h> +#include <tqlayout.h> +#include <tqtooltip.h> +#include <tqwhatsthis.h> #include <kdebug.h> #include "kprintDialogPage_pageoptions.h" -KPrintDialogPage_PageOptions::KPrintDialogPage_PageOptions( QWidget *parent, const char *name ) +KPrintDialogPage_PageOptions::KPrintDialogPage_PageOptions( TQWidget *parent, const char *name ) : KPrintDialogPage( parent, name ) { setTitle( i18n("Page Size & Placement") ); @@ -31,27 +31,27 @@ KPrintDialogPage_PageOptions::KPrintDialogPage_PageOptions( QWidget *parent, con checkBox_shrink = 0; checkBox_expand = 0; - kprintDialogPage_pageoptions_baseLayout = new QVBoxLayout( this, 11, 6, "kprintDialogPage_pageoptions_baseLayout"); + kprintDialogPage_pageoptions_baseLayout = new TQVBoxLayout( this, 11, 6, "kprintDialogPage_pageoptions_baseLayout"); if (kprintDialogPage_pageoptions_baseLayout == 0) { kdError(1223) << "KPrintDialogPage_PageOptions::KPrintDialogPage_PageOptions() cannot create layout" << endl; return; } - checkBox_center = new QCheckBox( this, "checkBox_center" ); + checkBox_center = new TQCheckBox( this, "checkBox_center" ); if (checkBox_center != 0) { checkBox_center->setText( i18n( "Center the page on paper" ) ); - QToolTip::add( checkBox_center, i18n( "If this option is enabled, the pages are centered on the paper." ) ); - QWhatsThis::add( checkBox_center, i18n( "<qt><p>If this option is enabled, the pages will be printed centered on the paper; this makes " + TQToolTip::add( checkBox_center, i18n( "If this option is enabled, the pages are centered on the paper." ) ); + TQWhatsThis::add( checkBox_center, i18n( "<qt><p>If this option is enabled, the pages will be printed centered on the paper; this makes " "more visually-appealing printouts.</p>" "<p>If the option is not enabled, all pages will be placed in the top-left corner of the paper.</p></qt>" ) ); kprintDialogPage_pageoptions_baseLayout->addWidget( checkBox_center ); } - checkBox_rotate = new QCheckBox( this, "checkBox_rotate" ); + checkBox_rotate = new TQCheckBox( this, "checkBox_rotate" ); if (checkBox_rotate != 0) { checkBox_rotate->setText( i18n( "Automatically choose landscape or portrait orientation" ) ); - QToolTip::add( checkBox_rotate, i18n( "If this option is enabled, some pages might be rotated to better fit the paper size." ) ); - QWhatsThis::add( checkBox_rotate, i18n( "<qt><p>If this option is enabled, landscape or portrait orientation are automatically chosen on a " + TQToolTip::add( checkBox_rotate, i18n( "If this option is enabled, some pages might be rotated to better fit the paper size." ) ); + TQWhatsThis::add( checkBox_rotate, i18n( "<qt><p>If this option is enabled, landscape or portrait orientation are automatically chosen on a " "page-by-page basis. This makes better use of the paper and gives more visually-" "appealing printouts.</p>" "<p><b>Note:</b> This option overrides the Portrait/Landscape option chosen in the printer " @@ -60,30 +60,30 @@ KPrintDialogPage_PageOptions::KPrintDialogPage_PageOptions( QWidget *parent, con kprintDialogPage_pageoptions_baseLayout->addWidget( checkBox_rotate ); } - QFrame *line = new QFrame( this, "line1" ); + TQFrame *line = new TQFrame( this, "line1" ); if (line != 0) { - line->setFrameShape( QFrame::HLine ); - line->setFrameShadow( QFrame::Sunken ); - line->setFrameShape( QFrame::HLine ); + line->setFrameShape( TQFrame::HLine ); + line->setFrameShadow( TQFrame::Sunken ); + line->setFrameShape( TQFrame::HLine ); kprintDialogPage_pageoptions_baseLayout->addWidget( line ); } - checkBox_shrink = new QCheckBox( this, "checkBox_shrink" ); + checkBox_shrink = new TQCheckBox( this, "checkBox_shrink" ); if (checkBox_shrink != 0) { checkBox_shrink->setText( i18n( "Shrink oversized pages to fit paper size" ) ); - QToolTip::add( checkBox_shrink, i18n( "If this option is enabled, large pages that would not fit the printer's paper size will be shrunk." ) ); - QWhatsThis::add( checkBox_shrink, i18n( "<qt><p>If this option is enabled, large pages that would not fit the printer's paper size will be " + TQToolTip::add( checkBox_shrink, i18n( "If this option is enabled, large pages that would not fit the printer's paper size will be shrunk." ) ); + TQWhatsThis::add( checkBox_shrink, i18n( "<qt><p>If this option is enabled, large pages that would not fit the printer's paper size will be " "shrunk so that edges won't be cut off during printing.</p>" "<p><b>Note:</b> If this option is enabled, and if the pages in your document have different sizes, " "then different pages might be shrunk by different scaling factors.</p></qt>" ) ); kprintDialogPage_pageoptions_baseLayout->addWidget( checkBox_shrink ); } - checkBox_expand = new QCheckBox( this, "checkBox_expand" ); + checkBox_expand = new TQCheckBox( this, "checkBox_expand" ); if (checkBox_expand != 0) { checkBox_expand->setText( i18n( "Expand small pages to fit paper size" ) ); - QToolTip::add( checkBox_expand, i18n( "If this option is enabled, small pages will be enlarged so that they fit the printer's paper size." ) ); - QWhatsThis::add( checkBox_expand, i18n( "<qt><p>If this option is enabled, small pages will be enlarged so that they fit the printer's " + TQToolTip::add( checkBox_expand, i18n( "If this option is enabled, small pages will be enlarged so that they fit the printer's paper size." ) ); + TQWhatsThis::add( checkBox_expand, i18n( "<qt><p>If this option is enabled, small pages will be enlarged so that they fit the printer's " "paper size.</p>" "<p><b>Note:</b> If this option is enabled, and if the pages in your document have different sizes, " "then different pages might be expanded by different scaling factors.</p></qt>" ) ); @@ -91,13 +91,13 @@ KPrintDialogPage_PageOptions::KPrintDialogPage_PageOptions( QWidget *parent, con } - resize( QSize(319, 166).expandedTo(minimumSizeHint()) ); + resize( TQSize(319, 166).expandedTo(minimumSizeHint()) ); clearWState( WState_Polished ); } -void KPrintDialogPage_PageOptions::getOptions( QMap<QString,QString>& opts, bool incldef ) +void KPrintDialogPage_PageOptions::getOptions( TQMap<TQString,TQString>& opts, bool incldef ) { // Save options, taking default values into consideration: by // default "center" is checked, "expand" and "shrink" are @@ -134,12 +134,12 @@ void KPrintDialogPage_PageOptions::getOptions( QMap<QString,QString>& opts, bool } -void KPrintDialogPage_PageOptions::setOptions( const QMap<QString,QString>& opts ) +void KPrintDialogPage_PageOptions::setOptions( const TQMap<TQString,TQString>& opts ) { // Sets the centering option. By default, this option is // checked. Warning: All default values are also coded into // getOptions() and kmultipage::print(..). - QString op = opts[ "kde-kviewshell-centerpage" ]; + TQString op = opts[ "kde-kviewshell-centerpage" ]; if (checkBox_center != 0) checkBox_center->setChecked( op != "false" ); @@ -160,7 +160,7 @@ void KPrintDialogPage_PageOptions::setOptions( const QMap<QString,QString>& opts } -bool KPrintDialogPage_PageOptions::isValid( QString& ) +bool KPrintDialogPage_PageOptions::isValid( TQString& ) { return true; } diff --git a/kviewshell/kprintDialogPage_pageoptions.h b/kviewshell/kprintDialogPage_pageoptions.h index 0c274248..8fea375f 100644 --- a/kviewshell/kprintDialogPage_pageoptions.h +++ b/kviewshell/kprintDialogPage_pageoptions.h @@ -13,8 +13,8 @@ #include <kdeprint/kprintdialogpage.h> -class QCheckBox; -class QVBoxLayout; +class TQCheckBox; +class TQVBoxLayout; // This is a fairly standard KPrintDialogPage that allows the user to @@ -24,19 +24,19 @@ class QVBoxLayout; class KPrintDialogPage_PageOptions : public KPrintDialogPage { public: - KPrintDialogPage_PageOptions( QWidget *parent = 0, const char *name = 0 ); + KPrintDialogPage_PageOptions( TQWidget *parent = 0, const char *name = 0 ); - void getOptions( QMap<QString,QString>& opts, bool incldef = false ); - void setOptions( const QMap<QString,QString>& opts ); - bool isValid( QString& msg ); + void getOptions( TQMap<TQString,TQString>& opts, bool incldef = false ); + void setOptions( const TQMap<TQString,TQString>& opts ); + bool isValid( TQString& msg ); - QCheckBox* checkBox_center; - QCheckBox* checkBox_rotate; - QCheckBox* checkBox_shrink; - QCheckBox* checkBox_expand; + TQCheckBox* checkBox_center; + TQCheckBox* checkBox_rotate; + TQCheckBox* checkBox_shrink; + TQCheckBox* checkBox_expand; private: - QVBoxLayout* kprintDialogPage_pageoptions_baseLayout; + TQVBoxLayout* kprintDialogPage_pageoptions_baseLayout; }; diff --git a/kviewshell/kviewpart.cpp b/kviewshell/kviewpart.cpp index ef21dca7..56e13b64 100644 --- a/kviewshell/kviewpart.cpp +++ b/kviewshell/kviewpart.cpp @@ -1,12 +1,12 @@ -#include <qfileinfo.h> -#include <qhbox.h> -#include <qlayout.h> -#include <qscrollview.h> -#include <qscrollbar.h> -#include <qtimer.h> -#include <qpainter.h> -#include <qprinter.h> -#include <qprintdialog.h> +#include <tqfileinfo.h> +#include <tqhbox.h> +#include <tqlayout.h> +#include <tqscrollview.h> +#include <tqscrollbar.h> +#include <tqtimer.h> +#include <tqpainter.h> +#include <tqprinter.h> +#include <tqprintdialog.h> #include <kaboutdialog.h> #include <kaccel.h> @@ -56,10 +56,10 @@ typedef KParts::GenericFactory<KViewPart> KViewPartFactory; K_EXPORT_COMPONENT_FACTORY(kviewerpart, KViewPartFactory) -KViewPart::KViewPart(QWidget *parentWidget, const char *widgetName, QObject *parent, - const char *name, const QStringList& args) +KViewPart::KViewPart(TQWidget *parentWidget, const char *widgetName, TQObject *parent, + const char *name, const TQStringList& args) : KViewPart_Iface(parent, name), showSidebar(0), saveAction(0), partManager(0), - multiPageLibrary(QString::null), aboutDialog(0) + multiPageLibrary(TQString::null), aboutDialog(0) { KGlobal::locale()->insertCatalogue("kviewshell"); @@ -68,11 +68,11 @@ KViewPart::KViewPart(QWidget *parentWidget, const char *widgetName, QObject *par setInstance(KViewPartFactory::instance()); watch = KDirWatch::self(); - connect(watch, SIGNAL(dirty(const QString&)), this, SLOT(fileChanged(const QString&))); + connect(watch, TQT_SIGNAL(dirty(const TQString&)), this, TQT_SLOT(fileChanged(const TQString&))); watch->startScan(); - mainWidget = new QHBox(parentWidget, widgetName); - mainWidget->setFocusPolicy(QWidget::StrongFocus); + mainWidget = new TQHBox(parentWidget, widgetName); + mainWidget->setFocusPolicy(TQWidget::StrongFocus); setWidget(mainWidget); // Setup part manager @@ -83,7 +83,7 @@ KViewPart::KViewPart(QWidget *parentWidget, const char *widgetName, QObject *par // Without this the GUI-items of the KMultiPages are not merged partManager->setAllowNestedParts(true); - connect(partManager, SIGNAL(activePartChanged(KParts::Part*)), this, SIGNAL(pluginChanged(KParts::Part*))); + connect(partManager, TQT_SIGNAL(activePartChanged(KParts::Part*)), this, TQT_SIGNAL(pluginChanged(KParts::Part*))); partManager->addPart(this); // create the displaying part @@ -94,10 +94,10 @@ KViewPart::KViewPart(QWidget *parentWidget, const char *widgetName, QObject *par if (!args.isEmpty()) { // If a default MimeType is specified try to load a MultiPage supporting it. - QString defaultMimeType = args.first(); + TQString defaultMimeType = args.first(); offers = KTrader::self()->query( - QString::fromLatin1("KViewShell/MultiPage" ), - QString("([X-KDE-MultiPageVersion] == %1) and " + TQString::fromLatin1("KViewShell/MultiPage" ), + TQString("([X-KDE-MultiPageVersion] == %1) and " "([X-KDE-MimeTypes] == '%2')").arg(MULTIPAGE_VERSION).arg(defaultMimeType)); } @@ -105,8 +105,8 @@ KViewPart::KViewPart(QWidget *parentWidget, const char *widgetName, QObject *par if (offers.isEmpty()) { offers = KTrader::self()->query( - QString::fromLatin1("KViewShell/MultiPage" ), - QString("([X-KDE-MultiPageVersion] == %1) and " + TQString::fromLatin1("KViewShell/MultiPage" ), + TQString("([X-KDE-MultiPageVersion] == %1) and " "([X-KDE-EmptyMultiPage] == 1)").arg(MULTIPAGE_VERSION)); } @@ -123,11 +123,11 @@ KViewPart::KViewPart(QWidget *parentWidget, const char *widgetName, QObject *par // Try to load the multiPage int error; multiPage = static_cast<KMultiPage*>(KParts::ComponentFactory::createInstanceFromService<KParts::ReadOnlyPart>(service, mainWidget, - service->name().utf8(), QStringList(), &error )); + service->name().utf8(), TQStringList(), &error )); // If the loading of the MultiPage failed report and error and abort. if (!multiPage) { - QString reason; + TQString reason; switch(error) { case KParts::ComponentFactory::ErrNoServiceFound: reason = i18n("<qt>No service implementing the given mimetype and fullfilling the given constraint expression can be found.</qt>"); @@ -147,7 +147,7 @@ KViewPart::KViewPart(QWidget *parentWidget, const char *widgetName, QObject *par break; } - QString text = i18n("<qt><p><b>Problem:</b> The document <b>%1</b> cannot be shown.</p>" + TQString text = i18n("<qt><p><b>Problem:</b> The document <b>%1</b> cannot be shown.</p>" "<p><b>Reason:</b> The software component <b>%2</b> which is required to " "display your files could not be initialized. This could point to " "serious misconfiguration of your KDE system, or to damaged program files.</p>" @@ -156,9 +156,9 @@ KViewPart::KViewPart(QWidget *parentWidget, const char *widgetName, QObject *par "provider of your software (e.g. the vendor of your Linux distribution), or " "directly to the authors of the software. The entry <b>Report Bug...</b> in the " "<b>Help</b> menu helps you to contact the KDE programmers.</p></qt>").arg(m_file).arg(service->library()); - QString caption = i18n("Error Initializing Software Component"); + TQString caption = i18n("Error Initializing Software Component"); KMessageBox::detailedError(mainWidget, text, reason, caption); - emit setStatusBarText(QString::null); + emit setStatusBarText(TQString::null); return; } // Make the KViewPart the parent of the MultiPage. @@ -170,35 +170,35 @@ KViewPart::KViewPart(QWidget *parentWidget, const char *widgetName, QObject *par // Add the multipage to the GUI. partManager->addPart(multiPage); - exportTextAction = new KAction(i18n("Text..."), 0, this, SLOT(mp_exportText()), actionCollection(), "export_text"); + exportTextAction = new KAction(i18n("Text..."), 0, this, TQT_SLOT(mp_exportText()), actionCollection(), "export_text"); // edit menu - findTextAction = KStdAction::find(this, SLOT(mp_showFindTextDialog()), actionCollection(), "find"); - findNextAction = KStdAction::findNext(this, SLOT(mp_findNextText()), actionCollection(), "findnext"); + findTextAction = KStdAction::find(this, TQT_SLOT(mp_showFindTextDialog()), actionCollection(), "find"); + findNextAction = KStdAction::findNext(this, TQT_SLOT(mp_findNextText()), actionCollection(), "findnext"); findNextAction->setEnabled(false); - findPrevAction = KStdAction::findPrev(this, SLOT(mp_findPrevText()), actionCollection(), "findprev"); + findPrevAction = KStdAction::findPrev(this, TQT_SLOT(mp_findPrevText()), actionCollection(), "findprev"); findPrevAction->setEnabled(false); - selectAllAction = KStdAction::selectAll(this, SLOT(mp_doSelectAll()), actionCollection(), "edit_select_all"); + selectAllAction = KStdAction::selectAll(this, TQT_SLOT(mp_doSelectAll()), actionCollection(), "edit_select_all"); - copyTextAction = KStdAction::copy(this, SLOT(mp_copyText()), actionCollection(), "copy_text"); + copyTextAction = KStdAction::copy(this, TQT_SLOT(mp_copyText()), actionCollection(), "copy_text"); copyTextAction->setEnabled(false); - deselectAction = KStdAction::deselect(this, SLOT(mp_clearSelection()), actionCollection(), "edit_deselect_all"); + deselectAction = KStdAction::deselect(this, TQT_SLOT(mp_clearSelection()), actionCollection(), "edit_deselect_all"); deselectAction->setEnabled(false); - saveAction = KStdAction::save(this, SLOT(mp_slotSave_defaultFilename()), actionCollection()); + saveAction = KStdAction::save(this, TQT_SLOT(mp_slotSave_defaultFilename()), actionCollection()); // settings menu showSidebar = new KToggleAction (i18n("Show &Sidebar"), "show_side_panel", 0, this, - SLOT(slotShowSidebar()), actionCollection(), "show_sidebar"); + TQT_SLOT(slotShowSidebar()), actionCollection(), "show_sidebar"); showSidebar->setCheckedState(i18n("Hide &Sidebar")); watchAct = new KToggleAction(i18n("&Watch File"), 0, 0, 0, actionCollection(), "watch_file"); scrollbarHandling = new KToggleAction (i18n("Show Scrollbars"), 0, 0, 0, actionCollection(), "scrollbarHandling"); scrollbarHandling->setCheckedState(i18n("Hide Scrollbars")); // View modes - QStringList viewModes; + TQStringList viewModes; viewModes.append(i18n("Single Page")); viewModes.append(i18n("Continuous")); viewModes.append(i18n("Continuous - Facing")); @@ -207,38 +207,38 @@ KViewPart::KViewPart(QWidget *parentWidget, const char *widgetName, QObject *par viewModeAction->setItems(viewModes); // Orientation menu - QStringList orientations; + TQStringList orientations; orientations.append(i18n("Portrait")); orientations.append(i18n("Landscape")); orientation = new KSelectAction (i18n("Preferred &Orientation"), 0, 0, 0, actionCollection(), "view_orientation"); orientation->setItems(orientations); - connect(orientation, SIGNAL(activated (int)), &userRequestedPaperSize, SLOT(setOrientation(int))); + connect(orientation, TQT_SIGNAL(activated (int)), &userRequestedPaperSize, TQT_SLOT(setOrientation(int))); // Zoom Menu zoom_action = new KSelectAction (i18n("&Zoom"), 0, 0, 0, actionCollection(), "view_zoom"); zoom_action->setEditable(true); zoom_action->setItems(_zoomVal.zoomNames()); - connect (&_zoomVal, SIGNAL(zoomNamesChanged(const QStringList &)), zoom_action, SLOT(setItems(const QStringList &))); - connect (&_zoomVal, SIGNAL(valNoChanged(int)), zoom_action, SLOT(setCurrentItem(int))); - connect (&_zoomVal, SIGNAL(zoomNameChanged(const QString &)), this, SIGNAL(zoomChanged(const QString &)) ); - connect (zoom_action, SIGNAL(activated(const QString &)), this, SLOT(setZoomValue(const QString &))); + connect (&_zoomVal, TQT_SIGNAL(zoomNamesChanged(const TQStringList &)), zoom_action, TQT_SLOT(setItems(const TQStringList &))); + connect (&_zoomVal, TQT_SIGNAL(valNoChanged(int)), zoom_action, TQT_SLOT(setCurrentItem(int))); + connect (&_zoomVal, TQT_SIGNAL(zoomNameChanged(const TQString &)), this, TQT_SIGNAL(zoomChanged(const TQString &)) ); + connect (zoom_action, TQT_SIGNAL(activated(const TQString &)), this, TQT_SLOT(setZoomValue(const TQString &))); _zoomVal.setZoomValue(1.0); // should not be necessary @@@@ emit(zoomChanged("100%")); // Paper Size Menu media = new KSelectAction (i18n("Preferred Paper &Size"), 0, 0, 0, actionCollection(), "view_media"); - QStringList items = userRequestedPaperSize.pageSizeNames(); + TQStringList items = userRequestedPaperSize.pageSizeNames(); items.prepend(i18n("Custom Size...")); media->setItems(items); - connect (media, SIGNAL(activated(int)), this, SLOT(slotMedia(int))); + connect (media, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotMedia(int))); - useDocumentSpecifiedSize = new KToggleAction(i18n("&Use Document Specified Paper Size"), 0, this, SLOT(slotShowSidebar()), + useDocumentSpecifiedSize = new KToggleAction(i18n("&Use Document Specified Paper Size"), 0, this, TQT_SLOT(slotShowSidebar()), actionCollection(), "view_use_document_specified_size"); // Zoom Actions - zoomInAct = KStdAction::zoomIn (this, SLOT(zoomIn()), actionCollection()); - zoomOutAct = KStdAction::zoomOut(this, SLOT(zoomOut()), actionCollection()); + zoomInAct = KStdAction::zoomIn (this, TQT_SLOT(zoomIn()), actionCollection()); + zoomOutAct = KStdAction::zoomOut(this, TQT_SLOT(zoomOut()), actionCollection()); fitPageAct = new KToggleAction(i18n("&Fit to Page"), "view_fit_window", Key_P, actionCollection(), "view_fit_to_page"); @@ -251,24 +251,24 @@ KViewPart::KViewPart(QWidget *parentWidget, const char *widgetName, QObject *par fitWidthAct -> setExclusiveGroup("view_fit"); fitHeightAct -> setExclusiveGroup("view_fit"); - connect(fitPageAct, SIGNAL(toggled(bool)), this, SLOT(enableFitToPage(bool))); - connect(fitWidthAct, SIGNAL(toggled(bool)), this, SLOT(enableFitToWidth(bool))); - connect(fitHeightAct, SIGNAL(toggled(bool)), this, SLOT(enableFitToHeight(bool))); + connect(fitPageAct, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(enableFitToPage(bool))); + connect(fitWidthAct, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(enableFitToWidth(bool))); + connect(fitHeightAct, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(enableFitToHeight(bool))); // go menu - backAct = KStdAction::prior(this, SLOT(mp_prevPage()), actionCollection()); - forwardAct = KStdAction::next(this, SLOT(mp_nextPage()), actionCollection()); - startAct = KStdAction::firstPage(this, SLOT(mp_firstPage()), actionCollection()); - endAct = KStdAction::lastPage(this, SLOT(mp_lastPage()), actionCollection()); - gotoAct = KStdAction::gotoPage(this, SLOT(goToPage()), actionCollection()); + backAct = KStdAction::prior(this, TQT_SLOT(mp_prevPage()), actionCollection()); + forwardAct = KStdAction::next(this, TQT_SLOT(mp_nextPage()), actionCollection()); + startAct = KStdAction::firstPage(this, TQT_SLOT(mp_firstPage()), actionCollection()); + endAct = KStdAction::lastPage(this, TQT_SLOT(mp_lastPage()), actionCollection()); + gotoAct = KStdAction::gotoPage(this, TQT_SLOT(goToPage()), actionCollection()); gotoAct->setShortcut("CTRL+G"); - readUpAct = new KAction(i18n("Read Up Document"), "up", SHIFT+Key_Space, this, SLOT(mp_readUp()), actionCollection(), "go_read_up"); - readDownAct = new KAction(i18n("Read Down Document"), "down", Key_Space, this, SLOT(mp_readDown()), actionCollection(), "go_read_down"); + readUpAct = new KAction(i18n("Read Up Document"), "up", SHIFT+Key_Space, this, TQT_SLOT(mp_readUp()), actionCollection(), "go_read_up"); + readDownAct = new KAction(i18n("Read Down Document"), "down", Key_Space, this, TQT_SLOT(mp_readDown()), actionCollection(), "go_read_down"); - printAction = KStdAction::print(this, SLOT(slotPrint()), actionCollection()); + printAction = KStdAction::print(this, TQT_SLOT(slotPrint()), actionCollection()); - saveAsAction = KStdAction::saveAs(this, SLOT(mp_slotSave()), actionCollection()); + saveAsAction = KStdAction::saveAs(this, TQT_SLOT(mp_slotSave()), actionCollection()); // mode action moveModeAction = new KRadioAction(i18n("&Move Tool"), "movetool", Key_F4, actionCollection(), "move_tool"); @@ -279,20 +279,20 @@ KViewPart::KViewPart(QWidget *parentWidget, const char *widgetName, QObject *par moveModeAction->setChecked(true); - connect(moveModeAction, SIGNAL(toggled(bool)), this, SLOT(slotEnableMoveTool(bool))); - //connect(selectionModeAction, SIGNAL(toggled(bool)), this, SLOT(slotEnableSelectionTool(bool))); + connect(moveModeAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotEnableMoveTool(bool))); + //connect(selectionModeAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotEnableSelectionTool(bool))); // history action backAction = new KAction(i18n("&Back"), "1leftarrow", 0, - this, SLOT(mp_doGoBack()), actionCollection(), "go_back"); + this, TQT_SLOT(mp_doGoBack()), actionCollection(), "go_back"); forwardAction = new KAction(i18n("&Forward"), "1rightarrow", 0, - this, SLOT(mp_doGoForward()), actionCollection(), "go_forward"); + this, TQT_SLOT(mp_doGoForward()), actionCollection(), "go_forward"); backAction->setEnabled(false); forwardAction->setEnabled(false); - settingsAction = KStdAction::preferences(this, SLOT(doSettings()), actionCollection()); + settingsAction = KStdAction::preferences(this, TQT_SLOT(doSettings()), actionCollection()); // We only show this menuitem if no default mimetype is set. This usually means kviewshell // has been started by itself. Otherwise if KDVI or KFaxView has been started show the @@ -300,20 +300,20 @@ KViewPart::KViewPart(QWidget *parentWidget, const char *widgetName, QObject *par if (!args.isEmpty()) { aboutAction = new KAction(i18n("About KViewShell"), "kviewshell", 0, this, - SLOT(aboutKViewShell()), actionCollection(), "help_about_kviewshell"); + TQT_SLOT(aboutKViewShell()), actionCollection(), "help_about_kviewshell"); } // keyboard accelerators accel = new KAccel(mainWidget); - accel->insert(I18N_NOOP("Scroll Up"), Key_Up, this, SLOT(mp_scrollUp())); - accel->insert(I18N_NOOP("Scroll Down"), Key_Down, this, SLOT(mp_scrollDown())); - accel->insert(I18N_NOOP("Scroll Left"), Key_Left, this, SLOT(mp_scrollLeft())); - accel->insert(I18N_NOOP("Scroll Right"), Key_Right, this, SLOT(mp_scrollRight())); + accel->insert(I18N_NOOP("Scroll Up"), Key_Up, this, TQT_SLOT(mp_scrollUp())); + accel->insert(I18N_NOOP("Scroll Down"), Key_Down, this, TQT_SLOT(mp_scrollDown())); + accel->insert(I18N_NOOP("Scroll Left"), Key_Left, this, TQT_SLOT(mp_scrollLeft())); + accel->insert(I18N_NOOP("Scroll Right"), Key_Right, this, TQT_SLOT(mp_scrollRight())); - accel->insert(I18N_NOOP("Scroll Up Page"), SHIFT+Key_Up, this, SLOT(mp_scrollUpPage())); - accel->insert(I18N_NOOP("Scroll Down Page"), SHIFT+Key_Down, this, SLOT(mp_scrollDownPage())); - accel->insert(I18N_NOOP("Scroll Left Page"), SHIFT+Key_Left, this, SLOT(mp_scrollLeftPage())); - accel->insert(I18N_NOOP("Scroll Right Page"), SHIFT+Key_Right, this, SLOT(mp_scrollRightPage())); + accel->insert(I18N_NOOP("Scroll Up Page"), SHIFT+Key_Up, this, TQT_SLOT(mp_scrollUpPage())); + accel->insert(I18N_NOOP("Scroll Down Page"), SHIFT+Key_Down, this, TQT_SLOT(mp_scrollDownPage())); + accel->insert(I18N_NOOP("Scroll Left Page"), SHIFT+Key_Left, this, TQT_SLOT(mp_scrollLeftPage())); + accel->insert(I18N_NOOP("Scroll Right Page"), SHIFT+Key_Right, this, TQT_SLOT(mp_scrollRightPage())); accel->readSettings(); readSettings(); @@ -333,7 +333,7 @@ KViewPart::KViewPart(QWidget *parentWidget, const char *widgetName, QObject *par // We disconnect because we dont want some FocusEvents to trigger a GUI update, which might mess // with our menus. - disconnect(partManager, SIGNAL(activePartChanged(KParts::Part*)), this, SIGNAL(pluginChanged(KParts::Part*))); + disconnect(partManager, TQT_SIGNAL(activePartChanged(KParts::Part*)), this, TQT_SIGNAL(pluginChanged(KParts::Part*))); } KViewPart::~KViewPart() @@ -360,41 +360,41 @@ void KViewPart::initializeMultiPage() // Paper Size handling multiPage->setUseDocumentSpecifiedSize(useDocumentSpecifiedSize->isChecked()); multiPage->setUserPreferredSize(userRequestedPaperSize); - connect(&userRequestedPaperSize, SIGNAL(sizeChanged(const SimplePageSize&)), multiPage, SLOT(setUserPreferredSize(const SimplePageSize&))); - connect(useDocumentSpecifiedSize, SIGNAL(toggled(bool)), multiPage, SLOT(setUseDocumentSpecifiedSize(bool))); + connect(&userRequestedPaperSize, TQT_SIGNAL(sizeChanged(const SimplePageSize&)), multiPage, TQT_SLOT(setUserPreferredSize(const SimplePageSize&))); + connect(useDocumentSpecifiedSize, TQT_SIGNAL(toggled(bool)), multiPage, TQT_SLOT(setUseDocumentSpecifiedSize(bool))); - connect(scrollbarHandling, SIGNAL(toggled(bool)), multiPage, SLOT(slotShowScrollbars(bool))); + connect(scrollbarHandling, TQT_SIGNAL(toggled(bool)), multiPage, TQT_SLOT(slotShowScrollbars(bool))); // connect to the multi page view - connect( this, SIGNAL(scrollbarStatusChanged(bool)), multiPage, SLOT(slotShowScrollbars(bool))); - connect( multiPage, SIGNAL(pageInfo(int, int)), this, SLOT(pageInfo(int, int)) ); - connect( multiPage, SIGNAL(askingToCheckActions()), this, SLOT(checkActions()) ); - connect( multiPage, SIGNAL( started( KIO::Job * ) ), this, SIGNAL( started( KIO::Job * ) ) ); - connect( multiPage, SIGNAL( completed() ), this, SIGNAL( completed() ) ); - connect( multiPage, SIGNAL( canceled( const QString & ) ), this, SIGNAL( canceled( const QString & ) ) ); - connect( multiPage, SIGNAL( setStatusBarText( const QString& ) ), this, SLOT( setStatusBarTextFromMultiPage( const QString& ) ) ); + connect( this, TQT_SIGNAL(scrollbarStatusChanged(bool)), multiPage, TQT_SLOT(slotShowScrollbars(bool))); + connect( multiPage, TQT_SIGNAL(pageInfo(int, int)), this, TQT_SLOT(pageInfo(int, int)) ); + connect( multiPage, TQT_SIGNAL(askingToCheckActions()), this, TQT_SLOT(checkActions()) ); + connect( multiPage, TQT_SIGNAL( started( KIO::Job * ) ), this, TQT_SIGNAL( started( KIO::Job * ) ) ); + connect( multiPage, TQT_SIGNAL( completed() ), this, TQT_SIGNAL( completed() ) ); + connect( multiPage, TQT_SIGNAL( canceled( const TQString & ) ), this, TQT_SIGNAL( canceled( const TQString & ) ) ); + connect( multiPage, TQT_SIGNAL( setStatusBarText( const TQString& ) ), this, TQT_SLOT( setStatusBarTextFromMultiPage( const TQString& ) ) ); - connect( multiPage, SIGNAL(zoomIn()), this, SLOT(zoomIn()) ); - connect( multiPage, SIGNAL(zoomOut()), this, SLOT(zoomOut()) ); + connect( multiPage, TQT_SIGNAL(zoomIn()), this, TQT_SLOT(zoomIn()) ); + connect( multiPage, TQT_SIGNAL(zoomOut()), this, TQT_SLOT(zoomOut()) ); // change the viewmode - connect(viewModeAction, SIGNAL(activated (int)), multiPage, SLOT(setViewMode(int))); + connect(viewModeAction, TQT_SIGNAL(activated (int)), multiPage, TQT_SLOT(setViewMode(int))); // Update zoomlevel on viewmode changes - connect(multiPage, SIGNAL(viewModeChanged()), this, SLOT(updateZoomLevel())); + connect(multiPage, TQT_SIGNAL(viewModeChanged()), this, TQT_SLOT(updateZoomLevel())); // navigation history - connect(multiPage->history(), SIGNAL(backItem(bool)), backAction, SLOT(setEnabled(bool))); - connect(multiPage->history(), SIGNAL(forwardItem(bool)), forwardAction, SLOT(setEnabled(bool))); + connect(multiPage->history(), TQT_SIGNAL(backItem(bool)), backAction, TQT_SLOT(setEnabled(bool))); + connect(multiPage->history(), TQT_SIGNAL(forwardItem(bool)), forwardAction, TQT_SLOT(setEnabled(bool))); // text selection - connect(multiPage, SIGNAL(textSelected(bool)), copyTextAction, SLOT(setEnabled(bool))); - connect(multiPage, SIGNAL(textSelected(bool)), deselectAction, SLOT(setEnabled(bool))); + connect(multiPage, TQT_SIGNAL(textSelected(bool)), copyTextAction, TQT_SLOT(setEnabled(bool))); + connect(multiPage, TQT_SIGNAL(textSelected(bool)), deselectAction, TQT_SLOT(setEnabled(bool))); // text search - connect(multiPage, SIGNAL(searchEnabled(bool)), findNextAction, SLOT(setEnabled(bool))); - connect(multiPage, SIGNAL(searchEnabled(bool)), findPrevAction, SLOT(setEnabled(bool))); + connect(multiPage, TQT_SIGNAL(searchEnabled(bool)), findNextAction, TQT_SLOT(setEnabled(bool))); + connect(multiPage, TQT_SIGNAL(searchEnabled(bool)), findPrevAction, TQT_SLOT(setEnabled(bool))); // allow parts to have a GUI, too :-) // (will be merged automatically) @@ -407,22 +407,22 @@ void KViewPart::slotStartFitTimer() } -QString KViewPart::pageSizeDescription() +TQString KViewPart::pageSizeDescription() { PageNumber nr = multiPage->currentPageNumber(); if (!nr.isValid()) - return QString::null; + return TQString::null; SimplePageSize ss = multiPage->sizeOfPage(nr); if (!ss.isValid()) - return QString::null; + return TQString::null; pageSize s(ss); - QString size = " "; + TQString size = " "; if (s.formatNumber() == -1) { if (KGlobal::locale()-> measureSystem() == KLocale::Metric) - size += QString("%1x%2 mm").arg(s.width().getLength_in_mm(), 0, 'f', 0).arg(s.height().getLength_in_mm(), 0, 'f', 0); + size += TQString("%1x%2 mm").arg(s.width().getLength_in_mm(), 0, 'f', 0).arg(s.height().getLength_in_mm(), 0, 'f', 0); else - size += QString("%1x%2 in").arg(s.width().getLength_in_inch(), 0, 'g', 2).arg(s.height().getLength_in_inch(), 0, 'g', 2); + size += TQString("%1x%2 in").arg(s.width().getLength_in_inch(), 0, 'g', 2).arg(s.height().getLength_in_inch(), 0, 'g', 2); } else { size += s.formatName() + "/"; if (s.getOrientation() == 0) @@ -459,20 +459,20 @@ void KViewPart::slotFileOpen() return; } - KURL url = KFileDialog::getOpenURL(QString::null, supportedMimeTypes().join(" ")); + KURL url = KFileDialog::getOpenURL(TQString::null, supportedMimeTypes().join(" ")); if (!url.isEmpty()) openURL(url); } -QStringList KViewPart::supportedMimeTypes() +TQStringList KViewPart::supportedMimeTypes() { - QStringList supportedMimeTypes; + TQStringList supportedMimeTypes; // Search for service KTrader::OfferList offers = KTrader::self()->query( - QString::fromLatin1("KViewShell/MultiPage"), - QString("([X-KDE-MultiPageVersion] == %1)").arg(MULTIPAGE_VERSION) + TQString::fromLatin1("KViewShell/MultiPage"), + TQString("([X-KDE-MultiPageVersion] == %1)").arg(MULTIPAGE_VERSION) ); if (!offers.isEmpty()) @@ -483,7 +483,7 @@ QStringList KViewPart::supportedMimeTypes() for (; iterator != end; ++iterator) { KService::Ptr service = *iterator; - QString mimeType = service->property("X-KDE-MimeTypes").toString(); + TQString mimeType = service->property("X-KDE-MimeTypes").toString(); supportedMimeTypes << mimeType; } @@ -505,19 +505,19 @@ QStringList KViewPart::supportedMimeTypes() return supportedMimeTypes; } -QStringList KViewPart::fileFormats() const +TQStringList KViewPart::fileFormats() const { // Compile a list of the supported filename patterns // First we build a list of the mimetypes which are supported by the // currently installed KMultiPage-Plugins. - QStringList supportedMimeTypes; - QStringList supportedPattern; + TQStringList supportedMimeTypes; + TQStringList supportedPattern; // Search for service KTrader::OfferList offers = KTrader::self()->query( - QString::fromLatin1("KViewShell/MultiPage"), - QString("([X-KDE-MultiPageVersion] == %1)").arg(MULTIPAGE_VERSION) + TQString::fromLatin1("KViewShell/MultiPage"), + TQString("([X-KDE-MultiPageVersion] == %1)").arg(MULTIPAGE_VERSION) ); if (!offers.isEmpty()) @@ -528,10 +528,10 @@ QStringList KViewPart::fileFormats() const for (; iterator != end; ++iterator) { KService::Ptr service = *iterator; - QString mimeType = service->property("X-KDE-MimeTypes").toString(); + TQString mimeType = service->property("X-KDE-MimeTypes").toString(); supportedMimeTypes << mimeType; - QStringList pattern = KMimeType::mimeType(mimeType)->patterns(); + TQStringList pattern = KMimeType::mimeType(mimeType)->patterns(); while(!pattern.isEmpty()) { supportedPattern.append(pattern.front().stripWhiteSpace()); @@ -549,9 +549,9 @@ QStringList KViewPart::fileFormats() const // Check if this version of KDE supports bzip2 bool bzip2Available = (KFilterBase::findFilterByMimeType( "application/x-bzip2" ) != 0L); - QStringList compressedPattern; + TQStringList compressedPattern; - for(QStringList::Iterator it = supportedPattern.begin(); it != supportedPattern.end(); ++it ) + for(TQStringList::Iterator it = supportedPattern.begin(); it != supportedPattern.end(); ++it ) { if ((*it).find(".gz", -3) == -1) // Paranoia safety check compressedPattern.append(*it + ".gz"); @@ -602,15 +602,15 @@ bool KViewPart::openFile() // We try to be error-tolerant about filenames. If the user calls us // with something like "test", and we are using the DVI-part, we'll // also look for "testdvi" and "test.dvi". - QFileInfo fi(m_file); + TQFileInfo fi(m_file); m_file = fi.absFilePath(); if (!fi.exists()) { - QStringList supportedPatterns = fileFormats(); - QStringList endings; + TQStringList supportedPatterns = fileFormats(); + TQStringList endings; - for (QStringList::Iterator it = supportedPatterns.begin(); it != supportedPatterns.end(); ++it) + for (TQStringList::Iterator it = supportedPatterns.begin(); it != supportedPatterns.end(); ++it) { // Only consider patterns starting with "*." if ((*it).find("*.") == 0) @@ -623,7 +623,7 @@ bool KViewPart::openFile() // Now try to append the endings with and without "." to the given filename, // and see if that gives a existing file. - for (QStringList::Iterator it = endings.begin(); it != endings.end(); ++it) + for (TQStringList::Iterator it = endings.begin(); it != endings.end(); ++it) { fi.setFile(m_file+(*it)); if (fi.exists()) @@ -643,10 +643,10 @@ bool KViewPart::openFile() if (!fi.exists()) { KMessageBox::error(mainWidget, i18n("<qt>File <nobr><strong>%1</strong></nobr> does not exist.</qt>").arg(m_file)); - emit setStatusBarText(QString::null); + emit setStatusBarText(TQString::null); return false; } - m_url.setPath(QFileInfo(m_file).absFilePath()); + m_url.setPath(TQFileInfo(m_file).absFilePath()); } // Set the window caption now, before we do any uncompression and generation of temporary files. @@ -670,8 +670,8 @@ bool KViewPart::openFile() { KMessageBox::error(mainWidget, i18n("<qt><strong>File Error!</strong> Could not create " "temporary file.</qt>")); - emit setWindowCaption(QString::null); - emit setStatusBarText(QString::null); + emit setWindowCaption(TQString::null); + emit setStatusBarText(TQString::null); return false; } tmpUnzipped->setAutoDelete(true); @@ -679,12 +679,12 @@ bool KViewPart::openFile() { KMessageBox::error(mainWidget, i18n("<qt><strong>File Error!</strong> Could not create temporary file " "<nobr><strong>%1</strong></nobr>.</qt>").arg(strerror(tmpUnzipped->status()))); - emit setWindowCaption(QString::null); - emit setStatusBarText(QString::null); + emit setWindowCaption(TQString::null); + emit setStatusBarText(TQString::null); return false; } - QIODevice* filterDev; + TQIODevice* filterDev; if (( mimetype->parentMimeType() == "application/x-gzip" ) || ( mimetype->parentMimeType() == "application/x-bzip2" )) filterDev = KFilterDev::deviceForFile(m_file, mimetype->parentMimeType()); @@ -692,8 +692,8 @@ bool KViewPart::openFile() filterDev = KFilterDev::deviceForFile(m_file); if (filterDev == 0L) { - emit setWindowCaption(QString::null); - emit setStatusBarText(QString::null); + emit setWindowCaption(TQString::null); + emit setStatusBarText(TQString::null); return false; } if(!filterDev->open(IO_ReadOnly)) @@ -704,9 +704,9 @@ bool KViewPart::openFile() i18n("<qt>This error typically occurs if you do not have enough permissions to read the file. " "You can check ownership and permissions if you right-click on the file in the Konqueror " "file manager and then choose the 'Properties' menu.</qt>")); - emit setWindowCaption(QString::null); + emit setWindowCaption(TQString::null); delete filterDev; - emit setStatusBarText(QString::null); + emit setStatusBarText(TQString::null); return false; } @@ -718,7 +718,7 @@ bool KViewPart::openFile() prog->progressBar()->setProgress(0); prog->setMinimumDuration(250); - QByteArray buf(1024); + TQByteArray buf(1024); int read = 0, wrtn = 0; bool progress_dialog_was_cancelled = false; @@ -739,7 +739,7 @@ bool KViewPart::openFile() tmpUnzipped->sync(); if (progress_dialog_was_cancelled) { - emit setStatusBarText(QString::null); + emit setStatusBarText(TQString::null); return false; } @@ -749,8 +749,8 @@ bool KViewPart::openFile() "the file <nobr><strong>%1</strong></nobr>. The file will not be loaded.</qt>").arg( m_file ), i18n("<qt>This error typically occurs if the file is corrupt. " "If you want to be sure, try to decompress the file manually using command-line tools.</qt>")); - emit setWindowCaption(QString::null); - emit setStatusBarText(QString::null); + emit setWindowCaption(TQString::null); + emit setStatusBarText(TQString::null); return false; } tmpUnzipped->close(); @@ -768,8 +768,8 @@ bool KViewPart::openFile() // Search for service KTrader::OfferList offers = KTrader::self()->query( - QString::fromLatin1("KViewShell/MultiPage" ), - QString("([X-KDE-MultiPageVersion] == %1) and " + TQString::fromLatin1("KViewShell/MultiPage" ), + TQString("([X-KDE-MultiPageVersion] == %1) and " "([X-KDE-MimeTypes] == '%2')").arg(MULTIPAGE_VERSION).arg(mimetype->name())); if (offers.isEmpty()) { @@ -777,8 +777,8 @@ bool KViewPart::openFile() "its file type is not supported.</qt>").arg(m_file), i18n("<qt>The file has mime type <b>%1</b> which is not supported by " "any of the installed KViewShell plugins.</qt>").arg(mimetype->name())); - emit setWindowCaption(QString::null); - emit setStatusBarText(QString::null); + emit setWindowCaption(TQString::null); + emit setStatusBarText(TQString::null); return false; } @@ -801,10 +801,10 @@ bool KViewPart::openFile() // Try to load the multiPage int error; multiPage = static_cast<KMultiPage*>(KParts::ComponentFactory::createInstanceFromService<KParts::ReadOnlyPart>(service, mainWidget, - service->name().utf8(), QStringList(), &error )); + service->name().utf8(), TQStringList(), &error )); if (multiPage.isNull()) { - QString reason; + TQString reason; switch(error) { case KParts::ComponentFactory::ErrNoServiceFound: reason = i18n("<qt>No service implementing the given mimetype and fullfilling the given constraint expression can be found.</qt>"); @@ -823,7 +823,7 @@ bool KViewPart::openFile() break; } - QString text = i18n("<qt><p><b>Problem:</b> The document <b>%1</b> cannot be shown.</p>" + TQString text = i18n("<qt><p><b>Problem:</b> The document <b>%1</b> cannot be shown.</p>" "<p><b>Reason:</b> The software " "component <b>%2</b> which is required to display files of type <b>%3</b> could " "not be initialized. This could point to serious misconfiguration of your KDE " @@ -833,19 +833,19 @@ bool KViewPart::openFile() "provider of your software (e.g. the vendor of your Linux distribution), or " "directly to the authors of the software. The entry <b>Report Bug...</b> in the " "<b>Help</b> menu helps you to contact the KDE programmers.</p></qt>").arg(m_file).arg(service->library()).arg(mimetype->name()); - QString caption = i18n("Error Initializing Software Component"); + TQString caption = i18n("Error Initializing Software Component"); if (reason.isEmpty()) KMessageBox::error(mainWidget, text, caption); else KMessageBox::detailedError(mainWidget, text, reason, caption); - emit setStatusBarText(QString::null); + emit setStatusBarText(TQString::null); return false; } // Remember the name of the part. So only need to switch if really necessary. multiPageLibrary = service->library(); - connect(partManager, SIGNAL(activePartChanged(KParts::Part*)), this, SIGNAL(pluginChanged(KParts::Part*))); + connect(partManager, TQT_SIGNAL(activePartChanged(KParts::Part*)), this, TQT_SIGNAL(pluginChanged(KParts::Part*))); // Switch to the new multiPage partManager->replacePart(oldMultiPage, multiPage); @@ -862,7 +862,7 @@ bool KViewPart::openFile() // We disconnect because we dont want some FocusEvents to trigger a GUI update, which might mess // with our menus. - disconnect(partManager, SIGNAL(activePartChanged(KParts::Part*)), this, SIGNAL(pluginChanged(KParts::Part*))); + disconnect(partManager, TQT_SIGNAL(activePartChanged(KParts::Part*)), this, TQT_SIGNAL(pluginChanged(KParts::Part*))); readSettings(); } @@ -895,13 +895,13 @@ bool KViewPart::openFile() // Notify the ViewShell about the newly opened file. emit fileOpened(); } else { - m_url = QString::null; - emit setWindowCaption(QString::null); + m_url = TQString::null; + emit setWindowCaption(TQString::null); } checkActions(); - emit zoomChanged(QString("%1%").arg((int)(_zoomVal.value()*100.0+0.5))); - emit setStatusBarText(QString::null); + emit zoomChanged(TQString("%1%").arg((int)(_zoomVal.value()*100.0+0.5))); + emit setStatusBarText(TQString::null); return r; } @@ -912,7 +912,7 @@ void KViewPart::reload() } -void KViewPart::fileChanged(const QString &file) +void KViewPart::fileChanged(const TQString &file) { if (file == m_file && watchAct->isChecked()) multiPage->reload(); @@ -946,7 +946,7 @@ bool KViewPart::closeURL() KParts::ReadOnlyPart::closeURL(); multiPage->closeURL(); - m_url = QString::null; + m_url = TQString::null; checkActions(); emit setWindowCaption(""); @@ -994,7 +994,7 @@ void KViewPart::pageInfo(int numpages, int currentpage) updateZoomLevel(); // ATTN: The string here must be the same as in setPage() below - QString pageString = i18n("Page %1 of %2").arg(currentpage).arg(numpages); + TQString pageString = i18n("Page %1 of %2").arg(currentpage).arg(numpages); if (pageChangeIsConnected) { emit pageChanged(pageString); emit sizeChanged(pageSizeDescription()); @@ -1083,15 +1083,15 @@ void KViewPart::enableFitToPage(bool enable) if (enable) { fitToPage(); - connect(multiPage->mainWidget(), SIGNAL(viewSizeChanged(const QSize&)), - this, SLOT(slotStartFitTimer())); - connect(&fitTimer, SIGNAL(timeout()), SLOT(fitToPage())); + connect(multiPage->mainWidget(), TQT_SIGNAL(viewSizeChanged(const TQSize&)), + this, TQT_SLOT(slotStartFitTimer())); + connect(&fitTimer, TQT_SIGNAL(timeout()), TQT_SLOT(fitToPage())); } else { - disconnect(multiPage->mainWidget(), SIGNAL(viewSizeChanged(const QSize&)), - this, SLOT(slotStartFitTimer())); - disconnect(&fitTimer, SIGNAL(timeout()), this, SLOT(fitToPage())); + disconnect(multiPage->mainWidget(), TQT_SIGNAL(viewSizeChanged(const TQSize&)), + this, TQT_SLOT(slotStartFitTimer())); + disconnect(&fitTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(fitToPage())); } } @@ -1100,15 +1100,15 @@ void KViewPart::enableFitToWidth(bool enable) if (enable) { fitToWidth(); - connect(multiPage->mainWidget(), SIGNAL(viewSizeChanged(const QSize&)), - this, SLOT(slotStartFitTimer())); - connect(&fitTimer, SIGNAL(timeout()), SLOT(fitToWidth())); + connect(multiPage->mainWidget(), TQT_SIGNAL(viewSizeChanged(const TQSize&)), + this, TQT_SLOT(slotStartFitTimer())); + connect(&fitTimer, TQT_SIGNAL(timeout()), TQT_SLOT(fitToWidth())); } else { - disconnect(multiPage->mainWidget(), SIGNAL(viewSizeChanged(const QSize&)), - this, SLOT(slotStartFitTimer())); - disconnect(&fitTimer, SIGNAL(timeout()), this, SLOT(fitToWidth())); + disconnect(multiPage->mainWidget(), TQT_SIGNAL(viewSizeChanged(const TQSize&)), + this, TQT_SLOT(slotStartFitTimer())); + disconnect(&fitTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(fitToWidth())); } } @@ -1117,15 +1117,15 @@ void KViewPart::enableFitToHeight(bool enable) if (enable) { fitToHeight(); - connect(multiPage->mainWidget(), SIGNAL(viewSizeChanged(const QSize&)), - this, SLOT(slotStartFitTimer())); - connect(&fitTimer, SIGNAL(timeout()), SLOT(fitToHeight())); + connect(multiPage->mainWidget(), TQT_SIGNAL(viewSizeChanged(const TQSize&)), + this, TQT_SLOT(slotStartFitTimer())); + connect(&fitTimer, TQT_SIGNAL(timeout()), TQT_SLOT(fitToHeight())); } else { - disconnect(multiPage->mainWidget(), SIGNAL(viewSizeChanged(const QSize&)), - this, SLOT(slotStartFitTimer())); - disconnect(&fitTimer, SIGNAL(timeout()), this, SLOT(fitToHeight())); + disconnect(multiPage->mainWidget(), TQT_SIGNAL(viewSizeChanged(const TQSize&)), + this, TQT_SLOT(slotStartFitTimer())); + disconnect(&fitTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(fitToHeight())); } } @@ -1179,7 +1179,7 @@ void KViewPart::fitToWidth() } -void KViewPart::setZoomValue(const QString &sval) +void KViewPart::setZoomValue(const TQString &sval) { if (sval == i18n("Fit to Page Width")) { @@ -1382,17 +1382,17 @@ void KViewPart::writeSettings() void KViewPart::connectNotify ( const char *sig ) { - if (QString(sig).contains("pageChanged")) + if (TQString(sig).contains("pageChanged")) pageChangeIsConnected = true; } -void KViewPart::setStatusBarTextFromMultiPage( const QString &msg ) +void KViewPart::setStatusBarTextFromMultiPage( const TQString &msg ) { if (msg.isEmpty()) { if (pageChangeIsConnected) - emit setStatusBarText(QString::null); + emit setStatusBarText(TQString::null); else { int currentPage = multiPage->currentPageNumber(); @@ -1420,26 +1420,26 @@ void KViewPart::aboutKViewShell() aboutDialog = new KAboutDialog(mainWidget, "about_kviewshell"); aboutDialog->setTitle(I18N_NOOP("KViewShell")); aboutDialog->setVersion("0.6"); - aboutDialog->setAuthor("Matthias Hoelzer-Kluepfel", QString::null, QString::null, + aboutDialog->setAuthor("Matthias Hoelzer-Kluepfel", TQString::null, TQString::null, I18N_NOOP("Original Author")); - aboutDialog->addContributor("Matthias Hoelzer-Kluepfel", "mhk@caldera.de", QString::null, + aboutDialog->addContributor("Matthias Hoelzer-Kluepfel", "mhk@caldera.de", TQString::null, I18N_NOOP("Framework")); aboutDialog->addContributor("David Sweet", "dsweet@kde.org", "http://www.chaos.umd.edu/~dsweet", I18N_NOOP("Former KGhostView Maintainer")); - aboutDialog->addContributor("Mark Donohoe", QString::null, QString::null, + aboutDialog->addContributor("Mark Donohoe", TQString::null, TQString::null, I18N_NOOP("KGhostView Author")); - aboutDialog->addContributor("Markku Hihnala", QString::null, QString::null, + aboutDialog->addContributor("Markku Hihnala", TQString::null, TQString::null, I18N_NOOP("Navigation widgets")); - aboutDialog->addContributor("David Faure", QString::null, QString::null, + aboutDialog->addContributor("David Faure", TQString::null, TQString::null, I18N_NOOP("Basis for shell")); - aboutDialog->addContributor("Daniel Duley", QString::null, QString::null, + aboutDialog->addContributor("Daniel Duley", TQString::null, TQString::null, I18N_NOOP("Port to KParts")); - aboutDialog->addContributor("Espen Sand", QString::null, QString::null, + aboutDialog->addContributor("Espen Sand", TQString::null, TQString::null, I18N_NOOP("Dialog boxes")); - aboutDialog->addContributor("Stefan Kebekus", "kebekus@kde.org", QString::null, + aboutDialog->addContributor("Stefan Kebekus", "kebekus@kde.org", TQString::null, I18N_NOOP("DCOP-Interface, major improvements")); - aboutDialog->addContributor("Wilfried Huss", "Wilfried.Huss@gmx.at", QString::null, + aboutDialog->addContributor("Wilfried Huss", "Wilfried.Huss@gmx.at", TQString::null, I18N_NOOP("Interface enhancements")); } aboutDialog->show(); @@ -1460,7 +1460,7 @@ void KViewPart::doSettings() multiPage->addConfigDialogs(configDialog); - connect(configDialog, SIGNAL(settingsChanged()), this, SLOT(preferencesChanged())); + connect(configDialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(preferencesChanged())); configDialog->show(); } @@ -1471,13 +1471,13 @@ void KViewPart::preferencesChanged() void KViewPart::partActivateEvent( KParts::PartActivateEvent *ev ) { - QApplication::sendEvent( multiPage, ev ); + TQApplication::sendEvent( multiPage, ev ); } void KViewPart::guiActivateEvent( KParts::GUIActivateEvent *ev ) { - QApplication::sendEvent( multiPage, ev ); + TQApplication::sendEvent( multiPage, ev ); } diff --git a/kviewshell/kviewpart.h b/kviewshell/kviewpart.h index f30b1109..446fe47f 100644 --- a/kviewshell/kviewpart.h +++ b/kviewshell/kviewpart.h @@ -7,7 +7,7 @@ #include "zoom.h" #include <kparts/browserextension.h> -#include <qtimer.h> +#include <tqtimer.h> class KAboutData; class KAboutDialog; @@ -23,9 +23,9 @@ class KTempFile; class KToggleAction; class KURL; class KViewPartExtension; -class QHBoxLayout; +class TQHBoxLayout; class pageSizeDialog; -class QSize; +class TQSize; class KViewPart : public KViewPart_Iface @@ -33,8 +33,8 @@ class KViewPart : public KViewPart_Iface Q_OBJECT public: - KViewPart(QWidget *parentWidget, const char *widgetName, QObject *parent, - const char *name, const QStringList& args); + KViewPart(TQWidget *parentWidget, const char *widgetName, TQObject *parent, + const char *name, const TQStringList& args); virtual ~KViewPart(); static KAboutData* createAboutData(); @@ -48,15 +48,15 @@ public: /* Returns a description of the current page size, for use in the statusbar of the kviewshell that embeds this KViewPart. */ - QString pageSizeDescription(); + TQString pageSizeDescription(); /** Returns a list of mimetypes supported by the installed KViewShell plugins. */ - virtual QStringList supportedMimeTypes(); + virtual TQStringList supportedMimeTypes(); signals: - void zoomChanged(const QString &); - void pageChanged(const QString &); - void sizeChanged(const QString &); + void zoomChanged(const TQString &); + void pageChanged(const TQString &); + void sizeChanged(const TQString &); void scrollbarStatusChanged(bool); void fileOpened(); @@ -67,8 +67,8 @@ public slots: virtual void slotFileOpen(); virtual bool closeURL(); - virtual QStringList fileFormats() const; - void setStatusBarTextFromMultiPage(const QString &); + virtual TQStringList fileFormats() const; + void setStatusBarTextFromMultiPage(const TQString &); /** Calling this slot will cause the kmultipage to reload the file */ void reload(); @@ -98,10 +98,10 @@ protected slots: void slotPrint(); - void fileChanged(const QString&); + void fileChanged(const TQString&); - // Connected to the QLineEdit in the toolbar. - void setZoomValue(const QString &); + // Connected to the TQLineEdit in the toolbar. + void setZoomValue(const TQString &); protected: @@ -207,17 +207,17 @@ private: KParts::PartManager* partManager; - QGuardedPtr<KMultiPage> multiPage; + TQGuardedPtr<KMultiPage> multiPage; // Name of the library of the currently loaded multiPage. // Is used to check if it is really necessary to load a new MultiPage. - QString multiPageLibrary; + TQString multiPageLibrary; KViewPartExtension *m_extension; bool pageChangeIsConnected; - QWidget *mainWidget; - QHBoxLayout* mainLayout; + TQWidget *mainWidget; + TQHBoxLayout* mainLayout; /** This entry stores the paper size that the user has requested in the preferences dialog. If that paper size is actually used or @@ -230,7 +230,7 @@ private: Zoom _zoomVal; pageSizeDialog *_pageSizeDialog; - QTimer fitTimer; + TQTimer fitTimer; KAboutDialog* aboutDialog; }; diff --git a/kviewshell/kviewpart_iface.h b/kviewshell/kviewpart_iface.h index 9e488f3e..d5603b01 100644 --- a/kviewshell/kviewpart_iface.h +++ b/kviewshell/kviewpart_iface.h @@ -4,32 +4,32 @@ #include <kparts/part.h> -class QStringList; +class TQStringList; class KViewPart_Iface : public KParts::ReadOnlyPart { Q_OBJECT public: - KViewPart_Iface(QObject *parent, const char *name) + KViewPart_Iface(TQObject *parent, const char *name) : KParts::ReadOnlyPart(parent, name) {} virtual ~KViewPart_Iface() {} /* Returns a description of the current page size, for use in the statusbar of the kviewshell that embeds this KViewPart. */ - virtual QString pageSizeDescription() = 0; + virtual TQString pageSizeDescription() = 0; /* This method calls closeURL(), but asks first ("The document was modified. Do you really want to close?") if the document has been modified after it has been loaded. */ virtual bool closeURL_ask() = 0; - virtual QStringList supportedMimeTypes() = 0; + virtual TQStringList supportedMimeTypes() = 0; public slots: virtual void slotSetFullPage(bool fullpage) = 0; - virtual QStringList fileFormats() const = 0; + virtual TQStringList fileFormats() const = 0; }; #endif diff --git a/kviewshell/kviewshell.cpp b/kviewshell/kviewshell.cpp index 90e1e474..968fd365 100644 --- a/kviewshell/kviewshell.cpp +++ b/kviewshell/kviewshell.cpp @@ -8,9 +8,9 @@ */ -#include <qfileinfo.h> -#include <qtimer.h> -#include <qregexp.h> +#include <tqfileinfo.h> +#include <tqtimer.h> +#include <tqregexp.h> #include <kiconloader.h> #include <kstandarddirs.h> @@ -29,7 +29,7 @@ #include <kmimetype.h> #include <kprogress.h> -#include <qlabel.h> +#include <tqlabel.h> #include <stdlib.h> #include <unistd.h> @@ -45,7 +45,7 @@ #define StatusBar_ID_Zoom 3 -KViewShell::KViewShell(const QString& defaultMimeType) +KViewShell::KViewShell(const TQString& defaultMimeType) : KParts::MainWindow() { // create the viewer part @@ -53,13 +53,13 @@ KViewShell::KViewShell(const QString& defaultMimeType) // Try to load KLibFactory *factory = KLibLoader::self()->factory("kviewerpart"); if (factory) { - if (defaultMimeType == QString::null) + if (defaultMimeType == TQString::null) { view = (KViewPart_Iface*) factory->create(this, "kviewerpart", "KViewPart"); } else { - QStringList args; + TQStringList args; args << defaultMimeType; view = (KViewPart_Iface*) factory->create(this, "kviewerpart", "KViewPart", args); } @@ -73,33 +73,33 @@ KViewShell::KViewShell(const QString& defaultMimeType) setCentralWidget(view->widget()); // file menu - KStdAction::open(view, SLOT(slotFileOpen()), actionCollection()); - recent = KStdAction::openRecent (this, SLOT(openURL(const KURL &)), actionCollection()); - reloadAction = new KAction(i18n("Reload"), "reload", CTRL + Key_R, view, SLOT(reload()), actionCollection(), "reload"); - closeAction = KStdAction::close(this, SLOT(slotFileClose()), actionCollection()); - KStdAction::quit (this, SLOT(slotQuit()), actionCollection()); + KStdAction::open(view, TQT_SLOT(slotFileOpen()), actionCollection()); + recent = KStdAction::openRecent (this, TQT_SLOT(openURL(const KURL &)), actionCollection()); + reloadAction = new KAction(i18n("Reload"), "reload", CTRL + Key_R, view, TQT_SLOT(reload()), actionCollection(), "reload"); + closeAction = KStdAction::close(this, TQT_SLOT(slotFileClose()), actionCollection()); + KStdAction::quit (this, TQT_SLOT(slotQuit()), actionCollection()); - connect(view, SIGNAL(fileOpened()), this, SLOT(addRecentFile())); + connect(view, TQT_SIGNAL(fileOpened()), this, TQT_SLOT(addRecentFile())); // view menu - fullScreenAction = KStdAction::fullScreen(this, SLOT(slotFullScreen()), actionCollection(), this, "fullscreen" ); + fullScreenAction = KStdAction::fullScreen(this, TQT_SLOT(slotFullScreen()), actionCollection(), this, "fullscreen" ); // settings menu createStandardStatusBarAction(); setStandardToolBarMenuEnabled(true); - KStdAction::keyBindings(this, SLOT(slotConfigureKeys()), actionCollection()); - KStdAction::configureToolbars(this, SLOT(slotEditToolbar()), actionCollection()); + KStdAction::keyBindings(this, TQT_SLOT(slotConfigureKeys()), actionCollection()); + KStdAction::configureToolbars(this, TQT_SLOT(slotEditToolbar()), actionCollection()); // statusbar connects - connect( view, SIGNAL( zoomChanged(const QString &) ), this,SLOT( slotChangeZoomText(const QString &) ) ); - connect( view, SIGNAL( pageChanged(const QString &) ), this,SLOT( slotChangePageText(const QString &) ) ); - connect( view, SIGNAL( sizeChanged(const QString &) ), this,SLOT( slotChangeSizeText(const QString &) ) ); + connect( view, TQT_SIGNAL( zoomChanged(const TQString &) ), this,TQT_SLOT( slotChangeZoomText(const TQString &) ) ); + connect( view, TQT_SIGNAL( pageChanged(const TQString &) ), this,TQT_SLOT( slotChangePageText(const TQString &) ) ); + connect( view, TQT_SIGNAL( sizeChanged(const TQString &) ), this,TQT_SLOT( slotChangeSizeText(const TQString &) ) ); // Setup session management - connect( this, SIGNAL( restoreDocument(const KURL &, int) ), view, SLOT( restoreDocument(const KURL &, int))); - connect( this, SIGNAL( saveDocumentRestoreInfo(KConfig*) ), view, SLOT( saveDocumentRestoreInfo(KConfig*))); + connect( this, TQT_SIGNAL( restoreDocument(const KURL &, int) ), view, TQT_SLOT( restoreDocument(const KURL &, int))); + connect( this, TQT_SIGNAL( saveDocumentRestoreInfo(KConfig*) ), view, TQT_SLOT( saveDocumentRestoreInfo(KConfig*))); setXMLFile( "kviewshell.rc" ); createGUI(view); @@ -120,7 +120,7 @@ KViewShell::KViewShell(const QString& defaultMimeType) statusBar()->changeItem("", StatusBar_ID_Zoom); statusBar()->insertItem(view->pageSizeDescription(), StatusBar_ID_PageSize, 0, true); - connect( view, SIGNAL(pluginChanged(KParts::Part*)), this, SLOT(createGUI(KParts::Part*))); + connect( view, TQT_SIGNAL(pluginChanged(KParts::Part*)), this, TQT_SLOT(createGUI(KParts::Part*))); } @@ -176,11 +176,11 @@ void KViewShell::readSettings() // Constant source of annoyance in KDVI < 1.0: the 'recent-files' // menu contains lots of files which don't exist (any longer). Thus, // we'll sort out the non-existent files here. - QStringList items = recent->items(); - for ( QStringList::Iterator it = items.begin(); it != items.end(); ++it ) { + TQStringList items = recent->items(); + for ( TQStringList::Iterator it = items.begin(); it != items.end(); ++it ) { KURL url(*it); if (url.isLocalFile()) { - QFileInfo info(url.path()); + TQFileInfo info(url.path()); if (!info.exists()) recent->removeURL(url); } @@ -229,7 +229,7 @@ void KViewShell::addRecentFile() KURL actualURL = view->url(); // To store the URL in the list of recent files, we remove the // reference part. - actualURL.setRef(QString::null); + actualURL.setRef(TQString::null); recent->addURL(actualURL); checkActions(); } @@ -290,7 +290,7 @@ void KViewShell::slotEditToolbar() { saveMainWindowSettings( KGlobal::config(), autoSaveGroup() ); KEditToolbar dlg(factory()); - connect( &dlg, SIGNAL( newToolbarConfig() ), SLOT( slotNewToolbarConfig() ) ); + connect( &dlg, TQT_SIGNAL( newToolbarConfig() ), TQT_SLOT( slotNewToolbarConfig() ) ); dlg.exec(); } @@ -300,7 +300,7 @@ void KViewShell::slotNewToolbarConfig() applyMainWindowSettings( KGlobal::config(), autoSaveGroup() ); } -void KViewShell::dragEnterEvent(QDragEnterEvent *event) +void KViewShell::dragEnterEvent(TQDragEnterEvent *event) { if (KURLDrag::canDecode(event)) { @@ -325,10 +325,10 @@ void KViewShell::dragEnterEvent(QDragEnterEvent *event) // Safety check if (view) { - QStringList mimetypeList = view->supportedMimeTypes(); + TQStringList mimetypeList = view->supportedMimeTypes(); kdDebug() << "[dragEnterEvent] Supported mime types: " << mimetypeList << endl; - for (QStringList::Iterator it = mimetypeList.begin(); it != mimetypeList.end(); ++it) + for (TQStringList::Iterator it = mimetypeList.begin(); it != mimetypeList.end(); ++it) { if (mimetype->is(*it)) { @@ -345,7 +345,7 @@ void KViewShell::dragEnterEvent(QDragEnterEvent *event) } -void KViewShell::dropEvent(QDropEvent *event) +void KViewShell::dropEvent(TQDropEvent *event) { KURL::List urls; if (KURLDrag::decode(event, urls) && !urls.isEmpty()) @@ -353,7 +353,7 @@ void KViewShell::dropEvent(QDropEvent *event) } -void KViewShell::keyPressEvent(QKeyEvent *event) +void KViewShell::keyPressEvent(TQKeyEvent *event) { // The Escape Key is used to return to normal mode from fullscreen // mode @@ -366,19 +366,19 @@ void KViewShell::keyPressEvent(QKeyEvent *event) } -void KViewShell::slotChangePageText(const QString &message) +void KViewShell::slotChangePageText(const TQString &message) { statusBar()->changeItem(" "+message+" ",StatusBar_ID_PageNr); } -void KViewShell::slotChangeSizeText(const QString &message) +void KViewShell::slotChangeSizeText(const TQString &message) { statusBar()->changeItem(" "+message+" ",StatusBar_ID_PageSize); } -void KViewShell::slotChangeZoomText(const QString &message) +void KViewShell::slotChangeZoomText(const TQString &message) { statusBar()->changeItem(" "+message+" ",StatusBar_ID_Zoom); } diff --git a/kviewshell/kviewshell.h b/kviewshell/kviewshell.h index c6aa0620..89131db8 100644 --- a/kviewshell/kviewshell.h +++ b/kviewshell/kviewshell.h @@ -2,7 +2,7 @@ #ifndef KVIEWSHELL_H #define KVIEWSHELL_H -#include <qstring.h> +#include <tqstring.h> #include <kparts/mainwindow.h> @@ -11,7 +11,7 @@ class KURL; class KViewPart_Iface; -class QLabel; +class TQLabel; class KViewShell : public KParts::MainWindow { @@ -21,7 +21,7 @@ public: KStatusBar *statusbar; KStatusBar *action; - KViewShell(const QString& defaultMimeType = QString::null); + KViewShell(const TQString& defaultMimeType = TQString::null); virtual ~KViewShell(); public slots: @@ -37,9 +37,9 @@ protected slots: void slotFileClose(); void slotNewToolbarConfig(); - void slotChangeZoomText(const QString &); - void slotChangePageText(const QString &); - void slotChangeSizeText(const QString &); + void slotChangeZoomText(const TQString &); + void slotChangePageText(const TQString &); + void slotChangeSizeText(const TQString &); signals: void restoreDocument(const KURL &url, int page); @@ -64,15 +64,15 @@ protected: void checkActions(); - void dragEnterEvent(QDragEnterEvent *event); - void dropEvent(QDropEvent *event); - void keyPressEvent(QKeyEvent * e); + void dragEnterEvent(TQDragEnterEvent *event); + void dropEvent(TQDropEvent *event); + void keyPressEvent(TQKeyEvent * e); private: KViewPart_Iface *view; KRecentFilesAction *recent; - QString cwd; + TQString cwd; KAction *closeAction, *reloadAction; KToggleAction *fullScreenAction; diff --git a/kviewshell/main.cpp b/kviewshell/main.cpp index c87cb07e..1a858049 100644 --- a/kviewshell/main.cpp +++ b/kviewshell/main.cpp @@ -9,7 +9,7 @@ #include <kurl.h> #include <klocale.h> #include <kaboutdata.h> -#include <qdir.h> +#include <tqdir.h> #include <stdlib.h> @@ -88,20 +88,20 @@ int main(int argc, char **argv) KURL url(args->url(0)); if (!args->url(0).isValid()) { - kdError(1223) << QString(I18N_NOOP("The URL %1 is not well-formed.")).arg(args->arg(0)) << endl; + kdError(1223) << TQString(I18N_NOOP("The URL %1 is not well-formed.")).arg(args->arg(0)) << endl; return -1; } if (!args->url(0).isLocalFile()) { - kdError(1223) << QString(I18N_NOOP("The URL %1 does not point to a local file. You can only specify local " + kdError(1223) << TQString(I18N_NOOP("The URL %1 does not point to a local file. You can only specify local " "files if you are using the '--unique' option.")).arg(args->arg(0)) << endl; return -1; } - QString qualPath = QFileInfo(args->url(0).path()).absFilePath(); + TQString qualPath = TQFileInfo(args->url(0).path()).absFilePath(); app.dcopClient()->attach(); - QCString id = app.dcopClient()->registerAs("unique-kviewshell"); + TQCString id = app.dcopClient()->registerAs("unique-kviewshell"); if (id.isNull()) kdError(1223) << "There was an error using dcopClient()->registerAs()." << endl; QCStringList apps = app.dcopClient()->registeredApplications(); @@ -109,22 +109,22 @@ int main(int argc, char **argv) { if ((*it).find("kviewshell") == 0) { - QByteArray data, replyData; - QCString replyType; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data, replyData; + TQCString replyType; + TQDataStream arg(data, IO_WriteOnly); bool result; arg << qualPath.stripWhiteSpace(); - if (!app.dcopClient()->call( *it, "kmultipage", "is_file_loaded(QString)", data, replyType, replyData)) + if (!app.dcopClient()->call( *it, "kmultipage", "is_file_loaded(TQString)", data, replyType, replyData)) kdError(1223) << "There was an error using DCOP." << endl; else { - QDataStream reply(replyData, IO_ReadOnly); + TQDataStream reply(replyData, IO_ReadOnly); if (replyType == "bool") { reply >> result; if (result == true) { - if (app.dcopClient()->send(*it, "kmultipage", "jumpToReference(QString)", args->url(0).ref()) == true) + if (app.dcopClient()->send(*it, "kmultipage", "jumpToReference(TQString)", args->url(0).ref()) == true) { app.dcopClient()->detach(); return 0; @@ -173,7 +173,7 @@ int main(int argc, char **argv) // If the url doesn't already has a reference part, add the // argument of --goto to the url as reference, to make the // KViewShell jump to this page. - QString reference = args->getOption("goto"); + TQString reference = args->getOption("goto"); url.setHTMLRef(reference); } shell->openURL(url); diff --git a/kviewshell/marklist.cpp b/kviewshell/marklist.cpp index 8e39f619..a9c7518a 100644 --- a/kviewshell/marklist.cpp +++ b/kviewshell/marklist.cpp @@ -19,15 +19,15 @@ #include <config.h> -#include <qcheckbox.h> -#include <qimage.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qtooltip.h> -#include <qlabel.h> -#include <qwhatsthis.h> -#include <qpainter.h> -#include <qtimer.h> +#include <tqcheckbox.h> +#include <tqimage.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqtooltip.h> +#include <tqlabel.h> +#include <tqwhatsthis.h> +#include <tqpainter.h> +#include <tqtimer.h> #include <kapplication.h> #include <kglobalsettings.h> @@ -47,7 +47,7 @@ namespace { /** Holds the icon used as a overlay on pages which are not drawn yet. */ -QPixmap* waitIcon = 0; +TQPixmap* waitIcon = 0; } // namespace anon @@ -55,7 +55,7 @@ QPixmap* waitIcon = 0; /****** ThumbnailWidget ******/ ThumbnailWidget::ThumbnailWidget(MarkListWidget* _parent, const PageNumber& _pageNumber, DocumentPageCache* _pageCache) - : QWidget(_parent), pageNumber(_pageNumber), pageCache(_pageCache), parent(_parent) + : TQWidget(_parent), pageNumber(_pageNumber), pageCache(_pageCache), parent(_parent) { setBackgroundMode(Qt::NoBackground); @@ -63,11 +63,11 @@ ThumbnailWidget::ThumbnailWidget(MarkListWidget* _parent, const PageNumber& _pag if (!waitIcon) { - waitIcon = new QPixmap(KGlobal::iconLoader()->loadIcon("gear", KIcon::NoGroup, KIcon::SizeMedium)); + waitIcon = new TQPixmap(KGlobal::iconLoader()->loadIcon("gear", KIcon::NoGroup, KIcon::SizeMedium)); } } -void ThumbnailWidget::paintEvent(QPaintEvent* e) +void ThumbnailWidget::paintEvent(TQPaintEvent* e) { // Only repaint if the widget is really visible. We need to check this because Qt // sends paintEvents to all widgets that have ever been visible in the Scrollview @@ -79,7 +79,7 @@ void ThumbnailWidget::paintEvent(QPaintEvent* e) return; } - QPainter p(this); + TQPainter p(this); p.setClipRect(e->rect()); // Paint a black border around the widget @@ -90,7 +90,7 @@ void ThumbnailWidget::paintEvent(QPaintEvent* e) // Remove 1 pixel from all sides of the rectangle, to eliminate overdraw with // the black border. - QRect thumbRect = rect(); + TQRect thumbRect = rect(); thumbRect.addCoords(1,1,-1,-1); // If the thumbnail is empty or has been marked for updating generate a new thumbnail. @@ -108,7 +108,7 @@ void ThumbnailWidget::paintEvent(QPaintEvent* e) // TODO: Disable or find something less distractiong. p.drawPixmap(10, 10, *waitIcon); - QTimer::singleShot(50, this, SLOT(setThumbnail())); + TQTimer::singleShot(50, this, TQT_SLOT(setThumbnail())); return; } @@ -122,14 +122,14 @@ void ThumbnailWidget::paintEvent(QPaintEvent* e) // The actual page starts at point (1,1) because of the outline. // Therefore we need to shift the destination rectangle. - QRect pixmapRect = thumbRect; + TQRect pixmapRect = thumbRect; pixmapRect.moveBy(-1,-1); // Paint widget bitBlt (this, thumbRect.topLeft(), &thumbnail, pixmapRect, CopyROP); } -void ThumbnailWidget::resizeEvent(QResizeEvent*) +void ThumbnailWidget::resizeEvent(TQResizeEvent*) { thumbnail.resize(width(), height()); // Generate a new thumbnail in the next paintEvent. @@ -164,12 +164,12 @@ void ThumbnailWidget::setThumbnail() /****** MarkListWidget ******/ -MarkListWidget::MarkListWidget(QWidget* _parent, MarkList* _markList, const PageNumber& _pageNumber, +MarkListWidget::MarkListWidget(TQWidget* _parent, MarkList* _markList, const PageNumber& _pageNumber, DocumentPageCache* _pageCache, bool _showThumbnail) - : QWidget(_parent), showThumbnail(_showThumbnail), pageNumber(_pageNumber), + : TQWidget(_parent), showThumbnail(_showThumbnail), pageNumber(_pageNumber), pageCache(_pageCache), markList(_markList) { - QBoxLayout* layout = new QVBoxLayout(this, margin); + TQBoxLayout* layout = new TQVBoxLayout(this, margin); thumbnailWidget = 0; if (showThumbnail) @@ -178,14 +178,14 @@ MarkListWidget::MarkListWidget(QWidget* _parent, MarkList* _markList, const Page layout->addWidget(thumbnailWidget, 1, Qt::AlignTop); } - QBoxLayout* bottomLayout = new QHBoxLayout(layout); + TQBoxLayout* bottomLayout = new TQHBoxLayout(layout); - checkBox = new QCheckBox(QString::null, this ); - checkBox->setFocusPolicy(QWidget::NoFocus); - QToolTip::add(checkBox, i18n("Select for printing")); + checkBox = new TQCheckBox(TQString::null, this ); + checkBox->setFocusPolicy(TQWidget::NoFocus); + TQToolTip::add(checkBox, i18n("Select for printing")); bottomLayout->addWidget(checkBox, 0, Qt::AlignAuto); - pageLabel = new QLabel(QString("%1").arg(pageNumber), this); + pageLabel = new TQLabel(TQString("%1").arg(pageNumber), this); bottomLayout->addWidget(pageLabel, 1); _backgroundColor = KGlobalSettings::baseColor(); @@ -217,7 +217,7 @@ void MarkListWidget::setChecked( bool checked ) void MarkListWidget::setSelected( bool selected ) { if (selected) - setPaletteBackgroundColor( QApplication::palette().active().highlight() ); + setPaletteBackgroundColor( TQApplication::palette().active().highlight() ); else setPaletteBackgroundColor( _backgroundColor ); } @@ -232,7 +232,7 @@ int MarkListWidget::setNewWidth(int width) int thumbnailHeight = (int)((thumbnailWidth - 2*margin - 2) / pageCache->sizeOfPage(pageNumber).aspectRatio() + 0.5) + 2; // Resize Thumbnail if necessary - if (thumbnailWidget->size() != QSize(thumbnailWidth, thumbnailHeight)) + if (thumbnailWidget->size() != TQSize(thumbnailWidth, thumbnailHeight)) thumbnailWidget->setFixedSize(thumbnailWidth - 2*margin, thumbnailHeight); height += thumbnailHeight + 2*margin; @@ -244,9 +244,9 @@ int MarkListWidget::setNewWidth(int width) bool MarkListWidget::isVisible() { - QRect visibleRect(markList->contentsX(), markList->contentsY(), + TQRect visibleRect(markList->contentsX(), markList->contentsY(), markList->visibleWidth(), markList->visibleHeight()); - QRect widgetRect(markList->childX(this), markList->childY(this), width(), height()); + TQRect widgetRect(markList->childX(this), markList->childY(this), width(), height()); if (widgetRect.intersects(visibleRect)) return true; @@ -255,7 +255,7 @@ bool MarkListWidget::isVisible() } -void MarkListWidget::mousePressEvent(QMouseEvent* e) +void MarkListWidget::mousePressEvent(TQMouseEvent* e) { // Select Page if (e->button() == LeftButton) @@ -272,19 +272,19 @@ void MarkListWidget::mousePressEvent(QMouseEvent* e) /****** MarkList ******/ -MarkList::MarkList(QWidget* parent, const char* name) - : QScrollView(parent, name), clickedThumbnail(0), showThumbnails(true), contextMenu(0) +MarkList::MarkList(TQWidget* parent, const char* name) + : TQScrollView(parent, name), clickedThumbnail(0), showThumbnails(true), contextMenu(0) { currentPage = PageNumber::invalidPage; widgetList.setAutoDelete(true); - setFocusPolicy( QWidget::StrongFocus ); - //viewport()->setFocusPolicy( QWidget::WheelFocus ); - setResizePolicy(QScrollView::Manual); + setFocusPolicy( TQWidget::StrongFocus ); + //viewport()->setFocusPolicy( TQWidget::WheelFocus ); + setResizePolicy(TQScrollView::Manual); - setVScrollBarMode(QScrollView::AlwaysOn); - setHScrollBarMode(QScrollView::AlwaysOff); + setVScrollBarMode(TQScrollView::AlwaysOn); + setHScrollBarMode(TQScrollView::AlwaysOff); - setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding); viewport()->setBackgroundMode(Qt::PaletteBase); enableClipper(true); @@ -300,9 +300,9 @@ void MarkList::setPageCache(DocumentPageCache* _pageCache) pageCache = _pageCache; } -QValueList<int> MarkList::selectedPages() const +TQValueList<int> MarkList::selectedPages() const { - QValueList<int> list; + TQValueList<int> list; MarkListWidget* item; for(unsigned int i = 0; i < widgetList.count(); i++) { @@ -325,8 +325,8 @@ void MarkList::setNumberOfPages(int numberOfPages, bool _showThumbnails) { MarkListWidget* item = new MarkListWidget(viewport(), this, page, pageCache, showThumbnails); - connect(item, SIGNAL(selected(const PageNumber&)), this, SLOT(thumbnailSelected(const PageNumber&))); - connect(item, SIGNAL(showPopupMenu(const PageNumber&, const QPoint&)), this, SLOT(showPopupMenu(const PageNumber&, const QPoint&))); + connect(item, TQT_SIGNAL(selected(const PageNumber&)), this, TQT_SLOT(thumbnailSelected(const PageNumber&))); + connect(item, TQT_SIGNAL(showPopupMenu(const PageNumber&, const TQPoint&)), this, TQT_SLOT(showPopupMenu(const PageNumber&, const TQPoint&))); widgetList.insert(page - 1, item); @@ -438,7 +438,7 @@ void MarkList::removeSelection() } } -void MarkList::viewportResizeEvent(QResizeEvent*) +void MarkList::viewportResizeEvent(TQResizeEvent*) { MarkListWidget* item; @@ -500,7 +500,7 @@ void MarkList::updateWidgetSize(const PageNumber& pageNumber) viewport()->update(); } -void MarkList::mousePressEvent(QMouseEvent* e) +void MarkList::mousePressEvent(TQMouseEvent* e) { if (e->button() == RightButton) { @@ -523,7 +523,7 @@ void MarkList::slotShowThumbnails(bool show) PageNumber _currentPage = currentPage; // Save page selections. - QValueVector<bool> selections; + TQValueVector<bool> selections; selections.resize(widgetList.count()); for (unsigned int i = 0; i < widgetList.count(); i++) selections[i] = widgetList[i]->isChecked(); @@ -553,7 +553,7 @@ void MarkList::repaintThumbnails() } -void MarkList::showPopupMenu(const PageNumber& pageNumber, const QPoint& position) +void MarkList::showPopupMenu(const PageNumber& pageNumber, const TQPoint& position) { if (contextMenu == 0) { diff --git a/kviewshell/marklist.h b/kviewshell/marklist.h index 01458db3..dd8c07a4 100644 --- a/kviewshell/marklist.h +++ b/kviewshell/marklist.h @@ -23,12 +23,12 @@ #include "pageNumber.h" -#include <qpixmap.h> -#include <qptrvector.h> -#include <qscrollview.h> +#include <tqpixmap.h> +#include <tqptrvector.h> +#include <tqscrollview.h> -class QCheckBox; -class QLabel; +class TQCheckBox; +class TQLabel; class KPopupMenu; class DocumentPageCache; @@ -48,8 +48,8 @@ public: ThumbnailWidget(MarkListWidget* parent_, const PageNumber& _pageNumber, DocumentPageCache*); private: - virtual void paintEvent(QPaintEvent*); - virtual void resizeEvent(QResizeEvent*); + virtual void paintEvent(TQPaintEvent*); + virtual void resizeEvent(TQResizeEvent*); private slots: void setThumbnail(); @@ -63,7 +63,7 @@ private: MarkListWidget* parent; - QPixmap thumbnail; + TQPixmap thumbnail; }; @@ -75,7 +75,7 @@ class MarkListWidget : public QWidget Q_OBJECT public: - MarkListWidget(QWidget* _parent, MarkList*, const PageNumber& _pageNumber, DocumentPageCache*, bool _showThumbnail = true); + MarkListWidget(TQWidget* _parent, MarkList*, const PageNumber& _pageNumber, DocumentPageCache*, bool _showThumbnail = true); bool isChecked() const; @@ -94,19 +94,19 @@ signals: void selected(const PageNumber&); /** Emitted on right click. */ - void showPopupMenu(const PageNumber& pageNumber, const QPoint& position); + void showPopupMenu(const PageNumber& pageNumber, const TQPoint& position); protected: - virtual void mousePressEvent(QMouseEvent*); + virtual void mousePressEvent(TQMouseEvent*); private: bool showThumbnail; ThumbnailWidget* thumbnailWidget; - QCheckBox* checkBox; - QLabel* pageLabel; - QColor _backgroundColor; + TQCheckBox* checkBox; + TQLabel* pageLabel; + TQColor _backgroundColor; const PageNumber pageNumber; @@ -126,18 +126,18 @@ class MarkList: public QScrollView Q_OBJECT public: - MarkList(QWidget* parent = 0, const char* name = 0); + MarkList(TQWidget* parent = 0, const char* name = 0); virtual ~MarkList(); void setPageCache(DocumentPageCache*); - QValueList<int> selectedPages() const; + TQValueList<int> selectedPages() const; PageNumber currentPageNumber() { return currentPage; } PageNumber numberOfPages() { return widgetList.count(); } - virtual QSize sizeHint() const { return QSize(); } + virtual TQSize sizeHint() const { return TQSize(); } public slots: void setNumberOfPages(int numberOfPages, bool showThumbnails = true); @@ -153,15 +153,15 @@ public slots: void updateWidgetSize(const PageNumber&); protected: - virtual void viewportResizeEvent(QResizeEvent*); + virtual void viewportResizeEvent(TQResizeEvent*); - virtual void mousePressEvent(QMouseEvent*); + virtual void mousePressEvent(TQMouseEvent*); signals: void selected(const PageNumber&); private slots: - void showPopupMenu(const PageNumber& pageNumber, const QPoint& position); + void showPopupMenu(const PageNumber& pageNumber, const TQPoint& position); void selectAll(); void selectEven(); @@ -170,7 +170,7 @@ private slots: void removeSelection(); private: - QPtrVector<MarkListWidget> widgetList; + TQPtrVector<MarkListWidget> widgetList; PageNumber currentPage; diff --git a/kviewshell/pageNumber.h b/kviewshell/pageNumber.h index 71ba3e50..161760fc 100644 --- a/kviewshell/pageNumber.h +++ b/kviewshell/pageNumber.h @@ -12,7 +12,7 @@ #ifndef PAGENUMBER_H #define PAGENUMBER_H -#include <qglobal.h> +#include <tqglobal.h> /** \brief Class to represent a page number diff --git a/kviewshell/pageSize.cpp b/kviewshell/pageSize.cpp index f52f01a4..43e21f74 100644 --- a/kviewshell/pageSize.cpp +++ b/kviewshell/pageSize.cpp @@ -13,7 +13,7 @@ #include <kglobal.h> #include <klocale.h> #include <math.h> -#include <qstringlist.h> +#include <tqstringlist.h> #include "pageSize.h" #include "units.h" @@ -61,10 +61,10 @@ pageSize::pageSize(const SimplePageSize& s) } -bool pageSize::setPageSize(const QString& name) +bool pageSize::setPageSize(const TQString& name) { // See if we can recognize the string - QString currentName; + TQString currentName; for(int i=0; staticList[i].name != 0; i++) { currentName = staticList[i].name; if (currentName == name) { @@ -138,14 +138,14 @@ void pageSize::setPageSize(double width, double height) } -void pageSize::setPageSize(const QString& width, const QString& _widthUnits, const QString& height, const QString& _heightUnits) +void pageSize::setPageSize(const TQString& width, const TQString& _widthUnits, const TQString& height, const TQString& _heightUnits) { SimplePageSize oldPage = *this; double w = width.toFloat(); double h = height.toFloat(); - QString widthUnits = _widthUnits; + TQString widthUnits = _widthUnits; if ((widthUnits != "cm") && (widthUnits != "mm") && (widthUnits != "in")) { kdError(1223) << "Unrecognized page width unit '" << widthUnits << "'. Assuming mm" << endl; widthUnits = "mm"; @@ -156,7 +156,7 @@ void pageSize::setPageSize(const QString& width, const QString& _widthUnits, con if (widthUnits == "in") pageWidth.setLength_in_inch(w); - QString heightUnits = _heightUnits; + TQString heightUnits = _heightUnits; if ((heightUnits != "cm") && (heightUnits != "mm") && (heightUnits != "in")) { kdError(1223) << "Unrecognized page height unit '" << widthUnits << "'. Assuming mm" << endl; heightUnits = "mm"; @@ -204,7 +204,7 @@ void pageSize::rectifySizes() } -QString pageSize::preferredUnit() const +TQString pageSize::preferredUnit() const { if (currentSize >= 0) return staticList[currentSize].preferredUnit; @@ -217,9 +217,9 @@ QString pageSize::preferredUnit() const } -QString pageSize::widthString(const QString& unit) const +TQString pageSize::widthString(const TQString& unit) const { - QString answer = "--"; + TQString answer = "--"; if (unit == "cm") answer.setNum(pageWidth.getLength_in_cm()); @@ -232,9 +232,9 @@ QString pageSize::widthString(const QString& unit) const } -QString pageSize::heightString(const QString& unit) const +TQString pageSize::heightString(const TQString& unit) const { - QString answer = "--"; + TQString answer = "--"; if (unit == "cm") answer.setNum(pageHeight.getLength_in_cm()); @@ -247,9 +247,9 @@ QString pageSize::heightString(const QString& unit) const } -QStringList pageSize::pageSizeNames() +TQStringList pageSize::pageSizeNames() { - QStringList names; + TQStringList names; for(int i=0; staticList[i].name != 0; i++) names << staticList[i].name; @@ -258,12 +258,12 @@ QStringList pageSize::pageSizeNames() } -QString pageSize::formatName() const +TQString pageSize::formatName() const { if (currentSize >= 0) return staticList[currentSize].name; else - return QString::null; + return TQString::null; } @@ -299,12 +299,12 @@ void pageSize::setOrientation(int orient) } -QString pageSize::serialize() const +TQString pageSize::serialize() const { if ((currentSize >= 0) && (fabs(staticList[currentSize].height-pageHeight.getLength_in_mm()) <= 0.5)) return staticList[currentSize].name; else - return QString("%1x%2").arg(pageWidth.getLength_in_mm()).arg(pageHeight.getLength_in_mm()); + return TQString("%1x%2").arg(pageWidth.getLength_in_mm()).arg(pageHeight.getLength_in_mm()); } @@ -330,7 +330,7 @@ void pageSize::reconstructCurrentSize() int pageSize::defaultPageSize() { - // FIXME: static_cast<QPrinter::PageSize>(KGlobal::locale()->pageSize()) + // FIXME: static_cast<TQPrinter::PageSize>(KGlobal::locale()->pageSize()) // is the proper solution here. Then you can determine the values // without using your hardcoded table too! if (KGlobal::locale()-> measureSystem() == KLocale::Metric) diff --git a/kviewshell/pageSize.h b/kviewshell/pageSize.h index 5ba0194e..27b30501 100644 --- a/kviewshell/pageSize.h +++ b/kviewshell/pageSize.h @@ -14,10 +14,10 @@ #include "simplePageSize.h" -#include <qobject.h> +#include <tqobject.h> -class QString; -class QStringList; +class TQString; +class TQStringList; /* \brief This class represents physical page sizes. @@ -38,7 +38,7 @@ The main difference to the SimplePageSize class are the following. @version 1.0.0 */ -class pageSize : public QObject, public SimplePageSize +class pageSize : public TQObject, public SimplePageSize { Q_OBJECT @@ -58,15 +58,15 @@ public: /** \brief List of standard pageSizes This method returns the names of standard pageSizes, - e.g. "A4". These can be used, e.g., by a QComboBox to let the user + e.g. "A4". These can be used, e.g., by a TQComboBox to let the user choose known sizes. The returned list is also a list of all possible return values of the formatName() method explained below. If you call pageSizeNames() more than once, it is guaranteed that the same list of strings will be returned. - @returns QStringList that contains + @returns TQStringList that contains */ - QStringList pageSizeNames(); + TQStringList pageSizeNames(); /** \brief Set page size by name. @@ -97,7 +97,7 @@ public: @returns 'True', if the parameter could be parsed, and 'false' otherwise. */ - bool setPageSize(const QString& name); + bool setPageSize(const TQString& name); /** \brief Set page size from width and height strings @@ -125,7 +125,7 @@ public: @param heightUnits units for the height string. Currently "mm", "cm" and "in" are allowed. */ - void setPageSize(const QString& width, const QString& widthUnits, const QString& height, const QString& heightUnits); + void setPageSize(const TQString& width, const TQString& widthUnits, const TQString& height, const TQString& heightUnits); /** \brief Set page size @@ -157,7 +157,7 @@ public: US Letter and US Legal are best given in inches, to avoid very odd numbers. If the page format is unknown, returns a guess based on the current locale. */ - QString preferredUnit() const; + TQString preferredUnit() const; /** \brief Returns the page width as a string @@ -167,7 +167,7 @@ public: @returns a string containing a number, e.g. "3.1415", which gives the page width in the given unit. If the unit is not recognized, the string "--" is returned. */ - QString widthString(const QString& unit) const; + TQString widthString(const TQString& unit) const; /** \brief Returns the page height as a string @@ -178,7 +178,7 @@ public: the given unit. If the unit is not recognized, the string "--" is returned. */ - QString heightString(const QString& unit) const; + TQString heightString(const TQString& unit) const; /** \brief Returns a name for the page size, if this is a standard size @@ -188,11 +188,11 @@ public: 297x210. @returns A name for the current page size, if the format has a - name, or QString::null otherwise. If the result is not - QString::null, it is guaranteed to be one of the strings + name, or TQString::null otherwise. If the result is not + TQString::null, it is guaranteed to be one of the strings returned by the pageSizeNames() method. */ - QString formatName() const; + TQString formatName() const; /** \brief Returns an number for the page size, if this is a standard size @@ -203,7 +203,7 @@ public: @returns If the current format is one of the standard sizes, a non-negative integer is returned, which is an index to the - QStringList returned by the pageSizeNames() method. If the + TQStringList returned by the pageSizeNames() method. If the current format is none of the standard sizes, -1 is returned. */ int formatNumber() const {return currentSize;} @@ -220,13 +220,13 @@ public: */ int getOrientation() const; - /** \brief Returns a string that can be read by setPageSize(QString) + /** \brief Returns a string that can be read by setPageSize(TQString) @returns This method returns a string like "210x297". The numbers - are page width and height in millimeters. The setPageSize(QString) + are page width and height in millimeters. The setPageSize(TQString) method will understand this output. */ - QString serialize() const; + TQString serialize() const; public slots: /** \brief Sets orientation diff --git a/kviewshell/pageSizeDialog.cpp b/kviewshell/pageSizeDialog.cpp index 3a64cbe3..75c4409d 100644 --- a/kviewshell/pageSizeDialog.cpp +++ b/kviewshell/pageSizeDialog.cpp @@ -13,11 +13,11 @@ #include <kcombobox.h> #include <klocale.h> #include <kmessagebox.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qlineedit.h> -#include <qvalidator.h> -#include <qhbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqlineedit.h> +#include <tqvalidator.h> +#include <tqhbox.h> @@ -25,13 +25,13 @@ #include "pageSizeWidget.h" -pageSizeDialog::pageSizeDialog( QWidget *parent, pageSize *userPrefdPageSize, const char *name, bool modal) +pageSizeDialog::pageSizeDialog( TQWidget *parent, pageSize *userPrefdPageSize, const char *name, bool modal) :KDialogBase( parent, name, modal, i18n("Page Size"), Ok|Apply|Cancel, Ok, true ) { userPreferredPageSize = userPrefdPageSize; pageSizeW = new pageSizeWidget(this, "PageSizeWidget"); - pageSizeW->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, 0, 0, + pageSizeW->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)3, 0, 0, pageSizeW->sizePolicy().hasHeightForWidth() ) ); setMainWidget(pageSizeW); } @@ -52,7 +52,7 @@ void pageSizeDialog::slotApply() } -void pageSizeDialog::setPageSize(const QString& name) +void pageSizeDialog::setPageSize(const TQString& name) { if (pageSizeW == 0) return; diff --git a/kviewshell/pageSizeDialog.h b/kviewshell/pageSizeDialog.h index 17a4a0df..50e8c0b6 100644 --- a/kviewshell/pageSizeDialog.h +++ b/kviewshell/pageSizeDialog.h @@ -36,8 +36,8 @@ public: // value whenever the user clicks on 'accept' or 'ok'. Programmers // can then connect to the signal sizeChanged() of the object to be // informed about the changes. - pageSizeDialog( QWidget *parent=0, pageSize *userPrefdPageSize=0, const char *name=0, bool modal=true); - void setPageSize(const QString&); + pageSizeDialog( TQWidget *parent=0, pageSize *userPrefdPageSize=0, const char *name=0, bool modal=true); + void setPageSize(const TQString&); protected slots: virtual void slotOk(); diff --git a/kviewshell/pageSizeWidget.cpp b/kviewshell/pageSizeWidget.cpp index d485f3bb..a745d1ef 100644 --- a/kviewshell/pageSizeWidget.cpp +++ b/kviewshell/pageSizeWidget.cpp @@ -12,8 +12,8 @@ #include <kcombobox.h> #include <kdebug.h> #include <klocale.h> -#include <qlineedit.h> -#include <qvalidator.h> +#include <tqlineedit.h> +#include <tqvalidator.h> #include "pageSize.h" #include "pageSizeWidget.h" @@ -23,10 +23,10 @@ // Constructs a pageSizeWidget_base which is a child of 'parent', with // the name 'name' and widget flags set to 'f'. -pageSizeWidget::pageSizeWidget( QWidget* parent, const char* name, WFlags fl ) +pageSizeWidget::pageSizeWidget( TQWidget* parent, const char* name, WFlags fl ) : pageSizeWidget_base( parent, name, fl ) { - connect(&chosenSize, SIGNAL(sizeChanged(const SimplePageSize&)), previewer, SLOT(setSize(const SimplePageSize&))); + connect(&chosenSize, TQT_SIGNAL(sizeChanged(const SimplePageSize&)), previewer, TQT_SLOT(setSize(const SimplePageSize&))); // Set up the formatChoice QComboBox formatChoice->insertItem(i18n("Custom Size")); @@ -42,23 +42,23 @@ pageSizeWidget::pageSizeWidget( QWidget* parent, const char* name, WFlags fl ) } paperSize(formatChoice->currentItem()); - connect(formatChoice, SIGNAL(activated(int)), this, SLOT(paperSize(int))); - connect(orientationChoice, SIGNAL(activated(int)), this, SLOT(orientationChanged(int))); + connect(formatChoice, TQT_SIGNAL(activated(int)), this, TQT_SLOT(paperSize(int))); + connect(orientationChoice, TQT_SIGNAL(activated(int)), this, TQT_SLOT(orientationChanged(int))); // Update the text fields when the user switches to a new unit, and // when the "custom format" is NOT selected. - connect(widthUnits, SIGNAL(activated(int)), this, SLOT(unitsChanged(int))); - connect(heightUnits, SIGNAL(activated(int)), this, SLOT(unitsChanged(int))); + connect(widthUnits, TQT_SIGNAL(activated(int)), this, TQT_SLOT(unitsChanged(int))); + connect(heightUnits, TQT_SIGNAL(activated(int)), this, TQT_SLOT(unitsChanged(int))); // Upate the chosen size whenever the user edits the input field. - connect(widthInput, SIGNAL(textChanged(const QString &)), this, SLOT(input(const QString &))); - connect(heightInput, SIGNAL(textChanged(const QString &)), this, SLOT(input(const QString &))); + connect(widthInput, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(input(const TQString &))); + connect(heightInput, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(input(const TQString &))); // Allow entries between 0 and 1200. More filtering is done by the // pageSize class, which silently ignores values which are out of // range. - widthInput->setValidator(new QDoubleValidator(0.0, 1200.0, 1, this, "widthValidator")); - heightInput->setValidator(new QDoubleValidator(0.0, 1200.0, 1, this, "heightValidator")); + widthInput->setValidator(new TQDoubleValidator(0.0, 1200.0, 1, this, "widthValidator")); + heightInput->setValidator(new TQDoubleValidator(0.0, 1200.0, 1, this, "heightValidator")); } @@ -81,7 +81,7 @@ void pageSizeWidget::paperSize(int index) } -void pageSizeWidget::setPageSize(const QString& sizeName) +void pageSizeWidget::setPageSize(const TQString& sizeName) { chosenSize.setPageSize(sizeName); @@ -104,9 +104,9 @@ void pageSizeWidget::fillTextFields() // Warning! It is really necessary here to first generate both // strings, and then call setText() on the input widgets. Reason? // Calling setText() implicitly calls the input() method via the - // textChanged()-Signal of the QLineEdit widgets. - QString width = chosenSize.widthString(widthUnits->currentText()); - QString height = chosenSize.heightString(heightUnits->currentText()); + // textChanged()-Signal of the TQLineEdit widgets. + TQString width = chosenSize.widthString(widthUnits->currentText()); + TQString height = chosenSize.heightString(heightUnits->currentText()); widthInput->setText(width); heightInput->setText(height); @@ -120,7 +120,7 @@ void pageSizeWidget::unitsChanged(int) if (formatChoice->currentItem() != 0) fillTextFields(); else - input(QString::null); + input(TQString::null); } @@ -138,7 +138,7 @@ void pageSizeWidget::orientationChanged(int orient) } -void pageSizeWidget::input(const QString &) +void pageSizeWidget::input(const TQString &) { chosenSize.setPageSize(widthInput->text(), widthUnits->currentText(), heightInput->text(), heightUnits->currentText()); } diff --git a/kviewshell/pageSizeWidget.h b/kviewshell/pageSizeWidget.h index 76cc0d02..ac95dd4e 100644 --- a/kviewshell/pageSizeWidget.h +++ b/kviewshell/pageSizeWidget.h @@ -14,19 +14,19 @@ #include "pageSize.h" #include "pageSizeWidget_base.h" -class QDoubleValidator; +class TQDoubleValidator; class pageSizeWidget : public pageSizeWidget_base { Q_OBJECT public: - pageSizeWidget( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + pageSizeWidget( TQWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); // Sets the page size. If the dialog is already shown, updates all // the GUI. Accepts the same strings as input as the setPageSize() // method of the pageSize() class. - void setPageSize(const QString&); + void setPageSize(const TQString&); void setOrientation(int ori); @@ -40,13 +40,13 @@ protected slots: // the fillTextFields() slot. void unitsChanged(int); void orientationChanged(int = 0); - void input(const QString &); + void input(const TQString &); private: pageSize chosenSize; - QDoubleValidator *widthValidator; - QDoubleValidator *heightValidator; + TQDoubleValidator *widthValidator; + TQDoubleValidator *heightValidator; }; #endif // PAGESIZEWIDGET_H diff --git a/kviewshell/pageView.cpp b/kviewshell/pageView.cpp index c7813280..884d7288 100644 --- a/kviewshell/pageView.cpp +++ b/kviewshell/pageView.cpp @@ -22,26 +22,26 @@ #include <config.h> #include <kdebug.h> -#include <qcursor.h> -#include <qpainter.h> -#include <qrect.h> +#include <tqcursor.h> +#include <tqpainter.h> +#include <tqrect.h> #include <math.h> #include "pageView.h" #include "pageNumber.h" -PageView::PageView( QWidget* parent, const char* name ) - : QScrollView( parent, name, WStaticContents | WNoAutoErase) +PageView::PageView( TQWidget* parent, const char* name ) + : TQScrollView( parent, name, WStaticContents | WNoAutoErase) { moveTool = true; widgetList = 0; - viewport()->setFocusPolicy(QWidget::StrongFocus); + viewport()->setFocusPolicy(TQWidget::StrongFocus); - setResizePolicy(QScrollView::Manual); + setResizePolicy(TQScrollView::Manual); - setVScrollBarMode(QScrollView::Auto); - setHScrollBarMode(QScrollView::Auto); + setVScrollBarMode(TQScrollView::Auto); + setHScrollBarMode(TQScrollView::Auto); viewport()->setBackgroundMode(Qt::NoBackground); @@ -54,11 +54,11 @@ PageView::PageView( QWidget* parent, const char* name ) continuousViewmode = true; fullScreen = false; - connect(this, SIGNAL(contentsMoving(int, int)), this, SLOT(calculateCurrentPageNumber(int, int))); + connect(this, TQT_SIGNAL(contentsMoving(int, int)), this, TQT_SLOT(calculateCurrentPageNumber(int, int))); } -void PageView::addChild( QPtrVector<DocumentWidget> *wdgList ) +void PageView::addChild( TQPtrVector<DocumentWidget> *wdgList ) { if( wdgList == 0 ) { kdError(1223) << "PageView::addChild(...) called with invalid arguments" << endl; @@ -171,7 +171,7 @@ void PageView::scrollTop() verticalScrollBar()->setValue( verticalScrollBar()->minValue() ); } -void PageView::keyPressEvent( QKeyEvent* e ) +void PageView::keyPressEvent( TQKeyEvent* e ) { switch ( e->key() ) { case Key_Up: @@ -193,7 +193,7 @@ void PageView::keyPressEvent( QKeyEvent* e ) e->accept(); } -void PageView::contentsMousePressEvent( QMouseEvent* e ) +void PageView::contentsMousePressEvent( TQMouseEvent* e ) { if (e->button() == LeftButton) { @@ -213,26 +213,26 @@ void PageView::contentsMousePressEvent( QMouseEvent* e ) } } -void PageView::contentsMouseReleaseEvent( QMouseEvent* ) +void PageView::contentsMouseReleaseEvent( TQMouseEvent* ) { setCursor(Qt::arrowCursor); } -void PageView::contentsMouseMoveEvent( QMouseEvent* e ) +void PageView::contentsMouseMoveEvent( TQMouseEvent* e ) { - QPoint newPos = e->globalPos(); + TQPoint newPos = e->globalPos(); if (e->state() == LeftButton && moveTool) { - QPoint delta = dragGrabPos - newPos; + TQPoint delta = dragGrabPos - newPos; scrollBy(delta.x(), delta.y()); } dragGrabPos = newPos; } -void PageView::viewportResizeEvent( QResizeEvent* e ) +void PageView::viewportResizeEvent( TQResizeEvent* e ) { - QScrollView::viewportResizeEvent( e ); + TQScrollView::viewportResizeEvent( e ); if (!widgetList) return; @@ -265,11 +265,11 @@ bool PageView::singlePageFullScreenMode() void PageView::slotShowScrollbars(bool status) { if (status == true) { - setVScrollBarMode(QScrollView::Auto); - setHScrollBarMode(QScrollView::Auto); + setVScrollBarMode(TQScrollView::Auto); + setHScrollBarMode(TQScrollView::Auto); } else { - setVScrollBarMode(QScrollView::AlwaysOff); - setHScrollBarMode(QScrollView::AlwaysOff); + setVScrollBarMode(TQScrollView::AlwaysOff); + setHScrollBarMode(TQScrollView::AlwaysOff); } } @@ -278,10 +278,10 @@ void PageView::setFullScreenMode(bool fullScreen) this -> fullScreen = fullScreen; if (fullScreen == true) { - setVScrollBarMode(QScrollView::AlwaysOff); - setHScrollBarMode(QScrollView::AlwaysOff); + setVScrollBarMode(TQScrollView::AlwaysOff); + setHScrollBarMode(TQScrollView::AlwaysOff); oldFrameStyle = frameStyle(); - setFrameStyle(QFrame::NoFrame); + setFrameStyle(TQFrame::NoFrame); backgroundColor = viewport()->paletteBackgroundColor(); if (singlePageFullScreenMode()) { @@ -307,7 +307,7 @@ void PageView::layoutPages(bool zoomChanged) // (we detect that by looking at the contentsWidth and -Height). if (widgetList->isEmpty()) { if ((contentsWidth() != 0) || (contentsHeight() != 0)) { - QScrollView::resizeContents(0,0); + TQScrollView::resizeContents(0,0); } return; } @@ -321,7 +321,7 @@ void PageView::layoutPages(bool zoomChanged) distance = 0; } - QMemArray<Q_UINT32> colWidth(nrCols); + TQMemArray<Q_UINT32> colWidth(nrCols); for(Q_UINT8 i=0; i<colWidth.size(); i++) colWidth[i] = 0; @@ -335,7 +335,7 @@ void PageView::layoutPages(bool zoomChanged) numRows = (Q_INT16)ceil(((double)widgetList->size()) / nrCols); } - QMemArray<Q_UINT32> rowHeight(numRows); + TQMemArray<Q_UINT32> rowHeight(numRows); for(Q_UINT16 i=0; i<rowHeight.size(); i++) rowHeight[i] = 0; @@ -369,7 +369,7 @@ void PageView::layoutPages(bool zoomChanged) totalWidth += colWidth[i]; totalWidth += (nrCols+1)*distance; - QSize newViewportSize = viewportSize( totalWidth, totalHeight ); + TQSize newViewportSize = viewportSize( totalWidth, totalHeight ); Q_UINT32 centeringLeft = 0; if( (Q_UINT32)newViewportSize.width() > totalWidth ) centeringLeft = ( newViewportSize.width() - totalWidth )/2; @@ -381,7 +381,7 @@ void PageView::layoutPages(bool zoomChanged) if (((Q_UINT32)contentsWidth() != totalWidth) || ((Q_UINT32)contentsHeight() != totalHeight)) { // Calculate the point in the coordinates of the contents which is currently at the center of the viewport. - QPoint midPoint = QPoint(visibleWidth() / 2 + contentsX(), visibleHeight() / 2 + contentsY()); + TQPoint midPoint = TQPoint(visibleWidth() / 2 + contentsX(), visibleHeight() / 2 + contentsY()); double midPointRatioX = (double)(midPoint.x()) / contentsWidth(); double midPointRatioY = (double)(midPoint.y()) / contentsHeight(); @@ -394,12 +394,12 @@ void PageView::layoutPages(bool zoomChanged) // Finally, calculate the left and top coordinates of each row and // column, respectively - QMemArray<Q_UINT32> colLeft(nrCols); + TQMemArray<Q_UINT32> colLeft(nrCols); colLeft[0] = distance; for(Q_UINT8 i=1; i<colLeft.size(); i++) colLeft[i] = colLeft[i-1]+colWidth[i-1]+distance; - QMemArray<Q_UINT32> rowTop(numRows); + TQMemArray<Q_UINT32> rowTop(numRows); rowTop[0] = distance; for(Q_UINT16 i=1; i<rowTop.size(); i++) rowTop[i] = rowTop[i-1]+rowHeight[i-1]+distance; @@ -442,13 +442,13 @@ void PageView::layoutPages(bool zoomChanged) } -void PageView::contentsWheelEvent ( QWheelEvent * e ) +void PageView::contentsWheelEvent ( TQWheelEvent * e ) { emit(wheelEventReceived(e)); } -void PageView::moveViewportToWidget(QWidget* widget, int y) +void PageView::moveViewportToWidget(TQWidget* widget, int y) { int verticalPos = 0; int verticalPosTop = 0; @@ -487,10 +487,10 @@ void PageView::moveViewportToWidget(QWidget* widget, int y) } -void PageView::viewportPaintEvent(QPaintEvent* e) +void PageView::viewportPaintEvent(TQPaintEvent* e) { // Region from which rectangles occupied by child widgets will by substracted. - QRegion backgroundArea(e->rect()); + TQRegion backgroundArea(e->rect()); if (widgetList != 0) { @@ -502,12 +502,12 @@ void PageView::viewportPaintEvent(QPaintEvent* e) if (!item->geometry().intersects(e->rect())) continue; - QRect widgetGeometry = item->geometry(); + TQRect widgetGeometry = item->geometry(); // Draw the widget. if (e->rect().intersects(widgetGeometry)) { - QRect widgetRect = e->rect().intersect(widgetGeometry); + TQRect widgetRect = e->rect().intersect(widgetGeometry); widgetRect.moveBy(-widgetGeometry.left(), -widgetGeometry.top()); item->update(widgetRect); @@ -519,9 +519,9 @@ void PageView::viewportPaintEvent(QPaintEvent* e) } // Paint the background. - QPainter p(viewport()); + TQPainter p(viewport()); - QMemArray<QRect> backgroundRects = backgroundArea.rects(); + TQMemArray<TQRect> backgroundRects = backgroundArea.rects(); for (unsigned int i = 0; i < backgroundRects.count(); i++) p.fillRect(backgroundRects[i], colorGroup().mid()); @@ -534,7 +534,7 @@ void PageView::calculateCurrentPageNumber(int x, int y) if (widgetList == 0) return; - QRect viewportRect(x, y, visibleWidth(), visibleHeight()); + TQRect viewportRect(x, y, visibleWidth(), visibleHeight()); //kdDebug() << "viewportRect(" << viewportRect.x() << ", " << viewportRect.y() << ", " // << viewportRect.width() << ", " << viewportRect.height() << ")" << endl; @@ -552,14 +552,14 @@ void PageView::calculateCurrentPageNumber(int x, int y) // Check if the Widget is visible int cx = childX(documentWidget); int cy = childY(documentWidget); - QRect widgetRect(cx, cy, documentWidget->width(), documentWidget->height()); + TQRect widgetRect(cx, cy, documentWidget->width(), documentWidget->height()); bool isVisible = widgetRect.intersects(viewportRect); if (!isVisible) continue; // Calculate the number of visible pixels of the widget - QRect visibleRect = widgetRect.intersect(viewportRect); + TQRect visibleRect = widgetRect.intersect(viewportRect); int visiblePixels = visibleRect.width() * visibleRect.height(); //kdDebug() << visiblePixels << " pixels are visible of page " << documentWidget->getPageNumber() << endl; diff --git a/kviewshell/pageView.h b/kviewshell/pageView.h index d87ae0ca..e2dfd59e 100644 --- a/kviewshell/pageView.h +++ b/kviewshell/pageView.h @@ -25,13 +25,13 @@ #include "documentWidget.h" -#include <qptrvector.h> -#include <qscrollview.h> +#include <tqptrvector.h> +#include <tqscrollview.h> class PageNumber; /* - * PageView is a customized QScrollView, which can hold one + * PageView is a customized TQScrollView, which can hold one * page. This page will be centered on the viewport. */ class PageView : public QScrollView @@ -39,10 +39,10 @@ class PageView : public QScrollView Q_OBJECT public: - PageView( QWidget* parent = 0, const char* name = 0 ); + PageView( TQWidget* parent = 0, const char* name = 0 ); ~PageView() {} - void addChild( QPtrVector<DocumentWidget> *wdgList ); + void addChild( TQPtrVector<DocumentWidget> *wdgList ); /** Sets the number of columns into which the widgets are aligned. If nothing is set, '2' is the default. */ @@ -85,7 +85,7 @@ public: int distanceBetweenPages() { return distanceBetweenWidgets; } /** Moves the viewport so that the widget is at the top left corner. */ - void moveViewportToWidget(QWidget* widget, int y = 0); + void moveViewportToWidget(TQWidget* widget, int y = 0); bool isMoveToolEnabled() const { return moveTool; } @@ -112,31 +112,31 @@ public slots: void slotEnableMoveTool(bool enable); signals: - void viewSizeChanged(const QSize& size); - void pageSizeChanged(const QSize& size); + void viewSizeChanged(const TQSize& size); + void pageSizeChanged(const TQSize& size); void currentPageChanged(const PageNumber&); /** This signal is emitted when the scrollView receives a mouse wheel event. */ - void wheelEventReceived( QWheelEvent * ); + void wheelEventReceived( TQWheelEvent * ); protected: - void keyPressEvent( QKeyEvent* ); + void keyPressEvent( TQKeyEvent* ); - /** Reimplemented from QScrollView to make sure that the page is + /** Reimplemented from TQScrollView to make sure that the page is centered when it fits in the viewport. */ - void viewportResizeEvent( QResizeEvent* ); - void viewportPaintEvent(QPaintEvent*); + void viewportResizeEvent( TQResizeEvent* ); + void viewportPaintEvent(TQPaintEvent*); - /** Reimplemented from QScrollView, because the kviepart needs to + /** Reimplemented from TQScrollView, because the kviepart needs to handle the wheel events itself. The wheel event is passed on by emitting the singal "wheelEventReceived". Nothing else is done. */ - void contentsWheelEvent ( QWheelEvent * ); + void contentsWheelEvent ( TQWheelEvent * ); - void contentsMousePressEvent(QMouseEvent*); - void contentsMouseReleaseEvent(QMouseEvent*); - void contentsMouseMoveEvent(QMouseEvent*); + void contentsMousePressEvent(TQMouseEvent*); + void contentsMouseReleaseEvent(TQMouseEvent*); + void contentsMouseMoveEvent(TQMouseEvent*); private slots: void calculateCurrentPageNumber(int x, int y); @@ -144,9 +144,9 @@ private slots: private: /** Stores the mouse position between two mouse events. This is used to implement the "grab and drag the viewport contents" feature. */ - QPoint dragGrabPos; + TQPoint dragGrabPos; - QPtrVector<DocumentWidget>* widgetList; + TQPtrVector<DocumentWidget>* widgetList; /** Used internally by the centerContents()-method. Set with the setNrColumns() method */ @@ -163,7 +163,7 @@ private: /** color of the viewport's background. This is also stored on entering the fullscreen mode. */ - QColor backgroundColor; + TQColor backgroundColor; /** Distance between pages in pixels (this is independent of the zoom level). */ diff --git a/kviewshell/plugins/djvu/djvumultipage.cpp b/kviewshell/plugins/djvu/djvumultipage.cpp index 2599cc29..0f0c7074 100644 --- a/kviewshell/plugins/djvu/djvumultipage.cpp +++ b/kviewshell/plugins/djvu/djvumultipage.cpp @@ -28,10 +28,10 @@ #include <kprinter.h> #include <ktempfile.h> #include "kvsprefs.h" -#include <qapplication.h> -#include <qpaintdevicemetrics.h> -#include <qprinter.h> -#include <qtooltip.h> +#include <tqapplication.h> +#include <tqpaintdevicemetrics.h> +#include <tqprinter.h> +#include <tqtooltip.h> #include "ByteStream.h" #include "DjVuToPS.h" @@ -47,8 +47,8 @@ typedef KParts::GenericFactory<DjVuMultiPage> DjVuMultiPageFactory; K_EXPORT_COMPONENT_FACTORY(djvuviewpart, DjVuMultiPageFactory) -DjVuMultiPage::DjVuMultiPage(QWidget *parentWidget, const char *widgetName, QObject *parent, - const char *name, const QStringList&) +DjVuMultiPage::DjVuMultiPage(TQWidget *parentWidget, const char *widgetName, TQObject *parent, + const char *name, const TQStringList&) : KMultiPage(parentWidget, widgetName, parent, name), djvuRenderer(parentWidget) { /* This is kparts wizardry that cannot be understood by man. Simply @@ -57,7 +57,7 @@ DjVuMultiPage::DjVuMultiPage(QWidget *parentWidget, const char *widgetName, QObj djvuRenderer.setName("DjVu renderer"); // Render modes - QStringList renderModes; + TQStringList renderModes; renderModes.append(i18n("Color")); renderModes.append(i18n("Black and White")); renderModes.append(i18n("Show foreground only")); @@ -67,10 +67,10 @@ DjVuMultiPage::DjVuMultiPage(QWidget *parentWidget, const char *widgetName, QObj renderModeAction->setCurrentItem(Prefs::renderMode()); - deletePagesAction = new KAction(i18n("Delete Pages..."), 0, this, SLOT(slotDeletePages()), actionCollection(), "delete_pages"); + deletePagesAction = new KAction(i18n("Delete Pages..."), 0, this, TQT_SLOT(slotDeletePages()), actionCollection(), "delete_pages"); // change the rendermode - connect(renderModeAction, SIGNAL(activated(int)), this, SLOT(setRenderMode(int))); + connect(renderModeAction, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setRenderMode(int))); /* It is very important that this method is called in the constructor. Otherwise kmultipage does not know how to render @@ -122,11 +122,11 @@ void DjVuMultiPage::setFile(bool r) enableActions(r); } -QStringList DjVuMultiPage::fileFormats() const +TQStringList DjVuMultiPage::fileFormats() const { /* This list is used in the file selection dialog when the file is saved */ - QStringList r; + TQStringList r; r << i18n("*.djvu|DjVu file (*.djvu)"); return r; } @@ -164,10 +164,10 @@ void DjVuMultiPage::slotDeletePages() KDialogBase dialog( parentWdg, "urldialog", true, i18n("Delete Pages"), KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true ); PageRangeWidget range( 1, numberOfPages(), currentPageNumber(), &dialog, "range widget" ); - QToolTip::add( &range, i18n( "Select the pages you wish to delete." ) ); + TQToolTip::add( &range, i18n( "Select the pages you wish to delete." ) ); dialog.setButtonOK(i18n("Delete Pages")); dialog.setMainWidget(&range); - if (dialog.exec() != QDialog::Accepted) + if (dialog.exec() != TQDialog::Accepted) return; djvuRenderer.deletePages(range.getFrom(), range.getTo()); @@ -188,7 +188,7 @@ void DjVuMultiPage::slotDeletePages() //@@@@@@@@@@ tableOfContents->setContents(renderer->getBookmarks()); // Clear Statusbar - emit setStatusBarText(QString::null); + emit setStatusBarText(TQString::null); } @@ -222,7 +222,7 @@ void DjVuMultiPage::print() // initialize the printer using the print dialog if ( printer->setup(parentWdg, i18n("Print %1").arg(m_file.section('/', -1))) ) { // Now do the printing. - QValueList<int> pageList = printer->pageList(); + TQValueList<int> pageList = printer->pageList(); if (pageList.isEmpty()) printer->abort(); else { @@ -236,7 +236,7 @@ void DjVuMultiPage::print() // Set PostScript Language Level, taking 3 as the default options.set_format(DjVuToPS::Options::PS); - QString op = printer->option( "kde-kdjvu-pslevel" ); + TQString op = printer->option( "kde-kdjvu-pslevel" ); if (op == "1") options.set_level(1); else @@ -279,12 +279,12 @@ void DjVuMultiPage::print() else options.set_zoom(100); - KTempFile tmpPSFile(QString::null, "ps"); + KTempFile tmpPSFile(TQString::null, "ps"); tmpPSFile.close(); tmpPSFile.setAutoDelete(true); if (djvuRenderer.convertToPSFile(converter, tmpPSFile.name(), pageList ) == true) - printer->printFiles( QStringList(tmpPSFile.name()), true ); + printer->printFiles( TQStringList(tmpPSFile.name()), true ); else printer->abort(); } @@ -312,18 +312,18 @@ void DjVuMultiPage::slotSave() return; // Try to guess the proper ending... - QString formats; - QString ending; + TQString formats; + TQString ending; int rindex = m_file.findRev("."); if (rindex == -1) { - ending = QString::null; - formats = QString::null; + ending = TQString::null; + formats = TQString::null; } else { ending = m_file.mid(rindex); // e.g. ".dvi" formats = fileFormats().grep(ending).join("\n"); } - QString fileName = KFileDialog::getSaveFileName(QString::null, formats, 0, i18n("Save File As")); + TQString fileName = KFileDialog::getSaveFileName(TQString::null, formats, 0, i18n("Save File As")); if (fileName.isEmpty()) return; @@ -333,7 +333,7 @@ void DjVuMultiPage::slotSave() if (!ending.isEmpty() && fileName.find(ending) == -1) fileName = fileName+ending; - if (QFile(fileName).exists()) { + if (TQFile(fileName).exists()) { int r = KMessageBox::warningContinueCancel(parentWdg, i18n("The file %1\nalready exists. Do you want to overwrite it?").arg(fileName), i18n("Overwrite File"), i18n("Overwrite")); if (r == KMessageBox::Cancel) diff --git a/kviewshell/plugins/djvu/djvumultipage.h b/kviewshell/plugins/djvu/djvumultipage.h index b417144b..c460e6b3 100644 --- a/kviewshell/plugins/djvu/djvumultipage.h +++ b/kviewshell/plugins/djvu/djvumultipage.h @@ -24,7 +24,7 @@ #ifndef __DJVUMULTIPAGE_H #define __DJVUMULTIPAGE_H -#include <qstringlist.h> +#include <tqstringlist.h> #include "kmultipage.h" #include "djvurenderer.h" @@ -95,8 +95,8 @@ public: kmultipage. Please have a look at the constructor's source code to see how to adjust this for your implementation. */ - DjVuMultiPage(QWidget *parentWidget, const char *widgetName, QObject *parent, - const char *name, const QStringList& args = QStringList()); + DjVuMultiPage(TQWidget *parentWidget, const char *widgetName, TQObject *parent, + const char *name, const TQStringList& args = TQStringList()); /** Destructor @@ -111,7 +111,7 @@ public: This method returns the list of supported file formats for saving the file. */ - virtual QStringList fileFormats() const; + virtual TQStringList fileFormats() const; /** Author information diff --git a/kviewshell/plugins/djvu/djvurenderer.cpp b/kviewshell/plugins/djvu/djvurenderer.cpp index 54a96b38..49413818 100644 --- a/kviewshell/plugins/djvu/djvurenderer.cpp +++ b/kviewshell/plugins/djvu/djvurenderer.cpp @@ -24,9 +24,9 @@ #include <kmessagebox.h> #include <kdebug.h> #include <klocale.h> -#include <qfileinfo.h> -#include <qimage.h> -#include <qpainter.h> +#include <tqfileinfo.h> +#include <tqimage.h> +#include <tqpainter.h> #include <kapp.h> #include "GBitmap.h" @@ -44,21 +44,21 @@ //#define KF_DEBUG -inline GUTF8String GStringFromQString(const QString& x) +inline GUTF8String GStringFromQString(const TQString& x) { GUTF8String retval=(const char*)x.utf8(); return retval; } -inline QString QStringFromGString(const GUTF8String& x) +inline TQString QStringFromGString(const GUTF8String& x) { - QString retval=QString::fromUtf8((const char*)x); + TQString retval=TQString::fromUtf8((const char*)x); return retval; } -DjVuRenderer::DjVuRenderer(QWidget* par) +DjVuRenderer::DjVuRenderer(TQWidget* par) : DocumentRenderer(par) { #ifdef KF_DEBUG @@ -77,7 +77,7 @@ DjVuRenderer::~DjVuRenderer() #endif // Wait for all access to this documentRenderer to finish - QMutexLocker locker( &mutex ); + TQMutexLocker locker( &mutex ); } @@ -98,7 +98,7 @@ void DjVuRenderer::drawPage(double resolution, RenderedDocumentPage* page) } // Wait for all access to this documentRenderer to finish - QMutexLocker locker( &mutex ); + TQMutexLocker locker( &mutex ); // more paranoid safety checks if (page->getPageNumber() > numPages) { @@ -151,7 +151,7 @@ void DjVuRenderer::drawPage(double resolution, RenderedDocumentPage* page) else if (Prefs::renderMode() == Prefs::EnumRenderMode::Background) djvuPixmap = djvuPage->get_bg_pixmap(pageRect, pageRect); - QPainter* foreGroundPaint = page->getPainter(); + TQPainter* foreGroundPaint = page->getPainter(); if (foreGroundPaint != 0) { if(djvuPixmap && Prefs::renderMode() != Prefs::EnumRenderMode::BlackAndWhite) @@ -180,7 +180,7 @@ void DjVuRenderer::drawPage(double resolution, RenderedDocumentPage* page) for (int j = 0; j < pageWidth; j++) { GPixel pixel = pixmapRow[j]; - foreGroundPaint->setPen(QColor(pixel.r, pixel.g, pixel.b)); + foreGroundPaint->setPen(TQColor(pixel.r, pixel.g, pixel.b)); foreGroundPaint->drawPoint(j, pageHeight - i - 1); } }*/ @@ -217,7 +217,7 @@ void DjVuRenderer::drawPage(double resolution, RenderedDocumentPage* page) for (int j = 0; j < pageWidth; j++) { unsigned char pixel = 255-bitmapRow[j]; - foreGroundPaint->setPen(QColor(pixel, pixel, pixel)); + foreGroundPaint->setPen(TQColor(pixel, pixel, pixel)); foreGroundPaint->drawPoint(j, pageHeight - i - 1); } }*/ @@ -237,7 +237,7 @@ void DjVuRenderer::drawPage(double resolution, RenderedDocumentPage* page) if (pageText) { - QSize djvuPageSize(djvuPage->get_width(), djvuPage->get_real_height()); + TQSize djvuPageSize(djvuPage->get_width(), djvuPage->get_real_height()); fillInText(page, pageText, pageText->page_zone, djvuPageSize); //kdDebug() << "Text of page " << pageNumber << endl; //kdDebug() << (const char*)pageText->textUTF8 << endl; @@ -249,14 +249,14 @@ void DjVuRenderer::drawPage(double resolution, RenderedDocumentPage* page) } -bool DjVuRenderer::setFile(const QString &fname, const KURL &) +bool DjVuRenderer::setFile(const TQString &fname, const KURL &) { #ifdef KF_DEBUG kdDebug() << "DjVuRenderer::setFile(" << fname << ") called" << endl; #endif // Wait for all access to this documentRenderer to finish - QMutexLocker locker( &mutex ); + TQMutexLocker locker( &mutex ); // If fname is the empty string, then this means: "close". if (fname.isEmpty()) { @@ -267,8 +267,8 @@ bool DjVuRenderer::setFile(const QString &fname, const KURL &) // Paranoid saftey checks: make sure the file actually exists, and // that it is a file, not a directory. Otherwise, show an error // message and exit.. - QFileInfo fi(fname); - QString filename = fi.absFilePath(); + TQFileInfo fi(fname); + TQString filename = fi.absFilePath(); if (!fi.exists() || fi.isDir()) { KMessageBox::error( parentWidget, i18n("<qt><strong>File error.</strong> The specified file '%1' does not exist.</qt>").arg(filename), @@ -353,12 +353,12 @@ void DjVuRenderer::getAnnotations(RenderedDocumentPage* page, GP<DjVuImage> djvu GRect rect = map[pos]->get_bound_rect(); - QRect hyperlinkRect((int)(rect.xmin*scaleX+0.5), (int)((djvuPage->get_height()-rect.ymax)*scaleY+0.5), + TQRect hyperlinkRect((int)(rect.xmin*scaleX+0.5), (int)((djvuPage->get_height()-rect.ymax)*scaleY+0.5), (int)(rect.width()*scaleX +0.5), (int)(rect.height()*scaleY+0.5)); - QString url((const char*)map[pos]->url); - QString target((const char*)map[pos]->target); - QString comment((const char*)map[pos]->comment); + TQString url((const char*)map[pos]->url); + TQString target((const char*)map[pos]->target); + TQString comment((const char*)map[pos]->comment); // Create an anchor for this link. if (!anchorList.contains(url)) @@ -418,7 +418,7 @@ bool DjVuRenderer::initializeDocument() pageSizes[i].setPageSize(w, h); } } - emit setStatusBarText(QString::null); + emit setStatusBarText(TQString::null); // We will also generate a list of hyperlink-anchors in the document. // So declare the existing lists empty. @@ -459,7 +459,7 @@ GP<DjVuTXT> DjVuRenderer::getText(PageNumber pageNumber) return 0; } -void DjVuRenderer::fillInText(RenderedDocumentPage* page, const GP<DjVuTXT>& text, DjVuTXT::Zone& zone, QSize& djvuPageSize) +void DjVuRenderer::fillInText(RenderedDocumentPage* page, const GP<DjVuTXT>& text, DjVuTXT::Zone& zone, TQSize& djvuPageSize) { if (zone.children.isempty()) { @@ -469,11 +469,11 @@ void DjVuRenderer::fillInText(RenderedDocumentPage* page, const GP<DjVuTXT>& tex double scaleX = pageWidth / (double)djvuPageSize.width(); double scaleY = pageHeight / (double)djvuPageSize.height(); - QString zoneString = QStringFromGString(text->textUTF8.substr(zone.text_start, zone.text_length)); + TQString zoneString = QStringFromGString(text->textUTF8.substr(zone.text_start, zone.text_length)); //kdDebug() << "zone text: " << zoneString << endl; - QRect textRect((int)(zone.rect.xmin*scaleX+0.5), (int)((djvuPageSize.height()-zone.rect.ymax)*scaleY+0.5), + TQRect textRect((int)(zone.rect.xmin*scaleX+0.5), (int)((djvuPageSize.height()-zone.rect.ymax)*scaleY+0.5), (int)(zone.rect.width()*scaleX+0.5), (int)(zone.rect.height()*scaleY+0.5)); //kdDebug() << "zone rect: " << textRect.x() << ", " << textRect.y() << ", " << textRect.width() << ", " << textRect.height() << endl; TextBox textBox(textRect, zoneString); @@ -545,7 +545,7 @@ bool DjVuRenderer::getPageInfo(GP<DjVuFile> file, int& width, int& height, int& void DjVuRenderer::getText(RenderedDocumentPage* page) { - QMutexLocker locker( &mutex ); + TQMutexLocker locker( &mutex ); int pageNumber = page->getPageNumber() - 1; GP<DjVuTXT> pageText = getText(pageNumber); @@ -560,37 +560,37 @@ void DjVuRenderer::getText(RenderedDocumentPage* page) if (ok) { - QSize djvuPageSize(pageWidth, pageHeight); + TQSize djvuPageSize(pageWidth, pageHeight); fillInText(page, pageText, pageText->page_zone, djvuPageSize); } } } -bool DjVuRenderer::convertToPSFile( DjVuToPS &converter, QString filename, QValueList<int> &pageList ) +bool DjVuRenderer::convertToPSFile( DjVuToPS &converter, TQString filename, TQValueList<int> &pageList ) { if (document == 0) { kdError(1223) << "DjVuRenderer::convertToPSFile(..) called when document was 0" << endl; return false; } - QMutexLocker locker( &mutex ); + TQMutexLocker locker( &mutex ); // Set up progress dialog KProgressDialog *pdialog = new KProgressDialog(parentWidget, "Printing-ProgressDialog", i18n("Printing..."), i18n("Preparing pages for printing..."), true); pdialog->setButtonText(i18n("Abort")); pdialog->showCancelButton(true); pdialog->progressBar()->setTotalSteps(pageList.size()); - pdialog->progressBar()->setFormat(QString::null); + pdialog->progressBar()->setFormat(TQString::null); // Open output file GURL outname = GURL::Filename::UTF8(GStringFromQString(filename)); GP<ByteStream> obs = ByteStream::create(outname, "w"); - QString pagename; - QValueList<int>::ConstIterator it = pageList.begin(); + TQString pagename; + TQValueList<int>::ConstIterator it = pageList.begin(); while (true) { - pagename += QString::number(*it); + pagename += TQString::number(*it); ++it; if (it == pageList.end()) break; @@ -630,14 +630,14 @@ void DjVuRenderer::deletePages(Q_UINT16 from, Q_UINT16 to) return; } - QMutexLocker locker( &mutex ); + TQMutexLocker locker( &mutex ); KProgressDialog *pdialog = 0; if (to-from > 9) { pdialog = new KProgressDialog(parentWidget, "Printing-ProgressDialog", i18n("Deleting pages..."), i18n("Please wait while pages are removed..."), true); pdialog->showCancelButton(false); pdialog->progressBar()->setTotalSteps(to-from+1); - pdialog->progressBar()->setFormat(QString::null); + pdialog->progressBar()->setFormat(TQString::null); pdialog->show(); kapp->processEvents(); } @@ -669,14 +669,14 @@ void DjVuRenderer::deletePages(Q_UINT16 from, Q_UINT16 to) } -bool DjVuRenderer::save(const QString &filename) +bool DjVuRenderer::save(const TQString &filename) { if (document == 0) { kdError() << "DjVuRenderer::save(..) called when document==0" << endl; return false; } - QMutexLocker locker( &mutex ); + TQMutexLocker locker( &mutex ); G_TRY { document->save_as(GURL::Filename::UTF8(GStringFromQString(filename)), true); @@ -688,7 +688,7 @@ bool DjVuRenderer::save(const QString &filename) document->save_as(GURL::Filename::UTF8(filename.ascii()), true); - if (QFile::exists(filename) == false) + if (TQFile::exists(filename) == false) return false; _isModified = false; diff --git a/kviewshell/plugins/djvu/djvurenderer.h b/kviewshell/plugins/djvu/djvurenderer.h index 40418c23..85b40626 100644 --- a/kviewshell/plugins/djvu/djvurenderer.h +++ b/kviewshell/plugins/djvu/djvurenderer.h @@ -25,7 +25,7 @@ #define _DJVURENDERER_H_ #include <kprogress.h> -#include <qpixmap.h> +#include <tqpixmap.h> #include "DjVuImage.h" #include "DjVuDocEditor.h" @@ -57,7 +57,7 @@ public: This constructor simply prints a message and calls the default constructor. */ - DjVuRenderer(QWidget* parent); + DjVuRenderer(TQWidget* parent); /** Destructor @@ -77,7 +77,7 @@ public: @param fname the name of the file that should be opened. */ - virtual bool setFile(const QString& fname, const KURL &); + virtual bool setFile(const TQString& fname, const KURL &); /** Rendering a page @param res resolution at which drawing should take place @@ -110,13 +110,13 @@ public: wasn't. The conversion can fail, for example, when the user aborts the operation. */ - bool convertToPSFile( DjVuToPS &converter, QString filename, QValueList<int> &pageList ); + bool convertToPSFile( DjVuToPS &converter, TQString filename, TQValueList<int> &pageList ); /** Deletes pages from the document */ void deletePages(Q_UINT16 from, Q_UINT16 to); /** Saves the file */ - bool save(const QString &filename); + bool save(const TQString &filename); private: /* This method is called after a document is loaded with @@ -131,7 +131,7 @@ private: GP<DjVuTXT> getText(PageNumber pageNumber); - void fillInText(RenderedDocumentPage* page, const GP<DjVuTXT>& text, DjVuTXT::Zone& zone, QSize& djvuPageSize); + void fillInText(RenderedDocumentPage* page, const GP<DjVuTXT>& text, DjVuTXT::Zone& zone, TQSize& djvuPageSize); GP<DjVuDocEditor> document; @@ -139,7 +139,7 @@ private: PostScript conversion */ static void printerInfoCallBack(int page_num, int page_count, int tot_pages, DjVuToPS::Stage, void *); - QPixmap pixmap; + TQPixmap pixmap; GP<ByteStream> PPMstream; }; diff --git a/kviewshell/plugins/djvu/kprintDialogPage_DJVUconversionoptions.cpp b/kviewshell/plugins/djvu/kprintDialogPage_DJVUconversionoptions.cpp index aea7d6b7..24b7dfbb 100644 --- a/kviewshell/plugins/djvu/kprintDialogPage_DJVUconversionoptions.cpp +++ b/kviewshell/plugins/djvu/kprintDialogPage_DJVUconversionoptions.cpp @@ -19,22 +19,22 @@ ***************************************************************************/ #include <klocale.h> -#include <qlayout.h> -#include <qcheckbox.h> -#include <qcombobox.h> -#include <qtooltip.h> -#include <qwhatsthis.h> +#include <tqlayout.h> +#include <tqcheckbox.h> +#include <tqcombobox.h> +#include <tqtooltip.h> +#include <tqwhatsthis.h> #include <kdebug.h> #include "kprintDialogPage_DJVUconversionoptions.h" #include "kprintDialogPage_DJVUconversionoptions_basewidget.h" -KPrintDialogPage_DJVUConversionOptions::KPrintDialogPage_DJVUConversionOptions( QWidget *parent, const char *name ) +KPrintDialogPage_DJVUConversionOptions::KPrintDialogPage_DJVUConversionOptions( TQWidget *parent, const char *name ) : KPrintDialogPage( parent, name ) { setTitle( i18n("DJVU to PS Conversion") ); - kprintDialogPage_pageoptions_baseLayout = new QVBoxLayout( this, 11, 6, "kprintDialogPage_pageoptions_baseLayout"); + kprintDialogPage_pageoptions_baseLayout = new TQVBoxLayout( this, 11, 6, "kprintDialogPage_pageoptions_baseLayout"); if (kprintDialogPage_pageoptions_baseLayout == 0) { kdError(1223) << "KPrintDialogPage_DJVUPageOptions::KPrintDialogPage_DJVUPageOptions() cannot create layout" << endl; return; @@ -48,12 +48,12 @@ KPrintDialogPage_DJVUConversionOptions::KPrintDialogPage_DJVUConversionOptions( -void KPrintDialogPage_DJVUConversionOptions::getOptions( QMap<QString,QString>& opts, bool ) +void KPrintDialogPage_DJVUConversionOptions::getOptions( TQMap<TQString,TQString>& opts, bool ) { if (wdg == 0) return; - opts["kde-kdjvu-pslevel"] = QString::number(wdg->psLevel->currentItem() + 1); + opts["kde-kdjvu-pslevel"] = TQString::number(wdg->psLevel->currentItem() + 1); kdDebug() << "getOptions: renderMode = " << wdg->renderMode->currentItem() << endl; switch (wdg->renderMode->currentItem()) @@ -73,7 +73,7 @@ void KPrintDialogPage_DJVUConversionOptions::getOptions( QMap<QString,QString>& } -void KPrintDialogPage_DJVUConversionOptions::setOptions( const QMap<QString,QString>& opts ) +void KPrintDialogPage_DJVUConversionOptions::setOptions( const TQMap<TQString,TQString>& opts ) { if (wdg == 0) return; @@ -92,7 +92,7 @@ void KPrintDialogPage_DJVUConversionOptions::setOptions( const QMap<QString,QStr } // Set render mode, taking "color" as default - QString op = opts["kde-kdjvu-rendermode"]; + TQString op = opts["kde-kdjvu-rendermode"]; if (op == "black-and-white") { wdg->renderMode->setCurrentItem(1); @@ -112,7 +112,7 @@ void KPrintDialogPage_DJVUConversionOptions::setOptions( const QMap<QString,QStr } -bool KPrintDialogPage_DJVUConversionOptions::isValid( QString& ) +bool KPrintDialogPage_DJVUConversionOptions::isValid( TQString& ) { return true; } diff --git a/kviewshell/plugins/djvu/kprintDialogPage_DJVUconversionoptions.h b/kviewshell/plugins/djvu/kprintDialogPage_DJVUconversionoptions.h index 9e3faa90..c1ec4b3c 100644 --- a/kviewshell/plugins/djvu/kprintDialogPage_DJVUconversionoptions.h +++ b/kviewshell/plugins/djvu/kprintDialogPage_DJVUconversionoptions.h @@ -34,16 +34,16 @@ class kprintDialogPage_DJVUconversionoptions_basewidget; class KPrintDialogPage_DJVUConversionOptions : public KPrintDialogPage { public: - KPrintDialogPage_DJVUConversionOptions( QWidget *parent = 0, const char *name = 0 ); + KPrintDialogPage_DJVUConversionOptions( TQWidget *parent = 0, const char *name = 0 ); - void getOptions( QMap<QString,QString>& opts, bool incldef = false ); - void setOptions( const QMap<QString,QString>& opts ); - bool isValid( QString& msg ); + void getOptions( TQMap<TQString,TQString>& opts, bool incldef = false ); + void setOptions( const TQMap<TQString,TQString>& opts ); + bool isValid( TQString& msg ); kprintDialogPage_DJVUconversionoptions_basewidget* wdg; private: - QVBoxLayout* kprintDialogPage_pageoptions_baseLayout; + TQVBoxLayout* kprintDialogPage_pageoptions_baseLayout; }; diff --git a/kviewshell/plugins/djvu/kprintDialogPage_DJVUpageoptions.cpp b/kviewshell/plugins/djvu/kprintDialogPage_DJVUpageoptions.cpp index cd77fa0e..e6872648 100644 --- a/kviewshell/plugins/djvu/kprintDialogPage_DJVUpageoptions.cpp +++ b/kviewshell/plugins/djvu/kprintDialogPage_DJVUpageoptions.cpp @@ -19,16 +19,16 @@ ***************************************************************************/ #include <klocale.h> -#include <qbuttongroup.h> -#include <qcheckbox.h> -#include <qlayout.h> -#include <qtooltip.h> -#include <qwhatsthis.h> +#include <tqbuttongroup.h> +#include <tqcheckbox.h> +#include <tqlayout.h> +#include <tqtooltip.h> +#include <tqwhatsthis.h> #include <kdebug.h> #include "kprintDialogPage_DJVUpageoptions.h" -KPrintDialogPage_DJVUPageOptions::KPrintDialogPage_DJVUPageOptions( QWidget *parent, const char *name ) +KPrintDialogPage_DJVUPageOptions::KPrintDialogPage_DJVUPageOptions( TQWidget *parent, const char *name ) : KPrintDialogPage( parent, name ) { setTitle( i18n("Page Size & Placement") ); @@ -38,17 +38,17 @@ KPrintDialogPage_DJVUPageOptions::KPrintDialogPage_DJVUPageOptions( QWidget *par checkBox_fitpage = 0; - kprintDialogPage_pageoptions_baseLayout = new QVBoxLayout( this, 11, 6, "kprintDialogPage_pageoptions_baseLayout"); + kprintDialogPage_pageoptions_baseLayout = new TQVBoxLayout( this, 11, 6, "kprintDialogPage_pageoptions_baseLayout"); if (kprintDialogPage_pageoptions_baseLayout == 0) { kdError(1223) << "KPrintDialogPage_DJVUPageOptions::KPrintDialogPage_DJVUPageOptions() cannot create layout" << endl; return; } - checkBox_rotate = new QCheckBox( this, "checkBox_rotate" ); + checkBox_rotate = new TQCheckBox( this, "checkBox_rotate" ); if (checkBox_rotate != 0) { checkBox_rotate->setText( i18n( "Automatically choose landscape or portrait orientation" ) ); - QToolTip::add( checkBox_rotate, i18n( "If this option is enabled, some pages might be rotated to better fit the paper size." ) ); - QWhatsThis::add( checkBox_rotate, i18n( "<qt><p>If this option is enabled, landscape or portrait orientation are automatically chosen on a " + TQToolTip::add( checkBox_rotate, i18n( "If this option is enabled, some pages might be rotated to better fit the paper size." ) ); + TQWhatsThis::add( checkBox_rotate, i18n( "<qt><p>If this option is enabled, landscape or portrait orientation are automatically chosen on a " "page-by-page basis. This makes better use of the paper and gives more visually-" "appealing printouts.</p>" "<p><b>Note:</b> This option overrides the Portrait/Landscape option chosen in the printer " @@ -57,11 +57,11 @@ KPrintDialogPage_DJVUPageOptions::KPrintDialogPage_DJVUPageOptions( QWidget *par kprintDialogPage_pageoptions_baseLayout->addWidget( checkBox_rotate ); } - checkBox_fitpage = new QCheckBox( this, "checkBox_shrink" ); + checkBox_fitpage = new TQCheckBox( this, "checkBox_shrink" ); if (checkBox_fitpage != 0) { checkBox_fitpage->setText( i18n( "Scale pages to fit paper size" ) ); - QToolTip::add( checkBox_fitpage, i18n( "If this option is enabled, all pages will be scaled to optimally fit the printer's paper size." ) ); - QWhatsThis::add( checkBox_fitpage, i18n( "<qt><p>If this option is enabled, all pages will be scaled to optimally fit the printer's " + TQToolTip::add( checkBox_fitpage, i18n( "If this option is enabled, all pages will be scaled to optimally fit the printer's paper size." ) ); + TQWhatsThis::add( checkBox_fitpage, i18n( "<qt><p>If this option is enabled, all pages will be scaled to optimally fit the printer's " "paper size.</p>" "<p><b>Note:</b> If this option is enabled, and if the pages in your document have different sizes, " "then different pages might be scaled by different scaling factors.</p></qt>" ) ); @@ -70,13 +70,13 @@ KPrintDialogPage_DJVUPageOptions::KPrintDialogPage_DJVUPageOptions( QWidget *par kprintDialogPage_pageoptions_baseLayout->addStretch(); - resize( QSize(319, 166).expandedTo(minimumSizeHint()) ); + resize( TQSize(319, 166).expandedTo(minimumSizeHint()) ); clearWState( WState_Polished ); } -void KPrintDialogPage_DJVUPageOptions::getOptions( QMap<QString,QString>& opts, bool ) +void KPrintDialogPage_DJVUPageOptions::getOptions( TQMap<TQString,TQString>& opts, bool ) { // Save options, taking default values into consideration. Warning: // The default values are also coded into setOptions() and @@ -96,13 +96,13 @@ void KPrintDialogPage_DJVUPageOptions::getOptions( QMap<QString,QString>& opts, } -void KPrintDialogPage_DJVUPageOptions::setOptions( const QMap<QString,QString>& opts ) +void KPrintDialogPage_DJVUPageOptions::setOptions( const TQMap<TQString,TQString>& opts ) { // Warning: All default values are also coded into getOptions() and // kmultipage::print(..). // same for rotation - QString op = opts[ "kde-kviewshell-rotatepage" ]; + TQString op = opts[ "kde-kviewshell-rotatepage" ]; if (checkBox_rotate != 0) checkBox_rotate->setChecked( op != "false" ); @@ -113,7 +113,7 @@ void KPrintDialogPage_DJVUPageOptions::setOptions( const QMap<QString,QString>& } -bool KPrintDialogPage_DJVUPageOptions::isValid( QString& ) +bool KPrintDialogPage_DJVUPageOptions::isValid( TQString& ) { return true; } diff --git a/kviewshell/plugins/djvu/kprintDialogPage_DJVUpageoptions.h b/kviewshell/plugins/djvu/kprintDialogPage_DJVUpageoptions.h index 0121c1a0..5bb5833e 100644 --- a/kviewshell/plugins/djvu/kprintDialogPage_DJVUpageoptions.h +++ b/kviewshell/plugins/djvu/kprintDialogPage_DJVUpageoptions.h @@ -14,8 +14,8 @@ #include <kdeprint/kprintdialogpage.h> -class QVBoxLayout; -class QCheckBox; +class TQVBoxLayout; +class TQCheckBox; // This is a fairly standard KPrintDialogPage that allows the user to @@ -25,17 +25,17 @@ class QCheckBox; class KPrintDialogPage_DJVUPageOptions : public KPrintDialogPage { public: - KPrintDialogPage_DJVUPageOptions( QWidget *parent = 0, const char *name = 0 ); + KPrintDialogPage_DJVUPageOptions( TQWidget *parent = 0, const char *name = 0 ); - void getOptions( QMap<QString,QString>& opts, bool incldef = false ); - void setOptions( const QMap<QString,QString>& opts ); - bool isValid( QString& msg ); + void getOptions( TQMap<TQString,TQString>& opts, bool incldef = false ); + void setOptions( const TQMap<TQString,TQString>& opts ); + bool isValid( TQString& msg ); - QCheckBox* checkBox_rotate; - QCheckBox* checkBox_fitpage; + TQCheckBox* checkBox_rotate; + TQCheckBox* checkBox_fitpage; private: - QVBoxLayout* kprintDialogPage_pageoptions_baseLayout; + TQVBoxLayout* kprintDialogPage_pageoptions_baseLayout; }; diff --git a/kviewshell/plugins/djvu/pageRangeWidget.cpp b/kviewshell/plugins/djvu/pageRangeWidget.cpp index 338624b8..ddff8299 100644 --- a/kviewshell/plugins/djvu/pageRangeWidget.cpp +++ b/kviewshell/plugins/djvu/pageRangeWidget.cpp @@ -23,7 +23,7 @@ #include "pageRangeWidget.h" -PageRangeWidget::PageRangeWidget( Q_UINT16 _from, Q_UINT16 _to, Q_UINT16 _current, QWidget *parent, const char *name) : PageRangeWidget_base(parent, name) +PageRangeWidget::PageRangeWidget( Q_UINT16 _from, Q_UINT16 _to, Q_UINT16 _current, TQWidget *parent, const char *name) : PageRangeWidget_base(parent, name) { // Paranoid security checks if ((from == 0) || (to == 0)) @@ -41,8 +41,8 @@ PageRangeWidget::PageRangeWidget( Q_UINT16 _from, Q_UINT16 _to, Q_UINT16 _curren _current = _to; } - connect(from, SIGNAL(valueChanged(int)), this, SLOT(fromValueChanged(int))); - connect(to, SIGNAL(valueChanged(int)), this, SLOT(toValueChanged(int))); + connect(from, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(fromValueChanged(int))); + connect(to, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(toValueChanged(int))); from->setRange(_from, _to); from->setValue(_current); diff --git a/kviewshell/plugins/djvu/pageRangeWidget.h b/kviewshell/plugins/djvu/pageRangeWidget.h index ca9b4a00..3ddb497b 100644 --- a/kviewshell/plugins/djvu/pageRangeWidget.h +++ b/kviewshell/plugins/djvu/pageRangeWidget.h @@ -31,7 +31,7 @@ class PageRangeWidget : public PageRangeWidget_base Q_OBJECT public: - PageRangeWidget( Q_UINT16 _from, Q_UINT16 _to, Q_UINT16 _current, QWidget *parent = 0, const char *name = 0 ); + PageRangeWidget( Q_UINT16 _from, Q_UINT16 _to, Q_UINT16 _current, TQWidget *parent = 0, const char *name = 0 ); Q_UINT16 getFrom() const {return (from == 0) ? 0 : from->value(); } Q_UINT16 getTo() const {return (to == 0) ? 0 : to->value(); } diff --git a/kviewshell/renderedDocumentPage.cpp b/kviewshell/renderedDocumentPage.cpp index c5f0d361..1d535bc5 100644 --- a/kviewshell/renderedDocumentPage.cpp +++ b/kviewshell/renderedDocumentPage.cpp @@ -21,7 +21,7 @@ RenderedDocumentPage::RenderedDocumentPage() textBoxList.reserve(250); pageNr = 0; isEmpty = true; - pageText = QString::null; + pageText = TQString::null; } @@ -46,23 +46,23 @@ void RenderedDocumentPage::clear() textBoxList.clear(); hyperLinkList.clear(); - pageText = QString::null; + pageText = TQString::null; isEmpty = true; } -QRegion RenderedDocumentPage::selectedRegion(const TextSelection& selection) +TQRegion RenderedDocumentPage::selectedRegion(const TextSelection& selection) { if (selection.isEmpty() || selection.getPageNumber() != pageNr) - return QRegion(); + return TQRegion(); int startIndex = selection.getSelectedTextStart(); int endIndex = selection.getSelectedTextEnd(); - QValueVector<QRect> wordBox; + TQValueVector<TQRect> wordBox; - QRect currentWordBox; + TQRect currentWordBox; //unsigned int currentBaseline = 0; // Merge character boxes into boxes containing complete words. @@ -93,12 +93,12 @@ QRegion RenderedDocumentPage::selectedRegion(const TextSelection& selection) // we still need to store the last word wordBox.push_back(currentWordBox); - QValueVector<QRect> lineBox; + TQValueVector<TQRect> lineBox; // Merge word boxes into boxes containing whole lines. // We start a new line if we encounter a wordbox which does not // vertically overlap which the current lineBox. - QRect currentLineBox; + TQRect currentLineBox; for (unsigned int i = 0; i < wordBox.size(); i++) { @@ -143,17 +143,17 @@ QRegion RenderedDocumentPage::selectedRegion(const TextSelection& selection) } // Add the lineboxes to a Region - QRegion selectedRegion; + TQRegion selectedRegion; for (unsigned int i = 0; i < lineBox.size(); i++) { - selectedRegion += QRegion(lineBox[i]); + selectedRegion += TQRegion(lineBox[i]); } return selectedRegion; } -TextSelection RenderedDocumentPage::select(const QRect& selectedRectangle) +TextSelection RenderedDocumentPage::select(const TQRect& selectedRectangle) { int selectedTextStart = -1; int selectedTextEnd = -1; @@ -172,7 +172,7 @@ TextSelection RenderedDocumentPage::select(const QRect& selectedRectangle) TextSelection selection; - QString selectedText; + TQString selectedText; if (selectedTextStart != -1) { @@ -187,7 +187,7 @@ TextSelection RenderedDocumentPage::select(const QRect& selectedRectangle) return selection; } -TextSelection RenderedDocumentPage::select(const QPoint& point) +TextSelection RenderedDocumentPage::select(const TQPoint& point) { int selectedTextStart = -1; int selectedTextEnd = -1; @@ -204,7 +204,7 @@ TextSelection RenderedDocumentPage::select(const QPoint& point) TextSelection selection; - QString selectedText; + TQString selectedText; if (selectedTextStart != -1) { @@ -216,12 +216,12 @@ TextSelection RenderedDocumentPage::select(const QPoint& point) return selection; } -TextSelection RenderedDocumentPage::find(const QString& str, int index, bool caseSensitive) +TextSelection RenderedDocumentPage::find(const TQString& str, int index, bool caseSensitive) { if (pageText.isNull()) { // Create the pageText by joining all entries of textBoxList. - for (QValueVector<TextBox>::Iterator i = textBoxList.begin(); i != textBoxList.end(); i++) + for (TQValueVector<TextBox>::Iterator i = textBoxList.begin(); i != textBoxList.end(); i++) { pageText = pageText + i->text; } @@ -291,7 +291,7 @@ TextSelection RenderedDocumentPage::find(const QString& str, int index, bool cas } -TextSelection RenderedDocumentPage::findRev(const QString& str, int index, bool caseSensitive) +TextSelection RenderedDocumentPage::findRev(const TQString& str, int index, bool caseSensitive) { // Negative index means we start the search at the end of the text. if (index < 0) @@ -302,7 +302,7 @@ TextSelection RenderedDocumentPage::findRev(const QString& str, int index, bool if (pageText.isNull()) { // Create the pageText by joining all entries of textBoxList. - for (QValueVector<TextBox>::Iterator i = textBoxList.begin(); i != textBoxList.end(); i++) + for (TQValueVector<TextBox>::Iterator i = textBoxList.begin(); i != textBoxList.end(); i++) { pageText = pageText + i->text; } diff --git a/kviewshell/renderedDocumentPage.h b/kviewshell/renderedDocumentPage.h index f91144cc..979f46e8 100644 --- a/kviewshell/renderedDocumentPage.h +++ b/kviewshell/renderedDocumentPage.h @@ -13,14 +13,14 @@ #include "pageNumber.h" -#include <qobject.h> -#include <qstring.h> -#include <qvaluevector.h> +#include <tqobject.h> +#include <tqstring.h> +#include <tqvaluevector.h> class Hyperlink; -class QPainter; -class QRect; -class QRegion; +class TQPainter; +class TQRect; +class TQRegion; class TextBox; class TextSelection; @@ -44,9 +44,9 @@ class TextSelection; mouse or for the "export as text..." functionality - the implementations of the documentPage will also contain a - QPaintDevice, onto which the graphical representation of the page - is rendered. This could for instance be a QPixmap, if the page is - to be displayed on a computer screen, or a QPrinter for printing. + TQPaintDevice, onto which the graphical representation of the page + is rendered. This could for instance be a TQPixmap, if the page is + to be displayed on a computer screen, or a TQPrinter for printing. The kviewshell program uses the documentPage class in the following manner: first, it is constructed, the page number is @@ -54,7 +54,7 @@ class TextSelection; the setPageNumber() method. After this, the documentRenderer.drawPage() method of an implementation of the documentRenderer is used to render a graphical representation into - the QPaintDevice at a given resolution, and to fill the + the TQPaintDevice at a given resolution, and to fill the (source-)hyperlink and text vectors, which are also resolution-dependent. After the data has been used, the documentPage is clear()ed, perhaps a new page number set, and @@ -95,11 +95,11 @@ class RenderedDocumentPage : public QObject /** \brief Get paint device This method is used for instance by the documentRenderer.drawPage() - method to draw on the page. It returns a pointer to a QPainter (in - most implementation a painter on either a QPixmap, or a - QPrinter). The pointer returned points to an active QPainter and is + method to draw on the page. It returns a pointer to a TQPainter (in + most implementation a painter on either a TQPixmap, or a + TQPrinter). The pointer returned points to an active TQPainter and is valid as long as *this RenderedDocumentPage exists. The pointer - returned must not be deleted nor should QPainter::end() be + returned must not be deleted nor should TQPainter::end() be called. Instead, the method returnPainter() must be called as soon as drawing is finished. @@ -107,7 +107,7 @@ class RenderedDocumentPage : public QObject @code RenderedDocumentPage rdp; - QPainter *paint = rdp.getPainter() + TQPainter *paint = rdp.getPainter() if (paint != 0) { <Do some painting, don't call paint->end() > @@ -121,11 +121,11 @@ class RenderedDocumentPage : public QObject results. Do not delete a renderedDocumentPage when you still hold a pointer. Call returnPainter() first. - @returns A pointer to a QPainter (in most implementation a painter - on either a QPixmap, or a QPrinter), or NULL, if painting is not - possible. The QPainter object is owned by the RenderedDocumentPage. + @returns A pointer to a TQPainter (in most implementation a painter + on either a TQPixmap, or a TQPrinter), or NULL, if painting is not + possible. The TQPainter object is owned by the RenderedDocumentPage. */ - virtual QPainter *getPainter() = 0; + virtual TQPainter *getPainter() = 0; /** \brief Returns a pointer to the paint device. @@ -137,13 +137,13 @@ class RenderedDocumentPage : public QObject @warning Returning a pointer twice, or returning arbitrary pointers will lead to a segfault. - @param pt a pointer to a QPainter, as returned by the getPainter() + @param pt a pointer to a TQPainter, as returned by the getPainter() method */ - virtual void returnPainter(QPainter *pt) = 0; + virtual void returnPainter(TQPainter *pt) = 0; /** \brief Returns the size of the page in pixel. */ - virtual QSize size() = 0; + virtual TQSize size() = 0; /** \brief Returns the width of the page in pixel. @@ -183,26 +183,26 @@ class RenderedDocumentPage : public QObject kviewshell e.g. for selecting text with the mouse or for the "export as text..." functionality. */ - QValueVector<TextBox> textBoxList; + TQValueVector<TextBox> textBoxList; /** \brief Calculates the text selected by the given rectangle. */ - TextSelection select(const QRect&); + TextSelection select(const TQRect&); /** \brief Selects the character which lies at the given point. */ - TextSelection select(const QPoint&); + TextSelection select(const TQPoint&); - QRegion selectedRegion(const TextSelection& selection); + TQRegion selectedRegion(const TextSelection& selection); /** Finds the first occurence of str starting by the current index. If the text is found a corresponding TextSelection is returned. If the text is not found a empty selection is returned. */ - TextSelection find(const QString& str, int index = 0, bool caseSensitive = true); + TextSelection find(const TQString& str, int index = 0, bool caseSensitive = true); /** Finds the first occurence of str starting by the current index searching backwards. If the text is found a corresponding TextSelection is returned. If the text is not found a empty selection is returned. If index < 0 start the search at the end of the page. */ - TextSelection findRev(const QString& str, int index = 0, bool cs = true); + TextSelection findRev(const TQString& str, int index = 0, bool cs = true); /** \brief Hyperlinks on the document page @@ -211,7 +211,7 @@ class RenderedDocumentPage : public QObject method. It is used in kviewshell so users can use the mouse to navigate in the document through hyperlinks. */ - QValueVector<Hyperlink> hyperLinkList; + TQValueVector<Hyperlink> hyperLinkList; // set to 'false' in the constructor, set to 'true' by the renderer, // if something really has been rendered @@ -234,7 +234,7 @@ class RenderedDocumentPage : public QObject */ PageNumber pageNr; - QString pageText; + TQString pageText; }; diff --git a/kviewshell/renderedDocumentPagePixmap.cpp b/kviewshell/renderedDocumentPagePixmap.cpp index aaa06878..f7f91ed9 100644 --- a/kviewshell/renderedDocumentPagePixmap.cpp +++ b/kviewshell/renderedDocumentPagePixmap.cpp @@ -22,7 +22,7 @@ #include <kimageeffect.h> #include <kdebug.h> -#include <qimage.h> +#include <tqimage.h> #include "kvsprefs.h" #include "renderedDocumentPagePixmap.h" @@ -38,39 +38,39 @@ RenderedDocumentPagePixmap::~RenderedDocumentPagePixmap() } -QPainter* RenderedDocumentPagePixmap::getPainter() +TQPainter* RenderedDocumentPagePixmap::getPainter() { if (paintingActive()) { kdError(1223) << "RenderedDocumentPagePixmap::getPainter() called when painting was active" << endl; return 0; } else - return new QPainter(this); + return new TQPainter(this); } void RenderedDocumentPagePixmap::resize(int width, int height) { - QPixmap::resize(width, height); + TQPixmap::resize(width, height); if(_accessiblePixmap) _accessiblePixmap->resize(width, height); dirty = true; } -void RenderedDocumentPagePixmap::resize(const QSize& size) +void RenderedDocumentPagePixmap::resize(const TQSize& size) { resize(size.width(), size.height()); } -QPixmap RenderedDocumentPagePixmap::accessiblePixmap() +TQPixmap RenderedDocumentPagePixmap::accessiblePixmap() { if (!_accessiblePixmap || dirty) { - QImage backImage = this->convertToImage(); + TQImage backImage = this->convertToImage(); switch (KVSPrefs::renderMode()) { case KVSPrefs::EnumRenderMode::Inverted: - // Invert image pixels using QImage internal function + // Invert image pixels using TQImage internal function backImage.invertPixels(false); break; case KVSPrefs::EnumRenderMode::Recolor: @@ -105,7 +105,7 @@ QPixmap RenderedDocumentPagePixmap::accessiblePixmap() break; } if (!_accessiblePixmap) - _accessiblePixmap = new QPixmap(width(), height()); + _accessiblePixmap = new TQPixmap(width(), height()); _accessiblePixmap->convertFromImage(backImage); dirty = false; diff --git a/kviewshell/renderedDocumentPagePixmap.h b/kviewshell/renderedDocumentPagePixmap.h index 112650ba..5e6e79fb 100644 --- a/kviewshell/renderedDocumentPagePixmap.h +++ b/kviewshell/renderedDocumentPagePixmap.h @@ -13,8 +13,8 @@ #include "renderedDocumentPage.h" -#include <qpainter.h> -#include <qpixmap.h> +#include <tqpainter.h> +#include <tqpixmap.h> // This class contains everything documentRenderer needs to know @@ -29,28 +29,28 @@ public: virtual ~RenderedDocumentPagePixmap(); /** Returns a pointer to the paintDevice (in most implementation - either a QPixmap, or a QPrinter). The pointer returned is valid + either a TQPixmap, or a TQPrinter). The pointer returned is valid as long as *this RenderedDocumentPage exists. This method is used by the renderer to draw on the page. */ - virtual QPainter *getPainter(); + virtual TQPainter *getPainter(); - /** This implementation delete the QPainter *pt (and thereby initiates the drawing) */ - virtual void returnPainter(QPainter *pt) {delete pt;} + /** This implementation delete the TQPainter *pt (and thereby initiates the drawing) */ + virtual void returnPainter(TQPainter *pt) {delete pt;} - QPixmap accessiblePixmap(); + TQPixmap accessiblePixmap(); - void resize(const QSize& size); + void resize(const TQSize& size); void resize(int width, int height); - virtual QSize size() { return QPixmap::size(); } - virtual int width() { return QPixmap::width(); } - virtual int height() { return QPixmap::height(); } + virtual TQSize size() { return TQPixmap::size(); } + virtual int width() { return TQPixmap::width(); } + virtual int height() { return TQPixmap::height(); } /** Returns the amount of memory used by this pixmap */ unsigned int memory(); private: - QPixmap* _accessiblePixmap; + TQPixmap* _accessiblePixmap; /** true if _accessiblePixmap needs updateing */ bool dirty; }; diff --git a/kviewshell/renderedDocumentPagePrinter.cpp b/kviewshell/renderedDocumentPagePrinter.cpp index 6e0ba57a..ff5171a0 100644 --- a/kviewshell/renderedDocumentPagePrinter.cpp +++ b/kviewshell/renderedDocumentPagePrinter.cpp @@ -21,8 +21,8 @@ #include <config.h> #include <kdebug.h> -#include <qguardedptr.h> -#include <qpaintdevicemetrics.h> +#include <tqguardedptr.h> +#include <tqpaintdevicemetrics.h> #include <kprinter.h> #include "renderedDocumentPagePrinter.h" @@ -37,17 +37,17 @@ RenderedDocumentPagePrinter::RenderedDocumentPagePrinter(KPrinter *kp) return; } - printerPainter = new QPainter(printer); + printerPainter = new TQPainter(printer); } -QSize RenderedDocumentPagePrinter::size() +TQSize RenderedDocumentPagePrinter::size() { if (printer == 0) { kdError(1223) << "RenderedDocumentPagePrinter::size() called with printer == 0" << endl; - return QSize(0,0); + return TQSize(0,0); } - QPaintDeviceMetrics pdm( printer ); - return QSize(pdm.width(), pdm.height()); + TQPaintDeviceMetrics pdm( printer ); + return TQSize(pdm.width(), pdm.height()); } diff --git a/kviewshell/renderedDocumentPagePrinter.h b/kviewshell/renderedDocumentPagePrinter.h index 44bdc6d2..f0b78f91 100644 --- a/kviewshell/renderedDocumentPagePrinter.h +++ b/kviewshell/renderedDocumentPagePrinter.h @@ -12,7 +12,7 @@ #define _rendereddocumentpageprinter_h_ #include "renderedDocumentPage.h" -#include <qpainter.h> +#include <tqpainter.h> class KPrinter; @@ -25,21 +25,21 @@ public: virtual ~RenderedDocumentPagePrinter() { delete printerPainter; } /** Returns a pointer to the paintDevice, in this implementation - either a QPrinter. The pointer returned is valid as long as + either a TQPrinter. The pointer returned is valid as long as *this RenderedDocumentPage exists. This method is used by the renderer to draw on the page. */ - virtual QPainter *getPainter() { return printerPainter; } + virtual TQPainter *getPainter() { return printerPainter; } - virtual QSize size(); + virtual TQSize size(); /** This method does nothing. In particular, it does NOT delete the - QPainter. The QPainter is deleted automatically when this + TQPainter. The TQPainter is deleted automatically when this RenderedDocumentPagePrinter is destructed. */ - virtual void returnPainter(QPainter *) {;} + virtual void returnPainter(TQPainter *) {;} private: KPrinter *printer; - QPainter *printerPainter; + TQPainter *printerPainter; }; diff --git a/kviewshell/searchWidget.cpp b/kviewshell/searchWidget.cpp index 7c4422e6..27ca42f8 100644 --- a/kviewshell/searchWidget.cpp +++ b/kviewshell/searchWidget.cpp @@ -20,12 +20,12 @@ #include <config.h> -#include <qlabel.h> -#include <qpushbutton.h> -#include <qcheckbox.h> -#include <qlayout.h> -#include <qtooltip.h> -#include <qwhatsthis.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqcheckbox.h> +#include <tqlayout.h> +#include <tqtooltip.h> +#include <tqwhatsthis.h> #include <kdebug.h> #include <kiconloader.h> @@ -36,20 +36,20 @@ #include "searchWidget.h" -SearchWidget::SearchWidget(QWidget* parent, const char* name, WFlags fl) - : QWidget(parent, name, fl) +SearchWidget::SearchWidget(TQWidget* parent, const char* name, WFlags fl) + : TQWidget(parent, name, fl) { setName("SearchWidget"); - setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); + setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::Fixed); - layout = new QHBoxLayout(this, 4, 6, "SearchWidgetLayout"); + layout = new TQHBoxLayout(this, 4, 6, "SearchWidgetLayout"); - stopButton = new QPushButton(this, "stopButton"); + stopButton = new TQPushButton(this, "stopButton"); stopButton->setPixmap(KGlobal::iconLoader()->loadIcon("stop", KIcon::Small, KIcon::SizeSmall)); layout->addWidget(stopButton); - searchLabel = new QLabel(this, "searchLabel"); + searchLabel = new TQLabel(this, "searchLabel"); searchLabel->setText(i18n("Search:")); layout->addWidget(searchLabel); @@ -58,26 +58,26 @@ SearchWidget::SearchWidget(QWidget* parent, const char* name, WFlags fl) searchLabel->setBuddy(searchText); - findPrevButton = new QPushButton(this, "findPrevButton"); + findPrevButton = new TQPushButton(this, "findPrevButton"); findPrevButton->setPixmap(KGlobal::iconLoader()->loadIcon("back", KIcon::NoGroup, KIcon::SizeSmall)); - QToolTip::add(findPrevButton, i18n("Find previous")); + TQToolTip::add(findPrevButton, i18n("Find previous")); layout->addWidget(findPrevButton); - findNextButton = new QPushButton(this, "findNextButton"); + findNextButton = new TQPushButton(this, "findNextButton"); findNextButton->setPixmap(KGlobal::iconLoader()->loadIcon("forward", KIcon::NoGroup, KIcon::SizeSmall)); - QToolTip::add(findNextButton, i18n("Find next")); + TQToolTip::add(findNextButton, i18n("Find next")); layout->addWidget(findNextButton); - caseSensitiveCheckBox = new QCheckBox(this, "caseSensitiveCheckBox"); + caseSensitiveCheckBox = new TQCheckBox(this, "caseSensitiveCheckBox"); caseSensitiveCheckBox->setText(i18n("Case sensitive")); layout->addWidget(caseSensitiveCheckBox); - connect(stopButton, SIGNAL(clicked()), this, SIGNAL(stopSearch())); + connect(stopButton, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(stopSearch())); - connect(findNextButton, SIGNAL(clicked()), this, SIGNAL(findNextText())); - connect(findPrevButton, SIGNAL(clicked()), this, SIGNAL(findPrevText())); + connect(findNextButton, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(findNextText())); + connect(findPrevButton, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(findPrevText())); - connect(searchText, SIGNAL(textChanged(const QString&)), this, SLOT(textChanged())); + connect(searchText, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(textChanged())); textChanged(); } @@ -86,7 +86,7 @@ SearchWidget::~SearchWidget() { } -QString SearchWidget::getText() const +TQString SearchWidget::getText() const { return searchText->text(); } @@ -109,14 +109,14 @@ void SearchWidget::show() { searchText->setEnabled(true); searchText->selectAll(); - QWidget::show(); + TQWidget::show(); emit searchEnabled(!searchText->text().isEmpty()); } void SearchWidget::hide() { searchText->setEnabled(false); - QWidget::hide(); + TQWidget::hide(); } void SearchWidget::setFocus() @@ -124,7 +124,7 @@ void SearchWidget::setFocus() searchText->setFocus(); } -void SearchWidget::keyPressEvent(QKeyEvent* e) +void SearchWidget::keyPressEvent(TQKeyEvent* e) { if (e->key() == Qt::Key_Escape) emit stopSearch(); diff --git a/kviewshell/searchWidget.h b/kviewshell/searchWidget.h index 49b2c5cb..8875597d 100644 --- a/kviewshell/searchWidget.h +++ b/kviewshell/searchWidget.h @@ -22,24 +22,24 @@ #ifndef SEARCHWIDGET_H #define SEARCHWIDGET_H -#include <qwidget.h> +#include <tqwidget.h> -class QHBoxLayout; -class QLabel; +class TQHBoxLayout; +class TQLabel; class KLineEdit; -class QPushButton; -class QCheckBox; -class QString; +class TQPushButton; +class TQCheckBox; +class TQString; class SearchWidget : public QWidget { Q_OBJECT public: - SearchWidget(QWidget* parent = 0, const char* name = 0, WFlags fl = 0); + SearchWidget(TQWidget* parent = 0, const char* name = 0, WFlags fl = 0); ~SearchWidget(); - QString getText() const; + TQString getText() const; bool caseSensitive() const; public slots: @@ -54,20 +54,20 @@ signals: void stopSearch(); protected: - virtual void keyPressEvent(QKeyEvent*); + virtual void keyPressEvent(TQKeyEvent*); private slots: void textChanged(); private: - QPushButton* stopButton; - QLabel* searchLabel; + TQPushButton* stopButton; + TQLabel* searchLabel; KLineEdit* searchText; - QPushButton* findNextButton; - QPushButton* findPrevButton; - QCheckBox* caseSensitiveCheckBox; + TQPushButton* findNextButton; + TQPushButton* findPrevButton; + TQCheckBox* caseSensitiveCheckBox; - QHBoxLayout* layout; + TQHBoxLayout* layout; }; #endif diff --git a/kviewshell/selection.cpp b/kviewshell/selection.cpp index be288fe0..83b9b5db 100644 --- a/kviewshell/selection.cpp +++ b/kviewshell/selection.cpp @@ -8,18 +8,18 @@ #include <config.h> -#include <qapplication.h> -#include <qclipboard.h> +#include <tqapplication.h> +#include <tqclipboard.h> #include "selection.h" TextSelection::TextSelection() : page(PageNumber::invalidPage), - selectedText(QString::null) + selectedText(TQString::null) {} -void TextSelection::set(const PageNumber& pageNr, Q_INT32 start, Q_INT32 end, const QString& text) +void TextSelection::set(const PageNumber& pageNr, Q_INT32 start, Q_INT32 end, const TQString& text) { page = pageNr; selectedTextStart = start; @@ -27,11 +27,11 @@ void TextSelection::set(const PageNumber& pageNr, Q_INT32 start, Q_INT32 end, co if (page != 0) selectedText = text; else - selectedText = QString::null; + selectedText = TQString::null; if (page != 0) { - QApplication::clipboard()->setSelectionMode(true); - QApplication::clipboard()->setText(selectedText); + TQApplication::clipboard()->setSelectionMode(true); + TQApplication::clipboard()->setText(selectedText); } } @@ -53,14 +53,14 @@ bool TextSelection::operator!= (const TextSelection& s) const void TextSelection::copyText() const { if (!isEmpty()) { - QApplication::clipboard()->setSelectionMode(false); - QApplication::clipboard()->setText(selectedText); + TQApplication::clipboard()->setSelectionMode(false); + TQApplication::clipboard()->setText(selectedText); } } void TextSelection::clear() { - set(0, -1, -1, QString::null); + set(0, -1, -1, TQString::null); } diff --git a/kviewshell/selection.h b/kviewshell/selection.h index 23261d49..30fe415d 100644 --- a/kviewshell/selection.h +++ b/kviewshell/selection.h @@ -10,7 +10,7 @@ #include "pageNumber.h" -#include <qstring.h> +#include <tqstring.h> /* The --very simple-- class TextSelection represents text that the @@ -22,7 +22,7 @@ should hold indiced referring to the start and the end of the selected text in the appropriate documentPage's textLinkList - a QString, 'selectedText' that holds the text that is selected + a TQString, 'selectedText' that holds the text that is selected these values can be stored, retrieved, it can be checked if the selection is empty, and signals are emitted when the values change @@ -47,7 +47,7 @@ public: // values; it is not even checked if selectedTextStart <= // selectedTextEnd! The signals pageChanged() and // selectionIsNotEmpty() are emitted if appropriate. - void set(const PageNumber& pageNr, Q_INT32 selectedTextStart, Q_INT32 selectedTextEnd, const QString& text); + void set(const PageNumber& pageNr, Q_INT32 selectedTextStart, Q_INT32 selectedTextEnd, const TQString& text); // This method can be used to find out if the selection is empty, // i.e. if the page number is invalid or the selected text is empty. @@ -60,7 +60,7 @@ public: Q_INT32 getSelectedTextEnd() const {return selectedTextEnd;} // Method used to retrieve the data described above - const QString &getSelectedText() const {return selectedText;} + const TQString &getSelectedText() const {return selectedText;} // Method used to retrieve the data described above PageNumber getPageNumber() const {return page;} @@ -80,7 +80,7 @@ public: Q_INT32 selectedTextStart, selectedTextEnd; // Described above - QString selectedText; + TQString selectedText; }; #endif diff --git a/kviewshell/simplePageSize.cpp b/kviewshell/simplePageSize.cpp index cc235ef8..9f222105 100644 --- a/kviewshell/simplePageSize.cpp +++ b/kviewshell/simplePageSize.cpp @@ -10,7 +10,7 @@ #include <config.h> #include <kdebug.h> -#include <qpaintdevice.h> +#include <tqpaintdevice.h> #include "simplePageSize.h" @@ -21,7 +21,7 @@ double SimplePageSize::zoomForHeight(Q_UINT32 height) const kdError(1223) << "SimplePageSize::zoomForHeight() called when paper height was invalid" << endl; return 0.1; } - return (double)(height)/(QPaintDevice::x11AppDpiY()*(pageHeight.getLength_in_inch())); + return (double)(height)/(TQPaintDevice::x11AppDpiY()*(pageHeight.getLength_in_inch())); } @@ -31,7 +31,7 @@ double SimplePageSize::zoomForWidth(Q_UINT32 width) const kdError(1223) << "SimplePageSize::zoomForWidth() called when paper width was invalid" << endl; return 0.1; } - return (double)(width)/(QPaintDevice::x11AppDpiX()*(pageWidth.getLength_in_inch())); + return (double)(width)/(TQPaintDevice::x11AppDpiX()*(pageWidth.getLength_in_inch())); } diff --git a/kviewshell/simplePageSize.h b/kviewshell/simplePageSize.h index bd5f9ca8..523eb62b 100644 --- a/kviewshell/simplePageSize.h +++ b/kviewshell/simplePageSize.h @@ -13,10 +13,10 @@ #include "length.h" -#include <qsize.h> +#include <tqsize.h> -class QString; -class QStringList; +class TQString; +class TQStringList; /** \brief This class represents phyiscal page sizes. @@ -74,16 +74,16 @@ class SimplePageSize @param resolution in dots per inch - @returns the pixel size, represented by a QSize. If the page size is + @returns the pixel size, represented by a TQSize. If the page size is invalid, the result is undefined. */ - QSize sizeInPixel(double resolution) const {return QSize( (int)(resolution*pageWidth.getLength_in_inch() + 0.5), + TQSize sizeInPixel(double resolution) const {return TQSize( (int)(resolution*pageWidth.getLength_in_inch() + 0.5), (int)(resolution*pageHeight.getLength_in_inch() + 0.5)); } /** \brief Zoom value required to scale to a certain height If the pageSize is valid, this method returns the zoom value required to scale the page size down to 'height' pixels on the - currently used display. The method uses QPaintDevice::x11AppDpiY() + currently used display. The method uses TQPaintDevice::x11AppDpiY() to find the resolution of the display. If the pageSize is invalid, an error message is printed, and an undefined value is returned. @@ -99,7 +99,7 @@ class SimplePageSize If the pageSize is valid, this method returns the zoom value required to scale the page size down to 'width' pixels on the - currently used display. The method uses QPaintDevice::x11AppDpiX() + currently used display. The method uses TQPaintDevice::x11AppDpiX() to find the resolution of the display. If the pageSize is invalid, an error message is printed, and an undefined value is returned. diff --git a/kviewshell/sizePreview.cpp b/kviewshell/sizePreview.cpp index e6d56715..37f7bb66 100644 --- a/kviewshell/sizePreview.cpp +++ b/kviewshell/sizePreview.cpp @@ -11,15 +11,15 @@ #include <kdebug.h> #include <krandomsequence.h> -#include <qevent.h> -#include <qpainter.h> +#include <tqevent.h> +#include <tqpainter.h> #include "sizePreview.h" #include "simplePageSize.h" -SizePreview::SizePreview( QWidget *parent, const char *name, WFlags) - : QWidget( parent, name, WStaticContents | WNoAutoErase ) +SizePreview::SizePreview( TQWidget *parent, const char *name, WFlags) + : TQWidget( parent, name, WStaticContents | WNoAutoErase ) { // Set a sane default _width = _height = 50.0; @@ -44,12 +44,12 @@ void SizePreview::setSize(const SimplePageSize& size) update(); } -void SizePreview::resizeEvent(QResizeEvent*) +void SizePreview::resizeEvent(TQResizeEvent*) { update(); } -void SizePreview::paintEvent( QPaintEvent * ) +void SizePreview::paintEvent( TQPaintEvent * ) { int displayedWidth, displayedHeight; @@ -73,7 +73,7 @@ void SizePreview::paintEvent( QPaintEvent * ) // Now draw the graphics pixmap.resize(width(), height()); - QPainter p(&pixmap); + TQPainter p(&pixmap); p.fillRect(rect(), colorGroup().background()); p.setPen(Qt::black); p.setBrush(Qt::white); @@ -81,7 +81,7 @@ void SizePreview::paintEvent( QPaintEvent * ) // mark the textbox; we assume 25mm margin int margin = (int)(25.0*displayedWidth/_width + 0.5); - QRect textBox(hOffset+margin, vOffset+margin, displayedWidth-2*margin, displayedHeight-2*margin); + TQRect textBox(hOffset+margin, vOffset+margin, displayedWidth-2*margin, displayedHeight-2*margin); p.setPen(Qt::lightGray); p.drawRect(textBox); diff --git a/kviewshell/sizePreview.h b/kviewshell/sizePreview.h index 4d5a5b3b..96e37a04 100644 --- a/kviewshell/sizePreview.h +++ b/kviewshell/sizePreview.h @@ -11,8 +11,8 @@ #ifndef SIZEPREVIEW_H #define SIZEPREVIEW_H -#include <qpixmap.h> -#include <qwidget.h> +#include <tqpixmap.h> +#include <tqwidget.h> class SimplePageSize; @@ -21,7 +21,7 @@ class SizePreview : public QWidget Q_OBJECT public: - SizePreview( QWidget *parent, const char* name=0, WFlags f=0 ); + SizePreview( TQWidget *parent, const char* name=0, WFlags f=0 ); public slots: // Sets the size. @@ -31,8 +31,8 @@ public slots: void setOrientation(int ori); protected: - void paintEvent(QPaintEvent*); - void resizeEvent(QResizeEvent*); + void paintEvent(TQPaintEvent*); + void resizeEvent(TQResizeEvent*); private: int orientation; // 0 = portrait, other = landscape @@ -41,7 +41,7 @@ private: float _width; // in mm float _height; // in mm - QPixmap pixmap; + TQPixmap pixmap; }; #endif diff --git a/kviewshell/tableOfContents.cpp b/kviewshell/tableOfContents.cpp index e7c5db28..51618d9a 100644 --- a/kviewshell/tableOfContents.cpp +++ b/kviewshell/tableOfContents.cpp @@ -33,13 +33,13 @@ TocItem::TocItem(TocItem* parent) { } -TocItem::TocItem(QListView* parent) +TocItem::TocItem(TQListView* parent) : KListViewItem(parent) { } -TableOfContents::TableOfContents(QWidget* parent) +TableOfContents::TableOfContents(TQWidget* parent) : KListView(parent) { addColumn(i18n("Topic")); @@ -47,7 +47,7 @@ TableOfContents::TableOfContents(QWidget* parent) setSorting(-1); setRootIsDecorated(true); - setSelectionMode(QListView::NoSelection); + setSelectionMode(TQListView::NoSelection); setResizeMode(AllColumns); setColumnWidthMode(0, Manual); setColumnWidthMode(1, Manual); @@ -55,7 +55,7 @@ TableOfContents::TableOfContents(QWidget* parent) readSettings(); - connect(this, SIGNAL(executed(QListViewItem*)), this, SLOT(itemClicked(QListViewItem*))); + connect(this, TQT_SIGNAL(executed(TQListViewItem*)), this, TQT_SLOT(itemClicked(TQListViewItem*))); } TableOfContents::~TableOfContents() @@ -73,21 +73,21 @@ void TableOfContents::readSettings() restoreLayout(KVSPrefs::self()->config(), "tocLayout"); } -void TableOfContents::setContents(const QPtrList<Bookmark>& bookmarks) +void TableOfContents::setContents(const TQPtrList<Bookmark>& bookmarks) { clear(); addItems(bookmarks); } -void TableOfContents::addItems(const QPtrList<Bookmark>& _bookmarks, TocItem* parent) +void TableOfContents::addItems(const TQPtrList<Bookmark>& _bookmarks, TocItem* parent) { kdDebug(1223) << "TableOfContents::setContents()" << endl; if (_bookmarks.isEmpty()) return; kdDebug(1223) << "Bookmarks are not empty" << endl; - // Why isn't QPtrList const-correct? - QPtrList<Bookmark> bookmarks = _bookmarks; + // Why isn't TQPtrList const-correct? + TQPtrList<Bookmark> bookmarks = _bookmarks; for (Bookmark* current = bookmarks.last(); current; current = bookmarks.prev() ) { TocItem* item; if (!parent) @@ -97,7 +97,7 @@ void TableOfContents::addItems(const QPtrList<Bookmark>& _bookmarks, TocItem* pa item->setText(0, current->bookmarkText); if (current->position.page != 0) - item->setText(1, QString().setNum(current->position.page)); + item->setText(1, TQString().setNum(current->position.page)); else item->setText(1, "--"); item->setAnchor(current->position); @@ -107,7 +107,7 @@ void TableOfContents::addItems(const QPtrList<Bookmark>& _bookmarks, TocItem* pa } } -void TableOfContents::itemClicked(QListViewItem* _item) +void TableOfContents::itemClicked(TQListViewItem* _item) { TocItem* item = static_cast<TocItem*>(_item); diff --git a/kviewshell/tableOfContents.h b/kviewshell/tableOfContents.h index 4f653d25..de5885ac 100644 --- a/kviewshell/tableOfContents.h +++ b/kviewshell/tableOfContents.h @@ -33,7 +33,7 @@ class TocItem : public KListViewItem { public: TocItem(TocItem* parent); - TocItem(QListView* parent); + TocItem(TQListView* parent); void setAnchor(const Anchor & _anchor) { anchor = _anchor; } Anchor getAnchor() { return anchor; } @@ -48,10 +48,10 @@ class TableOfContents : public KListView Q_OBJECT public: - TableOfContents(QWidget* parent); + TableOfContents(TQWidget* parent); virtual ~TableOfContents(); - void setContents(const QPtrList<Bookmark>& bookmarks); + void setContents(const TQPtrList<Bookmark>& bookmarks); void writeSettings(); void readSettings(); @@ -60,10 +60,10 @@ signals: void gotoPage(const Anchor&); private: - void addItems(const QPtrList<Bookmark>& bookmarks, TocItem* parent = 0); + void addItems(const TQPtrList<Bookmark>& bookmarks, TocItem* parent = 0); private slots: - void itemClicked(QListViewItem*); + void itemClicked(TQListViewItem*); }; #endif diff --git a/kviewshell/textBox.h b/kviewshell/textBox.h index 281de465..682b5583 100644 --- a/kviewshell/textBox.h +++ b/kviewshell/textBox.h @@ -10,8 +10,8 @@ #ifndef _textbox_h_ #define _textbox_h_ -#include <qrect.h> -#include <qstring.h> +#include <tqrect.h> +#include <tqstring.h> /** Represents a rectangular region in a RenderedDocumentPage that contains text @@ -41,7 +41,7 @@ public: @param re value for the box @param lT valus for the text field */ - TextBox(const QRect& re, const QString& lT): box(re), text(lT) {} + TextBox(const TQRect& re, const TQString& lT): box(re), text(lT) {} /** \brief Bounding box of the text or hyperlink @@ -51,13 +51,13 @@ public: documentRenderer.drawPage() method. The contents of the box is graphically inverted to indicate marked text. */ - QRect box; + TQRect box; /** \brief Name of the region The text associated with the box is stored here. */ - QString text; + TQString text; }; diff --git a/kviewshell/units.cpp b/kviewshell/units.cpp index e675f916..99dc2da9 100644 --- a/kviewshell/units.cpp +++ b/kviewshell/units.cpp @@ -13,7 +13,7 @@ #include <kglobal.h> #include <klocale.h> #include <math.h> -#include <qstringlist.h> +#include <tqstringlist.h> #include "units.h" @@ -53,7 +53,7 @@ unitOfDistance distanceUnitTable[] = { -float distance::convertToMM(const QString &distance, bool *ok) +float distance::convertToMM(const TQString &distance, bool *ok) { // kdDebug() << "convertToMM( " << distance << " )" << endl; @@ -78,6 +78,6 @@ float distance::convertToMM(const QString &distance, bool *ok) return 0.0; } - QString val = distance.left(unitPos).simplifyWhiteSpace(); + TQString val = distance.left(unitPos).simplifyWhiteSpace(); return MMperUnit*val.toFloat(ok); } diff --git a/kviewshell/units.h b/kviewshell/units.h index 48708c01..db83d675 100644 --- a/kviewshell/units.h +++ b/kviewshell/units.h @@ -10,7 +10,7 @@ #ifndef UNITS_H #define UNITS_H -class QString; +class TQString; class distance { public: @@ -28,7 +28,7 @@ class distance { // although the string is malformed. // // It is fine to set ok to 0. - static float convertToMM(const QString &distance, bool *ok=0); + static float convertToMM(const TQString &distance, bool *ok=0); }; #endif diff --git a/kviewshell/zoom.cpp b/kviewshell/zoom.cpp index 3c3e56df..1c3ee6f6 100644 --- a/kviewshell/zoom.cpp +++ b/kviewshell/zoom.cpp @@ -10,7 +10,7 @@ #include <config.h> #include <math.h> -#include <qstringlist.h> +#include <tqstringlist.h> #include <klocale.h> @@ -28,16 +28,16 @@ Zoom::Zoom() _zoomValue = 1.0; valNo = 6; // 1.0 is 6rd entry in the list for(int i=0; zoomVals[i] != 0; i++) - valueNames << QString("%1%").arg(zoomVals[i]); + valueNames << TQString("%1%").arg(zoomVals[i]); } -void Zoom::setZoomValue(const QString &cval) +void Zoom::setZoomValue(const TQString &cval) { float fval; // Remove a trailing '%', if any - QString val = cval.stripWhiteSpace(); + TQString val = cval.stripWhiteSpace(); if (val.right(1) == "%") val = val.left(val.length()-1).stripWhiteSpace(); @@ -49,7 +49,7 @@ void Zoom::setZoomValue(const QString &cval) else { emit(zoomNamesChanged(valueNames)); emit(valNoChanged(valNo)); - emit(zoomNameChanged(QString("%1%").arg((int)(_zoomValue*100.0+0.5)))); + emit(zoomNameChanged(TQString("%1%").arg((int)(_zoomValue*100.0+0.5)))); } } @@ -64,7 +64,7 @@ void Zoom::setZoomFitWidth(float zoom) valNo = 0; emit(valNoChanged(valNo)); - emit(zoomNameChanged(QString("%1%").arg((int)(_zoomValue*100.0+0.5)))); + emit(zoomNameChanged(TQString("%1%").arg((int)(_zoomValue*100.0+0.5)))); } void Zoom::setZoomFitHeight(float zoom) @@ -78,7 +78,7 @@ void Zoom::setZoomFitHeight(float zoom) valNo = 1; emit(valNoChanged(valNo)); - emit(zoomNameChanged(QString("%1%").arg((int)(_zoomValue*100.0+0.5)))); + emit(zoomNameChanged(TQString("%1%").arg((int)(_zoomValue*100.0+0.5)))); } void Zoom::setZoomFitPage(float zoom) @@ -92,7 +92,7 @@ void Zoom::setZoomFitPage(float zoom) valNo = 2; emit(valNoChanged(valNo)); - emit(zoomNameChanged(QString("%1%").arg((int)(_zoomValue*100.0+0.5)))); + emit(zoomNameChanged(TQString("%1%").arg((int)(_zoomValue*100.0+0.5)))); } void Zoom::setZoomValue(float f) @@ -117,19 +117,19 @@ void Zoom::setZoomValue(float f) flag = true; valNo = i + 3; if (fabs(_zoomValue-zoomVals[i]) > 0.01) - valueNames << QString("%1%").arg((int)(_zoomValue*100.0+0.5)); + valueNames << TQString("%1%").arg((int)(_zoomValue*100.0+0.5)); } - valueNames << QString("%1%").arg((int)(zoomVals[i]*100.0+0.5)); + valueNames << TQString("%1%").arg((int)(zoomVals[i]*100.0+0.5)); } if (flag == false) { valNo = valueNames.size(); - valueNames << QString("%1%").arg((int)(_zoomValue*100.0+0.5)); + valueNames << TQString("%1%").arg((int)(_zoomValue*100.0+0.5)); } emit(zoomNamesChanged(valueNames)); emit(valNoChanged(valNo)); - emit(zoomNameChanged(QString("%1%").arg((int)(_zoomValue*100.0+0.5)))); + emit(zoomNameChanged(TQString("%1%").arg((int)(_zoomValue*100.0+0.5)))); } float Zoom::zoomIn() diff --git a/kviewshell/zoom.h b/kviewshell/zoom.h index 985e18a9..b6108d05 100644 --- a/kviewshell/zoom.h +++ b/kviewshell/zoom.h @@ -11,8 +11,8 @@ #ifndef ZOOM_H #define ZOOM_H -#include <qobject.h> -#include <qstringlist.h> +#include <tqobject.h> +#include <tqstringlist.h> class Zoom : public QObject @@ -26,7 +26,7 @@ public: /** Returns a list like "33%", "100%", etc. If you call zoomNames() more than once, it is guaranteed that the same list of strings will be returned. */ - QStringList zoomNames() const { return valueNames; } + TQStringList zoomNames() const { return valueNames; } float zoomIn(); float zoomOut(); @@ -34,21 +34,21 @@ public: public slots: void setZoomValue(float); - void setZoomValue(const QString &); + void setZoomValue(const TQString &); void setZoomFitWidth(float zoom); void setZoomFitHeight(float zoom); void setZoomFitPage(float zoom); signals: - void zoomNamesChanged(const QStringList &); - void zoomNameChanged(const QString &); + void zoomNamesChanged(const TQStringList &); + void zoomNameChanged(const TQString &); void valNoChanged(int); private: float _zoomValue; - QStringList valueNames; - // This will be the number of the current value in the generated QStringList. + TQStringList valueNames; + // This will be the number of the current value in the generated TQStringList. int valNo; }; |