diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /tools/thumbnail | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'tools/thumbnail')
-rw-r--r-- | tools/thumbnail/clipartcreator.cpp | 18 | ||||
-rw-r--r-- | tools/thumbnail/clipartcreator.h | 2 | ||||
-rw-r--r-- | tools/thumbnail/kofficecreator.cpp | 28 | ||||
-rw-r--r-- | tools/thumbnail/kofficecreator.h | 7 |
4 files changed, 28 insertions, 27 deletions
diff --git a/tools/thumbnail/clipartcreator.cpp b/tools/thumbnail/clipartcreator.cpp index 73585a97..d1378988 100644 --- a/tools/thumbnail/clipartcreator.cpp +++ b/tools/thumbnail/clipartcreator.cpp @@ -18,9 +18,9 @@ * Boston, MA 02110-1301, USA. */ -#include <qimage.h> -#include <qpainter.h> -#include <qfile.h> +#include <tqimage.h> +#include <tqpainter.h> +#include <tqfile.h> #include <KoPicture.h> @@ -35,18 +35,18 @@ extern "C" } } -bool ClipartCreator::create(const QString &path, int width, int height, QImage &img) +bool ClipartCreator::create(const TQString &path, int width, int height, TQImage &img) { - QPixmap pixmap; + TQPixmap pixmap; KoPicture picture; if (picture.loadFromFile( path )) { - pixmap = QPixmap( 200, 200 ); - pixmap.fill( Qt::white ); + pixmap = TQPixmap( 200, 200 ); + pixmap.fill( TQt::white ); - QPainter p; + TQPainter p; p.begin( &pixmap ); - p.setBackgroundColor( Qt::white ); + p.setBackgroundColor( TQt::white ); picture.draw(p, 0, 0, pixmap.width(), pixmap.height()); p.end(); diff --git a/tools/thumbnail/clipartcreator.h b/tools/thumbnail/clipartcreator.h index d9e6e55b..8f33e623 100644 --- a/tools/thumbnail/clipartcreator.h +++ b/tools/thumbnail/clipartcreator.h @@ -26,7 +26,7 @@ class ClipartCreator : public ThumbCreator { public: ClipartCreator() {}; - virtual bool create(const QString &path, int, int, QImage &img); + virtual bool create(const TQString &path, int, int, TQImage &img); virtual Flags flags() const; }; diff --git a/tools/thumbnail/kofficecreator.cpp b/tools/thumbnail/kofficecreator.cpp index b62808d2..4e820eb1 100644 --- a/tools/thumbnail/kofficecreator.cpp +++ b/tools/thumbnail/kofficecreator.cpp @@ -21,9 +21,9 @@ #include <time.h> -#include <qpixmap.h> -#include <qimage.h> -#include <qpainter.h> +#include <tqpixmap.h> +#include <tqimage.h> +#include <tqpainter.h> #include <kapplication.h> #include <kfileitem.h> @@ -55,27 +55,27 @@ KOfficeCreator::~KOfficeCreator() delete m_doc; } -bool KOfficeCreator::create(const QString &path, int width, int height, QImage &img) +bool KOfficeCreator::create(const TQString &path, int width, int height, TQImage &img) { KoStore* store = KoStore::createStore(path, KoStore::Read); - if ( store && ( store->open( QString("Thumbnails/thumbnail.png") ) || store->open( QString("preview.png") ) ) ) + if ( store && ( store->open( TQString("Thumbnails/thumbnail.png") ) || store->open( TQString("preview.png") ) ) ) { // Hooray! No long delay for the user... - QByteArray bytes = store->read(store->size()); + TQByteArray bytes = store->read(store->size()); store->close(); delete store; return img.loadFromData(bytes); } delete store; - QString mimetype = KMimeType::findByPath( path )->name(); + TQString mimetype = KMimeType::findByPath( path )->name(); - m_doc = KParts::ComponentFactory::createPartInstanceFromQuery<KoDocument>( mimetype, QString::null); + m_doc = KParts::ComponentFactory::createPartInstanceFromQuery<KoDocument>( mimetype, TQString()); if (!m_doc) return false; - connect(m_doc, SIGNAL(completed()), SLOT(slotCompleted())); + connect(m_doc, TQT_SIGNAL(completed()), TQT_SLOT(slotCompleted())); KURL url; url.setPath( path ); @@ -90,22 +90,22 @@ bool KOfficeCreator::create(const QString &path, int width, int height, QImage & killTimers(); // render the page on a bigger pixmap and use smoothScale, - // looks better than directly scaling with the QPainter (malte) - QPixmap pix; + // looks better than directly scaling with the TQPainter (malte) + TQPixmap pix; if (width > 400) { - pix = m_doc->generatePreview(QSize(width, height)); + pix = m_doc->generatePreview(TQSize(width, height)); } else { - pix = m_doc->generatePreview(QSize(400, 400)); + pix = m_doc->generatePreview(TQSize(400, 400)); } img = pix.convertToImage(); return true; } -void KOfficeCreator::timerEvent(QTimerEvent *) +void KOfficeCreator::timerEvent(TQTimerEvent *) { m_doc->closeURL(); m_completed = true; diff --git a/tools/thumbnail/kofficecreator.h b/tools/thumbnail/kofficecreator.h index 3481c2b5..7bb70df7 100644 --- a/tools/thumbnail/kofficecreator.h +++ b/tools/thumbnail/kofficecreator.h @@ -26,17 +26,18 @@ class KoDocument; -class KOfficeCreator : public QObject, public ThumbCreator +class KOfficeCreator : public TQObject, public ThumbCreator { Q_OBJECT + TQ_OBJECT public: KOfficeCreator(); virtual ~KOfficeCreator(); - virtual bool create(const QString &path, int width, int height, QImage &img); + virtual bool create(const TQString &path, int width, int height, TQImage &img); virtual Flags flags() const; protected: - virtual void timerEvent(QTimerEvent *); + virtual void timerEvent(TQTimerEvent *); private slots: void slotCompleted(); |