From e69e8b1d09fb579316595b4e6a850e717358a8b1 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sun, 19 Jun 2011 19:03:33 +0000 Subject: TQt4 port kdegraphics This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1237557 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kfile-plugins/pdf/poppler-qt/test-poppler-qt.cpp | 38 ++++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'kfile-plugins/pdf/poppler-qt/test-poppler-qt.cpp') diff --git a/kfile-plugins/pdf/poppler-qt/test-poppler-qt.cpp b/kfile-plugins/pdf/poppler-qt/test-poppler-qt.cpp index d97954b8..d616290d 100644 --- a/kfile-plugins/pdf/poppler-qt/test-poppler-qt.cpp +++ b/kfile-plugins/pdf/poppler-qt/test-poppler-qt.cpp @@ -1,27 +1,27 @@ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include #include -class PDFDisplay : public QWidget // picture display widget +class PDFDisplay : public TQWidget // picture display widget { public: PDFDisplay( Poppler::Document *d ); ~PDFDisplay(); protected: - void paintEvent( QPaintEvent * ); - void keyPressEvent( QKeyEvent * ); + void paintEvent( TQPaintEvent * ); + void keyPressEvent( TQKeyEvent * ); private: void display(); int currentPage; - QPixmap *pixmap; + TQPixmap *pixmap; Poppler::Document *doc; }; @@ -39,16 +39,16 @@ PDFDisplay::~PDFDisplay() delete pixmap; } -void PDFDisplay::paintEvent( QPaintEvent *e ) +void PDFDisplay::paintEvent( TQPaintEvent *e ) { - QPainter paint( this ); // paint widget + TQPainter paint( this ); // paint widget if (pixmap) paint.drawPixmap(0, 0, *pixmap); } -void PDFDisplay::keyPressEvent( QKeyEvent *e ) +void PDFDisplay::keyPressEvent( TQKeyEvent *e ) { - if (e->key() == Qt::Key_Down) + if (e->key() == TQt::Key_Down) { if (currentPage + 1 < doc->getNumPages()) { @@ -56,7 +56,7 @@ void PDFDisplay::keyPressEvent( QKeyEvent *e ) display(); } } - else if (e->key() == Qt::Key_Up) + else if (e->key() == TQt::Key_Up) { if (currentPage > 0) { @@ -83,7 +83,7 @@ void PDFDisplay::display() int main( int argc, char **argv ) { - QApplication a( argc, argv ); // QApplication required! + TQApplication a( argc, argv ); // TQApplication required! if ( argc < 2 || (argc == 3 && strcmp(argv[2], "-extract") != 0) || argc > 3) { @@ -103,7 +103,7 @@ int main( int argc, char **argv ) { PDFDisplay test( doc ); // create picture display a.setMainWidget( &test); // set main widget - test.setCaption("Poppler-Qt Test"); + test.setCaption("Poppler-TQt Test"); test.show(); // show it return a.exec(); // start event loop @@ -112,7 +112,7 @@ int main( int argc, char **argv ) { Poppler::Page *page = doc->getPage(0); - QLabel *l = new QLabel(page->getText(Poppler::Rectangle()), 0); + TQLabel *l = new TQLabel(page->getText(Poppler::Rectangle()), 0); l->show(); a.setMainWidget(l); // set main widget delete page; -- cgit v1.2.1