summaryrefslogtreecommitdiffstats
path: root/src/kchmviewwindow_qtextbrowser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kchmviewwindow_qtextbrowser.cpp')
-rw-r--r--src/kchmviewwindow_qtextbrowser.cpp88
1 files changed, 44 insertions, 44 deletions
diff --git a/src/kchmviewwindow_qtextbrowser.cpp b/src/kchmviewwindow_qtextbrowser.cpp
index 1ab7bf6..82b7693 100644
--- a/src/kchmviewwindow_qtextbrowser.cpp
+++ b/src/kchmviewwindow_qtextbrowser.cpp
@@ -19,10 +19,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qprinter.h>
-#include <qpainter.h>
-#include <qsimplerichtext.h>
-#include <qpaintdevicemetrics.h>
+#include <tqprinter.h>
+#include <tqpainter.h>
+#include <tqsimplerichtext.h>
+#include <tqpaintdevicemetrics.h>
#include "kde-qt.h"
#include "kchmmainwindow.h"
@@ -39,15 +39,15 @@
*/
#define KEEP_ALL_OPENED_DATA_IN_SOURCE_FACTORY
-KCHMViewWindow_QTextBrowser::KCHMViewWindow_QTextBrowser( QTabWidget * parent )
- : QTextBrowser ( parent ), KCHMViewWindow ( parent )
+KCHMViewWindow_QTextBrowser::KCHMViewWindow_QTextBrowser( TQTabWidget * tqparent )
+ : TQTextBrowser ( tqparent ), KCHMViewWindow ( tqparent )
{
m_zoomfactor = 0;
m_sourcefactory = 0;
- invalidate();
+ tqinvalidate();
- setTextFormat ( Qt::RichText );
- connect( this, SIGNAL( linkClicked (const QString &) ), this, SLOT( slotLinkClicked(const QString &) ) );
+ setTextFormat ( TQt::RichText );
+ connect( this, TQT_SIGNAL( linkClicked (const TQString &) ), this, TQT_SLOT( slotLinkClicked(const TQString &) ) );
}
@@ -56,7 +56,7 @@ KCHMViewWindow_QTextBrowser::~KCHMViewWindow_QTextBrowser()
delete m_sourcefactory;
}
-bool KCHMViewWindow_QTextBrowser::openPage (const QString& url)
+bool KCHMViewWindow_QTextBrowser::openPage (const TQString& url)
{
// If we're using a memory saving scheme, we destroy MimeSourceFactory (including all the stored data)
// when opening a new page. It saves some memory, but spends more time while looking for already loaded
@@ -71,13 +71,13 @@ bool KCHMViewWindow_QTextBrowser::openPage (const QString& url)
return true;
}
-void KCHMViewWindow_QTextBrowser::setSource ( const QString & name )
+void KCHMViewWindow_QTextBrowser::setSource ( const TQString & name )
{
if ( m_allowSourceChange )
{
// Do URI decoding, qtextbrowser does stupid job.
- QString fixedname = decodeUrl( name );
- QTextBrowser::setSource (fixedname);
+ TQString fixedname = decodeUrl( name );
+ TQTextBrowser::setSource (fixedname);
}
else
m_allowSourceChange = true;
@@ -88,12 +88,12 @@ void KCHMViewWindow_QTextBrowser::setZoomFactor( int zoom )
m_zoomfactor = zoom;
if ( zoom < 0 )
- QTextBrowser::zoomOut( -zoom );
+ TQTextBrowser::zoomOut( -zoom );
else if ( zoom > 0 )
- QTextBrowser::zoomIn( zoom);
+ TQTextBrowser::zoomIn( zoom);
}
-void KCHMViewWindow_QTextBrowser::invalidate( )
+void KCHMViewWindow_QTextBrowser::tqinvalidate( )
{
delete m_sourcefactory;
m_sourcefactory = new KCHMSourceFactory (this);
@@ -102,10 +102,10 @@ void KCHMViewWindow_QTextBrowser::invalidate( )
m_allowSourceChange = true;
m_searchLastIndex = 0;
m_searchLastParagraph = 0;
- m_searchText = QString::null;
+ m_searchText = TQString();
reload();
- KCHMViewWindow::invalidate( );
+ KCHMViewWindow::tqinvalidate( );
}
int KCHMViewWindow_QTextBrowser::getScrollbarPosition( )
@@ -123,7 +123,7 @@ void KCHMViewWindow_QTextBrowser::addZoomFactor( int value )
setZoomFactor( value);
}
-void KCHMViewWindow_QTextBrowser::slotLinkClicked( const QString & newlink )
+void KCHMViewWindow_QTextBrowser::slotLinkClicked( const TQString & newlink )
{
emit signalLinkClicked (newlink, m_allowSourceChange);
}
@@ -131,44 +131,44 @@ void KCHMViewWindow_QTextBrowser::slotLinkClicked( const QString & newlink )
bool KCHMViewWindow_QTextBrowser::printCurrentPage( )
{
-#if !defined (QT_NO_PRINTER)
- QPrinter printer( QPrinter::HighResolution );
+#if !defined (TQT_NO_PRINTER)
+ TQPrinter printer( TQPrinter::HighResolution );
printer.setFullPage(TRUE);
if ( printer.setup( this ) )
{
- QPainter p( &printer );
+ TQPainter p( &printer );
if( !p.isActive() ) // starting printing failed
return false;
- QPaintDeviceMetrics metrics(p.device());
+ TQPaintDeviceMetrics metrics(p.device());
int dpiy = metrics.logicalDpiY();
int margin = (int) ( (2/2.54)*dpiy ); // 2 cm margins
- QRect body( margin, margin, metrics.width() - 2*margin, metrics.height() - 2*margin );
- QSimpleRichText richText( text(),
- QFont(),
+ TQRect body( margin, margin, metrics.width() - 2*margin, metrics.height() - 2*margin );
+ TQSimpleRichText richText( text(),
+ TQFont(),
context(),
styleSheet(),
mimeSourceFactory(),
body.height() );
richText.setWidth( &p, body.width() );
- QRect view( body );
+ TQRect view( body );
int page = 1;
do
{
- richText.draw( &p, body.left(), body.top(), view, colorGroup() );
+ richText.draw( &p, body.left(), body.top(), view, tqcolorGroup() );
view.moveBy( 0, body.height() );
p.translate( 0 , -body.height() );
- p.drawText( view.right() - p.fontMetrics().width( QString::number(page) ),
- view.bottom() + p.fontMetrics().ascent() + 5, QString::number(page) );
+ p.drawText( view.right() - p.fontMetrics().width( TQString::number(page) ),
+ view.bottom() + p.fontMetrics().ascent() + 5, TQString::number(page) );
if ( view.top() >= richText.height() )
break;
- QString msg = i18n( "Printing (page %1)...") .arg(page);
+ TQString msg = i18n( "Printing (page %1)...") .tqarg(page);
::mainWindow->showInStatusBar( msg );
printer.newPage();
@@ -183,18 +183,18 @@ bool KCHMViewWindow_QTextBrowser::printCurrentPage( )
::mainWindow->showInStatusBar( i18n( "Printing aborted") );
return false;
-#else /* QT_NO_PRINTER */
+#else /* TQT_NO_PRINTER */
- QMessageBox::warning( this,
+ TQMessageBox::warning( this,
i18n( "%1 - could not print") . arg(APP_NAME),
- i18n( "Could not print.\nYour Qt library has been compiled without printing support");
+ i18n( "Could not print.\nYour TQt library has been compiled without printing support");
return false;
-#endif /* QT_NO_PRINTER */
+#endif /* TQT_NO_PRINTER */
}
-void KCHMViewWindow_QTextBrowser::searchWord( const QString & word, bool forward, bool )
+void KCHMViewWindow_QTextBrowser::searchWord( const TQString & word, bool forward, bool )
{
if ( m_searchText == word )
{
@@ -207,7 +207,7 @@ void KCHMViewWindow_QTextBrowser::searchWord( const QString & word, bool forward
m_searchText = word;
}
- if ( find (m_searchText, false, false, forward, &m_searchLastParagraph, &m_searchLastIndex) )
+ if ( tqfind (m_searchText, false, false, forward, &m_searchLastParagraph, &m_searchLastIndex) )
::mainWindow->showInStatusBar( i18n( "Search failed") );
}
@@ -222,15 +222,15 @@ void KCHMViewWindow_QTextBrowser::clipCopy( )
}
-// Shamelessly stolen from Qt
-QString KCHMViewWindow_QTextBrowser::decodeUrl( const QString &input )
+// Shamelessly stolen from TQt
+TQString KCHMViewWindow_QTextBrowser::decodeUrl( const TQString &input )
{
- QString temp;
+ TQString temp;
int i = 0;
int len = input.length();
int a, b;
- QChar c;
+ TQChar c;
while (i < len)
{
c = input[i];
@@ -247,7 +247,7 @@ QString KCHMViewWindow_QTextBrowser::decodeUrl( const QString &input )
else if (b >= 'a' && b <= 'f') b = b - 'a' + 10;
else if (b >= 'A' && b <= 'F') b = b - 'A' + 10;
- temp.append( (QChar)((a << 4) | b ) );
+ temp.append( (TQChar)((a << 4) | b ) );
}
else
{
@@ -260,9 +260,9 @@ QString KCHMViewWindow_QTextBrowser::decodeUrl( const QString &input )
return temp;
}
-QPopupMenu * KCHMViewWindow_QTextBrowser::createPopupMenu( const QPoint & pos )
+TQPopupMenu * KCHMViewWindow_QTextBrowser::createPopupMenu( const TQPoint & pos )
{
- KQPopupMenu * menu = getContextMenu( anchorAt( pos ), this );
+ KTQPopupMenu * menu = getContextMenu( anchorAt( pos ), this );
menu->exec( mapToGlobal( contentsToViewport( pos ) ) );
return 0;
}