diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:42:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:42:31 +0000 |
commit | 576eb4299a00bc053db35414406f46372a0f70f2 (patch) | |
tree | 4c030922d533821db464af566188e7d40cc8848c /kblackbox/kbbgfx.cpp | |
parent | 0718336b6017d1a4fc1d626544180a5a2a29ddec (diff) | |
download | tdegames-576eb4299a00bc053db35414406f46372a0f70f2.tar.gz tdegames-576eb4299a00bc053db35414406f46372a0f70f2.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1157643 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kblackbox/kbbgfx.cpp')
-rw-r--r-- | kblackbox/kbbgfx.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/kblackbox/kbbgfx.cpp b/kblackbox/kbbgfx.cpp index d37edc1e..79e4b029 100644 --- a/kblackbox/kbbgfx.cpp +++ b/kblackbox/kbbgfx.cpp @@ -9,11 +9,11 @@ // The implementation of the KBBGraphic widget // -#include <qpainter.h> -#include <qpixmap.h> -#include <qcolor.h> -#include <qkeycode.h> -#include <qwmatrix.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqcolor.h> +#include <tqkeycode.h> +#include <tqwmatrix.h> #include "kbbgfx.h" #include "util.h" @@ -22,8 +22,8 @@ Constructs a KBBGraphic widget. */ -KBBGraphic::KBBGraphic( QPixmap **p, QWidget* parent, const char* name ) - : QWidget( parent, name ) +KBBGraphic::KBBGraphic( TQPixmap **p, TQWidget* parent, const char* name ) + : TQWidget( parent, name ) { int i; @@ -37,7 +37,7 @@ KBBGraphic::KBBGraphic( QPixmap **p, QWidget* parent, const char* name ) pix = p; if (pix == NULL) pixScaled = NULL; else { - pixScaled = new QPixmap * [NROFTYPES]; + pixScaled = new TQPixmap * [NROFTYPES]; for (i = 0; i < NROFTYPES; i++) { pixScaled[i] = new QPixmap; } @@ -117,7 +117,7 @@ void KBBGraphic::setNumCols( int cols ) void KBBGraphic::scalePixmaps( int w, int h ) { int i, w0, h0; - QWMatrix wm; + TQWMatrix wm; w0 = pix[0]->width(); h0 = pix[0]->height(); @@ -137,7 +137,7 @@ int KBBGraphic::width() { return cellW * numRows; } int KBBGraphic::height() { return cellH * numCols; } int KBBGraphic::wHint() const { return minW; } int KBBGraphic::hHint() const { return minH; } -QSize KBBGraphic::sizeHint() const { return QSize(wHint(), hHint()); } +TQSize KBBGraphic::sizeHint() const { return TQSize(wHint(), hHint()); } /* Returns a pointer to graphicBoard @@ -149,20 +149,20 @@ RectOnArray *KBBGraphic::getGraphicBoard() { return graphicBoard; } Handles cell painting for the KBBGraphic widget. */ -void KBBGraphic::paintCell( QPainter* p, int row, int col ) +void KBBGraphic::paintCell( TQPainter* p, int row, int col ) { if (pix == NULL) paintCellDefault( p, row, col ); else paintCellPixmap( p, row, col ); } -void KBBGraphic::paintCellPixmap( QPainter* p, int row, int col ) +void KBBGraphic::paintCellPixmap( TQPainter* p, int row, int col ) { int w = cellW; int h = cellH; int x2 = w - 1; int y2 = h - 1; int type; - QPixmap pm; + TQPixmap pm; // kdDebug(12009) << p->viewport().width() << endl; @@ -193,7 +193,7 @@ void KBBGraphic::paintCellPixmap( QPainter* p, int row, int col ) /* Extra drawings for boxes aroud lasers. */ - QString s; + TQString s; switch (type) { case RLASERBBG: s.sprintf( "%c", 'R' ); @@ -225,14 +225,14 @@ void KBBGraphic::paintCellPixmap( QPainter* p, int row, int col ) } } -void KBBGraphic::paintCellDefault( QPainter* p, int row, int col ) +void KBBGraphic::paintCellDefault( TQPainter* p, int row, int col ) { int w = cellW; int h = cellH; int x2 = w - 1; int y2 = h - 1; int type; - QColor color; + TQColor color; switch (type = graphicBoard->get( col, row )) { case MARK1BBG: color = darkRed; break; @@ -254,7 +254,7 @@ void KBBGraphic::paintCellDefault( QPainter* p, int row, int col ) /* Extra drawings for boxes aroud lasers. */ - QString s; + TQString s; switch (type) { case RLASERBBG: s.sprintf( "%c", 'R' ); @@ -289,10 +289,10 @@ void KBBGraphic::paintCellDefault( QPainter* p, int row, int col ) Xperimantal... */ -void KBBGraphic::paintEvent( QPaintEvent* ) +void KBBGraphic::paintEvent( TQPaintEvent* ) { int i, j; - QPainter paint( drawBuffer ); + TQPainter paint( drawBuffer ); // kdDebug(12009) << drawBuffer->width() << endl; for (i = 0; i < numRows; i++) { @@ -308,10 +308,10 @@ void KBBGraphic::paintEvent( QPaintEvent* ) Resize event of the KBBGraphic widget. */ -void KBBGraphic::resizeEvent( QResizeEvent* ) +void KBBGraphic::resizeEvent( TQResizeEvent* ) { - int w = QWidget::width(); - int h = QWidget::height(); + int w = TQWidget::width(); + int h = TQWidget::height(); int wNew, hNew; // kbDebug() << w << " " << h << " " << minW << " " << minH << endl; @@ -330,13 +330,13 @@ void KBBGraphic::resizeEvent( QResizeEvent* ) setCellHeight( hNew ); delete drawBuffer; - drawBuffer = new QPixmap( cellW * numRows, cellH * numCols ); + drawBuffer = new TQPixmap( cellW * numRows, cellH * numCols ); } /* Handles mouse press events for the KBBGraphic widget. */ -void KBBGraphic::mousePressEvent( QMouseEvent* e ) +void KBBGraphic::mousePressEvent( TQMouseEvent* e ) { if (inputAccepted) { /* @@ -348,7 +348,7 @@ void KBBGraphic::mousePressEvent( QMouseEvent* e ) } int oldRow = curRow; int oldCol = curCol; - QPoint pos = e->pos(); // extract pointer position + TQPoint pos = e->pos(); // extract pointer position curRow = pos.y() / cellH; curCol = pos.x() / cellW; //kdDebug(12009) << e->state() << " " << LeftButton << " " << e->state()&LeftButton << endl; @@ -362,11 +362,11 @@ void KBBGraphic::mousePressEvent( QMouseEvent* e ) Handles mouse move events for the KBBGraphic widget. */ -void KBBGraphic::mouseMoveEvent( QMouseEvent* e ) { +void KBBGraphic::mouseMoveEvent( TQMouseEvent* e ) { if (inputAccepted) { int oldRow = curRow; int oldCol = curCol; - QPoint pos = e->pos(); // extract pointer position + TQPoint pos = e->pos(); // extract pointer position int movRow = pos.y() / cellH; int movCol = pos.x() / cellW; // kdDebug(12009) << movRow << " " << curRow << endl; @@ -432,7 +432,7 @@ void KBBGraphic::moveSelection(int drow, int dcol) Handles focus reception events for the KBBGraphic widget. */ -void KBBGraphic::focusInEvent( QFocusEvent* ) +void KBBGraphic::focusInEvent( TQFocusEvent* ) { repaint( FALSE ); } @@ -442,7 +442,7 @@ void KBBGraphic::focusInEvent( QFocusEvent* ) Handles focus loss events for the KBBGraphic widget. */ -void KBBGraphic::focusOutEvent( QFocusEvent* ) +void KBBGraphic::focusOutEvent( TQFocusEvent* ) { repaint( FALSE ); } @@ -464,7 +464,7 @@ void KBBGraphic::setInputAccepted( bool b ) void KBBGraphic::updateElement( int col, int row ) { - QPainter paint( this ); + TQPainter paint( this ); paint.setViewport( col * cellW, row * cellH, width(), height() ); paintCell( &paint, row, col ); |