diff options
Diffstat (limited to 'kbattleship/kbattleship/kgridwidget.cpp')
-rw-r--r-- | kbattleship/kbattleship/kgridwidget.cpp | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/kbattleship/kbattleship/kgridwidget.cpp b/kbattleship/kbattleship/kgridwidget.cpp index 49a6d106..6cc660d7 100644 --- a/kbattleship/kbattleship/kgridwidget.cpp +++ b/kbattleship/kbattleship/kgridwidget.cpp @@ -15,9 +15,9 @@ * * ***************************************************************************/ -#include <qapplication.h> -#include <qimage.h> -#include <qpainter.h> +#include <tqapplication.h> +#include <tqimage.h> +#include <tqpainter.h> #include <kstandarddirs.h> #include <kimageeffect.h> @@ -26,9 +26,9 @@ #include "kbattlefield.h" #include "kgridwidget.h" -KGridWidget::KGridWidget(QWidget *parent, bool draw) : m_drawGrid(draw) +KGridWidget::KGridWidget(TQWidget *parent, bool draw) : m_drawGrid(draw) { - m_doubleBuffer = new QPixmap(parent->width(), parent->height()); + m_doubleBuffer = new TQPixmap(parent->width(), parent->height()); m_parent = parent; cleanBuffer(); @@ -42,31 +42,31 @@ KGridWidget::~KGridWidget() void KGridWidget::cacheImages() { - seaPng = QPixmap(findIcon("sea.png")); - waterPng = QPixmap(findIcon("water.png")); - hitPng = QPixmap(findIcon("hit.png")); - borderPng = QPixmap(findIcon("border.png")); - deathPng = QPixmap(findIcon("death.png")); - ship1p1Png = QPixmap(findIcon("ship1-1.png")); - ship1p1rPng = QPixmap(findIcon("ship1-1-r.png")); - ship2p1Png = QPixmap(findIcon("ship2-1.png")); - ship2p1rPng = QPixmap(findIcon("ship2-1-r.png")); - ship2p2Png = QPixmap(findIcon("ship2-2.png")); - ship2p2rPng = QPixmap(findIcon("ship2-2-r.png")); - ship3p1Png = QPixmap(findIcon("ship3-1.png")); - ship3p1rPng = QPixmap(findIcon("ship3-1-r.png")); - ship3p2Png = QPixmap(findIcon("ship3-2.png")); - ship3p2rPng = QPixmap(findIcon("ship3-2-r.png")); - ship3p3Png = QPixmap(findIcon("ship3-3.png")); - ship3p3rPng = QPixmap(findIcon("ship3-3-r.png")); - ship4p1Png = QPixmap(findIcon("ship4-1.png")); - ship4p1rPng = QPixmap(findIcon("ship4-1-r.png")); - ship4p2Png = QPixmap(findIcon("ship4-2.png")); - ship4p2rPng = QPixmap(findIcon("ship4-2-r.png")); - ship4p3Png = QPixmap(findIcon("ship4-3.png")); - ship4p3rPng = QPixmap(findIcon("ship4-3-r.png")); - ship4p4Png = QPixmap(findIcon("ship4-4.png")); - ship4p4rPng = QPixmap(findIcon("ship4-4-r.png")); + seaPng = TQPixmap(findIcon("sea.png")); + waterPng = TQPixmap(findIcon("water.png")); + hitPng = TQPixmap(findIcon("hit.png")); + borderPng = TQPixmap(findIcon("border.png")); + deathPng = TQPixmap(findIcon("death.png")); + ship1p1Png = TQPixmap(findIcon("ship1-1.png")); + ship1p1rPng = TQPixmap(findIcon("ship1-1-r.png")); + ship2p1Png = TQPixmap(findIcon("ship2-1.png")); + ship2p1rPng = TQPixmap(findIcon("ship2-1-r.png")); + ship2p2Png = TQPixmap(findIcon("ship2-2.png")); + ship2p2rPng = TQPixmap(findIcon("ship2-2-r.png")); + ship3p1Png = TQPixmap(findIcon("ship3-1.png")); + ship3p1rPng = TQPixmap(findIcon("ship3-1-r.png")); + ship3p2Png = TQPixmap(findIcon("ship3-2.png")); + ship3p2rPng = TQPixmap(findIcon("ship3-2-r.png")); + ship3p3Png = TQPixmap(findIcon("ship3-3.png")); + ship3p3rPng = TQPixmap(findIcon("ship3-3-r.png")); + ship4p1Png = TQPixmap(findIcon("ship4-1.png")); + ship4p1rPng = TQPixmap(findIcon("ship4-1-r.png")); + ship4p2Png = TQPixmap(findIcon("ship4-2.png")); + ship4p2rPng = TQPixmap(findIcon("ship4-2-r.png")); + ship4p3Png = TQPixmap(findIcon("ship4-3.png")); + ship4p3rPng = TQPixmap(findIcon("ship4-3-r.png")); + ship4p4Png = TQPixmap(findIcon("ship4-4.png")); + ship4p4rPng = TQPixmap(findIcon("ship4-4-r.png")); } void KGridWidget::setValues(int x, int y, int size) @@ -365,14 +365,14 @@ void KGridWidget::drawShipIcon(int ship, int part, bool rotate, bool hit) } } -void KGridWidget::drawIcon(const QPixmap &icon, bool hitBlend, bool waterBlend, bool rotate) +void KGridWidget::drawIcon(const TQPixmap &icon, bool hitBlend, bool waterBlend, bool rotate) { - QPainter painter; + TQPainter painter; painter.begin(m_doubleBuffer); if(!hitBlend && waterBlend) { - QImage first = icon.convertToImage(); - QImage second = seaPng.convertToImage(); + TQImage first = icon.convertToImage(); + TQImage second = seaPng.convertToImage(); painter.drawPixmap(m_x, m_y, seaPng); if(rotate) painter.drawImage(m_x, m_y, KImageEffect::blend(first, second, KImageEffect::VerticalGradient, 30, 30)); @@ -399,7 +399,7 @@ void KGridWidget::drawIcon(const QPixmap &icon, bool hitBlend, bool waterBlend, } } -QString KGridWidget::findIcon(const QString &name) const +TQString KGridWidget::findIcon(const TQString &name) const { return locate("data", "kbattleship/pictures/" + name); } @@ -412,5 +412,5 @@ void KGridWidget::finished() void KGridWidget::cleanBuffer() { - m_doubleBuffer->fill(QApplication::palette().color(QPalette::Normal, QColorGroup::Background)); + m_doubleBuffer->fill(TQApplication::palette().color(TQPalette::Normal, TQColorGroup::Background)); } |