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 /lib/kofficecore/KoPictureClipart.cpp | |
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 'lib/kofficecore/KoPictureClipart.cpp')
-rw-r--r-- | lib/kofficecore/KoPictureClipart.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/lib/kofficecore/KoPictureClipart.cpp b/lib/kofficecore/KoPictureClipart.cpp index f4d94fd2..d5c482f8 100644 --- a/lib/kofficecore/KoPictureClipart.cpp +++ b/lib/kofficecore/KoPictureClipart.cpp @@ -19,10 +19,10 @@ * Boston, MA 02110-1301, USA. */ -#include <qbuffer.h> -#include <qpainter.h> -#include <qpicture.h> -#include <qpixmap.h> +#include <tqbuffer.h> +#include <tqpainter.h> +#include <tqpicture.h> +#include <tqpixmap.h> #include <kdebug.h> #include <kdeversion.h> @@ -34,7 +34,7 @@ #include "KoPictureBase.h" #include "KoPictureClipart.h" -KoPictureClipart::KoPictureClipart(void) : m_clipart(KoPictureType::formatVersionQPicture) +KoPictureClipart::KoPictureClipart(void) : m_clipart(KoPictureType::formatVersionTQPicture) { } @@ -57,15 +57,15 @@ bool KoPictureClipart::isNull(void) const return m_clipart.isNull(); } -void KoPictureClipart::drawQPicture(QPicture& clipart, QPainter& painter, +void KoPictureClipart::drawTQPicture(TQPicture& clipart, TQPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh) { kdDebug(30003) << "Drawing KoPictureClipart " << this << endl; kdDebug(30003) << " x=" << x << " y=" << y << " width=" << width << " height=" << height << endl; kdDebug(30003) << " sx=" << sx << " sy=" << sy << " sw=" << sw << " sh=" << sh << endl; painter.save(); - // Thanks to Harri, Qt3 makes it much easier than Qt2 ;) - QRect br = clipart.boundingRect(); + // Thanks to Harri, TQt3 makes it much easier than TQt2 ;) + TQRect br = clipart.boundingRect(); kdDebug(30003) << " Bounding rect. " << br << endl; painter.translate(x,y); // Translating must be done before scaling! @@ -77,17 +77,17 @@ void KoPictureClipart::drawQPicture(QPicture& clipart, QPainter& painter, painter.restore(); } -void KoPictureClipart::draw(QPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool /*fastMode*/) +void KoPictureClipart::draw(TQPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool /*fastMode*/) { - drawQPicture(m_clipart, painter, x, y, width, height, sx, sy, sw, sh); + drawTQPicture(m_clipart, painter, x, y, width, height, sx, sy, sw, sh); } -bool KoPictureClipart::loadData(const QByteArray& array, const QString& extension) +bool KoPictureClipart::loadData(const TQByteArray& array, const TQString& extension) { // Second, create the original clipart kdDebug(30003) << "Trying to load clipart... (Size:" << m_rawData.size() << ")" << endl; m_rawData=array; - QBuffer buffer(m_rawData); + TQBuffer buffer(m_rawData); buffer.open(IO_ReadOnly); bool check = true; if (extension=="svg") @@ -102,7 +102,7 @@ bool KoPictureClipart::loadData(const QByteArray& array, const QString& extensio { if (!m_clipart.load(&buffer, NULL)) { - kdWarning(30003) << "Loading QPicture has failed! (KoPictureClipart::load)" << endl; + kdWarning(30003) << "Loading TQPicture has failed! (KoPictureClipart::load)" << endl; check = false; } } @@ -110,29 +110,29 @@ bool KoPictureClipart::loadData(const QByteArray& array, const QString& extensio return check; } -bool KoPictureClipart::save(QIODevice* io) const +bool KoPictureClipart::save(TQIODevice* io) const { - // We save the raw data, as the SVG supposrt in QPicture is poor - Q_ULONG size=io->writeBlock(m_rawData); // WARNING: writeBlock returns Q_LONG but size() Q_ULONG! + // We save the raw data, as the SVG supposrt in TQPicture is poor + TQ_ULONG size=io->writeBlock(m_rawData); // WARNING: writeBlock returns TQ_LONG but size() TQ_ULONG! return (size==m_rawData.size()); } -QSize KoPictureClipart::getOriginalSize(void) const +TQSize KoPictureClipart::getOriginalSize(void) const { return m_clipart.boundingRect().size(); } -QPixmap KoPictureClipart::generatePixmap(const QSize& size, bool /*smoothScale*/) +TQPixmap KoPictureClipart::generatePixmap(const TQSize& size, bool /*smoothScale*/) { // Not sure if it works, but it worked for KoPictureFilePreviewWidget::setClipart - QPixmap pixmap(size); - QPainter p; + TQPixmap pixmap(size); + TQPainter p; p.begin( &pixmap ); - p.setBackgroundColor( Qt::white ); - pixmap.fill( Qt::white ); + p.setBackgroundColor( TQt::white ); + pixmap.fill( TQt::white ); - QRect br = m_clipart.boundingRect(); + TQRect br = m_clipart.boundingRect(); if ( br.width() && br.height() ) p.scale( (double)pixmap.width() / (double)br.width(), (double)pixmap.height() / (double)br.height() ); p.drawPicture( m_clipart ); @@ -140,7 +140,7 @@ QPixmap KoPictureClipart::generatePixmap(const QSize& size, bool /*smoothScale*/ return pixmap; } -QString KoPictureClipart::getMimeType(const QString& extension) const +TQString KoPictureClipart::getMimeType(const TQString& extension) const { if (extension=="svg") return "image/svg+xml"; |