From 0a80cfd57d271dd44221467efb426675fa470356 Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 28 Jun 2011 18:31:12 +0000 Subject: TQt4 port kvirc This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1238719 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/kvilib/ext/kvi_imagelib.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src/kvilib/ext/kvi_imagelib.cpp') diff --git a/src/kvilib/ext/kvi_imagelib.cpp b/src/kvilib/ext/kvi_imagelib.cpp index 10835b25..90b21af6 100644 --- a/src/kvilib/ext/kvi_imagelib.cpp +++ b/src/kvilib/ext/kvi_imagelib.cpp @@ -24,31 +24,31 @@ #define __KVILIB__ -#include +#include #include "kvi_imagelib.h" #include "kvi_fileutils.h" #include "kvi_locale.h" #include "kvi_memmove.h" -#include +#include -//KviImageLibrary::KviImageLibrary(const QPixmap &pixmap,int imageWidth,int imageHeight) +//KviImageLibrary::KviImageLibrary(const TQPixmap &pixmap,int imageWidth,int imageHeight) //{ // if(pixmap.isNull())m_pLibrary=0; -// else m_pLibrary=new QPixmap(pixmap); +// else m_pLibrary=new TQPixmap(pixmap); // setImageSize(imageWidth,imageHeight); //} -KviImageLibrary::KviImageLibrary(const QString &path,int imageWidth,int imageHeight) +KviImageLibrary::KviImageLibrary(const TQString &path,int imageWidth,int imageHeight) { m_pLibrary=0; loadLibrary(path); setImageSize(imageWidth,imageHeight); } -KviImageLibrary::KviImageLibrary(const QString &path1,const QString &path2,int imageWidth,int imageHeight) +KviImageLibrary::KviImageLibrary(const TQString &path1,const TQString &path2,int imageWidth,int imageHeight) { m_pLibrary=0; if(KviFileUtils::fileExists(path1)) @@ -78,15 +78,15 @@ bool KviImageLibrary::setImageSize(int imageWidth,int imageHeight) return true; } -bool KviImageLibrary::loadLibrary(const QString &path) +bool KviImageLibrary::loadLibrary(const TQString &path) { if(m_pLibrary)delete m_pLibrary; - m_pLibrary=new QImage(path); + m_pLibrary=new TQImage(path); if(m_pLibrary->isNull()) { delete m_pLibrary; m_pLibrary=0; - debug("WARNING : Can not load image library %s",KviQString::toUtf8(path).data()); + debug("WARNING : Can not load image library %s",KviTQString::toUtf8(path).data()); } return (m_pLibrary != 0); } @@ -99,11 +99,11 @@ int KviImageLibrary::imageCount() return ( nRows * (m_pLibrary->height()/m_iHeight)); } -QPixmap KviImageLibrary::getImage(int zeroBasedIndex) +TQPixmap KviImageLibrary::getImage(int zeroBasedIndex) { if((zeroBasedIndex >= imageCount())||(zeroBasedIndex < 0)||(m_pLibrary->depth() < 8)) { - QPixmap image(32,32); + TQPixmap image(32,32); image.fill(); //White fill return image; } @@ -114,25 +114,25 @@ QPixmap KviImageLibrary::getImage(int zeroBasedIndex) int yOffset=(zeroBasedIndex / imPerRow) * m_iHeight; #ifdef COMPILE_USE_QT4 - QImage image(m_iWidth,m_iHeight,m_pLibrary->format()); + TQImage image(m_iWidth,m_iHeight,m_pLibrary->format()); #else - QImage image(m_iWidth,m_iHeight,m_pLibrary->depth()); + TQImage image(m_iWidth,m_iHeight,m_pLibrary->depth()); #endif int d = image.depth() / 8; #ifndef COMPILE_USE_QT4 - if(d == 4)image.setAlphaBuffer(true); // Qt 4.x should manage it automagically + if(d == 4)image.setAlphaBuffer(true); // TQt 4.x should manage it automagically #endif //Copy the image data - //bitBlt(&image,0,0,m_pLibrary,xOffset,yOffset,m_iWidth,m_iHeight,Qt::CopyROP,false); + //bitBlt(&image,0,0,m_pLibrary,xOffset,yOffset,m_iWidth,m_iHeight,TQt::CopyROP,false); for(int i=0;iscanLine(i + yOffset) + (xOffset * d),m_iWidth * d); #ifdef COMPILE_USE_QT4 - QPixmap p = QPixmap::fromImage(image); + TQPixmap p = TQPixmap::fromImage(image); #else - QPixmap p(image); + TQPixmap p(image); #endif return p; } -- cgit v1.2.1