summaryrefslogtreecommitdiffstats
path: root/kdeprint/tests
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:46:43 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:46:43 +0000
commitffe8a83e053396df448e9413828527613ca3bd46 (patch)
treea73d4169e02df4a50f9a12cb165fcd0ab5bac7c6 /kdeprint/tests
parent682bf3bfdcbcbb1fca85e8a36ed03e062e0555d5 (diff)
downloadtdelibs-ffe8a83e053396df448e9413828527613ca3bd46.tar.gz
tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdeprint/tests')
-rw-r--r--kdeprint/tests/drawdemo.cpp62
-rw-r--r--kdeprint/tests/drawdemo.h8
-rw-r--r--kdeprint/tests/helpwindow.cpp190
-rw-r--r--kdeprint/tests/helpwindow.h24
-rw-r--r--kdeprint/tests/main.cpp16
-rw-r--r--kdeprint/tests/richpage.cpp36
-rw-r--r--kdeprint/tests/richpage.h6
7 files changed, 171 insertions, 171 deletions
diff --git a/kdeprint/tests/drawdemo.cpp b/kdeprint/tests/drawdemo.cpp
index f399d7d6d..443cc89e8 100644
--- a/kdeprint/tests/drawdemo.cpp
+++ b/kdeprint/tests/drawdemo.cpp
@@ -8,14 +8,14 @@
**
*****************************************************************************/
-#include <qwidget.h>
-#include <qpainter.h>
+#include <tqwidget.h>
+#include <tqpainter.h>
#include <kprinter.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qbuttongroup.h>
+#include <tqpushbutton.h>
+#include <tqradiobutton.h>
+#include <tqbuttongroup.h>
#include <kapplication.h>
-#include <qapplication.h>
+#include <tqapplication.h>
#include <math.h>
@@ -24,27 +24,27 @@
// The coordinate system x=(0..500), y=(0..500) spans the paint device.
//
-void drawColorWheel( QPainter *p )
+void drawColorWheel( TQPainter *p )
{
- QFont f( "times", 18, QFont::Bold );
+ TQFont f( "times", 18, TQFont::Bold );
p->setFont( f );
p->setPen( Qt::black );
p->setWindow( 0, 0, 500, 500 ); // defines coordinate system
for ( int i=0; i<36; i++ ) { // draws 36 rotated rectangles
- QWMatrix matrix;
+ TQWMatrix matrix;
matrix.translate( 250.0F, 250.0F ); // move to center
matrix.shear( 0.0F, 0.3F ); // twist it
matrix.rotate( (float)i*10 ); // rotate 0,10,20,.. degrees
p->setWorldMatrix( matrix ); // use this world matrix
- QColor c;
+ TQColor c;
c.setHsv( i*10, 255, 255 ); // rainbow effect
p->setBrush( c ); // solid fill with color c
p->drawRect( 70, -10, 80, 10 ); // draw the rectangle
- QString n;
+ TQString n;
n.sprintf( "H=%d", i*10 );
p->drawText( 80+70+5, 0, n ); // draw the hue number
}
@@ -55,7 +55,7 @@ void drawColorWheel( QPainter *p )
// This function draws a few lines of text using different fonts.
//
-void drawFonts( QPainter *p )
+void drawFonts( TQPainter *p )
{
static const char *fonts[] = { "Helvetica", "Courier", "Times", 0 };
static int sizes[] = { 10, 12, 18, 24, 36, 0 };
@@ -64,9 +64,9 @@ void drawFonts( QPainter *p )
while ( fonts[f] ) {
int s = 0;
while ( sizes[s] ) {
- QFont font( fonts[f], sizes[s] );
+ TQFont font( fonts[f], sizes[s] );
p->setFont( font );
- QFontMetrics fm = p->fontMetrics();
+ TQFontMetrics fm = p->fontMetrics();
y += fm.ascent();
p->drawText( 10, y, "Quartz Glyph Job Vex'd Cwm Finks" );
y += fm.descent();
@@ -81,12 +81,12 @@ void drawFonts( QPainter *p )
// This function draws some shapes
//
-void drawShapes( QPainter *p )
+void drawShapes( TQPainter *p )
{
- QBrush b1( Qt::blue );
- QBrush b2( Qt::green, Qt::Dense6Pattern ); // green 12% fill
- QBrush b3( Qt::NoBrush ); // void brush
- QBrush b4( Qt::CrossPattern ); // black cross pattern
+ TQBrush b1( Qt::blue );
+ TQBrush b2( Qt::green, Qt::Dense6Pattern ); // green 12% fill
+ TQBrush b3( Qt::NoBrush ); // void brush
+ TQBrush b4( Qt::CrossPattern ); // black cross pattern
p->setPen( Qt::red );
p->setBrush( b1 );
@@ -100,7 +100,7 @@ void drawShapes( QPainter *p )
}
-typedef void (*draw_func)(QPainter*);
+typedef void (*draw_func)(TQPainter*);
struct DrawThing {
draw_func f;
@@ -131,15 +131,15 @@ DrawView::DrawView()
setBackgroundColor( white );
// Create a button group to contain all buttons
- bgroup = new QButtonGroup( this );
+ bgroup = new TQButtonGroup( this );
bgroup->resize( 200, 200 );
- connect( bgroup, SIGNAL(clicked(int)), SLOT(updateIt(int)) );
+ connect( bgroup, TQT_SIGNAL(clicked(int)), TQT_SLOT(updateIt(int)) );
// Calculate the size for the radio buttons
int maxwidth = 80;
int i;
const char *n;
- QFontMetrics fm = bgroup->fontMetrics();
+ TQFontMetrics fm = bgroup->fontMetrics();
for ( i=0; (n=ourDrawFunctions[i].name) != 0; i++ ) {
int w = fm.width( n );
maxwidth = QMAX(w,maxwidth);
@@ -147,7 +147,7 @@ DrawView::DrawView()
maxwidth = maxwidth + 20; // add 20 pixels
for ( i=0; (n=ourDrawFunctions[i].name) != 0; i++ ) {
- QRadioButton *rb = new QRadioButton( n, bgroup );
+ TQRadioButton *rb = new TQRadioButton( n, bgroup );
rb->setGeometry( 10, i*30+10, maxwidth, 30 );
if ( i == 0 )
rb->setChecked( true );
@@ -161,10 +161,10 @@ DrawView::DrawView()
printer = new KPrinter;
// Create and setup the print button
- print = new QPushButton( "Print...", bgroup );
+ print = new TQPushButton( "Print...", bgroup );
print->resize( 80, 30 );
print->move( maxwidth/2 - print->width()/2, maxindex*30+20 );
- connect( print, SIGNAL(clicked()), SLOT(printIt()) );
+ connect( print, TQT_SIGNAL(clicked()), TQT_SLOT(printIt()) );
bgroup->resize( maxwidth, print->y()+print->height()+10 );
@@ -197,7 +197,7 @@ void DrawView::updateIt( int index )
// Calls the drawing function as specified by the radio buttons.
//
-void DrawView::drawIt( QPainter *p )
+void DrawView::drawIt( TQPainter *p )
{
(*ourDrawFunctions[drawindex].f)(p);
}
@@ -210,7 +210,7 @@ void DrawView::printIt()
{
#ifndef QT_NO_PRINTER
if ( printer->setup( this ) ) {
- QPainter paint( printer );
+ TQPainter paint( printer );
drawIt( &paint );
}
#endif
@@ -220,9 +220,9 @@ void DrawView::printIt()
// Called when the widget needs to be updated.
//
-void DrawView::paintEvent( QPaintEvent * )
+void DrawView::paintEvent( TQPaintEvent * )
{
- QPainter paint( this );
+ TQPainter paint( this );
drawIt( &paint );
}
@@ -231,7 +231,7 @@ void DrawView::paintEvent( QPaintEvent * )
// Moves the button group to the upper right corner
// of the widget.
-void DrawView::resizeEvent( QResizeEvent * )
+void DrawView::resizeEvent( TQResizeEvent * )
{
bgroup->move( width()-bgroup->width(), 0 );
}
diff --git a/kdeprint/tests/drawdemo.h b/kdeprint/tests/drawdemo.h
index 81b201d54..5d2412477 100644
--- a/kdeprint/tests/drawdemo.h
+++ b/kdeprint/tests/drawdemo.h
@@ -16,12 +16,12 @@ public slots:
void updateIt( int );
void printIt();
protected:
- void drawIt( QPainter * );
- void paintEvent( QPaintEvent * );
- void resizeEvent( QResizeEvent * );
+ void drawIt( TQPainter * );
+ void paintEvent( TQPaintEvent * );
+ void resizeEvent( TQResizeEvent * );
private:
KPrinter *printer;
- QButtonGroup *bgroup;
+ TQButtonGroup *bgroup;
QPushButton *print;
int drawindex;
int maxindex;
diff --git a/kdeprint/tests/helpwindow.cpp b/kdeprint/tests/helpwindow.cpp
index 4fdc6d7a5..c2cdb1b22 100644
--- a/kdeprint/tests/helpwindow.cpp
+++ b/kdeprint/tests/helpwindow.cpp
@@ -10,99 +10,99 @@
#include "helpwindow.h"
#include "richpage.h"
-#include <qstatusbar.h>
-#include <qpixmap.h>
-#include <qpopupmenu.h>
+#include <tqstatusbar.h>
+#include <tqpixmap.h>
+#include <tqpopupmenu.h>
#include <kmenubar.h>
#include <ktoolbar.h>
#include <kstatusbar.h>
-#include <qtoolbutton.h>
-#include <qiconset.h>
-#include <qfile.h>
-#include <qtextstream.h>
-#include <qstylesheet.h>
-#include <qmessagebox.h>
-#include <qfiledialog.h>
-#include <qapplication.h>
-#include <qcombobox.h>
-#include <qevent.h>
-#include <qlineedit.h>
-#include <qobjectlist.h>
-#include <qfileinfo.h>
-#include <qdatastream.h>
+#include <tqtoolbutton.h>
+#include <tqiconset.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
+#include <tqstylesheet.h>
+#include <tqmessagebox.h>
+#include <tqfiledialog.h>
+#include <tqapplication.h>
+#include <tqcombobox.h>
+#include <tqevent.h>
+#include <tqlineedit.h>
+#include <tqobjectlist.h>
+#include <tqfileinfo.h>
+#include <tqdatastream.h>
#include <kprinter.h>
-#include <qsimplerichtext.h>
-#include <qpainter.h>
-#include <qpaintdevicemetrics.h>
+#include <tqsimplerichtext.h>
+#include <tqpainter.h>
+#include <tqpaintdevicemetrics.h>
#include <ctype.h>
-HelpWindow::HelpWindow( const QString& home_, const QString& _path,
- QWidget* parent, const char *name )
+HelpWindow::HelpWindow( const TQString& home_, const TQString& _path,
+ TQWidget* parent, const char *name )
: KMainWindow( parent, name, WDestructiveClose ),
pathCombo( 0 ), selectedURL()
{
readHistory();
readBookmarks();
- browser = new QTextBrowser( this );
+ browser = new TQTextBrowser( this );
browser->mimeSourceFactory()->setFilePath( _path );
- browser->setFrameStyle( QFrame::Panel | QFrame::Sunken );
- connect( browser, SIGNAL( textChanged() ),
- this, SLOT( textChanged() ) );
+ browser->setFrameStyle( TQFrame::Panel | TQFrame::Sunken );
+ connect( browser, TQT_SIGNAL( textChanged() ),
+ this, TQT_SLOT( textChanged() ) );
setCentralWidget( browser );
if ( !home_.isEmpty() )
browser->setSource( home_ );
- connect( browser, SIGNAL( highlighted( const QString&) ),
- statusBar(), SLOT( message( const QString&)) );
+ connect( browser, TQT_SIGNAL( highlighted( const TQString&) ),
+ statusBar(), TQT_SLOT( message( const TQString&)) );
resize( 640,700 );
- QPopupMenu* file = new QPopupMenu( this );
- file->insertItem( "&New Window", this, SLOT( newWindow() ), ALT | Key_N );
- file->insertItem( "&Open File", this, SLOT( openFile() ), ALT | Key_O );
- file->insertItem( "&Print", this, SLOT( print() ), ALT | Key_P );
+ TQPopupMenu* file = new TQPopupMenu( this );
+ file->insertItem( "&New Window", this, TQT_SLOT( newWindow() ), ALT | Key_N );
+ file->insertItem( "&Open File", this, TQT_SLOT( openFile() ), ALT | Key_O );
+ file->insertItem( "&Print", this, TQT_SLOT( print() ), ALT | Key_P );
file->insertSeparator();
- file->insertItem( "&Close", this, SLOT( close() ), ALT | Key_Q );
- file->insertItem( "E&xit", qApp, SLOT( closeAllWindows() ), ALT | Key_X );
+ file->insertItem( "&Close", this, TQT_SLOT( close() ), ALT | Key_Q );
+ file->insertItem( "E&xit", qApp, TQT_SLOT( closeAllWindows() ), ALT | Key_X );
// The same three icons are used twice each.
- QIconSet icon_back( QPixmap("back.xpm") );
- QIconSet icon_forward( QPixmap("forward.xpm") );
- QIconSet icon_home( QPixmap("home.xpm") );
+ TQIconSet icon_back( TQPixmap("back.xpm") );
+ TQIconSet icon_forward( TQPixmap("forward.xpm") );
+ TQIconSet icon_home( TQPixmap("home.xpm") );
- QPopupMenu* go = new QPopupMenu( this );
+ TQPopupMenu* go = new TQPopupMenu( this );
backwardId = go->insertItem( icon_back,
- "&Backward", browser, SLOT( backward() ),
+ "&Backward", browser, TQT_SLOT( backward() ),
ALT | Key_Left );
forwardId = go->insertItem( icon_forward,
- "&Forward", browser, SLOT( forward() ),
+ "&Forward", browser, TQT_SLOT( forward() ),
ALT | Key_Right );
- go->insertItem( icon_home, "&Home", browser, SLOT( home() ) );
+ go->insertItem( icon_home, "&Home", browser, TQT_SLOT( home() ) );
- QPopupMenu* help = new QPopupMenu( this );
- help->insertItem( "&About ...", this, SLOT( about() ) );
- help->insertItem( "About &Qt ...", this, SLOT( aboutQt() ) );
+ TQPopupMenu* help = new TQPopupMenu( this );
+ help->insertItem( "&About ...", this, TQT_SLOT( about() ) );
+ help->insertItem( "About &Qt ...", this, TQT_SLOT( aboutQt() ) );
- hist = new QPopupMenu( this );
- QStringList::Iterator it = history.begin();
+ hist = new TQPopupMenu( this );
+ TQStringList::Iterator it = history.begin();
for ( ; it != history.end(); ++it )
mHistory[ hist->insertItem( *it ) ] = *it;
- connect( hist, SIGNAL( activated( int ) ),
- this, SLOT( histChosen( int ) ) );
+ connect( hist, TQT_SIGNAL( activated( int ) ),
+ this, TQT_SLOT( histChosen( int ) ) );
- bookm = new QPopupMenu( this );
- bookm->insertItem( tr( "Add Bookmark" ), this, SLOT( addBookmark() ) );
+ bookm = new TQPopupMenu( this );
+ bookm->insertItem( tr( "Add Bookmark" ), this, TQT_SLOT( addBookmark() ) );
bookm->insertSeparator();
- QStringList::Iterator it2 = bookmarks.begin();
+ TQStringList::Iterator it2 = bookmarks.begin();
for ( ; it2 != bookmarks.end(); ++it2 )
mBookmarks[ bookm->insertItem( *it2 ) ] = *it2;
- connect( bookm, SIGNAL( activated( int ) ),
- this, SLOT( bookmChosen( int ) ) );
+ connect( bookm, TQT_SIGNAL( activated( int ) ),
+ this, TQT_SLOT( bookmChosen( int ) ) );
menuBar()->insertItem( tr("&File"), file );
menuBar()->insertItem( tr("&Go"), go );
@@ -113,29 +113,29 @@ HelpWindow::HelpWindow( const QString& home_, const QString& _path,
menuBar()->setItemEnabled( forwardId, false);
menuBar()->setItemEnabled( backwardId, false);
- connect( browser, SIGNAL( backwardAvailable( bool ) ),
- this, SLOT( setBackwardAvailable( bool ) ) );
- connect( browser, SIGNAL( forwardAvailable( bool ) ),
- this, SLOT( setForwardAvailable( bool ) ) );
+ connect( browser, TQT_SIGNAL( backwardAvailable( bool ) ),
+ this, TQT_SLOT( setBackwardAvailable( bool ) ) );
+ connect( browser, TQT_SIGNAL( forwardAvailable( bool ) ),
+ this, TQT_SLOT( setForwardAvailable( bool ) ) );
- QToolBar* toolbar = new QToolBar( this );
+ TQToolBar* toolbar = new TQToolBar( this );
addToolBar( toolbar, "Toolbar");
- QToolButton* button;
+ TQToolButton* button;
- button = new QToolButton( icon_back, tr("Backward"), "", browser, SLOT(backward()), toolbar );
- connect( browser, SIGNAL( backwardAvailable(bool) ), button, SLOT( setEnabled(bool) ) );
+ button = new TQToolButton( icon_back, tr("Backward"), "", browser, TQT_SLOT(backward()), toolbar );
+ connect( browser, TQT_SIGNAL( backwardAvailable(bool) ), button, TQT_SLOT( setEnabled(bool) ) );
button->setEnabled( false );
- button = new QToolButton( icon_forward, tr("Forward"), "", browser, SLOT(forward()), toolbar );
- connect( browser, SIGNAL( forwardAvailable(bool) ), button, SLOT( setEnabled(bool) ) );
+ button = new TQToolButton( icon_forward, tr("Forward"), "", browser, TQT_SLOT(forward()), toolbar );
+ connect( browser, TQT_SIGNAL( forwardAvailable(bool) ), button, TQT_SLOT( setEnabled(bool) ) );
button->setEnabled( false );
- button = new QToolButton( icon_home, tr("Home"), "", browser, SLOT(home()), toolbar );
+ button = new TQToolButton( icon_home, tr("Home"), "", browser, TQT_SLOT(home()), toolbar );
toolbar->addSeparator();
- pathCombo = new QComboBox( true, toolbar );
- connect( pathCombo, SIGNAL( activated( const QString & ) ),
- this, SLOT( pathSelected( const QString & ) ) );
+ pathCombo = new TQComboBox( true, toolbar );
+ connect( pathCombo, TQT_SIGNAL( activated( const TQString & ) ),
+ this, TQT_SLOT( pathSelected( const TQString & ) ) );
toolbar->setStretchableWidget( pathCombo );
setRightJustification( true );
setDockEnabled( DockLeft, false );
@@ -181,38 +181,38 @@ void HelpWindow::textChanged()
mHistory[ hist->insertItem( selectedURL ) ] = selectedURL;
} else
pathCombo->setCurrentItem( i );
- selectedURL = QString::null;
+ selectedURL = TQString::null;
}
}
HelpWindow::~HelpWindow()
{
history.clear();
- QMap<int, QString>::Iterator it = mHistory.begin();
+ TQMap<int, TQString>::Iterator it = mHistory.begin();
for ( ; it != mHistory.end(); ++it )
history.append( *it );
- QFile f( QDir::currentDirPath() + "/.history" );
+ TQFile f( TQDir::currentDirPath() + "/.history" );
f.open( IO_WriteOnly );
- QDataStream s( &f );
+ TQDataStream s( &f );
s << history;
f.close();
bookmarks.clear();
- QMap<int, QString>::Iterator it2 = mBookmarks.begin();
+ TQMap<int, TQString>::Iterator it2 = mBookmarks.begin();
for ( ; it2 != mBookmarks.end(); ++it2 )
bookmarks.append( *it2 );
- QFile f2( QDir::currentDirPath() + "/.bookmarks" );
+ TQFile f2( TQDir::currentDirPath() + "/.bookmarks" );
f2.open( IO_WriteOnly );
- QDataStream s2( &f2 );
+ TQDataStream s2( &f2 );
s2 << bookmarks;
f2.close();
}
void HelpWindow::about()
{
- QMessageBox::about( this, "HelpViewer Example",
+ TQMessageBox::about( this, "HelpViewer Example",
"<p>This example implements a simple HTML help viewer "
"using Qt's rich text capabilities</p>"
"<p>It's just about 100 lines of C++ code, so don't expect too much :-)</p>"
@@ -222,13 +222,13 @@ void HelpWindow::about()
void HelpWindow::aboutQt()
{
- QMessageBox::aboutQt( this, "QBrowser" );
+ TQMessageBox::aboutQt( this, "QBrowser" );
}
void HelpWindow::openFile()
{
#ifndef QT_NO_FILEDIALOG
- QString fn = QFileDialog::getOpenFileName( QString::null, QString::null, this );
+ TQString fn = TQFileDialog::getOpenFileName( TQString::null, TQString::null, this );
if ( !fn.isEmpty() )
browser->setSource( fn );
#endif
@@ -245,7 +245,7 @@ void HelpWindow::print()
#ifdef KDE_PRINT
KPrinter printer;
#else
- QPrinter printer;
+ TQPrinter printer;
#endif
printer.setFullPage(true);
printer.setDocName("Help Viewer");
@@ -255,8 +255,8 @@ void HelpWindow::print()
printer.addStandardPage(KPrinter::FilesPage);
#endif
if ( printer.setup(this) ) {
- QPainter p( &printer );
- QPaintDeviceMetrics metrics(p.device());
+ TQPainter p( &printer );
+ TQPaintDeviceMetrics metrics(p.device());
int dpix = metrics.logicalDpiX();
int dpiy = metrics.logicalDpiY();
#ifdef KDE_PRINT
@@ -264,26 +264,26 @@ void HelpWindow::print()
#else
const int margin = 72; // pt
#endif
- QRect body(margin*dpix/72, margin*dpiy/72,
+ TQRect body(margin*dpix/72, margin*dpiy/72,
metrics.width()-margin*dpix/72*2,
metrics.height()-margin*dpiy/72*2 );
#ifdef KDE_PRINT
- QFont font(printer.option("app-rich-fontname"), printer.option("app-rich-fontsize").toInt());
+ TQFont font(printer.option("app-rich-fontname"), printer.option("app-rich-fontsize").toInt());
#else
- QFont font("times",10);
+ TQFont font("times",10);
#endif
- QSimpleRichText richText( browser->text(), font, browser->context(), browser->styleSheet(),
+ TQSimpleRichText richText( browser->text(), font, browser->context(), browser->styleSheet(),
browser->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() );
view.moveBy( 0, body.height() );
p.translate( 0 , -body.height() );
p.setFont( font );
- 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;
printer.newPage();
@@ -292,10 +292,10 @@ void HelpWindow::print()
}
}
-void HelpWindow::pathSelected( const QString &_path )
+void HelpWindow::pathSelected( const TQString &_path )
{
browser->setSource( _path );
- QMap<int, QString>::Iterator it = mHistory.begin();
+ TQMap<int, TQString>::Iterator it = mHistory.begin();
bool exists = false;
for ( ; it != mHistory.end(); ++it ) {
if ( *it == _path ) {
@@ -309,10 +309,10 @@ void HelpWindow::pathSelected( const QString &_path )
void HelpWindow::readHistory()
{
- if ( QFile::exists( QDir::currentDirPath() + "/.history" ) ) {
- QFile f( QDir::currentDirPath() + "/.history" );
+ if ( TQFile::exists( TQDir::currentDirPath() + "/.history" ) ) {
+ TQFile f( TQDir::currentDirPath() + "/.history" );
f.open( IO_ReadOnly );
- QDataStream s( &f );
+ TQDataStream s( &f );
s >> history;
f.close();
while ( history.count() > 20 )
@@ -322,10 +322,10 @@ void HelpWindow::readHistory()
void HelpWindow::readBookmarks()
{
- if ( QFile::exists( QDir::currentDirPath() + "/.bookmarks" ) ) {
- QFile f( QDir::currentDirPath() + "/.bookmarks" );
+ if ( TQFile::exists( TQDir::currentDirPath() + "/.bookmarks" ) ) {
+ TQFile f( TQDir::currentDirPath() + "/.bookmarks" );
f.open( IO_ReadOnly );
- QDataStream s( &f );
+ TQDataStream s( &f );
s >> bookmarks;
f.close();
}
diff --git a/kdeprint/tests/helpwindow.h b/kdeprint/tests/helpwindow.h
index 1de9e5e2b..93704046a 100644
--- a/kdeprint/tests/helpwindow.h
+++ b/kdeprint/tests/helpwindow.h
@@ -12,10 +12,10 @@
#define HELPWINDOW_H
#include <kmainwindow.h>
-#include <qtextbrowser.h>
-#include <qstringlist.h>
-#include <qmap.h>
-#include <qdir.h>
+#include <tqtextbrowser.h>
+#include <tqstringlist.h>
+#include <tqmap.h>
+#include <tqdir.h>
class QComboBox;
class QPopupMenu;
@@ -24,7 +24,7 @@ class HelpWindow : public KMainWindow
{
Q_OBJECT
public:
- HelpWindow( const QString& home_, const QString& path, QWidget* parent = 0, const char *name=0 );
+ HelpWindow( const TQString& home_, const TQString& path, TQWidget* parent = 0, const char *name=0 );
~HelpWindow();
private slots:
@@ -38,7 +38,7 @@ private slots:
void newWindow();
void print();
- void pathSelected( const QString & );
+ void pathSelected( const TQString & );
void histChosen( int );
void bookmChosen( int );
void addBookmark();
@@ -47,13 +47,13 @@ private:
void readHistory();
void readBookmarks();
- QTextBrowser* browser;
- QComboBox *pathCombo;
+ TQTextBrowser* browser;
+ TQComboBox *pathCombo;
int backwardId, forwardId;
- QString selectedURL;
- QStringList history, bookmarks;
- QMap<int, QString> mHistory, mBookmarks;
- QPopupMenu *hist, *bookm;
+ TQString selectedURL;
+ TQStringList history, bookmarks;
+ TQMap<int, TQString> mHistory, mBookmarks;
+ TQPopupMenu *hist, *bookm;
};
diff --git a/kdeprint/tests/main.cpp b/kdeprint/tests/main.cpp
index 4db031532..a1dc6b5e0 100644
--- a/kdeprint/tests/main.cpp
+++ b/kdeprint/tests/main.cpp
@@ -10,8 +10,8 @@
#include "helpwindow.h"
#include <kapplication.h>
-#include <qwindowsstyle.h>
-#include <qstylesheet.h>
+#include <tqwindowsstyle.h>
+#include <tqstylesheet.h>
#include <stdlib.h>
@@ -19,23 +19,23 @@ int main( int argc, char ** argv )
{
KApplication a(argc, argv, "helpviewer");
- QString home;
+ TQString home;
if (argc > 1)
home = argv[1];
else
- home = QString(getenv("QTDIR")) + "/doc/html/index.html";
+ home = TQString(getenv("QTDIR")) + "/doc/html/index.html";
HelpWindow *help = new HelpWindow(home, ".", 0, "help viewer");
- if ( QApplication::desktop()->width() > 400
- && QApplication::desktop()->height() > 500 )
+ if ( TQApplication::desktop()->width() > 400
+ && TQApplication::desktop()->height() > 500 )
help->show();
else
help->showMaximized();
- QObject::connect( &a, SIGNAL(lastWindowClosed()),
- &a, SLOT(quit()) );
+ TQObject::connect( &a, TQT_SIGNAL(lastWindowClosed()),
+ &a, TQT_SLOT(quit()) );
return a.exec();
}
diff --git a/kdeprint/tests/richpage.cpp b/kdeprint/tests/richpage.cpp
index 9b175894b..f12040b71 100644
--- a/kdeprint/tests/richpage.cpp
+++ b/kdeprint/tests/richpage.cpp
@@ -1,38 +1,38 @@
#include "richpage.h"
-#include <qlabel.h>
-#include <qspinbox.h>
-#include <qcombobox.h>
-#include <qfontdatabase.h>
-#include <qlayout.h>
+#include <tqlabel.h>
+#include <tqspinbox.h>
+#include <tqcombobox.h>
+#include <tqfontdatabase.h>
+#include <tqlayout.h>
-RichPage::RichPage(QWidget *parent, const char *name)
+RichPage::RichPage(TQWidget *parent, const char *name)
: KPrintDialogPage(parent,name)
{
m_title = "Rich Text Options";
- margin_ = new QSpinBox(this);
+ margin_ = new TQSpinBox(this);
margin_->setRange(1,999);
margin_->setValue(72);
- fontsize_ = new QSpinBox(this);
+ fontsize_ = new TQSpinBox(this);
fontsize_->setRange(4,100);
fontsize_->setValue(10);
- fontname_ = new QComboBox(this);
+ fontname_ = new TQComboBox(this);
QFontDatabase db;
QStringList fonts = db.families();
fontname_->insertStringList(fonts);
- fontname_->setCurrentItem(fonts.findIndex(QString::fromLatin1("times")));
+ fontname_->setCurrentItem(fonts.findIndex(TQString::fromLatin1("times")));
if (fontname_->currentItem() < 0) fontname_->setCurrentItem(0);
- QLabel *l1 = new QLabel("Margin:",this);
- QLabel *l2 = new QLabel("Font name:",this);
- QLabel *l3 = new QLabel("Font size:",this);
+ QLabel *l1 = new TQLabel("Margin:",this);
+ QLabel *l2 = new TQLabel("Font name:",this);
+ QLabel *l3 = new TQLabel("Font size:",this);
- QHBoxLayout *s1 = new QHBoxLayout(0, 0, 10);
- QHBoxLayout *s2 = new QHBoxLayout(0, 0, 10);
- QVBoxLayout *main_ = new QVBoxLayout(this, 10, 10);
+ QHBoxLayout *s1 = new TQHBoxLayout(0, 0, 10);
+ QHBoxLayout *s2 = new TQHBoxLayout(0, 0, 10);
+ QVBoxLayout *main_ = new TQVBoxLayout(this, 10, 10);
main_->addLayout(s1,0);
main_->addSpacing(20);
@@ -55,7 +55,7 @@ RichPage::~RichPage()
{
}
-void RichPage::setOptions(const QMap<QString,QString>& opts)
+void RichPage::setOptions(const TQMap<TQString,TQString>& opts)
{
QString value;
@@ -77,7 +77,7 @@ void RichPage::setOptions(const QMap<QString,QString>& opts)
fontsize_->setValue(value.toInt());
}
-void RichPage::getOptions(QMap<QString,QString>& opts, bool)
+void RichPage::getOptions(TQMap<TQString,TQString>& opts, bool)
{
opts["app-rich-margin"] = margin_->text();
opts["app-rich-fontname"] = fontname_->currentText();
diff --git a/kdeprint/tests/richpage.h b/kdeprint/tests/richpage.h
index 579e52bf2..e41f64e0d 100644
--- a/kdeprint/tests/richpage.h
+++ b/kdeprint/tests/richpage.h
@@ -9,11 +9,11 @@ class QComboBox;
class RichPage : public KPrintDialogPage
{
public:
- RichPage(QWidget *parent = 0, const char *name = 0);
+ RichPage(TQWidget *parent = 0, const char *name = 0);
~RichPage();
- void setOptions(const QMap<QString,QString>& opts);
- void getOptions(QMap<QString,QString>& opts, bool incldef = false);
+ void setOptions(const TQMap<TQString,TQString>& opts);
+ void getOptions(TQMap<TQString,TQString>& opts, bool incldef = false);
private:
QSpinBox *margin_;