From f4f8ac034fa04404e2fcd5029ba050c537c07d7a Mon Sep 17 00:00:00 2001 From: tpearson Date: Mon, 9 May 2011 19:45:27 +0000 Subject: TQt4 port Abakus This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/abakus@1231045 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/dragsupport.cpp | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'src/dragsupport.cpp') diff --git a/src/dragsupport.cpp b/src/dragsupport.cpp index e20207f..f597022 100644 --- a/src/dragsupport.cpp +++ b/src/dragsupport.cpp @@ -17,42 +17,42 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include "dragsupport.h" namespace DragSupport { -QPixmap makePixmap(const QString &text, const QFont &font) +TQPixmap makePixmap(const TQString &text, const TQFont &font) { - QColor background(234, 178, 230); - QFontMetrics fm(font); + TQColor background(234, 178, 230); + TQFontMetrics fm(font); int height = 2 * fm.height(); - QSize bonusSize (height, 0); - QSize size(fm.width(text), height); - QImage image(size + bonusSize, 32); + TQSize bonusSize (height, 0); + TQSize size(fm.width(text), height); + TQImage image(size + bonusSize, 32); image.setAlphaBuffer(false); image.fill(0); // All transparent pixels image.setAlphaBuffer(true); - QPixmap pix(size + bonusSize); - pix.fill(Qt::magenta); // Watch for incoming hacks + TQPixmap pix(size + bonusSize); + pix.fill(TQt::magenta); // Watch for incoming hacks - QPainter painter(&pix); + TQPainter painter(&pix); painter.setFont(font); // Outline black, background white - painter.setPen(Qt::black); + painter.setPen(TQt::black); painter.setBrush(background); // roundRect is annoying in that the four "pies" in each corner aren't @@ -64,19 +64,19 @@ QPixmap makePixmap(const QString &text, const QFont &font) int textLeft = height / 2; // Draw text - painter.setPen(Qt::black); + painter.setPen(TQt::black); painter.drawText(textLeft, height / 4, size.width(), size.height(), 0, text); - QImage overlay(pix.convertToImage()); + TQImage overlay(pix.convertToImage()); // The images should have the same size, copy pixels from overlay to the // bottom unless the pixel is called magenta. The pixels we don't copy - // are transparent in the QImage, and will remain transparent when - // converted to a QPixmap. + // are transparent in the TQImage, and will remain transparent when + // converted to a TQPixmap. for(int i = 0; i < image.width(); ++i) for(int j = 0; j < image.height(); ++j) { - if(QColor(overlay.pixel(i, j)) != Qt::magenta) + if(TQColor(overlay.pixel(i, j)) != TQt::magenta) image.setPixel(i, j, overlay.pixel(i, j)); } -- cgit v1.2.1