diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-09 19:45:27 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-09 19:45:27 +0000 |
commit | f4f8ac034fa04404e2fcd5029ba050c537c07d7a (patch) | |
tree | 0daa81b0533ce203c33d5571dcb842257dba4cd0 /src/dragsupport.cpp | |
parent | 4488b6112c4e22493ed88c68035b980a5b42228d (diff) | |
download | abakus-f4f8ac034fa04404e2fcd5029ba050c537c07d7a.tar.gz abakus-f4f8ac034fa04404e2fcd5029ba050c537c07d7a.zip |
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
Diffstat (limited to 'src/dragsupport.cpp')
-rw-r--r-- | src/dragsupport.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
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 <qstring.h> -#include <qpixmap.h> -#include <qimage.h> -#include <qpainter.h> -#include <qcolor.h> -#include <qfont.h> -#include <qbrush.h> -#include <qfontmetrics.h> +#include <tqstring.h> +#include <tqpixmap.h> +#include <tqimage.h> +#include <tqpainter.h> +#include <tqcolor.h> +#include <tqfont.h> +#include <tqbrush.h> +#include <tqfontmetrics.h> #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)); } |