summaryrefslogtreecommitdiffstats
path: root/libksirtet/base
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:42:31 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:42:31 +0000
commit576eb4299a00bc053db35414406f46372a0f70f2 (patch)
tree4c030922d533821db464af566188e7d40cc8848c /libksirtet/base
parent0718336b6017d1a4fc1d626544180a5a2a29ddec (diff)
downloadtdegames-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 'libksirtet/base')
-rw-r--r--libksirtet/base/board.cpp32
-rw-r--r--libksirtet/base/board.h16
-rw-r--r--libksirtet/base/factory.cpp4
-rw-r--r--libksirtet/base/factory.h12
-rw-r--r--libksirtet/base/field.cpp48
-rw-r--r--libksirtet/base/field.h20
-rw-r--r--libksirtet/base/gtetris.cpp12
-rw-r--r--libksirtet/base/gtetris.h6
-rw-r--r--libksirtet/base/highscores.cpp2
-rw-r--r--libksirtet/base/inter.cpp4
-rw-r--r--libksirtet/base/inter.h4
-rw-r--r--libksirtet/base/kzoommainwindow.cpp24
-rw-r--r--libksirtet/base/kzoommainwindow.h6
-rw-r--r--libksirtet/base/main.cpp22
-rw-r--r--libksirtet/base/main.h2
-rw-r--r--libksirtet/base/piece.cpp36
-rw-r--r--libksirtet/base/piece.h36
-rw-r--r--libksirtet/base/settings.cpp46
-rw-r--r--libksirtet/base/settings.h8
19 files changed, 170 insertions, 170 deletions
diff --git a/libksirtet/base/board.cpp b/libksirtet/base/board.cpp
index 257e72c3..12193e31 100644
--- a/libksirtet/base/board.cpp
+++ b/libksirtet/base/board.cpp
@@ -12,14 +12,14 @@
using namespace KGrid2D;
//-----------------------------------------------------------------------------
-FixedCanvasView::FixedCanvasView(QWidget *parent, const char *name)
- : QCanvasView(parent, name, WNoAutoErase)
+FixedCanvasView::FixedCanvasView(TQWidget *parent, const char *name)
+ : TQCanvasView(parent, name, WNoAutoErase)
{}
-QSize FixedCanvasView::sizeHint() const
+TQSize FixedCanvasView::sizeHint() const
{
- if ( canvas()==0 ) return QSize();
- return canvas()->size() + 2 * QSize(frameWidth(), frameWidth());
+ if ( canvas()==0 ) return TQSize();
+ return canvas()->size() + 2 * TQSize(frameWidth(), frameWidth());
}
void FixedCanvasView::adjustSize()
@@ -35,7 +35,7 @@ const BaseBoard::DirectionData BaseBoard::DIRECTION_DATA[Nb_Direction] = {
{ SquareBase::Up, Down }
};
-BaseBoard::BaseBoard(bool graphic, QWidget *parent)
+BaseBoard::BaseBoard(bool graphic, TQWidget *parent)
: FixedCanvasView(parent, "board"),
GenericTetris(bfactory->bbi.width, bfactory->bbi.height,
bfactory->bbi.withPieces, graphic),
@@ -45,7 +45,7 @@ BaseBoard::BaseBoard(bool graphic, QWidget *parent)
if (graphic) {
setVScrollBarMode(AlwaysOff);
setHScrollBarMode(AlwaysOff);
- setFrameStyle( QFrame::Panel | QFrame::Sunken );
+ setFrameStyle( TQFrame::Panel | TQFrame::Sunken );
sequences = new SequenceArray;
main = new BlockInfo(*sequences);
@@ -54,7 +54,7 @@ BaseBoard::BaseBoard(bool graphic, QWidget *parent)
_next = new BlockInfo(*sequences);
setBlockInfo(main, _next);
- connect(&timer, SIGNAL(timeout()), SLOT(timeout()));
+ connect(&timer, TQT_SIGNAL(timeout()), TQT_SLOT(timeout()));
Piece::info().loadColors();
KZoomMainWindow::addWidget(this);
@@ -83,7 +83,7 @@ void BaseBoard::adjustSize()
for (uint j=0; j<firstClearLine(); j++) {
Coord c(i, j);
if ( matrix()[c]==0 ) continue;
- partialMoveBlock(c, QPoint(0, 0));
+ partialMoveBlock(c, TQPoint(0, 0));
}
if (_next) {
@@ -143,10 +143,10 @@ void BaseBoard::gameOver()
emit gameOverSignal();
}
-void BaseBoard::showCanvas(QCanvas *c, bool show)
+void BaseBoard::showCanvas(TQCanvas *c, bool show)
{
- QCanvasItemList l = c->allItems();
- QCanvasItemList::Iterator it;
+ TQCanvasItemList l = c->allItems();
+ TQCanvasItemList::Iterator it;
for (it=l.begin(); it!=l.end(); ++it) {
if (show) (*it)->show();
else (*it)->hide();
@@ -236,7 +236,7 @@ bool BaseBoard::doFall(bool doAll, bool first, bool lineByLine)
// we do not rely on firstClearLine() here since this method is
// used in kfouleggs to make gift blocks fall down ...
uint h = 0;
- QMemArray<uint> heights(matrix().height());
+ TQMemArray<uint> heights(matrix().height());
for (uint j=1; j<matrix().height(); j++) { // first line cannot fall
Coord src(i, j);
if ( toFall(src) ) h++;
@@ -347,7 +347,7 @@ void BaseBoard::partialBlockFall(const Coord &src, const Coord &dest)
float c = float(loop+1) / bfactory->bbi.nbFallStages * BasePrefs::blockSize();
int xdec = dest.first - src.first;
int ydec = src.second - dest.second;
- QPoint p(int(xdec * c), int(ydec * c));
+ TQPoint p(int(xdec * c), int(ydec * c));
partialMoveBlock(src, p);
}
@@ -383,11 +383,11 @@ void BaseBoard::blockInGroup(Square<int> &field, const Coord &c, uint value,
_findGroup(field, c, nb, set);
}
-QMemArray<uint> BaseBoard::findGroups(Square<int> &field, uint minSize,
+TQMemArray<uint> BaseBoard::findGroups(Square<int> &field, uint minSize,
bool exitAtFirstFound) const
{
field.fill(0);
- QMemArray<uint> groups;
+ TQMemArray<uint> groups;
for (uint j=0; j<firstClearLine(); j++)
for (uint i=0; i<matrix().width(); i++) {
Coord c(i, j);
diff --git a/libksirtet/base/board.h b/libksirtet/base/board.h
index 443c6532..7be2a4ec 100644
--- a/libksirtet/base/board.h
+++ b/libksirtet/base/board.h
@@ -1,8 +1,8 @@
#ifndef BASE_BOARD_H
#define BASE_BOARD_H
-#include <qtimer.h>
-#include <qcanvas.h>
+#include <tqtimer.h>
+#include <tqcanvas.h>
#include "gtetris.h"
@@ -16,9 +16,9 @@ class KDE_EXPORT FixedCanvasView : public QCanvasView
{
Q_OBJECT
public:
- FixedCanvasView(QWidget *parent = 0, const char *name = 0);
+ FixedCanvasView(TQWidget *parent = 0, const char *name = 0);
- virtual QSize sizeHint() const;
+ virtual TQSize sizeHint() const;
public slots:
virtual void adjustSize();
@@ -38,7 +38,7 @@ class KDE_EXPORT BaseBoard : public FixedCanvasView, public GenericTetris
static const DirectionData DIRECTION_DATA[Nb_Direction];
public:
- BaseBoard(bool graphic, QWidget *parent);
+ BaseBoard(bool graphic, TQWidget *parent);
virtual ~BaseBoard();
void copy(const GenericTetris &);
@@ -93,7 +93,7 @@ class KDE_EXPORT BaseBoard : public FixedCanvasView, public GenericTetris
void partialBlockFall(const KGrid2D::Coord &src, const KGrid2D::Coord &dest);
// return the sizes of the groups (>=minSize)
- QMemArray<uint> findGroups(KGrid2D::Square<int> &field, uint minSize,
+ TQMemArray<uint> findGroups(KGrid2D::Square<int> &field, uint minSize,
bool exitAtFirstFound = false) const;
// find group size and put -1 in the corresponding blocks (these blocks
// should be 0 at start)
@@ -107,13 +107,13 @@ class KDE_EXPORT BaseBoard : public FixedCanvasView, public GenericTetris
void updateScore(uint newScore);
virtual void showBoard(bool show);
- void showCanvas(QCanvas *c, bool show);
+ void showCanvas(TQCanvas *c, bool show);
enum BoardState { GameOver, Normal, Paused,
DropDown, BeforeGlue, AfterGlue, BeforeRemove,
AfterRemove, AfterGift };
BoardState state, _oldState;
- QTimer timer;
+ TQTimer timer;
SequenceArray *sequences;
BlockInfo *main, *_next;
uint loop;
diff --git a/libksirtet/base/factory.cpp b/libksirtet/base/factory.cpp
index 55850f0b..cb2f484b 100644
--- a/libksirtet/base/factory.cpp
+++ b/libksirtet/base/factory.cpp
@@ -41,12 +41,12 @@ BaseFactory::~BaseFactory()
_self = 0;
}
-QWidget *BaseFactory::createAppearanceConfig()
+TQWidget *BaseFactory::createAppearanceConfig()
{
return new BaseAppearanceConfig;
}
-QWidget *BaseFactory::createColorConfig()
+TQWidget *BaseFactory::createColorConfig()
{
return new ColorConfig;
}
diff --git a/libksirtet/base/factory.h b/libksirtet/base/factory.h
index b542205e..60717f4c 100644
--- a/libksirtet/base/factory.h
+++ b/libksirtet/base/factory.h
@@ -1,7 +1,7 @@
#ifndef BASE_FACTORY_H
#define BASE_FACTORY_H
-#include <qglobal.h>
+#include <tqglobal.h>
#include <kdemacros.h>
@@ -43,12 +43,12 @@ class KDE_EXPORT BaseFactory
const MainData &mainData;
const BaseBoardInfo &bbi;
- virtual BaseBoard *createBoard(bool graphic, QWidget *parent) = 0;
- virtual BaseInterface *createInterface(QWidget *parent) = 0;
+ virtual BaseBoard *createBoard(bool graphic, TQWidget *parent) = 0;
+ virtual BaseInterface *createInterface(TQWidget *parent) = 0;
- virtual QWidget *createAppearanceConfig();
- virtual QWidget *createColorConfig();
- virtual QWidget *createGameConfig() { return 0; }
+ virtual TQWidget *createAppearanceConfig();
+ virtual TQWidget *createColorConfig();
+ virtual TQWidget *createGameConfig() { return 0; }
protected:
KAboutData *_aboutData;
diff --git a/libksirtet/base/field.cpp b/libksirtet/base/field.cpp
index 53f6220a..fae20266 100644
--- a/libksirtet/base/field.cpp
+++ b/libksirtet/base/field.cpp
@@ -1,9 +1,9 @@
#include "field.h"
-#include <qwhatsthis.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
+#include <tqwhatsthis.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqpushbutton.h>
#include <klocale.h>
#include <kcanvasrootpixmap.h>
@@ -19,12 +19,12 @@ const char *BaseField::BUTTON_TEXTS[NB_BUTTON_TYPE] = {
I18N_NOOP("Start"), I18N_NOOP("Resume"), I18N_NOOP("Proceed")
};
-BaseField::BaseField(QWidget *w)
+BaseField::BaseField(TQWidget *w)
: _widget(w), _boardLayout(0), _label(0), _button(0)
{
- top = new QGridLayout(w, 3, 5, 10);
+ top = new TQGridLayout(w, 3, 5, 10);
- lcds = new QGridLayout(7, 1, 5);
+ lcds = new TQGridLayout(7, 1, 5);
top->addLayout(lcds, 1, 0);
lcds->setRowStretch(1, 0);
@@ -35,15 +35,15 @@ BaseField::BaseField(QWidget *w)
}
void BaseField::init(bool AI, bool multiplayer, bool server, bool first,
- const QString &name)
+ const TQString &name)
{
_flags.AI = AI;
_flags.multiplayer = multiplayer;
_flags.server = server;
_flags.first = first;
- QString text = (AI ? i18n("%1\n(AI player)").arg(name)
+ TQString text = (AI ? i18n("%1\n(AI player)").arg(name)
: (multiplayer ? i18n("%1\n(Human player)").arg(name)
- : QString::null));
+ : TQString::null));
if ( first && !server ) text += i18n("\nWaiting for server");
setMessage(text, (first && server ? StartButton : NoButton));
showScore->resetColor();
@@ -61,7 +61,7 @@ bool BaseField::isArcade() const
return board->isArcade();
}
-void BaseField::setMessage(const QString &label, ButtonType type)
+void BaseField::setMessage(const TQString &label, ButtonType type)
{
delete _label;
_label = 0;
@@ -75,24 +75,24 @@ void BaseField::setMessage(const QString &label, ButtonType type)
return;
}
- _boardLayout = new QVBoxLayout(board);
+ _boardLayout = new TQVBoxLayout(board);
_boardLayout->addStretch(3);
if ( !label.isEmpty() ) {
- QString str = (isArcade() ? i18n("Arcade game") + '\n'
- : QString::null) + label;
- _label = new QLabel(str, board);
+ TQString str = (isArcade() ? i18n("Arcade game") + '\n'
+ : TQString::null) + label;
+ _label = new TQLabel(str, board);
_label->setAlignment(Qt::AlignCenter);
- _label->setFrameStyle( QFrame::Panel | QFrame::Sunken );
+ _label->setFrameStyle( TQFrame::Panel | TQFrame::Sunken );
_boardLayout->addWidget(_label, 0, Qt::AlignCenter);
_label->show();
}
_boardLayout->addStretch(1);
if ( type!=NoButton ) {
- _button = new QPushButton(i18n(BUTTON_TEXTS[type]), board);
+ _button = new TQPushButton(i18n(BUTTON_TEXTS[type]), board);
_button->setFocus();
- const char *slot = (type==ResumeButton ? SLOT(pause())
- : SLOT(start()));
- _button->connect(_button, SIGNAL(clicked()),
+ const char *slot = (type==ResumeButton ? TQT_SLOT(pause())
+ : TQT_SLOT(start()));
+ _button->connect(_button, TQT_SIGNAL(clicked()),
_widget->parent(), slot);
_boardLayout->addWidget(_button, 0, Qt::AlignCenter);
_button->show();
@@ -123,7 +123,7 @@ void BaseField::stop(bool gameover)
{
board->stop();
ButtonType button = StartButton;
- QString msg = (gameover ? i18n("Game over") : QString::null);
+ TQString msg = (gameover ? i18n("Game over") : TQString::null);
if ( board->isArcade() && board->arcadeStageDone() ) {
if ( board->arcadeStage()==bfactory->bbi.nbArcadeStages )
msg = i18n("The End");
@@ -135,7 +135,7 @@ void BaseField::stop(bool gameover)
setMessage(msg, button);
}
-void BaseField::gameOver(const KExtHighscore::Score &score, QWidget *parent)
+void BaseField::gameOver(const KExtHighscore::Score &score, TQWidget *parent)
{
KNotifyClient::event(parent->winId(), "game over", i18n("Game Over"));
KExtHighscore::submitScore(score, parent);
@@ -146,7 +146,7 @@ void BaseField::scoreUpdated()
showScore->display( (int)board->score() );
if (_flags.multiplayer) return;
- QColor color;
+ TQColor color;
if ( _firstScore<currentScore() ) color = Qt::red;
else if ( _lastScore<currentScore() ) color = Qt::blue;
showScore->setColor(color);
@@ -154,7 +154,7 @@ void BaseField::scoreUpdated()
void BaseField::settingsChanged()
{
- QColor color = BasePrefs::fadeColor();
+ TQColor color = BasePrefs::fadeColor();
double s = BasePrefs::fadeIntensity();
_boardRootPixmap->setFadeEffect(s, color);
board->canvas()->setBackgroundColor(color);
diff --git a/libksirtet/base/field.h b/libksirtet/base/field.h
index d006a052..f4478ad5 100644
--- a/libksirtet/base/field.h
+++ b/libksirtet/base/field.h
@@ -18,39 +18,39 @@ class KCanvasRootPixmap;
class KDE_EXPORT BaseField
{
public:
- BaseField(QWidget *widget);
+ BaseField(TQWidget *widget);
virtual ~BaseField() {}
virtual KExtHighscore::Score currentScore() const = 0;
- static void gameOver(const KExtHighscore::Score &, QWidget *parent);
+ static void gameOver(const KExtHighscore::Score &, TQWidget *parent);
virtual void setArcade();
bool isArcade() const;
protected:
- QGridLayout *top, *lcds;
+ TQGridLayout *top, *lcds;
KGameLCD *showScore;
KGameLCDList *removedList, *scoreList;
BaseBoard *board;
virtual void scoreUpdated();
virtual void init(bool AI, bool multiplayer, bool server, bool first,
- const QString &name);
+ const TQString &name);
virtual void start(const GTInitData &);
virtual void pause(bool pause);
virtual void stop(bool gameover);
virtual void settingsChanged();
private:
- QWidget *_widget;
+ TQWidget *_widget;
struct Flags {
bool AI, multiplayer, server, first;
};
Flags _flags;
uint _arcadeStage;
- QVBoxLayout *_boardLayout;
- QLabel *_label;
- QButton *_button;
+ TQVBoxLayout *_boardLayout;
+ TQLabel *_label;
+ TQButton *_button;
KCanvasRootPixmap *_boardRootPixmap;
KExtHighscore::Score _firstScore, _lastScore;
@@ -59,8 +59,8 @@ class KDE_EXPORT BaseField
static const char *BUTTON_TEXTS[NB_BUTTON_TYPE];
bool hasButton() const { return _flags.server && _flags.first; }
- void setMessage(const QString &label, ButtonType);
- void hideMessage() { setMessage(QString::null, NB_BUTTON_TYPE); }
+ void setMessage(const TQString &label, ButtonType);
+ void hideMessage() { setMessage(TQString::null, NB_BUTTON_TYPE); }
};
#endif
diff --git a/libksirtet/base/gtetris.cpp b/libksirtet/base/gtetris.cpp
index 2141f9ef..6c2a66a9 100644
--- a/libksirtet/base/gtetris.cpp
+++ b/libksirtet/base/gtetris.cpp
@@ -166,7 +166,7 @@ bool GenericTetris::rotate(bool left)
Piece tmp;
tmp.copy(_currentPiece);
- QPoint p(0, 0);
+ TQPoint p(0, 0);
tmp.rotate(left, p);
if ( canPosition(_currentPos, &tmp) ) {
if (_graphic) p = toPoint(_currentPos);
@@ -192,7 +192,7 @@ void GenericTetris::setBlock(const Coord &c, Block *b)
Q_ASSERT( b && _matrix[c]==0 );
_matrix[c] = b;
if (_graphic) {
- QPoint p = toPoint(c);
+ TQPoint p = toPoint(c);
b->sprite()->move(p.x(), p.y());
}
}
@@ -212,7 +212,7 @@ void GenericTetris::moveBlock(const Coord &src, const Coord &dest)
}
}
-QPoint GenericTetris::toPoint(const Coord &c) const
+TQPoint GenericTetris::toPoint(const Coord &c) const
{
return _main->toPoint(Coord(c.first, _matrix.height() - 1 - c.second));
}
@@ -230,12 +230,12 @@ void GenericTetris::gluePiece()
void GenericTetris::bumpCurrentPiece(int dec)
{
Q_ASSERT( _graphic && _currentPiece );
- _currentPiece->move(toPoint(_currentPos) + QPoint(0, dec));
+ _currentPiece->move(toPoint(_currentPos) + TQPoint(0, dec));
}
-void GenericTetris::partialMoveBlock(const Coord &c, const QPoint &dec)
+void GenericTetris::partialMoveBlock(const Coord &c, const TQPoint &dec)
{
Q_ASSERT( _graphic && _matrix[c]!=0 );
- QPoint p = toPoint(c) + dec;
+ TQPoint p = toPoint(c) + dec;
_matrix[c]->sprite()->move(p.x(), p.y());
}
diff --git a/libksirtet/base/gtetris.h b/libksirtet/base/gtetris.h
index 48aefb9d..b0f990b9 100644
--- a/libksirtet/base/gtetris.h
+++ b/libksirtet/base/gtetris.h
@@ -91,7 +91,7 @@
#ifndef GTETRIS_H
#define GTETRIS_H
-#include <qpoint.h>
+#include <tqpoint.h>
#include <krandomsequence.h>
#include <kgrid2d.h>
@@ -155,10 +155,10 @@ class KDE_EXPORT GenericTetris
virtual void updateNextPiece() {}
virtual void updatePieceConfig() {}
void bumpCurrentPiece(int dec);
- void partialMoveBlock(const KGrid2D::Coord &, const QPoint &dec);
+ void partialMoveBlock(const KGrid2D::Coord &, const TQPoint &dec);
private:
- QPoint toPoint(const KGrid2D::Coord &) const;
+ TQPoint toPoint(const KGrid2D::Coord &) const;
uint moveTo(const KGrid2D::Coord &dec);
bool rotate(bool left);
void clear();
diff --git a/libksirtet/base/highscores.cpp b/libksirtet/base/highscores.cpp
index 2b3596d7..d1836d78 100644
--- a/libksirtet/base/highscores.cpp
+++ b/libksirtet/base/highscores.cpp
@@ -12,7 +12,7 @@ BaseHighscores::BaseHighscores()
setWWHighscores(KURL( bfactory->mainData.homepage ), bfactory->mainData.version);
const BaseBoardInfo &bi = bfactory->bbi;
if ( bi.histogramSize!=0 ) {
- QMemArray<uint> a;
+ TQMemArray<uint> a;
a.duplicate(bi.histogram, bi.histogramSize);
setScoreHistogram(a, bi.scoreBound ? ScoreBound : ScoreNotBound);
}
diff --git a/libksirtet/base/inter.cpp b/libksirtet/base/inter.cpp
index 4f40b63f..658e7c47 100644
--- a/libksirtet/base/inter.cpp
+++ b/libksirtet/base/inter.cpp
@@ -3,13 +3,13 @@
#include <kexthighscore.h>
-void BaseInterface::showHighscores(QWidget *parent)
+void BaseInterface::showHighscores(TQWidget *parent)
{
if ( !_isPaused() ) _pause();
_showHighscores(parent);
}
-void BaseInterface::_showHighscores(QWidget *parent)
+void BaseInterface::_showHighscores(TQWidget *parent)
{
KExtHighscore::show(parent);
}
diff --git a/libksirtet/base/inter.h b/libksirtet/base/inter.h
index 446a77d3..ac72b61c 100644
--- a/libksirtet/base/inter.h
+++ b/libksirtet/base/inter.h
@@ -14,10 +14,10 @@ public:
virtual void _pause() = 0;
virtual bool _isPaused() const = 0;
- void showHighscores(QWidget *parent);
+ void showHighscores(TQWidget *parent);
protected:
- virtual void _showHighscores(QWidget *parent);
+ virtual void _showHighscores(TQWidget *parent);
};
#endif
diff --git a/libksirtet/base/kzoommainwindow.cpp b/libksirtet/base/kzoommainwindow.cpp
index 115d5175..4e1b85a5 100644
--- a/libksirtet/base/kzoommainwindow.cpp
+++ b/libksirtet/base/kzoommainwindow.cpp
@@ -30,11 +30,11 @@ KZoomMainWindow::KZoomMainWindow(uint min, uint max, uint step, const char *name
{
installEventFilter(this);
- _zoomInAction = KStdAction::zoomIn(this, SLOT(zoomIn()), actionCollection());
+ _zoomInAction = KStdAction::zoomIn(this, TQT_SLOT(zoomIn()), actionCollection());
_zoomOutAction =
- KStdAction::zoomOut(this, SLOT(zoomOut()), actionCollection());
+ KStdAction::zoomOut(this, TQT_SLOT(zoomOut()), actionCollection());
_menu =
- KStdAction::showMenubar(this, SLOT(toggleMenubar()), actionCollection());
+ KStdAction::showMenubar(this, TQT_SLOT(toggleMenubar()), actionCollection());
}
void KZoomMainWindow::init(const char *popupName)
@@ -48,32 +48,32 @@ void KZoomMainWindow::init(const char *popupName)
// context popup
if (popupName) {
- QPopupMenu *popup =
- static_cast<QPopupMenu *>(factory()->container(popupName, this));
+ TQPopupMenu *popup =
+ static_cast<TQPopupMenu *>(factory()->container(popupName, this));
Q_ASSERT(popup);
if (popup) KContextMenuManager::insert(this, popup);
}
}
-void KZoomMainWindow::addWidget(QWidget *widget)
+void KZoomMainWindow::addWidget(TQWidget *widget)
{
widget->adjustSize();
- QWidget *tlw = widget->topLevelWidget();
+ TQWidget *tlw = widget->topLevelWidget();
KZoomMainWindow *zm =
static_cast<KZoomMainWindow *>(tlw->qt_cast("KZoomMainWindow"));
Q_ASSERT(zm);
zm->_widgets.append(widget);
- connect(widget, SIGNAL(destroyed()), zm, SLOT(widgetDestroyed()));
+ connect(widget, TQT_SIGNAL(destroyed()), zm, TQT_SLOT(widgetDestroyed()));
}
void KZoomMainWindow::widgetDestroyed()
{
- _widgets.remove(static_cast<const QWidget *>(sender()));
+ _widgets.remove(static_cast<const TQWidget *>(sender()));
}
-bool KZoomMainWindow::eventFilter(QObject *o, QEvent *e)
+bool KZoomMainWindow::eventFilter(TQObject *o, TQEvent *e)
{
- if ( e->type()==QEvent::LayoutHint )
+ if ( e->type()==TQEvent::LayoutHint )
setFixedSize(minimumSize()); // because K/QMainWindow
// does not manage fixed central widget
// with hidden menubar...
@@ -84,7 +84,7 @@ void KZoomMainWindow::setZoom(uint zoom)
{
_zoom = zoom;
writeZoomSetting(_zoom);
- QPtrListIterator<QWidget> it(_widgets);
+ TQPtrListIterator<TQWidget> it(_widgets);
for (; it.current(); ++it)
(*it)->adjustSize();;
_zoomOutAction->setEnabled( _zoom>_minZoom );
diff --git a/libksirtet/base/kzoommainwindow.h b/libksirtet/base/kzoommainwindow.h
index 14f780fb..fd213fd7 100644
--- a/libksirtet/base/kzoommainwindow.h
+++ b/libksirtet/base/kzoommainwindow.h
@@ -53,7 +53,7 @@ public:
* widget is called whenever the zoom is changed.
* This function assumes that the topLevelWidget() is the KZoomMainWindow.
*/
- static void addWidget(QWidget *widget);
+ static void addWidget(TQWidget *widget);
uint zoom() const { return _zoom; }
@@ -71,7 +71,7 @@ protected:
void init(const char *popupName = 0);
virtual void setZoom(uint zoom);
- virtual bool eventFilter(QObject *o, QEvent *e);
+ virtual bool eventFilter(TQObject *o, TQEvent *e);
virtual bool queryExit();
/** You need to implement this method since different application
@@ -117,7 +117,7 @@ private slots:
private:
uint _zoom, _zoomStep, _minZoom, _maxZoom;
- QPtrList<QWidget> _widgets;
+ TQPtrList<TQWidget> _widgets;
KAction *_zoomInAction, *_zoomOutAction;
KToggleAction *_menu;
diff --git a/libksirtet/base/main.cpp b/libksirtet/base/main.cpp
index 4b5a4160..e09a9c50 100644
--- a/libksirtet/base/main.cpp
+++ b/libksirtet/base/main.cpp
@@ -24,26 +24,26 @@ BaseMainWindow::BaseMainWindow()
KNotifyClient::startDaemon();
// File & Popup
- KStdGameAction::gameNew(this, SLOT(start()), actionCollection());
- _pause = KStdGameAction::pause(this, SLOT(pause()), actionCollection());
+ KStdGameAction::gameNew(this, TQT_SLOT(start()), actionCollection());
+ _pause = KStdGameAction::pause(this, TQT_SLOT(pause()), actionCollection());
_pause->setEnabled(false);
- KStdGameAction::highscores(this, SLOT(showHighscores()),
+ KStdGameAction::highscores(this, TQT_SLOT(showHighscores()),
actionCollection());
- KStdGameAction::quit(qApp, SLOT(quit()), actionCollection());
+ KStdGameAction::quit(qApp, TQT_SLOT(quit()), actionCollection());
// Settings
- KStdAction::preferences(this, SLOT(configureSettings()),
+ KStdAction::preferences(this, TQT_SLOT(configureSettings()),
actionCollection());
- KStdAction::keyBindings(this, SLOT(configureKeys()), actionCollection());
- KStdAction::configureNotifications(this, SLOT(configureNotifications()),
+ KStdAction::keyBindings(this, TQT_SLOT(configureKeys()), actionCollection());
+ KStdAction::configureNotifications(this, TQT_SLOT(configureNotifications()),
actionCollection());
- KStdGameAction::configureHighscores(this, SLOT(configureHighscores()),
+ KStdGameAction::configureHighscores(this, TQT_SLOT(configureHighscores()),
actionCollection());
_inter = bfactory->createInterface(this);
}
-void BaseMainWindow::buildGUI(QWidget *widget)
+void BaseMainWindow::buildGUI(TQWidget *widget)
{
createGUI();
setCentralWidget(widget);
@@ -81,7 +81,7 @@ void BaseMainWindow::configureSettings()
if ( KConfigDialog::showDialog("settings") ) return;
KConfigDialog *dialog = new KConfigDialog(this, "settings", BasePrefs::self() );
- QWidget *w = bfactory->createGameConfig();
+ TQWidget *w = bfactory->createGameConfig();
if (w) dialog->addPage(w, i18n("Game"), "package_system");
w = bfactory->createAppearanceConfig();
if (w) dialog->addPage(w, i18n("Appearance"), "style");
@@ -89,7 +89,7 @@ void BaseMainWindow::configureSettings()
if (w) dialog->addPage(w, i18n("Colors"), "colorize");
// dialog->addPage(new BackgroundConfigWidget, i18n("Background"), "background");
addConfig(dialog);
- connect(dialog, SIGNAL(settingsChanged()), SIGNAL(settingsChanged()));
+ connect(dialog, TQT_SIGNAL(settingsChanged()), TQT_SIGNAL(settingsChanged()));
dialog->show();
}
diff --git a/libksirtet/base/main.h b/libksirtet/base/main.h
index d2e108aa..cd165963 100644
--- a/libksirtet/base/main.h
+++ b/libksirtet/base/main.h
@@ -32,7 +32,7 @@ private slots:
protected:
BaseInterface *_inter;
- void buildGUI(QWidget *widget);
+ void buildGUI(TQWidget *widget);
virtual void addConfig(KConfigDialog *) {}
virtual void addKeys(KKeyDialog &) {}
virtual void saveKeys() {}
diff --git a/libksirtet/base/piece.cpp b/libksirtet/base/piece.cpp
index 25aed934..d423473c 100644
--- a/libksirtet/base/piece.cpp
+++ b/libksirtet/base/piece.cpp
@@ -7,9 +7,9 @@
using namespace KGrid2D;
-QPoint operator *(const Coord &c, int i)
+TQPoint operator *(const Coord &c, int i)
{
- return QPoint(c.first * i, c.second * i);
+ return TQPoint(c.first * i, c.second * i);
}
//-----------------------------------------------------------------------------
@@ -18,10 +18,10 @@ GPieceInfo::GPieceInfo()
Piece::setPieceInfo(this);
}
-QPixmap *GPieceInfo::pixmap(uint blockSize, uint blockType, uint blockMode,
+TQPixmap *GPieceInfo::pixmap(uint blockSize, uint blockType, uint blockMode,
bool lighted) const
{
- QPixmap *pixmap = new QPixmap(blockSize, blockSize);
+ TQPixmap *pixmap = new TQPixmap(blockSize, blockSize);
draw(pixmap, blockType, blockMode, lighted);
setMask(pixmap, blockMode);
return pixmap;
@@ -73,18 +73,18 @@ void SequenceArray::setBlockSize(uint bsize)
{
_size = bsize;
const GPieceInfo &pinfo = Piece::info();
- QPtrList<QPixmap> pixmaps;
+ TQPtrList<TQPixmap> pixmaps;
pixmaps.setAutoDelete(TRUE);
- QPtrList<QPoint> points;
+ TQPtrList<TQPoint> points;
points.setAutoDelete(TRUE);
uint nm = pinfo.nbBlockModes();
for (uint i=0; i<size(); i++) {
for (uint k=0; k<2; k++)
for (uint j=0; j<nm; j++) {
- QPoint *po = new QPoint(0, 0);
- QPixmap *pi = pinfo.pixmap(bsize, i, j, k==1);
+ TQPoint *po = new TQPoint(0, 0);
+ TQPixmap *pi = pinfo.pixmap(bsize, i, j, k==1);
if ( at(i) ) {
- at(i)->setImage(k*nm + j, new QCanvasPixmap(*pi, *po));
+ at(i)->setImage(k*nm + j, new TQCanvasPixmap(*pi, *po));
delete po;
delete pi;
} else {
@@ -93,7 +93,7 @@ void SequenceArray::setBlockSize(uint bsize)
}
}
if ( at(i)==0 ) {
- at(i) = new QCanvasPixmapArray(pixmaps, points);
+ at(i) = new TQCanvasPixmapArray(pixmaps, points);
pixmaps.clear();
points.clear();
}
@@ -110,7 +110,7 @@ BlockInfo::BlockInfo(const SequenceArray &s)
: _sequences(s)
{}
-QPoint BlockInfo::toPoint(const Coord &pos) const
+TQPoint BlockInfo::toPoint(const Coord &pos) const
{
return pos * _sequences.blockSize();
}
@@ -129,10 +129,10 @@ void Block::setValue(uint value, BlockInfo *binfo)
{
_value = value;
if (binfo) {
- QCanvasPixmapArray *seq = binfo->sequences()[value];
+ TQCanvasPixmapArray *seq = binfo->sequences()[value];
if (_sprite) _sprite->setSequence(seq);
else {
- _sprite = new QCanvasSprite(seq, binfo);
+ _sprite = new TQCanvasSprite(seq, binfo);
_sprite->setZ(0);
}
}
@@ -161,7 +161,7 @@ Piece::Piece()
_blocks.setAutoDelete(true);
}
-void Piece::rotate(bool left, const QPoint &p)
+void Piece::rotate(bool left, const TQPoint &p)
{
if (left) {
if ( _rotation==0 ) _rotation = 3;
@@ -231,7 +231,7 @@ void Piece::generateNext(int type)
void Piece::moveCenter()
{
uint s = _binfo->sequences().blockSize();
- QPoint p = QPoint(_binfo->width(), _binfo->height()) - size() * s;
+ TQPoint p = TQPoint(_binfo->width(), _binfo->height()) - size() * s;
move(p/2 - min() * s);
}
@@ -240,14 +240,14 @@ Coord Piece::pos(uint k, const Coord &pos) const
return Coord(pos.first + coord(k).first, pos.second - coord(k).second);
}
-void Piece::move(const QPoint &p)
+void Piece::move(const TQPoint &p)
{
for (uint k=0; k<_blocks.size(); k++) moveBlock(k, p);
}
-void Piece::moveBlock(uint k, const QPoint &p)
+void Piece::moveBlock(uint k, const TQPoint &p)
{
- QPoint po = p + _binfo->toPoint(coord(k));
+ TQPoint po = p + _binfo->toPoint(coord(k));
_blocks[k]->sprite()->move(po.x(), po.y());
}
diff --git a/libksirtet/base/piece.h b/libksirtet/base/piece.h
index 4c0486a8..6cdd667c 100644
--- a/libksirtet/base/piece.h
+++ b/libksirtet/base/piece.h
@@ -1,8 +1,8 @@
#ifndef BASE_PIECE_H
#define BASE_PIECE_H
-#include <qcanvas.h>
-#include <qptrvector.h>
+#include <tqcanvas.h>
+#include <tqptrvector.h>
#include <kgrid2d.h>
@@ -29,7 +29,7 @@ class GPieceInfo
KGrid2D::Coord maxSize() const;
- QPixmap *pixmap(uint blockSize, uint blockType, uint blockMode,
+ TQPixmap *pixmap(uint blockSize, uint blockType, uint blockMode,
bool lighted) const;
virtual uint nbNormalBlockTypes() const = 0;
@@ -39,23 +39,23 @@ class GPieceInfo
uint generateGarbageBlockType(KRandomSequence *) const;
virtual uint nbColors() const = 0;
- virtual QString colorLabel(uint i) const = 0;
- QCString colorKey(uint i) const;
- virtual QColor defaultColor(uint i) const = 0;
+ virtual TQString colorLabel(uint i) const = 0;
+ TQCString colorKey(uint i) const;
+ virtual TQColor defaultColor(uint i) const = 0;
void loadColors();
protected:
- QColor color(uint i) const { return _colors[i]; }
+ TQColor color(uint i) const { return _colors[i]; }
- virtual void draw(QPixmap *, uint blockType, uint blockMode,
+ virtual void draw(TQPixmap *, uint blockType, uint blockMode,
bool lighted) const = 0;
- virtual void setMask(QPixmap *, uint /*blockMode*/) const {}
+ virtual void setMask(TQPixmap *, uint /*blockMode*/) const {}
private:
- QValueVector<QColor> _colors;
+ TQValueVector<TQColor> _colors;
};
-class SequenceArray : public QMemArray<QCanvasPixmapArray *>
+class SequenceArray : public TQMemArray<TQCanvasPixmapArray *>
{
public:
SequenceArray();
@@ -75,7 +75,7 @@ class BlockInfo : public QCanvas
BlockInfo(const SequenceArray &);
const SequenceArray &sequences() const { return _sequences; }
- QPoint toPoint(const KGrid2D::Coord &) const;
+ TQPoint toPoint(const KGrid2D::Coord &) const;
private:
const SequenceArray &_sequences;
@@ -92,11 +92,11 @@ class Block
uint value() const { return _value; }
bool isGarbage() const;
void toggleLight();
- QCanvasSprite *sprite() const { return _sprite; }
+ TQCanvasSprite *sprite() const { return _sprite; }
private:
uint _value;
- QCanvasSprite *_sprite;
+ TQCanvasSprite *_sprite;
Block(const Block &); // disabled
Block &operator =(const Block &); // disabled
@@ -125,8 +125,8 @@ class Piece
KGrid2D::Coord size() const { return max() - min() + KGrid2D::Coord(1, 1); }
void generateNext(int type = -1);
- void rotate(bool left, const QPoint &);
- void move(const QPoint &);
+ void rotate(bool left, const TQPoint &);
+ void move(const TQPoint &);
void moveCenter();
void show(bool show);
@@ -136,7 +136,7 @@ class Piece
Block *takeBlock(uint k);
private:
- QPtrVector<Block> _blocks;
+ TQPtrVector<Block> _blocks;
uint _type;
KRandomSequence *_random;
static GPieceInfo *_info;
@@ -149,7 +149,7 @@ class Piece
Piece &operator =(const Piece &); // disabled
KGrid2D::Coord coord(uint k) const { return KGrid2D::Coord(_i[k], _j[k]); }
- void moveBlock(uint k, const QPoint &);
+ void moveBlock(uint k, const TQPoint &);
};
#endif
diff --git a/libksirtet/base/settings.cpp b/libksirtet/base/settings.cpp
index 1ea3b16a..a695d746 100644
--- a/libksirtet/base/settings.cpp
+++ b/libksirtet/base/settings.cpp
@@ -1,11 +1,11 @@
#include "settings.h"
#include "settings.moc"
-#include <qlabel.h>
-#include <qhbox.h>
-#include <qlayout.h>
-#include <qcheckbox.h>
-#include <qhgroupbox.h>
+#include <tqlabel.h>
+#include <tqhbox.h>
+#include <tqlayout.h>
+#include <tqcheckbox.h>
+#include <tqhgroupbox.h>
#include <klocale.h>
#include <knuminput.h>
@@ -19,35 +19,35 @@
//-----------------------------------------------------------------------------
BaseAppearanceConfig::BaseAppearanceConfig()
- : QWidget(0, "appearance_config")
+ : TQWidget(0, "appearance_config")
{
- QVBoxLayout *top = new QVBoxLayout(this);
+ TQVBoxLayout *top = new TQVBoxLayout(this);
// upper part
- _main = new QWidget(this);
+ _main = new TQWidget(this);
top->addWidget(_main);
- _grid = new QGridLayout(_main, 3, 2, 0, KDialog::spacingHint());
+ _grid = new TQGridLayout(_main, 3, 2, 0, KDialog::spacingHint());
_grid->setColStretch(1, 1);
- QCheckBox *chb =
- new QCheckBox(i18n("Enable animations"), _main, "kcfg_AnimationsEnabled");
+ TQCheckBox *chb =
+ new TQCheckBox(i18n("Enable animations"), _main, "kcfg_AnimationsEnabled");
_grid->addMultiCellWidget(chb, 2, 2, 0, 1);
top->addSpacing(KDialog::spacingHint());
// lower part
- QHGroupBox *gbox = new QHGroupBox(i18n("Background"), this);
+ TQHGroupBox *gbox = new TQHGroupBox(i18n("Background"), this);
top->addWidget(gbox);
- QWidget *widget = new QWidget(gbox);
- QGridLayout *grid =
- new QGridLayout(widget, 2, 3, 0, KDialog::spacingHint());
+ TQWidget *widget = new TQWidget(gbox);
+ TQGridLayout *grid =
+ new TQGridLayout(widget, 2, 3, 0, KDialog::spacingHint());
grid->setColStretch(2, 1);
- QLabel *label = new QLabel(i18n("Color:"), widget);
+ TQLabel *label = new TQLabel(i18n("Color:"), widget);
grid->addWidget(label, 0, 0);
KColorButton *cob = new KColorButton(widget, "kcfg_FadeColor");
cob->setFixedWidth(100);
grid->addWidget(cob, 0, 1);
- label = new QLabel(i18n("Opacity:"), widget);
+ label = new TQLabel(i18n("Opacity:"), widget);
grid->addWidget(label, 1, 0);
KDoubleNumInput *dn = new KDoubleNumInput(widget, "kcfg_FadeIntensity");
dn->setRange(0.0, 1.0, 0.01);
@@ -58,15 +58,15 @@ BaseAppearanceConfig::BaseAppearanceConfig()
//-----------------------------------------------------------------------------
ColorConfig::ColorConfig()
- : QWidget(0, "color_config")
+ : TQWidget(0, "color_config")
{
const GPieceInfo &info = Piece::info();
- QVBoxLayout *top = new QVBoxLayout(this);
+ TQVBoxLayout *top = new TQVBoxLayout(this);
uint nb = info.nbColors();
- QGridLayout *grid = new QGridLayout(top, nb+1, 3, KDialog::spacingHint());
+ TQGridLayout *grid = new TQGridLayout(top, nb+1, 3, KDialog::spacingHint());
grid->setColStretch(2, 1);
for (uint i=0; i<nb; i++) {
- QLabel *label = new QLabel(info.colorLabel(i), this);
+ TQLabel *label = new TQLabel(info.colorLabel(i), this);
grid->addWidget(label, i, 0);
KColorButton *cob = new KColorButton(this, colorKey(i));
cob->setFixedWidth(100);
@@ -75,9 +75,9 @@ ColorConfig::ColorConfig()
grid->setRowStretch(nb, 1);
}
-QCString ColorConfig::colorKey(uint i)
+TQCString ColorConfig::colorKey(uint i)
{
- QCString s;
+ TQCString s;
s.setNum(i);
return "kcfg_Color" + s;
}
diff --git a/libksirtet/base/settings.h b/libksirtet/base/settings.h
index c64bfd5b..37d0aea7 100644
--- a/libksirtet/base/settings.h
+++ b/libksirtet/base/settings.h
@@ -1,7 +1,7 @@
#ifndef BASE_SETTINGS_H
#define BASE_SETTINGS_H
-#include <qwidget.h>
+#include <tqwidget.h>
#include <kconfig.h>
class QGridLayout;
@@ -15,8 +15,8 @@ public:
BaseAppearanceConfig();
protected:
- QWidget *_main;
- QGridLayout *_grid;
+ TQWidget *_main;
+ TQGridLayout *_grid;
};
//-----------------------------------------------------------------------------
@@ -27,7 +27,7 @@ public:
ColorConfig();
private:
- static QCString colorKey(uint i);
+ static TQCString colorKey(uint i);
};
#endif