From 838baf3f99ec5ab81b063eb5449a3381d860f377 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 11 Jun 2011 04:58:26 +0000 Subject: [PATCH] TQt4 port kdegames This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1236074 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- atlantik/COPYING.LIB | 4 +- atlantik/atlanticd/atlanticclient.cpp | 2 +- atlantik/atlanticd/atlanticclient.h | 5 +- atlantik/atlanticd/atlanticdaemon.h | 3 +- atlantik/atlanticd/serversocket.h | 3 +- atlantik/client/atlantik.cpp | 104 ++--- atlantik/client/atlantik.h | 8 +- atlantik/client/configdlg.cpp | 66 +-- atlantik/client/configdlg.h | 23 +- atlantik/client/event.h | 5 +- atlantik/client/eventlogwidget.cpp | 8 +- atlantik/client/eventlogwidget.h | 10 +- atlantik/client/monopigator.cpp | 8 +- atlantik/client/monopigator.h | 8 +- .../client/selectconfiguration_widget.cpp | 12 +- atlantik/client/selectconfiguration_widget.h | 5 +- atlantik/client/selectgame_widget.cpp | 12 +- atlantik/client/selectgame_widget.h | 7 +- atlantik/client/selectserver_widget.cpp | 12 +- atlantik/client/selectserver_widget.h | 7 +- atlantik/kio_atlantik/kio_atlantik.cpp | 2 +- atlantik/libatlantic/atlantic_core.cpp | 2 +- atlantik/libatlantic/atlantic_core.h | 7 +- atlantik/libatlantic/auction.cpp | 2 +- atlantik/libatlantic/auction.h | 5 +- atlantik/libatlantic/configoption.h | 3 +- atlantik/libatlantic/estate.cpp | 2 +- atlantik/libatlantic/estate.h | 3 +- atlantik/libatlantic/estategroup.h | 3 +- atlantik/libatlantic/game.cpp | 4 +- atlantik/libatlantic/game.h | 3 +- atlantik/libatlantic/player.h | 3 +- atlantik/libatlantic/trade.cpp | 2 +- atlantik/libatlantic/trade.h | 8 +- .../libatlantikclient/atlantik_network.cpp | 44 +- atlantik/libatlantikclient/atlantik_network.h | 3 +- atlantik/libatlantikclient/monopdprotocol.cpp | 10 +- atlantik/libatlantikclient/monopdprotocol.h | 3 +- atlantik/libatlantikui/auction_widget.cpp | 8 +- atlantik/libatlantikui/auction_widget.h | 5 +- atlantik/libatlantikui/board.cpp | 18 +- atlantik/libatlantikui/board.h | 5 +- atlantik/libatlantikui/estatedetails.cpp | 32 +- atlantik/libatlantikui/estatedetails.h | 7 +- atlantik/libatlantikui/estateview.cpp | 28 +- atlantik/libatlantikui/estateview.h | 5 +- .../libatlantikui/kwrappedlistviewitem.cpp | 20 +- atlantik/libatlantikui/kwrappedlistviewitem.h | 7 +- atlantik/libatlantikui/portfolioestate.cpp | 6 +- atlantik/libatlantikui/portfolioestate.h | 5 +- atlantik/libatlantikui/portfolioview.cpp | 30 +- atlantik/libatlantikui/portfolioview.h | 5 +- atlantik/libatlantikui/token.cpp | 18 +- atlantik/libatlantikui/token.h | 5 +- atlantik/libatlantikui/trade_widget.cpp | 12 +- atlantik/libatlantikui/trade_widget.h | 7 +- kasteroids/ledmeter.cpp | 4 +- kasteroids/ledmeter.h | 7 +- kasteroids/sprites.h | 14 +- kasteroids/sprites/rock1/rock1.pov | 2 +- kasteroids/sprites/rock2/rock2.pov | 2 +- kasteroids/sprites/rock3/rock3.pov | 2 +- kasteroids/toplevel.cpp | 76 ++-- kasteroids/toplevel.h | 1 + kasteroids/view.cpp | 6 +- kasteroids/view.h | 5 +- katomic/configbox.cpp | 6 +- katomic/configbox.h | 1 + katomic/feld.cpp | 32 +- katomic/feld.h | 7 +- katomic/gamewidget.cpp | 38 +- katomic/gamewidget.h | 5 +- katomic/molek.cpp | 20 +- katomic/molek.h | 5 +- katomic/toplevel.cpp | 26 +- katomic/toplevel.h | 1 + kbackgammon/engines/fibs/kbgfibs.cpp | 320 +++++++------- kbackgammon/engines/fibs/kbgfibs.h | 11 +- kbackgammon/engines/fibs/kbgfibschat.cpp | 168 ++++---- kbackgammon/engines/fibs/kbgfibschat.h | 5 +- kbackgammon/engines/fibs/kbginvite.cpp | 6 +- kbackgammon/engines/fibs/kbginvite.h | 1 + kbackgammon/engines/fibs/kplayerlist.cpp | 110 ++--- kbackgammon/engines/fibs/kplayerlist.h | 9 +- kbackgammon/engines/generic/kbgengine.cpp | 6 +- kbackgammon/engines/generic/kbgengine.h | 14 +- kbackgammon/engines/gnubg/kbggnubg.cpp | 58 +-- kbackgammon/engines/gnubg/kbggnubg.h | 3 +- kbackgammon/engines/nextgen/kbggame.cpp | 6 +- kbackgammon/engines/nextgen/kbggame.h | 3 +- kbackgammon/engines/nextgen/kbgng.cpp | 58 +-- kbackgammon/engines/nextgen/kbgng.h | 15 +- kbackgammon/engines/nextgen/kbgplayer.h | 1 + kbackgammon/engines/offline/kbgoffline.cpp | 44 +- kbackgammon/engines/offline/kbgoffline.h | 3 +- kbackgammon/kbg.cpp | 58 +-- kbackgammon/kbg.h | 1 + kbackgammon/kbgboard.cpp | 136 +++--- kbackgammon/kbgboard.h | 76 ++-- kbackgammon/kbgstatus.cpp | 70 +-- kbackgammon/kbgstatus.h | 21 +- kbackgammon/kbgtextview.cpp | 4 +- kbackgammon/kbgtextview.h | 3 +- kbattleship/CLIENTS | 2 +- kbattleship/kbattleship/dialogs/chatDlg.ui | 18 +- kbattleship/kbattleship/dialogs/connectDlg.ui | 30 +- kbattleship/kbattleship/dialogs/infoDlg.ui | 30 +- kbattleship/kbattleship/dialogs/serverDlg.ui | 26 +- kbattleship/kbattleship/dialogs/statDlg.ui | 58 +-- kbattleship/kbattleship/kbaiplayer.h | 3 +- kbattleship/kbattleship/kbattlefield.cpp | 10 +- kbattleship/kbattleship/kbattlefield.h | 2 +- kbattleship/kbattleship/kbattleship.cpp | 218 +++++----- kbattleship/kbattleship/kbattleship.h | 1 + kbattleship/kbattleship/kbattleshipclient.cpp | 6 +- kbattleship/kbattleship/kbattleshipclient.h | 1 + kbattleship/kbattleship/kbattleshipserver.cpp | 12 +- kbattleship/kbattleship/kbattleshipserver.h | 1 + kbattleship/kbattleship/kbattleshipview.cpp | 38 +- kbattleship/kbattleship/kbattleshipview.h | 5 +- kbattleship/kbattleship/kbchooserstrategy.cpp | 2 +- kbattleship/kbattleship/kbchooserstrategy.h | 2 +- .../kbattleship/kbdestroyshipstrategy.cpp | 22 +- .../kbattleship/kbdestroyshipstrategy.h | 2 +- .../kbattleship/kbdiagonalshotstrategy.cpp | 6 +- .../kbattleship/kbdiagonalshotstrategy.h | 2 +- .../kbattleship/kbdiagonalwrapstrategy.cpp | 4 +- .../kbattleship/kbdiagonalwrapstrategy.h | 2 +- .../kbattleship/kbhorizontalstepstrategy.cpp | 4 +- .../kbattleship/kbhorizontalstepstrategy.h | 2 +- .../kbattleship/kbrandomshotstrategy.cpp | 2 +- .../kbattleship/kbrandomshotstrategy.h | 2 +- kbattleship/kbattleship/kbstrategy.cpp | 4 +- kbattleship/kbattleship/kbstrategy.h | 2 +- .../kbattleship/kbverticalstepstrategy.cpp | 4 +- .../kbattleship/kbverticalstepstrategy.h | 2 +- kbattleship/kbattleship/kchatwidget.cpp | 10 +- kbattleship/kbattleship/kchatwidget.h | 3 +- kbattleship/kbattleship/kclientdialog.cpp | 6 +- kbattleship/kbattleship/kclientdialog.h | 3 +- kbattleship/kbattleship/kgridwidget.cpp | 10 +- kbattleship/kbattleship/kgridwidget.h | 2 +- kbattleship/kbattleship/kmessage.cpp | 2 +- .../kbattleship/konnectionhandling.cpp | 12 +- kbattleship/kbattleship/konnectionhandling.h | 7 +- kbattleship/kbattleship/kserverdialog.cpp | 4 +- kbattleship/kbattleship/kserverdialog.h | 3 +- kbattleship/kbattleship/kship.cpp | 4 +- kbattleship/kbattleship/kship.h | 2 +- kbattleship/kbattleship/kshiplist.cpp | 8 +- kbattleship/kbattleship/kshiplist.h | 3 +- kbattleship/kbattleship/kstatdialog.cpp | 2 +- kbattleship/kbattleship/kstatdialog.h | 3 +- kblackbox/CHANGES | 2 +- kblackbox/kbbgame.cpp | 52 +-- kblackbox/kbbgame.h | 1 + kblackbox/kbbgfx.cpp | 20 +- kblackbox/kbbgfx.h | 7 +- kbounce/game.cpp | 34 +- kbounce/game.h | 22 +- kbounce/highscores.cpp | 2 +- kbounce/kbounce.cpp | 48 +-- kbounce/kbounce.h | 1 + kenolaba/AbTop.cpp | 102 ++--- kenolaba/AbTop.h | 3 +- kenolaba/Ball.cpp | 28 +- kenolaba/Ball.h | 10 +- kenolaba/Board.cpp | 10 +- kenolaba/Board.h | 3 +- kenolaba/BoardWidget.cpp | 32 +- kenolaba/BoardWidget.h | 5 +- kenolaba/EvalDlg.ui | 364 ++++++++-------- kenolaba/EvalDlgImpl.cpp | 10 +- kenolaba/EvalDlgImpl.h | 3 +- kenolaba/EvalScheme.cpp | 20 +- kenolaba/Network.h | 3 +- kenolaba/Spy.cpp | 16 +- kenolaba/Spy.h | 3 +- kfouleggs/ai.h | 1 + kfouleggs/board.cpp | 4 +- kfouleggs/board.h | 3 +- kfouleggs/field.cpp | 4 +- kfouleggs/field.h | 3 +- kfouleggs/main.cpp | 4 +- kfouleggs/main.h | 11 +- kfouleggs/piece.cpp | 8 +- kgoldrunner/Doxyfile | 2 +- kgoldrunner/gamedata/levels.tar | Bin 317440 -> 317446 bytes kgoldrunner/src/kgoldrunner.cpp | 112 ++--- kgoldrunner/src/kgoldrunner.h | 7 +- kgoldrunner/src/kgrcanvas.cpp | 26 +- kgoldrunner/src/kgrcanvas.h | 7 +- kgoldrunner/src/kgrconsts.h | 2 +- kgoldrunner/src/kgrdialog.cpp | 138 +++--- kgoldrunner/src/kgrdialog.h | 46 +- kgoldrunner/src/kgrfigure.cpp | 18 +- kgoldrunner/src/kgrfigure.h | 19 +- kgoldrunner/src/kgrgame.cpp | 200 ++++----- kgoldrunner/src/kgrgame.h | 37 +- kgoldrunner/src/kgrobject.h | 7 +- kjumpingcube/kcubeboxwidget.cpp | 26 +- kjumpingcube/kcubeboxwidget.h | 11 +- kjumpingcube/kcubewidget.cpp | 10 +- kjumpingcube/kcubewidget.h | 3 +- kjumpingcube/kjumpingcube.cpp | 38 +- kjumpingcube/kjumpingcube.h | 1 + kjumpingcube/settings.ui | 46 +- klickety/board.cpp | 6 +- klickety/board.h | 3 +- klickety/field.cpp | 8 +- klickety/field.h | 3 +- klickety/main.h | 9 +- klickety/piece.cpp | 2 +- klines/ballpainter.cpp | 8 +- klines/ballpainter.h | 3 +- klines/field.cpp | 14 +- klines/field.h | 5 +- klines/klines.cpp | 56 +-- klines/klines.h | 1 + klines/linesboard.cpp | 32 +- klines/linesboard.h | 3 +- klines/mwidget.cpp | 12 +- klines/mwidget.h | 5 +- klines/povray/balls.sh | 2 +- klines/povray/fire.sh | 2 +- klines/povray/makeballs.sh | 2 +- klines/povray/povray.ini | 2 +- klines/prompt.cpp | 6 +- klines/prompt.h | 5 +- kmahjongg/Background.cpp | 8 +- kmahjongg/BoardLayout.cpp | 4 +- kmahjongg/BoardLayout.h | 2 +- kmahjongg/Editor.cpp | 48 +-- kmahjongg/Editor.h | 5 +- kmahjongg/GameTimer.cpp | 6 +- kmahjongg/GameTimer.h | 7 +- kmahjongg/HighScore.cpp | 26 +- kmahjongg/HighScore.h | 9 +- kmahjongg/Preview.cpp | 88 ++-- kmahjongg/Preview.h | 12 +- kmahjongg/Tileset.cpp | 66 +-- kmahjongg/Tileset.h | 26 +- kmahjongg/boardwidget.cpp | 42 +- kmahjongg/boardwidget.h | 7 +- kmahjongg/kmahjongg.cpp | 68 +-- kmahjongg/kmahjongg.h | 5 +- kmahjongg/pics/cross.layout | 2 +- kmahjongg/pics/default.layout | 2 +- kmahjongg/pics/default.theme | 2 +- kmahjongg/pics/pirates.layout | 2 +- kmahjongg/pics/pirates.theme | 2 +- kmahjongg/pics/pyramid.layout | 2 +- kmahjongg/pics/stax.layout | 2 +- kmahjongg/pics/test.layout | 2 +- kmahjongg/pics/test2.layout | 2 +- kmahjongg/pics/tower.layout | 2 +- kmahjongg/pics/triangle.layout | 2 +- kmahjongg/settings.ui | 30 +- kmines/dialogs.cpp | 8 +- kmines/dialogs.h | 11 +- kmines/field.cpp | 8 +- kmines/field.h | 7 +- kmines/frame.cpp | 66 +-- kmines/frame.h | 8 +- kmines/highscores.cpp | 6 +- kmines/kzoommainwindow.cpp | 10 +- kmines/kzoommainwindow.h | 3 +- kmines/main.cpp | 36 +- kmines/main.h | 7 +- kmines/solver/advFastRules.cpp | 26 +- kmines/solver/headerP.h | 2 +- kmines/solver/solver.cpp | 18 +- kmines/solver/solver.h | 8 +- kmines/status.cpp | 68 +-- kmines/status.h | 7 +- knetwalk/src/cell.cpp | 22 +- knetwalk/src/cell.h | 5 +- knetwalk/src/highscores.cpp | 6 +- knetwalk/src/mainwindow.cpp | 18 +- knetwalk/src/mainwindow.h | 3 +- kolf/ball.cpp | 18 +- kolf/canvasitem.h | 4 +- kolf/config.cpp | 16 +- kolf/config.h | 11 +- kolf/editor.cpp | 18 +- kolf/editor.h | 5 +- kolf/floater.cpp | 20 +- kolf/floater.h | 7 +- kolf/game.cpp | 400 +++++++++--------- kolf/game.h | 49 ++- kolf/kcomboboxdialog.cpp | 22 +- kolf/kcomboboxdialog.h | 19 +- kolf/kolf.cpp | 154 +++---- kolf/kolf.h | 3 +- kolf/kvolumecontrol.cpp | 12 +- kolf/kvolumecontrol.h | 7 +- kolf/main.cpp | 8 +- kolf/newgame.cpp | 64 +-- kolf/newgame.h | 10 +- kolf/object.h | 5 +- kolf/objects/poolball/poolball.cpp | 18 +- kolf/objects/poolball/poolball.h | 7 +- kolf/objects/test/test.cpp | 30 +- kolf/objects/test/test.h | 7 +- kolf/printdialogpage.cpp | 8 +- kolf/printdialogpage.h | 3 +- kolf/scoreboard.cpp | 6 +- kolf/scoreboard.h | 5 +- kolf/slope.cpp | 32 +- kolf/slope.h | 5 +- kolf/tutorial.kolf | 2 +- konquest/fleetdlg.cc | 32 +- konquest/fleetdlg.h | 6 +- konquest/gameboard.cc | 92 ++-- konquest/gameboard.h | 7 +- konquest/gamecore.cc | 34 +- konquest/gamecore.h | 23 +- konquest/gameenddlg.cc | 12 +- konquest/gameenddlg.h | 3 +- konquest/int_validator.cc | 8 +- konquest/int_validator.h | 7 +- konquest/mainwin.cc | 14 +- konquest/mainwin.h | 1 + konquest/map_widget.cc | 6 +- konquest/map_widget.h | 5 +- konquest/minimap.cc | 4 +- konquest/minimap.h | 5 +- konquest/newGameDlg_ui.ui | 76 ++-- konquest/newgamedlg.cc | 18 +- konquest/newgamedlg.h | 3 +- konquest/planet_info.cc | 46 +- konquest/planet_info.h | 7 +- konquest/scoredlg.cc | 34 +- konquest/scoredlg.h | 8 +- kpat/CHANGES | 2 +- kpat/card.cpp | 4 +- kpat/card.h | 3 +- kpat/cardmaps.cpp | 14 +- kpat/clock.cpp | 6 +- kpat/clock.h | 3 +- kpat/computation.cpp | 6 +- kpat/computation.h | 3 +- kpat/dealer.cpp | 92 ++-- kpat/dealer.h | 13 +- kpat/deck.cpp | 8 +- kpat/deck.h | 4 +- kpat/fortyeight.cpp | 10 +- kpat/fortyeight.h | 6 +- kpat/freecell-solver/USAGE | 34 +- kpat/freecell-solver/caas.c | 14 +- kpat/freecell-solver/fcs.h | 8 +- kpat/freecell-solver/fcs_hash.c | 12 +- kpat/freecell-solver/fcs_hash.h | 4 +- kpat/freecell-solver/fcs_user.h | 2 +- kpat/freecell-solver/freecell.c | 12 +- kpat/freecell-solver/intrface.c | 12 +- kpat/freecell-solver/lib.c | 4 +- kpat/freecell-solver/lookup2.c | 2 +- kpat/freecell-solver/main.c | 42 +- kpat/freecell-solver/pqueue.c | 26 +- kpat/freecell-solver/pqueue.h | 32 +- kpat/freecell-solver/preset.c | 2 +- kpat/freecell-solver/scans.c | 20 +- kpat/freecell-solver/simpsim.c | 60 +-- kpat/freecell-solver/state.h | 14 +- kpat/freecell-solver/test_arr.h | 28 +- kpat/freecell-solver/tests.h | 18 +- kpat/freecell.cpp | 28 +- kpat/freecell.h | 5 +- kpat/gamestats.ui | 62 +-- kpat/gamestatsimpl.cpp | 18 +- kpat/golf.cpp | 10 +- kpat/golf.h | 6 +- kpat/grandf.cpp | 6 +- kpat/grandf.h | 3 +- kpat/gypsy.cpp | 6 +- kpat/gypsy.h | 3 +- kpat/idiot.cpp | 6 +- kpat/idiot.h | 3 +- kpat/kings.cpp | 6 +- kpat/kings.h | 3 +- kpat/klondike.cpp | 14 +- kpat/klondike.h | 3 +- kpat/mod3.cpp | 6 +- kpat/mod3.h | 3 +- kpat/napoleon.cpp | 6 +- kpat/napoleon.h | 3 +- kpat/pile.cpp | 14 +- kpat/pile.h | 5 +- kpat/pwidget.cpp | 66 +-- kpat/pwidget.h | 1 + kpat/simon.cpp | 6 +- kpat/simon.h | 3 +- kpat/spider.cpp | 10 +- kpat/spider.h | 5 +- kpat/yukon.cpp | 6 +- kpat/yukon.h | 3 +- kpoker/betbox.cpp | 12 +- kpoker/betbox.h | 5 +- kpoker/defines.h | 2 +- kpoker/kpaint.cpp | 18 +- kpoker/kpaint.h | 12 +- kpoker/kpoker.cpp | 46 +- kpoker/kpoker.h | 9 +- kpoker/newgamedlg.cpp | 8 +- kpoker/newgamedlg.h | 3 +- kpoker/optionsdlg.cpp | 4 +- kpoker/optionsdlg.h | 3 +- kpoker/playerbox.cpp | 22 +- kpoker/playerbox.h | 7 +- kpoker/poker.h | 4 +- kpoker/top.cpp | 40 +- kpoker/top.h | 1 + kreversi/DESIGN | 4 +- kreversi/Engine.cpp | 2 +- kreversi/Move.cpp | 4 +- kreversi/board.cpp | 71 ++-- kreversi/board.h | 11 +- kreversi/highscores.cpp | 6 +- kreversi/kreversi.cpp | 58 +-- kreversi/kreversi.h | 5 +- kreversi/kzoommainwindow.cpp | 10 +- kreversi/kzoommainwindow.h | 3 +- kreversi/qreversigame.cpp | 14 +- kreversi/qreversigame.h | 13 +- kreversi/qreversigameview.cpp | 78 ++-- kreversi/qreversigameview.h | 30 +- kreversi/settings.ui | 54 +-- ksame/KSameWidget.cpp | 62 +-- ksame/KSameWidget.h | 3 +- ksame/StoneWidget.cpp | 26 +- ksame/StoneWidget.h | 5 +- kshisen/app.cpp | 94 ++-- kshisen/app.h | 3 +- kshisen/board.cpp | 20 +- kshisen/board.h | 7 +- kshisen/settings.ui | 56 +-- kshisen/tileset.cpp | 6 +- ksirtet/ksirtet/ai.h | 1 + ksirtet/ksirtet/board.cpp | 4 +- ksirtet/ksirtet/board.h | 3 +- ksirtet/ksirtet/field.cpp | 6 +- ksirtet/ksirtet/field.h | 3 +- ksirtet/ksirtet/main.cpp | 4 +- ksirtet/ksirtet/main.h | 11 +- ksirtet/ksirtet/settings.h | 1 + ksmiletris/gamewidget.cpp | 30 +- ksmiletris/gamewidget.h | 5 +- ksmiletris/gamewindow.cpp | 34 +- ksmiletris/gamewindow.h | 3 +- ksmiletris/mirrorwidget.cpp | 4 +- ksmiletris/mirrorwidget.h | 2 +- ksmiletris/npiecewidget.cpp | 4 +- ksmiletris/npiecewidget.h | 2 +- ksmiletris/screenwidget.cpp | 4 +- ksmiletris/screenwidget.h | 2 +- ksnake/appearance.ui | 16 +- ksnake/ball.cpp | 2 +- ksnake/ball.h | 2 +- ksnake/basket.cpp | 2 +- ksnake/basket.h | 8 +- ksnake/board.cpp | 8 +- ksnake/board.h | 2 +- ksnake/game.cpp | 20 +- ksnake/game.h | 3 +- ksnake/general.ui | 38 +- ksnake/level.cpp | 2 +- ksnake/pixServer.cpp | 12 +- ksnake/progress.cpp | 4 +- ksnake/progress.h | 3 +- ksnake/rattler.cpp | 36 +- ksnake/rattler.h | 5 +- ksnake/snake.cpp | 2 +- ksnake/snake.h | 5 +- ksnake/startroom.cpp | 14 +- ksnake/startroom.h | 5 +- ksnake/view.cpp | 6 +- ksnake/view.h | 7 +- ksokoban/ImageData.cpp | 12 +- ksokoban/InternalCollections.cpp | 2 +- ksokoban/MainWindow.cpp | 4 +- ksokoban/MainWindow.h | 1 + ksokoban/ModalLabel.cpp | 16 +- ksokoban/ModalLabel.h | 5 +- ksokoban/NEWS | 2 +- ksokoban/PlayField.cpp | 66 +-- ksokoban/PlayField.h | 3 +- ksokoban/Queue.h | 6 +- ksokoban/StaticImage.cpp | 2 +- kspaceduel/defines.h | 2 +- kspaceduel/dialogs.cpp | 18 +- kspaceduel/dialogs.h | 8 +- kspaceduel/general.ui | 46 +- kspaceduel/mainview.cpp | 40 +- kspaceduel/mainview.h | 7 +- kspaceduel/playerinfo.cpp | 10 +- kspaceduel/playerinfo.h | 5 +- kspaceduel/sprites.cpp | 2 +- kspaceduel/sprites.h | 8 +- kspaceduel/topwidget.cpp | 32 +- kspaceduel/topwidget.h | 1 + ktron/ai.ui | 22 +- ktron/appearance.ui | 40 +- ktron/general.ui | 46 +- ktron/ktron.cpp | 24 +- ktron/ktron.h | 5 +- ktron/tron.cpp | 24 +- ktron/tron.h | 5 +- ktuberling/pics/layout.i18n | 2 +- ktuberling/pics/layout.xml | 8 +- ktuberling/playground.cpp | 84 ++-- ktuberling/playground.h | 15 +- ktuberling/soundfactory.cpp | 32 +- ktuberling/soundfactory.h | 9 +- ktuberling/todraw.cpp | 10 +- ktuberling/toplevel.cpp | 108 ++--- ktuberling/toplevel.h | 3 +- kwin4/index.html | 2 +- kwin4/install-sh | 2 +- kwin4/kwin4/kspritecache.cpp | 50 +-- kwin4/kwin4/kspritecache.h | 36 +- kwin4/kwin4/kwin4.cpp | 56 +-- kwin4/kwin4/kwin4.h | 6 +- kwin4/kwin4/kwin4doc.cpp | 64 +-- kwin4/kwin4/kwin4doc.h | 9 +- kwin4/kwin4/kwin4player.h | 1 + kwin4/kwin4/kwin4proc.cpp | 18 +- kwin4/kwin4/kwin4proc.h | 3 +- kwin4/kwin4/kwin4view.cpp | 26 +- kwin4/kwin4/kwin4view.h | 5 +- kwin4/kwin4/scorewidget.cpp | 22 +- kwin4/kwin4/scorewidget.h | 5 +- kwin4/kwin4/settings.ui | 50 +-- kwin4/kwin4/statistics.ui | 66 +-- kwin4/kwin4/statuswidget.ui | 54 +-- libkdegames/carddecks/convertpysols | 104 ++--- libkdegames/highscore/kconfigrawbackend.cpp | 2 +- libkdegames/highscore/kconfigrawbackend.h | 1 + libkdegames/highscore/kexthighscore.cpp | 18 +- libkdegames/highscore/kexthighscore.h | 8 +- libkdegames/highscore/kexthighscore_gui.cpp | 48 +-- libkdegames/highscore/kexthighscore_gui.h | 26 +- .../highscore/kexthighscore_internal.cpp | 50 +-- .../highscore/kexthighscore_internal.h | 18 +- libkdegames/highscore/kexthighscore_item.cpp | 18 +- libkdegames/highscore/kexthighscore_item.h | 12 +- libkdegames/highscore/kexthighscore_tab.cpp | 30 +- libkdegames/highscore/kexthighscore_tab.h | 16 +- libkdegames/highscore/khighscore.cpp | 30 +- libkdegames/highscore/khighscore.h | 21 +- libkdegames/highscore/kscoredialog.cpp | 48 +-- libkdegames/highscore/kscoredialog.h | 7 +- libkdegames/kcanvasrootpixmap.cpp | 2 +- libkdegames/kcanvasrootpixmap.h | 1 + libkdegames/kcarddialog.cpp | 114 ++--- libkdegames/kcarddialog.h | 9 +- libkdegames/kchat.cpp | 2 +- libkdegames/kchat.h | 5 +- libkdegames/kchatbase.cpp | 40 +- libkdegames/kchatbase.h | 45 +- libkdegames/kchatdialog.cpp | 34 +- libkdegames/kchatdialog.h | 5 +- libkdegames/kgame/COMPAT | 6 +- libkdegames/kgame/DESIGN | 2 +- .../kgame/dialogs/kgameconnectdialog.cpp | 14 +- .../kgame/dialogs/kgameconnectdialog.h | 22 +- .../kgame/dialogs/kgamedebugdialog.cpp | 48 +-- libkdegames/kgame/dialogs/kgamedebugdialog.h | 7 +- libkdegames/kgame/dialogs/kgamedialog.cpp | 34 +- libkdegames/kgame/dialogs/kgamedialog.h | 25 +- .../kgame/dialogs/kgamedialogconfig.cpp | 40 +- libkdegames/kgame/dialogs/kgamedialogconfig.h | 32 +- .../kgame/dialogs/kgameerrordialog.cpp | 30 +- libkdegames/kgame/dialogs/kgameerrordialog.h | 16 +- libkdegames/kgame/kgame.cpp | 110 ++--- libkdegames/kgame/kgame.h | 53 +-- libkdegames/kgame/kgamechat.cpp | 28 +- libkdegames/kgame/kgamechat.h | 13 +- libkdegames/kgame/kgameerror.cpp | 22 +- libkdegames/kgame/kgameio.cpp | 58 +-- libkdegames/kgame/kgameio.h | 29 +- libkdegames/kgame/kgamemessage.cpp | 32 +- libkdegames/kgame/kgamemessage.h | 16 +- libkdegames/kgame/kgamenetwork.cpp | 78 ++-- libkdegames/kgame/kgamenetwork.h | 49 +-- libkdegames/kgame/kgameprocess.cpp | 16 +- libkdegames/kgame/kgameprocess.h | 13 +- libkdegames/kgame/kgameproperty.cpp | 12 +- libkdegames/kgame/kgameproperty.h | 42 +- libkdegames/kgame/kgamepropertyhandler.cpp | 34 +- libkdegames/kgame/kgamepropertyhandler.h | 23 +- libkdegames/kgame/kgamepropertylist.h | 2 +- libkdegames/kgame/kgamesequence.h | 3 +- libkdegames/kgame/kmessageclient.cpp | 58 +-- libkdegames/kgame/kmessageclient.h | 45 +- libkdegames/kgame/kmessageio.cpp | 48 +-- libkdegames/kgame/kmessageio.h | 45 +- libkdegames/kgame/kmessageserver.cpp | 102 ++--- libkdegames/kgame/kmessageserver.h | 112 ++--- libkdegames/kgame/kplayer.cpp | 26 +- libkdegames/kgame/kplayer.h | 17 +- libkdegames/kgame/messages.txt | 2 +- libkdegames/kgamelcd.cpp | 26 +- libkdegames/kgamelcd.h | 25 +- libkdegames/kgameprogress.cpp | 52 +-- libkdegames/kgameprogress.h | 35 +- libkdegames/kgrid2d.h | 12 +- libkdegames/kstdgameaction.cpp | 114 ++--- libkdegames/kstdgameaction.h | 52 +-- libksirtet/base/board.cpp | 12 +- libksirtet/base/board.h | 10 +- libksirtet/base/factory.h | 4 +- libksirtet/base/field.cpp | 30 +- libksirtet/base/field.h | 4 +- libksirtet/base/gtetris.h | 2 +- libksirtet/base/inter.cpp | 8 +- libksirtet/base/inter.h | 4 +- libksirtet/base/kzoommainwindow.cpp | 10 +- libksirtet/base/kzoommainwindow.h | 3 +- libksirtet/base/main.cpp | 16 +- libksirtet/base/main.h | 1 + libksirtet/base/piece.h | 2 +- libksirtet/base/settings.h | 6 +- libksirtet/common/ai.cpp | 6 +- libksirtet/common/ai.h | 6 +- libksirtet/common/board.cpp | 4 +- libksirtet/common/board.h | 3 +- libksirtet/common/factory.h | 2 +- libksirtet/common/field.cpp | 8 +- libksirtet/common/field.h | 3 +- libksirtet/common/highscores.cpp | 10 +- libksirtet/common/inter.cpp | 10 +- libksirtet/common/inter.h | 5 +- libksirtet/common/main.cpp | 12 +- libksirtet/common/main.h | 1 + libksirtet/common/misc_ui.cpp | 46 +- libksirtet/common/misc_ui.h | 22 +- libksirtet/common/settings.h | 4 +- libksirtet/common/types.h | 6 +- libksirtet/lib/defines.cpp | 10 +- libksirtet/lib/defines.h | 4 +- libksirtet/lib/internal.cpp | 2 +- libksirtet/lib/internal.h | 4 + libksirtet/lib/keys.cpp | 14 +- libksirtet/lib/keys.h | 7 +- libksirtet/lib/meeting.cpp | 34 +- libksirtet/lib/meeting.h | 11 +- libksirtet/lib/miscui.cpp | 8 +- libksirtet/lib/miscui.h | 10 +- libksirtet/lib/mp_board.h | 7 +- libksirtet/lib/mp_interface.cpp | 20 +- libksirtet/lib/mp_interface.h | 5 +- libksirtet/lib/mp_option.h | 9 +- libksirtet/lib/mp_simple_board.h | 5 +- libksirtet/lib/mp_simple_interface.cpp | 6 +- libksirtet/lib/mp_simple_interface.h | 3 +- libksirtet/lib/mp_simple_types.cpp | 4 +- libksirtet/lib/pline.cpp | 28 +- libksirtet/lib/pline.h | 21 +- libksirtet/lib/smanager.cpp | 6 +- libksirtet/lib/smanager.h | 2 +- libksirtet/lib/socket.cpp | 4 +- libksirtet/lib/socket.h | 2 +- libksirtet/lib/types.cpp | 51 +-- libksirtet/lib/types.h | 6 +- libksirtet/lib/wizard.cpp | 26 +- libksirtet/lib/wizard.h | 3 +- lskat/lskat/KChildConnect.cpp | 6 +- lskat/lskat/KChildConnect.h | 5 +- lskat/lskat/KConnectEntry.cpp | 8 +- lskat/lskat/KConnectEntry.h | 2 +- lskat/lskat/KEInput.cpp | 10 +- lskat/lskat/KEInput.h | 7 +- lskat/lskat/KEMessage.cpp | 28 +- lskat/lskat/KInputChildProcess.cpp | 2 +- lskat/lskat/KInputChildProcess.h | 3 +- lskat/lskat/KInteractiveConnect.h | 1 + lskat/lskat/KProcessConnect.cpp | 2 +- lskat/lskat/KProcessConnect.h | 1 + lskat/lskat/KRSocket.h | 3 +- lskat/lskat/KRemoteConnect.cpp | 4 +- lskat/lskat/KRemoteConnect.h | 3 +- lskat/lskat/lskat.cpp | 48 +-- lskat/lskat/lskat.h | 3 +- lskat/lskat/lskatdoc.cpp | 12 +- lskat/lskat/lskatdoc.h | 13 +- lskat/lskat/lskatview.cpp | 132 +++--- lskat/lskat/lskatview.h | 11 +- lskat/lskat/msgdlg.cpp | 4 +- lskat/lskat/msgdlg.h | 5 +- lskat/lskat/namedlg.cpp | 16 +- lskat/lskat/namedlg.h | 3 +- lskat/lskat/networkdlg.cpp | 8 +- lskat/lskat/networkdlg.h | 3 +- lskat/lskat/networkdlgbase.ui | 56 +-- lskat/lskatproc/KChildConnect.cpp | 6 +- lskat/lskatproc/KChildConnect.h | 5 +- lskat/lskatproc/KEMessage.cpp | 28 +- lskat/lskatproc/KInputChildProcess.cpp | 2 +- lskat/lskatproc/KInputChildProcess.h | 3 +- 700 files changed, 6880 insertions(+), 6511 deletions(-) diff --git a/atlantik/COPYING.LIB b/atlantik/COPYING.LIB index ae23fcfd..fbb61ee9 100644 --- a/atlantik/COPYING.LIB +++ b/atlantik/COPYING.LIB @@ -135,7 +135,7 @@ included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated +all the source code for all modules it tqcontains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. @@ -257,7 +257,7 @@ linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline +structure tqlayouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the diff --git a/atlantik/atlanticd/atlanticclient.cpp b/atlantik/atlanticd/atlanticclient.cpp index 0e4e3e12..a3baf2e6 100644 --- a/atlantik/atlanticd/atlanticclient.cpp +++ b/atlantik/atlanticd/atlanticclient.cpp @@ -20,7 +20,7 @@ #include "atlanticclient.h" #include "atlanticclient.moc" -AtlanticClient::AtlanticClient(TQObject *parent, const char *name) : TQSocket(parent, name) +AtlanticClient::AtlanticClient(TQObject *tqparent, const char *name) : TQSocket(tqparent, name) { connect(this, TQT_SIGNAL(readyRead()), this, TQT_SLOT(readData())); } diff --git a/atlantik/atlanticd/atlanticclient.h b/atlantik/atlanticd/atlanticclient.h index 8f63b88c..7b4dc19a 100644 --- a/atlantik/atlanticd/atlanticclient.h +++ b/atlantik/atlanticd/atlanticclient.h @@ -19,12 +19,13 @@ #include -class AtlanticClient : public QSocket +class AtlanticClient : public TQSocket { Q_OBJECT + TQ_OBJECT public: - AtlanticClient(TQObject *parent = 0, const char *name = 0); + AtlanticClient(TQObject *tqparent = 0, const char *name = 0); void sendData(const TQString &data); private slots: diff --git a/atlantik/atlanticd/atlanticdaemon.h b/atlantik/atlanticd/atlanticdaemon.h index 2e107a0a..8de64c3e 100644 --- a/atlantik/atlanticd/atlanticdaemon.h +++ b/atlantik/atlanticd/atlanticdaemon.h @@ -25,9 +25,10 @@ class AtlanticCore; class AtlanticClient; class ServerSocket; -class AtlanticDaemon : public QObject +class AtlanticDaemon : public TQObject { Q_OBJECT + TQ_OBJECT public: AtlanticDaemon(); diff --git a/atlantik/atlanticd/serversocket.h b/atlantik/atlanticd/serversocket.h index cc31c8ab..29550769 100644 --- a/atlantik/atlanticd/serversocket.h +++ b/atlantik/atlanticd/serversocket.h @@ -21,9 +21,10 @@ class AtlanticClient; -class ServerSocket : public QServerSocket +class ServerSocket : public TQServerSocket { Q_OBJECT + TQ_OBJECT public: ServerSocket(int port, int backlog); diff --git a/atlantik/client/atlantik.cpp b/atlantik/client/atlantik.cpp index f1e24645..2ad1bf98 100644 --- a/atlantik/client/atlantik.cpp +++ b/atlantik/client/atlantik.cpp @@ -64,15 +64,15 @@ #include "selectgame_widget.h" #include "selectconfiguration_widget.h" -LogTextEdit::LogTextEdit( TQWidget *parent, const char *name ) : TQTextEdit( parent, name ) +LogTextEdit::LogTextEdit( TQWidget *tqparent, const char *name ) : TQTextEdit( tqparent, name ) { #ifdef KDE_3_2_FEATURES - m_clear = KStdAction::clear( this, TQT_SLOT( clear() ), 0 ); + m_clear = KStdAction::clear( TQT_TQOBJECT(this), TQT_SLOT( clear() ), 0 ); #else - m_clear = new KAction( i18n("Clear"), "clear", NULL, this, TQT_SLOT( clear() ), static_cast(0), "clear" ); + m_clear = new KAction( i18n("Clear"), "clear", NULL, TQT_TQOBJECT(this), TQT_SLOT( clear() ), static_cast(0), "clear" ); #endif - m_selectAll = KStdAction::selectAll( this, TQT_SLOT( selectAll() ), 0 ); - m_copy = KStdAction::copy( this, TQT_SLOT( copy() ), 0 ); + m_selectAll = KStdAction::selectAll( TQT_TQOBJECT(this), TQT_SLOT( selectAll() ), 0 ); + m_copy = KStdAction::copy( TQT_TQOBJECT(this), TQT_SLOT( copy() ), 0 ); } LogTextEdit::~LogTextEdit() @@ -103,12 +103,12 @@ Atlantik::Atlantik () // Toolbar: Game // KStdGameAction::gameNew(this, TQT_SLOT(slotNewGame()), actionCollection(), "game_new"); - m_showEventLog = new KAction(i18n("Show Event &Log")/*, "atlantik_showeventlog"*/, CTRL+Key_L, this, TQT_SLOT(showEventLog()), actionCollection(), "showeventlog"); - KStdGameAction::quit(kapp, TQT_SLOT(closeAllWindows()), actionCollection(), "game_quit"); + m_showEventLog = new KAction(i18n("Show Event &Log")/*, "atlantik_showeventlog"*/, CTRL+Key_L, TQT_TQOBJECT(this), TQT_SLOT(showEventLog()), actionCollection(), "showeventlog"); + KStdGameAction::quit(TQT_TQOBJECT(kapp), TQT_SLOT(closeAllWindows()), actionCollection(), "game_quit"); // Toolbar: Settings - KStdAction::preferences(this, TQT_SLOT(slotConfigure()), actionCollection()); - KStdAction::configureNotifications(this, TQT_SLOT(configureNotifications()), actionCollection()); + KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(slotConfigure()), actionCollection()); + KStdAction::configureNotifications(TQT_TQOBJECT(this), TQT_SLOT(configureNotifications()), actionCollection()); // Initialize pointers to 0L m_configDialog = 0; @@ -120,37 +120,37 @@ Atlantik::Atlantik () m_atlantikNetwork = 0; // Game and network core - m_atlanticCore = new AtlanticCore(this, "atlanticCore"); - connect(m_atlanticCore, TQT_SIGNAL(createGUI(Player *)), this, TQT_SLOT(newPlayer(Player *))); - connect(m_atlanticCore, TQT_SIGNAL(removeGUI(Player *)), this, TQT_SLOT(removeGUI(Player *))); - connect(m_atlanticCore, TQT_SIGNAL(createGUI(Trade *)), this, TQT_SLOT(newTrade(Trade *))); - connect(m_atlanticCore, TQT_SIGNAL(removeGUI(Trade *)), this, TQT_SLOT(removeGUI(Trade *))); + m_atlanticCore = new AtlanticCore(TQT_TQOBJECT(this), "atlanticCore"); + connect(m_atlanticCore, TQT_SIGNAL(createGUI(Player *)), TQT_TQOBJECT(this), TQT_SLOT(newPlayer(Player *))); + connect(m_atlanticCore, TQT_SIGNAL(removeGUI(Player *)), TQT_TQOBJECT(this), TQT_SLOT(removeGUI(Player *))); + connect(m_atlanticCore, TQT_SIGNAL(createGUI(Trade *)), TQT_TQOBJECT(this), TQT_SLOT(newTrade(Trade *))); + connect(m_atlanticCore, TQT_SIGNAL(removeGUI(Trade *)), TQT_TQOBJECT(this), TQT_SLOT(removeGUI(Trade *))); initEventLog(); initNetworkObject(); // Menu,toolbar: Move - m_roll = KStdGameAction::roll(this, TQT_SIGNAL(rollDice()), actionCollection()); + m_roll = KStdGameAction::roll(TQT_TQOBJECT(this), TQT_SIGNAL(rollDice()), actionCollection()); m_roll->setEnabled(false); - m_buyEstate = new KAction(i18n("&Buy"), "atlantik_buy_estate", CTRL+Key_B, this, TQT_SIGNAL(buyEstate()), actionCollection(), "buy_estate"); + m_buyEstate = new KAction(i18n("&Buy"), "atlantik_buy_estate", CTRL+Key_B, TQT_TQOBJECT(this), TQT_SIGNAL(buyEstate()), actionCollection(), "buy_estate"); m_buyEstate->setEnabled(false); - m_auctionEstate = new KAction(i18n("&Auction"), "auction", CTRL+Key_A, this, TQT_SIGNAL(auctionEstate()), actionCollection(), "auction"); + m_auctionEstate = new KAction(i18n("&Auction"), "auction", CTRL+Key_A, TQT_TQOBJECT(this), TQT_SIGNAL(auctionEstate()), actionCollection(), "auction"); m_auctionEstate->setEnabled(false); - m_endTurn = KStdGameAction::endTurn(this, TQT_SIGNAL(endTurn()), actionCollection()); + m_endTurn = KStdGameAction::endTurn(TQT_TQOBJECT(this), TQT_SIGNAL(endTurn()), actionCollection()); m_endTurn->setEnabled(false); - m_jailCard = new KAction(i18n("Use Card to Leave Jail")/*, "atlantik_move_jail_card"*/, 0, this, TQT_SIGNAL(jailCard()), actionCollection(), "move_jailcard"); + m_jailCard = new KAction(i18n("Use Card to Leave Jail")/*, "atlantik_move_jail_card"*/, 0, TQT_TQOBJECT(this), TQT_SIGNAL(jailCard()), actionCollection(), "move_jailcard"); m_jailCard->setEnabled(false); - m_jailPay = new KAction(i18n("&Pay to Leave Jail"), "jail_pay", CTRL+Key_P, this, TQT_SIGNAL(jailPay()), actionCollection(), "move_jailpay"); + m_jailPay = new KAction(i18n("&Pay to Leave Jail"), "jail_pay", CTRL+Key_P, TQT_TQOBJECT(this), TQT_SIGNAL(jailPay()), actionCollection(), "move_jailpay"); m_jailPay->setEnabled(false); - m_jailRoll = new KAction(i18n("Roll to Leave &Jail")/*, "atlantik_move_jail_roll"*/, CTRL+Key_J, this, TQT_SIGNAL(jailRoll()), actionCollection(), "move_jailroll"); + m_jailRoll = new KAction(i18n("Roll to Leave &Jail")/*, "atlantik_move_jail_roll"*/, CTRL+Key_J, TQT_TQOBJECT(this), TQT_SIGNAL(jailRoll()), actionCollection(), "move_jailroll"); m_jailRoll->setEnabled(false); // Mix code and XML into GUI KMainWindow::createGUI(); applyMainWindowSettings( KGlobal::config(), "AtlantikMainWindow" ); KMainWindow::statusBar()->insertItem("Atlantik " ATLANTIK_VERSION_STRING, 0); - KMainWindow::statusBar()->insertItem(TQString::null, 1); - connect(statusBar(), TQT_SIGNAL(released(int)), this, TQT_SLOT(statusBarClick(int))); + KMainWindow::statusBar()->insertItem(TQString(), 1); + connect(statusBar(), TQT_SIGNAL(released(int)), TQT_TQOBJECT(this), TQT_SLOT(statusBarClick(int))); // Main widget, containing all others m_mainWidget = new TQWidget(this, "main"); @@ -158,7 +158,7 @@ Atlantik::Atlantik () m_mainLayout = new TQGridLayout(m_mainWidget, 3, 2); setCentralWidget(m_mainWidget); - // Vertical view area for portfolios. + //Qt::Vertical view area for portfolios. m_portfolioScroll = new TQScrollView(m_mainWidget, "pfScroll"); m_mainLayout->addWidget( m_portfolioScroll, 0, 0 ); m_portfolioScroll->setHScrollBarMode( TQScrollView::AlwaysOff ); @@ -192,7 +192,7 @@ Atlantik::Atlantik () m_serverMsgs->setFocusProxy(m_input); - connect(m_input, TQT_SIGNAL(returnPressed()), this, TQT_SLOT(slotSendMsg())); + connect(m_input, TQT_SIGNAL(returnPressed()), TQT_TQOBJECT(this), TQT_SLOT(slotSendMsg())); // Set stretching where we want it. m_mainLayout->setRowStretch(1, 1); // make m_board+m_serverMsgs stretch vertically, not the rest @@ -253,8 +253,8 @@ void Atlantik::newPlayer(Player *player) // we'd better force an update. playerChanged(player); - connect(player, TQT_SIGNAL(changed(Player *)), this, TQT_SLOT(playerChanged(Player *))); - connect(player, TQT_SIGNAL(gainedTurn()), this, TQT_SLOT(gainedTurn())); + connect(player, TQT_SIGNAL(changed(Player *)), TQT_TQOBJECT(this), TQT_SLOT(playerChanged(Player *))); + connect(player, TQT_SIGNAL(gainedTurn()), TQT_TQOBJECT(this), TQT_SLOT(gainedTurn())); connect(player, TQT_SIGNAL(changed(Player *)), m_board, TQT_SLOT(playerChanged(Player *))); KNotifyClient::event(winId(), "newplayer"); @@ -315,7 +315,7 @@ void Atlantik::showSelectServer() initNetworkObject(); connect(m_selectServer, TQT_SIGNAL(serverConnect(const TQString, int)), m_atlantikNetwork, TQT_SLOT(serverConnect(const TQString, int))); - connect(m_selectServer, TQT_SIGNAL(msgStatus(const TQString &)), this, TQT_SLOT(slotMsgStatus(const TQString &))); + connect(m_selectServer, TQT_SIGNAL(msgtqStatus(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotMsgtqStatus(const TQString &))); m_selectServer->slotRefresh( m_config.connectOnStart ); } @@ -356,8 +356,8 @@ void Atlantik::showSelectGame() connect(m_selectGame, TQT_SIGNAL(joinGame(int)), m_atlantikNetwork, TQT_SLOT(joinGame(int))); connect(m_selectGame, TQT_SIGNAL(newGame(const TQString &)), m_atlantikNetwork, TQT_SLOT(newGame(const TQString &))); - connect(m_selectGame, TQT_SIGNAL(leaveServer()), this, TQT_SLOT(showSelectServer())); - connect(m_selectGame, TQT_SIGNAL(msgStatus(const TQString &)), this, TQT_SLOT(slotMsgStatus(const TQString &))); + connect(m_selectGame, TQT_SIGNAL(leaveServer()), TQT_TQOBJECT(this), TQT_SLOT(showSelectServer())); + connect(m_selectGame, TQT_SIGNAL(msgtqStatus(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotMsgtqStatus(const TQString &))); } void Atlantik::showSelectConfiguration() @@ -383,7 +383,7 @@ void Atlantik::showSelectConfiguration() connect(m_selectConfiguration, TQT_SIGNAL(changeOption(int, const TQString &)), m_atlantikNetwork, TQT_SLOT(changeOption(int, const TQString &))); connect(m_selectConfiguration, TQT_SIGNAL(buttonCommand(TQString)), m_atlantikNetwork, TQT_SLOT(writeData(TQString))); connect(m_selectConfiguration, TQT_SIGNAL(iconSelected(const TQString &)), m_atlantikNetwork, TQT_SLOT(setImage(const TQString &))); - connect(m_selectConfiguration, TQT_SIGNAL(statusMessage(const TQString &)), this, TQT_SLOT(slotMsgStatus(const TQString &))); + connect(m_selectConfiguration, TQT_SIGNAL(statusMessage(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotMsgtqStatus(const TQString &))); } void Atlantik::initBoard() @@ -475,12 +475,12 @@ void Atlantik::networkClosed(int status) switch( status ) { case KBufferedIO::involuntary: - slotMsgStatus( i18n("Connection with server %1:%2 lost.").arg(m_atlantikNetwork->host()).arg(m_atlantikNetwork->port()), TQString("connect_no") ); + slotMsgtqStatus( i18n("Connection with server %1:%2 lost.").tqarg(m_atlantikNetwork->host()).tqarg(m_atlantikNetwork->port()), TQString("connect_no") ); showSelectServer(); break; default: if ( !m_atlantikNetwork->host().isEmpty() ) - slotMsgStatus( i18n("Disconnected from %1:%2.").arg(m_atlantikNetwork->host()).arg(m_atlantikNetwork->port()), TQString("connect_no") ); + slotMsgtqStatus( i18n("Disconnected from %1:%2.").tqarg(m_atlantikNetwork->host()).tqarg(m_atlantikNetwork->port()), TQString("connect_no") ); break; } } @@ -491,7 +491,7 @@ void Atlantik::slotConfigure() m_configDialog = new ConfigDialog(this); m_configDialog->show(); - connect(m_configDialog, TQT_SIGNAL(okClicked()), this, TQT_SLOT(slotUpdateConfig())); + connect(m_configDialog, TQT_SIGNAL(okClicked()), TQT_TQOBJECT(this), TQT_SLOT(slotUpdateConfig())); } void Atlantik::showEventLog() @@ -612,7 +612,7 @@ void Atlantik::slotUpdateConfig() void Atlantik::slotSendMsg() { m_atlantikNetwork->cmdChat(m_input->text()); - m_input->setText(TQString::null); + m_input->setText(TQString()); } void Atlantik::slotMsgInfo(TQString msg) @@ -625,7 +625,7 @@ void Atlantik::slotMsgError(TQString msg) serverMsgsAppend("Error: " + msg); } -void Atlantik::slotMsgStatus(const TQString &message, const TQString &icon) +void Atlantik::slotMsgtqStatus(const TQString &message, const TQString &icon) { KMainWindow::statusBar()->changeItem(message, 1); m_eventLog->addEvent(message, icon); @@ -636,7 +636,7 @@ void Atlantik::slotMsgChat(TQString player, TQString msg) if (m_config.chatTimestamps) { TQTime time = TQTime::currentTime(); - serverMsgsAppend(TQString("[%1] %2: %3").arg(time.toString("hh:mm")).arg(player).arg(msg)); + serverMsgsAppend(TQString("[%1] %2: %3").tqarg(time.toString("hh:mm")).tqarg(player).tqarg(msg)); } else serverMsgsAppend(player + ": " + msg); @@ -728,26 +728,26 @@ void Atlantik::initNetworkObject() } m_atlantikNetwork = new AtlantikNetwork(m_atlanticCore); - connect(m_atlantikNetwork, TQT_SIGNAL(msgInfo(TQString)), this, TQT_SLOT(slotMsgInfo(TQString))); - connect(m_atlantikNetwork, TQT_SIGNAL(msgError(TQString)), this, TQT_SLOT(slotMsgError(TQString))); - connect(m_atlantikNetwork, TQT_SIGNAL(msgStatus(const TQString &, const TQString &)), this, TQT_SLOT(slotMsgStatus(const TQString &, const TQString &))); - connect(m_atlantikNetwork, TQT_SIGNAL(msgChat(TQString, TQString)), this, TQT_SLOT(slotMsgChat(TQString, TQString))); + connect(m_atlantikNetwork, TQT_SIGNAL(msgInfo(TQString)), TQT_TQOBJECT(this), TQT_SLOT(slotMsgInfo(TQString))); + connect(m_atlantikNetwork, TQT_SIGNAL(msgError(TQString)), TQT_TQOBJECT(this), TQT_SLOT(slotMsgError(TQString))); + connect(m_atlantikNetwork, TQT_SIGNAL(msgtqStatus(const TQString &, const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotMsgtqStatus(const TQString &, const TQString &))); + connect(m_atlantikNetwork, TQT_SIGNAL(msgChat(TQString, TQString)), TQT_TQOBJECT(this), TQT_SLOT(slotMsgChat(TQString, TQString))); - connect(m_atlantikNetwork, TQT_SIGNAL(connectionSuccess()), this, TQT_SLOT(slotNetworkConnected())); - connect(m_atlantikNetwork, TQT_SIGNAL(connectionFailed(int)), this, TQT_SLOT(slotNetworkError(int))); - connect(m_atlantikNetwork, TQT_SIGNAL(closed(int)), this, TQT_SLOT(networkClosed(int))); + connect(m_atlantikNetwork, TQT_SIGNAL(connectionSuccess()), TQT_TQOBJECT(this), TQT_SLOT(slotNetworkConnected())); + connect(m_atlantikNetwork, TQT_SIGNAL(connectionFailed(int)), TQT_TQOBJECT(this), TQT_SLOT(slotNetworkError(int))); + connect(m_atlantikNetwork, TQT_SIGNAL(closed(int)), TQT_TQOBJECT(this), TQT_SLOT(networkClosed(int))); - connect(m_atlantikNetwork, TQT_SIGNAL(receivedHandshake()), this, TQT_SLOT(sendHandshake())); + connect(m_atlantikNetwork, TQT_SIGNAL(receivedHandshake()), TQT_TQOBJECT(this), TQT_SLOT(sendHandshake())); - connect(m_atlantikNetwork, TQT_SIGNAL(gameConfig()), this, TQT_SLOT(showSelectConfiguration())); - connect(m_atlantikNetwork, TQT_SIGNAL(gameInit()), this, TQT_SLOT(initBoard())); - connect(m_atlantikNetwork, TQT_SIGNAL(gameRun()), this, TQT_SLOT(showBoard())); - connect(m_atlantikNetwork, TQT_SIGNAL(gameEnd()), this, TQT_SLOT(freezeBoard())); + connect(m_atlantikNetwork, TQT_SIGNAL(gameConfig()), TQT_TQOBJECT(this), TQT_SLOT(showSelectConfiguration())); + connect(m_atlantikNetwork, TQT_SIGNAL(gameInit()), TQT_TQOBJECT(this), TQT_SLOT(initBoard())); + connect(m_atlantikNetwork, TQT_SIGNAL(gameRun()), TQT_TQOBJECT(this), TQT_SLOT(showBoard())); + connect(m_atlantikNetwork, TQT_SIGNAL(gameEnd()), TQT_TQOBJECT(this), TQT_SLOT(freezeBoard())); - connect(m_atlantikNetwork, TQT_SIGNAL(newEstate(Estate *)), this, TQT_SLOT(newEstate(Estate *))); - connect(m_atlantikNetwork, TQT_SIGNAL(newAuction(Auction *)), this, TQT_SLOT(newAuction(Auction *))); + connect(m_atlantikNetwork, TQT_SIGNAL(newEstate(Estate *)), TQT_TQOBJECT(this), TQT_SLOT(newEstate(Estate *))); + connect(m_atlantikNetwork, TQT_SIGNAL(newAuction(Auction *)), TQT_TQOBJECT(this), TQT_SLOT(newAuction(Auction *))); - connect(m_atlantikNetwork, TQT_SIGNAL(clientCookie(TQString)), this, TQT_SLOT(clientCookie(TQString))); + connect(m_atlantikNetwork, TQT_SIGNAL(clientCookie(TQString)), TQT_TQOBJECT(this), TQT_SLOT(clientCookie(TQString))); connect(m_atlantikNetwork, TQT_SIGNAL(networkEvent(const TQString &, const TQString &)), m_eventLog, TQT_SLOT(addEvent(const TQString &, const TQString &))); connect(this, TQT_SIGNAL(rollDice()), m_atlantikNetwork, TQT_SLOT(rollDice())); diff --git a/atlantik/client/atlantik.h b/atlantik/client/atlantik.h index d3eac354..24b989d3 100644 --- a/atlantik/client/atlantik.h +++ b/atlantik/client/atlantik.h @@ -68,12 +68,13 @@ class Player; class Estate; class Trade; -class LogTextEdit : public QTextEdit +class LogTextEdit : public TQTextEdit { Q_OBJECT + TQ_OBJECT public: - LogTextEdit( TQWidget *parent = 0, const char *name = 0 ); + LogTextEdit( TQWidget *tqparent = 0, const char *name = 0 ); virtual ~LogTextEdit(); TQPopupMenu *createPopupMenu( const TQPoint & pos ); @@ -91,6 +92,7 @@ private: class Atlantik : public KMainWindow { Q_OBJECT + TQ_OBJECT public: /** @@ -186,7 +188,7 @@ public slots: */ void slotMsgInfo(TQString msg); - void slotMsgStatus(const TQString &message, const TQString &icon = TQString::null); + void slotMsgtqStatus(const TQString &message, const TQString &icon = TQString()); /** * Informs serverMsgs() to append an incoming message from the diff --git a/atlantik/client/configdlg.cpp b/atlantik/client/configdlg.cpp index 9e936147..b5d1ecae 100644 --- a/atlantik/client/configdlg.cpp +++ b/atlantik/client/configdlg.cpp @@ -40,9 +40,9 @@ #include "atlantik.h" #include "configdlg.moc" -ConfigDialog::ConfigDialog(Atlantik* parent, const char *name) : KDialogBase(IconList, i18n("Configure Atlantik"), Ok|Cancel, Ok, parent, "config_atlantik", false, name) +ConfigDialog::ConfigDialog(Atlantik* tqparent, const char *name) : KDialogBase(IconList, i18n("Configure Atlantik"), Ok|Cancel, Ok, tqparent, "config_atlantik", false, name) { - m_parent = parent; + m_parent = tqparent; p_general = addPage(i18n("General"), i18n("General"), BarIcon("configure", KIcon::SizeMedium)); p_p13n = addPage(i18n("Personalization"), i18n("Personalization"), BarIcon("personal", KIcon::SizeMedium)); p_board = addPage(i18n("Board"), i18n("Board"), BarIcon("monop_board", KIcon::SizeMedium)); @@ -53,7 +53,7 @@ ConfigDialog::ConfigDialog(Atlantik* parent, const char *name) : KDialogBase(Ico configBoard = new ConfigBoard(this, p_board, "configBoard"); configMonopigator = new ConfigMonopigator(this, p_monopigator, "configMonopigator"); - setMinimumSize(sizeHint()); + setMinimumSize(tqsizeHint()); } bool ConfigDialog::chatTimestamps() @@ -111,26 +111,26 @@ AtlantikConfig ConfigDialog::config() return m_parent->config(); } -ConfigPlayer::ConfigPlayer(ConfigDialog* configDialog, TQWidget *parent, const char *name) : TQWidget(parent, name) +ConfigPlayer::ConfigPlayer(ConfigDialog* configDialog, TQWidget *tqparent, const char *name) : TQWidget(tqparent, name) { m_configDialog = configDialog; - TQVBoxLayout *layout = new TQVBoxLayout(parent, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout *tqlayout = new TQVBoxLayout(tqparent, KDialog::marginHint(), KDialog::spacingHint()); - TQLabel *label = new TQLabel(i18n("Player name:"), parent); - layout->addWidget(label); + TQLabel *label = new TQLabel(i18n("Player name:"), tqparent); + tqlayout->addWidget(label); - m_playerName = new TQLineEdit(parent); - layout->addWidget(m_playerName); + m_playerName = new TQLineEdit(tqparent); + tqlayout->addWidget(m_playerName); - TQLabel *label2 = new TQLabel(i18n("Player image:"), parent); - layout->addWidget(label2); + TQLabel *label2 = new TQLabel(i18n("Player image:"), tqparent); + tqlayout->addWidget(label2); - m_playerIcon = new KPushButton(parent, "playerIcon"); - layout->addWidget(m_playerIcon); + m_playerIcon = new KPushButton(tqparent, "playerIcon"); + tqlayout->addWidget(m_playerIcon); connect( m_playerIcon, TQT_SIGNAL(clicked()), this, TQT_SLOT(chooseImage()) ); - layout->addStretch(1); + tqlayout->addStretch(1); reset(); } @@ -182,21 +182,21 @@ void ConfigPlayer::reset() setImage(); } -ConfigMonopigator::ConfigMonopigator(ConfigDialog *configDialog, TQWidget *parent, const char *name) : TQWidget(parent, name) +ConfigMonopigator::ConfigMonopigator(ConfigDialog *configDialog, TQWidget *tqparent, const char *name) : TQWidget(tqparent, name) { m_configDialog = configDialog; - TQVBoxLayout *layout = new TQVBoxLayout(parent, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout *tqlayout = new TQVBoxLayout(tqparent, KDialog::marginHint(), KDialog::spacingHint()); - m_connectOnStart = new TQCheckBox(i18n("Request list of Internet servers on start-up"), parent); - layout->addWidget(m_connectOnStart); + m_connectOnStart = new TQCheckBox(i18n("Request list of Internet servers on start-up"), tqparent); + tqlayout->addWidget(m_connectOnStart); TQString message=i18n( "If checked, Atlantik connects to a meta server on start-up to\n" "request a list of Internet servers.\n"); TQWhatsThis::add(m_connectOnStart, message); - m_hideDevelopmentServers = new TQCheckBox(i18n("Hide development servers"), parent); - layout->addWidget(m_hideDevelopmentServers); + m_hideDevelopmentServers = new TQCheckBox(i18n("Hide development servers"), tqparent); + tqlayout->addWidget(m_hideDevelopmentServers); message=i18n( "Some of the Internet servers might be running development\n" @@ -204,7 +204,7 @@ ConfigMonopigator::ConfigMonopigator(ConfigDialog *configDialog, TQWidget *paren "display these servers.\n"); TQWhatsThis::add(m_hideDevelopmentServers, message); - layout->addStretch(1); + tqlayout->addStretch(1); reset(); } @@ -225,20 +225,20 @@ void ConfigMonopigator::reset() m_hideDevelopmentServers->setChecked(m_configDialog->config().hideDevelopmentServers); } -ConfigGeneral::ConfigGeneral(ConfigDialog *configDialog, TQWidget *parent, const char *name) : TQWidget(parent, name) +ConfigGeneral::ConfigGeneral(ConfigDialog *configDialog, TQWidget *tqparent, const char *name) : TQWidget(tqparent, name) { m_configDialog = configDialog; - TQVBoxLayout *layout = new TQVBoxLayout(parent, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout *tqlayout = new TQVBoxLayout(tqparent, KDialog::marginHint(), KDialog::spacingHint()); - m_chatTimestamps = new TQCheckBox(i18n("Show timestamps in chat messages"), parent); - layout->addWidget(m_chatTimestamps); + m_chatTimestamps = new TQCheckBox(i18n("Show timestamps in chat messages"), tqparent); + tqlayout->addWidget(m_chatTimestamps); TQString message=i18n( "If checked, Atlantik will add timestamps in front of chat\n" "messages.\n"); TQWhatsThis::add(m_chatTimestamps, message); - layout->addStretch(1); + tqlayout->addStretch(1); reset(); } @@ -253,13 +253,13 @@ void ConfigGeneral::reset() m_chatTimestamps->setChecked(m_configDialog->config().chatTimestamps); } -ConfigBoard::ConfigBoard(ConfigDialog *configDialog, TQWidget *parent, const char *name) : TQWidget(parent, name) +ConfigBoard::ConfigBoard(ConfigDialog *configDialog, TQWidget *tqparent, const char *name) : TQWidget(tqparent, name) { m_configDialog = configDialog; - TQVBoxLayout *layout = new TQVBoxLayout(parent, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout *tqlayout = new TQVBoxLayout(tqparent, KDialog::marginHint(), KDialog::spacingHint()); - TQGroupBox *box = new TQGroupBox(1, Qt::Horizontal, i18n("Game Status Feedback"), parent); - layout->addWidget(box); + TQGroupBox *box = new TQGroupBox(1, Qt::Horizontal, i18n("Game tqStatus Feedback"), tqparent); + tqlayout->addWidget(box); m_indicateUnowned = new TQCheckBox(i18n("Display title deed card on unowned properties"), box); TQString message=i18n( @@ -291,10 +291,10 @@ ConfigBoard::ConfigBoard(ConfigDialog *configDialog, TQWidget *parent, const cha "will have a Quartz effect similar to the Quartz KWin style.\n"); TQWhatsThis::add(m_quartzEffects, message); -// box = new TQGroupBox(1, Qt::Horizontal, i18n("Size"), parent); -// layout->addWidget(box); +// box = new TQGroupBox(1, Qt::Horizontal, i18n("Size"), tqparent); +// tqlayout->addWidget(box); - layout->addStretch(1); + tqlayout->addStretch(1); reset(); } diff --git a/atlantik/client/configdlg.h b/atlantik/client/configdlg.h index 41843ca6..c28e3a98 100644 --- a/atlantik/client/configdlg.h +++ b/atlantik/client/configdlg.h @@ -32,12 +32,13 @@ class ConfigDialog; struct AtlantikConfig; -class ConfigPlayer : public QWidget +class ConfigPlayer : public TQWidget { Q_OBJECT + TQ_OBJECT public: - ConfigPlayer(ConfigDialog *configDialog, TQWidget *parent, const char *name=0); + ConfigPlayer(ConfigDialog *configDialog, TQWidget *tqparent, const char *name=0); TQString playerName(); TQString playerImage(); @@ -55,12 +56,13 @@ private: KPushButton *m_playerIcon; }; -class ConfigBoard : public QWidget +class ConfigBoard : public TQWidget { Q_OBJECT + TQ_OBJECT public: - ConfigBoard(ConfigDialog *configDialog, TQWidget *parent, const char *name=0); + ConfigBoard(ConfigDialog *configDialog, TQWidget *tqparent, const char *name=0); bool indicateUnowned(); bool highliteUnowned(); @@ -75,12 +77,13 @@ private: TQCheckBox *m_indicateUnowned, *m_highliteUnowned, *m_darkenMortgaged, *m_animateToken, *m_quartzEffects; }; -class ConfigMonopigator : public QWidget +class ConfigMonopigator : public TQWidget { Q_OBJECT + TQ_OBJECT public: - ConfigMonopigator(ConfigDialog *dialog, TQWidget *parent, const char *name = 0); + ConfigMonopigator(ConfigDialog *dialog, TQWidget *tqparent, const char *name = 0); bool connectOnStart(); bool hideDevelopmentServers(); @@ -92,12 +95,13 @@ private: TQCheckBox *m_connectOnStart, *m_hideDevelopmentServers; }; -class ConfigGeneral : public QWidget +class ConfigGeneral : public TQWidget { Q_OBJECT + TQ_OBJECT public: - ConfigGeneral(ConfigDialog *dialog, TQWidget *parent, const char *name = 0); + ConfigGeneral(ConfigDialog *dialog, TQWidget *tqparent, const char *name = 0); bool chatTimestamps(); @@ -111,9 +115,10 @@ private: class ConfigDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - ConfigDialog(Atlantik *parent, const char *name=0); + ConfigDialog(Atlantik *tqparent, const char *name=0); bool chatTimestamps(); bool indicateUnowned(); diff --git a/atlantik/client/event.h b/atlantik/client/event.h index dc3b6c9b..96d02c41 100644 --- a/atlantik/client/event.h +++ b/atlantik/client/event.h @@ -22,12 +22,13 @@ class TQDateTime; class TQString; -class Event : public QObject +class Event : public TQObject { Q_OBJECT + TQ_OBJECT public: - Event(const TQDateTime &dateTime, const TQString &description, const TQString &icon = TQString::null); + Event(const TQDateTime &dateTime, const TQString &description, const TQString &icon = TQString()); TQDateTime dateTime() const; TQString description() const; TQString icon() const; diff --git a/atlantik/client/eventlogwidget.cpp b/atlantik/client/eventlogwidget.cpp index 6bc81b04..2821253a 100644 --- a/atlantik/client/eventlogwidget.cpp +++ b/atlantik/client/eventlogwidget.cpp @@ -37,7 +37,7 @@ EventLog::EventLog() void EventLog::addEvent(const TQString &description, const TQString &icon) { - Event *event = new Event(TQDateTime::currentDateTime(), description, icon); + Event *event = new Event(TQDateTime::tqcurrentDateTime(), description, icon); m_events.append(event); emit newEvent(event); } @@ -47,8 +47,8 @@ TQPtrList EventLog::events() return m_events; } -EventLogWidget::EventLogWidget(EventLog *eventLog, TQWidget *parent, const char *name) - : TQWidget(parent, name, +EventLogWidget::EventLogWidget(EventLog *eventLog, TQWidget *tqparent, const char *name) + : TQWidget(tqparent, name, WType_Dialog | WStyle_Customize | WStyle_DialogBorder | WStyle_Title | WStyle_Minimize | WStyle_ContextHelp ) { @@ -113,7 +113,7 @@ void EventLogWidget::save() { TQTextStream stream(&file); - stream << i18n( "Atlantik log file, saved at %1." ).arg( TQDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss") ) << endl; + stream << i18n( "Atlantik log file, saved at %1." ).tqarg( TQDateTime::tqcurrentDateTime().toString("yyyy-MM-dd hh:mm:ss") ) << endl; TQPtrList events = m_eventLog->events(); for (TQPtrListIterator it( events ); (*it) ; ++it) diff --git a/atlantik/client/eventlogwidget.h b/atlantik/client/eventlogwidget.h index c9e1eacd..3b2d1883 100644 --- a/atlantik/client/eventlogwidget.h +++ b/atlantik/client/eventlogwidget.h @@ -28,16 +28,17 @@ class KListView; class KListViewItem; class KPushButton; -class EventLog : public QObject +class EventLog : public TQObject { Q_OBJECT + TQ_OBJECT public: EventLog(); TQPtrList events(); public slots: - void addEvent(const TQString &description, const TQString &icon = TQString::null); + void addEvent(const TQString &description, const TQString &icon = TQString()); signals: void newEvent(Event *event); @@ -46,14 +47,15 @@ private: TQPtrList m_events; }; -class EventLogWidget : public QWidget +class EventLogWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: enum EventLogType { Default, Net_In, Net_Out }; - EventLogWidget(EventLog *eventLog, TQWidget *parent=0, const char *name = 0); + EventLogWidget(EventLog *eventLog, TQWidget *tqparent=0, const char *name = 0); public slots: void addEvent(Event *event); diff --git a/atlantik/client/monopigator.cpp b/atlantik/client/monopigator.cpp index 7e0a834d..22081de0 100644 --- a/atlantik/client/monopigator.cpp +++ b/atlantik/client/monopigator.cpp @@ -46,7 +46,7 @@ void Monopigator::loadData(const KURL &url) m_downloadData->reset(); m_job = KIO::get(url, true, false); - m_job->addMetaData(TQString::fromLatin1("UserAgent"), TQString::fromLatin1("Atlantik/" ATLANTIK_VERSION_STRING)); + m_job->addMetaData(TQString::tqfromLatin1("UserAgent"), TQString::tqfromLatin1("Atlantik/" ATLANTIK_VERSION_STRING)); if (!m_timer) { @@ -108,12 +108,12 @@ void Monopigator::processData(const TQByteArray &data, bool okSoFar) } } -MonopigatorEntry::MonopigatorEntry(TQListView *parent, TQString host, TQString latency, TQString version, TQString users, TQString port, TQString ip) : TQObject(), TQListViewItem(parent, host, latency, version, users, port) +MonopigatorEntry::MonopigatorEntry(TQListView *tqparent, TQString host, TQString latency, TQString version, TQString users, TQString port, TQString ip) : TQObject(), TQListViewItem(tqparent, host, latency, version, users, port) { - m_isDev = ( version.find( TQRegExp("(CVS|-dev)") ) != -1 ) ? true : false; + m_isDev = ( version.tqfind( TQRegExp("(CVS|-dev)") ) != -1 ) ? true : false; setEnabled(false); - parent->sort(); + tqparent->sort(); if ( !ip.isEmpty() ) host = ip; diff --git a/atlantik/client/monopigator.h b/atlantik/client/monopigator.h index dd88b0ae..c785b980 100644 --- a/atlantik/client/monopigator.h +++ b/atlantik/client/monopigator.h @@ -28,9 +28,10 @@ class KExtendedSocket; class TQTime; -class Monopigator : public QObject +class Monopigator : public TQObject { Q_OBJECT + TQ_OBJECT public: Monopigator(); @@ -55,12 +56,13 @@ private: KIO::Job *m_job; }; -class MonopigatorEntry : public TQObject, public QListViewItem +class MonopigatorEntry : public TQObject, public TQListViewItem { Q_OBJECT + TQ_OBJECT public: - MonopigatorEntry(TQListView *parent, TQString host, TQString latency, TQString version, TQString users, TQString port, TQString ip); + MonopigatorEntry(TQListView *tqparent, TQString host, TQString latency, TQString version, TQString users, TQString port, TQString ip); int compare(TQListViewItem *i, int col, bool ascending) const; bool isDev() const; diff --git a/atlantik/client/selectconfiguration_widget.cpp b/atlantik/client/selectconfiguration_widget.cpp index b40bdd4f..1cb7a142 100644 --- a/atlantik/client/selectconfiguration_widget.cpp +++ b/atlantik/client/selectconfiguration_widget.cpp @@ -33,7 +33,7 @@ #include "selectconfiguration_widget.moc" -SelectConfiguration::SelectConfiguration(AtlanticCore *atlanticCore, TQWidget *parent, const char *name) : TQWidget(parent, name) +SelectConfiguration::SelectConfiguration(AtlanticCore *atlanticCore, TQWidget *tqparent, const char *name) : TQWidget(tqparent, name) { m_atlanticCore = atlanticCore; m_game = 0; @@ -51,7 +51,7 @@ SelectConfiguration::SelectConfiguration(AtlanticCore *atlanticCore, TQWidget *p playerButtons->addItem(new TQSpacerItem(20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum)); - // Vertical spacer. + //Qt::Vertical spacer. m_mainLayout->addItem(new TQSpacerItem(20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding)); // Server buttons. @@ -127,11 +127,11 @@ void SelectConfiguration::gameOption(TQString title, TQString type, TQString val void SelectConfiguration::changeOption() { - ConfigOption *configOption = m_configMap[(TQObject *)TQObject::sender()]; + ConfigOption *configOption = m_configMap[(TQObject *)TQT_BASE_OBJECT_NAME::sender()]; if (configOption) { - kdDebug() << "checked " << ((TQCheckBox *)TQObject::sender())->isChecked() << endl; - emit changeOption( configOption->id(), TQString::number( ((TQCheckBox *)TQObject::sender())->isChecked() ) ); + kdDebug() << "checked " << ((TQCheckBox *)TQT_BASE_OBJECT_NAME::sender())->isChecked() << endl; + emit changeOption( configOption->id(), TQString::number( ((TQCheckBox *)TQT_BASE_OBJECT_NAME::sender())->isChecked() ) ); } } @@ -148,7 +148,7 @@ void SelectConfiguration::optionChanged(ConfigOption *configOption) void SelectConfiguration::optionChanged() { - TQString command = m_optionCommandMap[(TQObject *)TQObject::sender()]; + TQString command = m_optionCommandMap[(TQObject *)TQT_BASE_OBJECT_NAME::sender()]; if (TQCheckBox *checkBox = m_checkBoxMap[command]) { diff --git a/atlantik/client/selectconfiguration_widget.h b/atlantik/client/selectconfiguration_widget.h index a0cfcd24..0ad747d0 100644 --- a/atlantik/client/selectconfiguration_widget.h +++ b/atlantik/client/selectconfiguration_widget.h @@ -32,12 +32,13 @@ class ConfigOption; class Game; class Player; -class SelectConfiguration : public QWidget +class SelectConfiguration : public TQWidget { Q_OBJECT + TQ_OBJECT public: - SelectConfiguration(AtlanticCore *atlanticCore, TQWidget *parent, const char *name=0); + SelectConfiguration(AtlanticCore *atlanticCore, TQWidget *tqparent, const char *name=0); void setCanStart(const bool &canStart); TQString hostToConnect() const; diff --git a/atlantik/client/selectgame_widget.cpp b/atlantik/client/selectgame_widget.cpp index 8f39ff08..e634b3c2 100644 --- a/atlantik/client/selectgame_widget.cpp +++ b/atlantik/client/selectgame_widget.cpp @@ -29,7 +29,7 @@ #include "selectgame_widget.h" -SelectGame::SelectGame(AtlanticCore *atlanticCore, TQWidget *parent, const char *name) : TQWidget(parent, name) +SelectGame::SelectGame(AtlanticCore *atlanticCore, TQWidget *tqparent, const char *name) : TQWidget(tqparent, name) { m_atlanticCore = atlanticCore; @@ -80,13 +80,13 @@ void SelectGame::addGame(Game *game) if (game->id() == -1) { - TQListViewItem *item = new TQListViewItem( m_gameList, i18n("Create a new %1 Game").arg(game->name()), game->description(), TQString::null, TQString::null, game->type() ); + TQListViewItem *item = new TQListViewItem( m_gameList, i18n("Create a new %1 Game").tqarg(game->name()), game->description(), TQString(), TQString(), game->type() ); item->setPixmap(0, TQPixmap(SmallIcon("filenew"))); } else { Player *master = game->master(); - TQListViewItem *item = new TQListViewItem( m_gameList, i18n("Join %1's %2 Game").arg( (master ? master->name() : TQString::null), game->name() ), game->description(), TQString::number(game->id()), TQString::number(game->players()), game->type() ); + TQListViewItem *item = new TQListViewItem( m_gameList, i18n("Join %1's %2 Game").tqarg( (master ? master->name() : TQString()), game->name() ), game->description(), TQString::number(game->id()), TQString::number(game->players()), game->type() ); item->setPixmap( 0, TQPixmap(SmallIcon("atlantik")) ); item->setEnabled(game->canBeJoined()); @@ -118,11 +118,11 @@ void SelectGame::updateGame(Game *game) item->setText( 1, game->description() ); if (game->id() == -1) - item->setText(0, i18n("Create a new %1 Game").arg(game->name())); + item->setText(0, i18n("Create a new %1 Game").tqarg(game->name())); else { Player *master = game->master(); - item->setText( 0, i18n("Join %1's %2 Game").arg( (master ? master->name() : TQString::null), game->name() ) ); + item->setText( 0, i18n("Join %1's %2 Game").tqarg( (master ? master->name() : TQString()), game->name() ) ); item->setText( 3, TQString::number( game->players() ) ); item->setEnabled( game->canBeJoined() ); @@ -143,7 +143,7 @@ void SelectGame::playerChanged(Player *player) game = m_atlanticCore->findGame( item->text(2).toInt() ); if ( game && game->master() == player ) { - item->setText( 0, i18n("Join %1's %2 Game").arg( player->name(), game->name() ) ); + item->setText( 0, i18n("Join %1's %2 Game").tqarg( player->name(), game->name() ) ); return; } item = item->nextSibling(); diff --git a/atlantik/client/selectgame_widget.h b/atlantik/client/selectgame_widget.h index f6d28f43..42ec3350 100644 --- a/atlantik/client/selectgame_widget.h +++ b/atlantik/client/selectgame_widget.h @@ -27,12 +27,13 @@ class AtlanticCore; class Game; class Player; -class SelectGame : public QWidget +class SelectGame : public TQWidget { Q_OBJECT + TQ_OBJECT public: - SelectGame(AtlanticCore *atlanticCore, TQWidget *parent, const char *name=0); + SelectGame(AtlanticCore *atlanticCore, TQWidget *tqparent, const char *name=0); void initPage(); bool validateNext(); @@ -51,7 +52,7 @@ signals: void joinGame(int gameId); void newGame(const TQString &gameType); void leaveServer(); - void msgStatus(const TQString &status); + void msgtqStatus(const TQString &status); private: TQListViewItem *findItem(Game *game); diff --git a/atlantik/client/selectserver_widget.cpp b/atlantik/client/selectserver_widget.cpp index 97a594c4..2404ebd1 100644 --- a/atlantik/client/selectserver_widget.cpp +++ b/atlantik/client/selectserver_widget.cpp @@ -28,7 +28,7 @@ #include "selectserver_widget.moc" -SelectServer::SelectServer(bool useMonopigatorOnStart, bool hideDevelopmentServers, TQWidget *parent, const char *name) : TQWidget(parent, name) +SelectServer::SelectServer(bool useMonopigatorOnStart, bool hideDevelopmentServers, TQWidget *tqparent, const char *name) : TQWidget(tqparent, name) { m_hideDevelopmentServers = hideDevelopmentServers; @@ -42,12 +42,12 @@ SelectServer::SelectServer(bool useMonopigatorOnStart, bool hideDevelopmentServe TQLabel *hostLabel = new TQLabel(i18n("Hostname:"), customGroup); m_hostEdit = new KLineEdit(customGroup); - m_hostEdit->setSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::Minimum)); + m_hostEdit->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::Minimum)); TQLabel *portLabel = new TQLabel(i18n("Port:"), customGroup); m_portEdit = new KLineEdit(TQString::number(1234), customGroup); - m_portEdit->setSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Minimum)); + m_portEdit->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Minimum)); KPushButton *connectButton = new KPushButton( KGuiItem(i18n("Connect"), "network"), customGroup); connect(connectButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(customConnect())); @@ -113,7 +113,7 @@ void SelectServer::setHideDevelopmentServers(bool hideDevelopmentServers) void SelectServer::initMonopigator() { // Hardcoded, but there aren't any other Monopigator root servers at the moment - emit msgStatus(i18n("Retrieving server list...")); + emit msgtqStatus(i18n("Retrieving server list...")); m_refreshButton->setGuiItem(KGuiItem(i18n("Reload Server List"), "reload")); m_monopigator->loadData(KURL( "http://monopd-gator.kde.org/")); @@ -135,13 +135,13 @@ void SelectServer::slotMonopigatorAdd(TQString ip, TQString host, TQString port, void SelectServer::monopigatorFinished() { - emit msgStatus(i18n("Retrieved server list.")); + emit msgtqStatus(i18n("Retrieved server list.")); m_refreshButton->setEnabled(true); } void SelectServer::monopigatorTimeout() { - emit msgStatus(i18n("Error while retrieving the server list.")); + emit msgtqStatus(i18n("Error while retrieving the server list.")); m_refreshButton->setEnabled(true); } diff --git a/atlantik/client/selectserver_widget.h b/atlantik/client/selectserver_widget.h index 471bc8d2..7e4ba45d 100644 --- a/atlantik/client/selectserver_widget.h +++ b/atlantik/client/selectserver_widget.h @@ -29,12 +29,13 @@ class KExtendedSocket; -class SelectServer : public QWidget +class SelectServer : public TQWidget { Q_OBJECT + TQ_OBJECT public: - SelectServer(bool useMonopigatorOnStart, bool hideDevelopmentServers, TQWidget *parent, const char *name=0); + SelectServer(bool useMonopigatorOnStart, bool hideDevelopmentServers, TQWidget *tqparent, const char *name=0); virtual ~SelectServer(); void initPage(); @@ -56,7 +57,7 @@ private slots: signals: void serverConnect(const TQString host, int port); - void msgStatus(const TQString &message); + void msgtqStatus(const TQString &message); void showDevelopmentServers(bool show); private: diff --git a/atlantik/kio_atlantik/kio_atlantik.cpp b/atlantik/kio_atlantik/kio_atlantik.cpp index de74a1e0..fcf425e1 100644 --- a/atlantik/kio_atlantik/kio_atlantik.cpp +++ b/atlantik/kio_atlantik/kio_atlantik.cpp @@ -55,7 +55,7 @@ void AtlantikProtocol::get( const KURL& url ) #endif TQString port = TQString::number( url.port() ? url.port() : 1234 ); int game = url.queryItem("game").toInt(); - TQString gameString = game ? TQString::number( game ) : TQString::null; + TQString gameString = game ? TQString::number( game ) : TQString(); if (!host.isNull() && !port.isNull()) { diff --git a/atlantik/libatlantic/atlantic_core.cpp b/atlantik/libatlantic/atlantic_core.cpp index 9139e6ed..c73b6e0f 100644 --- a/atlantik/libatlantic/atlantic_core.cpp +++ b/atlantik/libatlantic/atlantic_core.cpp @@ -26,7 +26,7 @@ #include "player.h" #include "trade.h" -AtlanticCore::AtlanticCore(TQObject *parent, const char *name) : TQObject(parent, name) +AtlanticCore::AtlanticCore(TQObject *tqparent, const char *name) : TQObject(tqparent, name) { m_playerSelf = 0; } diff --git a/atlantik/libatlantic/atlantic_core.h b/atlantik/libatlantic/atlantic_core.h index 197fca91..2ea9f25c 100644 --- a/atlantik/libatlantic/atlantic_core.h +++ b/atlantik/libatlantic/atlantic_core.h @@ -30,12 +30,13 @@ class Game; class Trade; class Auction; -class LIBATLANTIC_EXPORT AtlanticCore : public QObject +class LIBATLANTIC_EXPORT AtlanticCore : public TQObject { Q_OBJECT + TQ_OBJECT public: - AtlanticCore(TQObject *parent, const char *name); + AtlanticCore(TQObject *tqparent, const char *name); void reset(bool deletePermanents = false); @@ -50,7 +51,7 @@ public: void removePlayer(Player *player); TQPtrList games(); - Game *newGame(int gameId, const TQString &type = TQString::null); + Game *newGame(int gameId, const TQString &type = TQString()); Game *findGame(const TQString &type); // finds game types Game *findGame(int gameId); // finds actual games Game *gameSelf(); diff --git a/atlantik/libatlantic/auction.cpp b/atlantik/libatlantic/auction.cpp index 2e09a685..ebc6c40e 100644 --- a/atlantik/libatlantic/auction.cpp +++ b/atlantik/libatlantic/auction.cpp @@ -32,7 +32,7 @@ Auction::~Auction() emit completed(); } -void Auction::setStatus(int status) +void Auction::settqStatus(int status) { if (m_status != status) { diff --git a/atlantik/libatlantic/auction.h b/atlantik/libatlantic/auction.h index 80633bc8..c482416e 100644 --- a/atlantik/libatlantic/auction.h +++ b/atlantik/libatlantic/auction.h @@ -24,9 +24,10 @@ class Player; class Estate; -class LIBATLANTIC_EXPORT Auction : public QObject +class LIBATLANTIC_EXPORT Auction : public TQObject { Q_OBJECT + TQ_OBJECT public: Auction(int auctionId, Estate *estate); @@ -35,7 +36,7 @@ public: int auctionId() { return m_auctionId; } Estate *estate() { return m_estate; } - void setStatus(int status); + void settqStatus(int status); int status() { return m_status; } void newBid(Player *player, int bid); diff --git a/atlantik/libatlantic/configoption.h b/atlantik/libatlantic/configoption.h index 823938c8..b988e22f 100644 --- a/atlantik/libatlantic/configoption.h +++ b/atlantik/libatlantic/configoption.h @@ -22,9 +22,10 @@ #include "libatlantic_export.h" -class LIBATLANTIC_EXPORT ConfigOption : public QObject +class LIBATLANTIC_EXPORT ConfigOption : public TQObject { Q_OBJECT + TQ_OBJECT public: ConfigOption(int configId); diff --git a/atlantik/libatlantic/estate.cpp b/atlantik/libatlantic/estate.cpp index c9b40e73..ec86c6ff 100644 --- a/atlantik/libatlantic/estate.cpp +++ b/atlantik/libatlantic/estate.cpp @@ -23,7 +23,7 @@ Estate::Estate(int estateId) : TQObject() { m_id = estateId; - m_name = TQString::null; + m_name = TQString(); m_owner = 0; m_houses = 0; m_price = 0; diff --git a/atlantik/libatlantic/estate.h b/atlantik/libatlantic/estate.h index cbbd51e1..dc92fd5f 100644 --- a/atlantik/libatlantic/estate.h +++ b/atlantik/libatlantic/estate.h @@ -25,9 +25,10 @@ class EstateGroup; class Player; -class LIBATLANTIC_EXPORT Estate : public QObject +class LIBATLANTIC_EXPORT Estate : public TQObject { Q_OBJECT + TQ_OBJECT public: Estate(int estateId); diff --git a/atlantik/libatlantic/estategroup.h b/atlantik/libatlantic/estategroup.h index 9e0399bc..48c81a8b 100644 --- a/atlantik/libatlantic/estategroup.h +++ b/atlantik/libatlantic/estategroup.h @@ -21,9 +21,10 @@ #include "libatlantic_export.h" -class LIBATLANTIC_EXPORT EstateGroup : public QObject +class LIBATLANTIC_EXPORT EstateGroup : public TQObject { Q_OBJECT + TQ_OBJECT public: EstateGroup(const int id); diff --git a/atlantik/libatlantic/game.cpp b/atlantik/libatlantic/game.cpp index 308a827d..8a310e16 100644 --- a/atlantik/libatlantic/game.cpp +++ b/atlantik/libatlantic/game.cpp @@ -21,8 +21,8 @@ Game::Game(int gameId) : TQObject() { m_id = gameId; - m_description = TQString::null; - m_type = TQString::null; + m_description = TQString(); + m_type = TQString(); m_players = 0; m_master = 0; diff --git a/atlantik/libatlantic/game.h b/atlantik/libatlantic/game.h index c2e8138f..34a40b73 100644 --- a/atlantik/libatlantic/game.h +++ b/atlantik/libatlantic/game.h @@ -25,9 +25,10 @@ class TQString; class Player; -class LIBATLANTIC_EXPORT Game : public QObject +class LIBATLANTIC_EXPORT Game : public TQObject { Q_OBJECT + TQ_OBJECT public: Game(int gameId); diff --git a/atlantik/libatlantic/player.h b/atlantik/libatlantic/player.h index f36b1e8a..98f67f89 100644 --- a/atlantik/libatlantic/player.h +++ b/atlantik/libatlantic/player.h @@ -25,9 +25,10 @@ class Estate; class Game; -class LIBATLANTIC_EXPORT Player : public QObject +class LIBATLANTIC_EXPORT Player : public TQObject { Q_OBJECT + TQ_OBJECT public: Player(int playerId); diff --git a/atlantik/libatlantic/trade.cpp b/atlantik/libatlantic/trade.cpp index 7bd638c9..7bd3aee1 100644 --- a/atlantik/libatlantic/trade.cpp +++ b/atlantik/libatlantic/trade.cpp @@ -196,5 +196,5 @@ void TradeMoney::setMoney(unsigned int money) TQString TradeMoney::text() const { - return TQString("$%1").arg(m_money); + return TQString("$%1").tqarg(m_money); } diff --git a/atlantik/libatlantic/trade.h b/atlantik/libatlantic/trade.h index 0d168f0a..5ee399d1 100644 --- a/atlantik/libatlantic/trade.h +++ b/atlantik/libatlantic/trade.h @@ -28,9 +28,10 @@ class Player; class Trade; class Estate; -class LIBATLANTIC_EXPORT TradeItem : public QObject +class LIBATLANTIC_EXPORT TradeItem : public TQObject { Q_OBJECT + TQ_OBJECT public: TradeItem(Trade *trade, Player *from, Player *to); @@ -60,6 +61,7 @@ private: class LIBATLANTIC_EXPORT TradeEstate : public TradeItem { Q_OBJECT + TQ_OBJECT public: TradeEstate(Estate *estate, Trade *trade, Player *to); @@ -79,6 +81,7 @@ private: class LIBATLANTIC_EXPORT TradeMoney : public TradeItem { Q_OBJECT + TQ_OBJECT public: TradeMoney(unsigned int money, Trade *trade, Player *from, Player *to); @@ -96,9 +99,10 @@ private: }; -class LIBATLANTIC_EXPORT Trade : public QObject +class LIBATLANTIC_EXPORT Trade : public TQObject { Q_OBJECT + TQ_OBJECT public: Trade(int tradeId); diff --git a/atlantik/libatlantikclient/atlantik_network.cpp b/atlantik/libatlantikclient/atlantik_network.cpp index 51347f84..7b980ef8 100644 --- a/atlantik/libatlantikclient/atlantik_network.cpp +++ b/atlantik/libatlantikclient/atlantik_network.cpp @@ -95,37 +95,37 @@ void AtlantikNetwork::endTurn() void AtlantikNetwork::setName(TQString name) { // Almost deprecated, will be replaced by libmonopdprotocol - writeData(TQString(".n%1").arg(name)); + writeData(TQString(".n%1").tqarg(name)); } void AtlantikNetwork::tokenConfirmation(Estate *estate) { - writeData(TQString(".t%1").arg(estate ? estate->id() : -1)); + writeData(TQString(".t%1").tqarg(estate ? estate->id() : -1)); } void AtlantikNetwork::estateToggleMortgage(Estate *estate) { - writeData(TQString(".em%1").arg(estate ? estate->id() : -1)); + writeData(TQString(".em%1").tqarg(estate ? estate->id() : -1)); } void AtlantikNetwork::estateHouseBuy(Estate *estate) { - writeData(TQString(".hb%1").arg(estate ? estate->id() : -1)); + writeData(TQString(".hb%1").tqarg(estate ? estate->id() : -1)); } void AtlantikNetwork::estateHouseSell(Estate *estate) { - writeData(TQString(".hs%1").arg(estate ? estate->id() : -1)); + writeData(TQString(".hs%1").tqarg(estate ? estate->id() : -1)); } void AtlantikNetwork::newGame(const TQString &gameType) { - writeData(TQString(".gn%1").arg(gameType)); + writeData(TQString(".gn%1").tqarg(gameType)); } void AtlantikNetwork::joinGame(int gameId) { - writeData(TQString(".gj%1").arg(gameId)); + writeData(TQString(".gj%1").tqarg(gameId)); } void AtlantikNetwork::cmdChat(TQString msg) @@ -135,42 +135,42 @@ void AtlantikNetwork::cmdChat(TQString msg) void AtlantikNetwork::newTrade(Player *player) { - writeData(TQString(".Tn%1").arg(player ? player->id() : -1)); + writeData(TQString(".Tn%1").tqarg(player ? player->id() : -1)); } void AtlantikNetwork::kickPlayer(Player *player) { - writeData(TQString(".gk%1").arg(player ? player->id() : -1)); + writeData(TQString(".gk%1").tqarg(player ? player->id() : -1)); } void AtlantikNetwork::tradeUpdateEstate(Trade *trade, Estate *estate, Player *player) { - writeData(TQString(".Te%1:%2:%3").arg(trade ? trade->tradeId() : -1).arg(estate ? estate->id() : -1).arg(player ? player->id() : -1)); + writeData(TQString(".Te%1:%2:%3").tqarg(trade ? trade->tradeId() : -1).tqarg(estate ? estate->id() : -1).tqarg(player ? player->id() : -1)); } void AtlantikNetwork::tradeUpdateMoney(Trade *trade, unsigned int money, Player *pFrom, Player *pTo) { - writeData(TQString(".Tm%1:%2:%3:%4").arg(trade ? trade->tradeId() : -1).arg(pFrom ? pFrom->id() : -1).arg(pTo ? pTo->id() : -1).arg(money)); + writeData(TQString(".Tm%1:%2:%3:%4").tqarg(trade ? trade->tradeId() : -1).tqarg(pFrom ? pFrom->id() : -1).tqarg(pTo ? pTo->id() : -1).tqarg(money)); } void AtlantikNetwork::tradeReject(Trade *trade) { - writeData(TQString(".Tr%1").arg(trade ? trade->tradeId() : -1)); + writeData(TQString(".Tr%1").tqarg(trade ? trade->tradeId() : -1)); } void AtlantikNetwork::tradeAccept(Trade *trade) { - writeData(TQString(".Ta%1:%2").arg(trade ? trade->tradeId() : -1).arg(trade ? trade->revision() : -1)); + writeData(TQString(".Ta%1:%2").tqarg(trade ? trade->tradeId() : -1).tqarg(trade ? trade->revision() : -1)); } void AtlantikNetwork::auctionBid(Auction *auction, int amount) { - writeData(TQString(".ab%1:%2").arg(auction ? auction->auctionId() : -1).arg(amount)); + writeData(TQString(".ab%1:%2").tqarg(auction ? auction->auctionId() : -1).tqarg(amount)); } void AtlantikNetwork::setImage(const TQString &name) { - writeData(TQString(".pi%1").arg(name)); + writeData(TQString(".pi%1").tqarg(name)); } void AtlantikNetwork::jailPay() @@ -190,7 +190,7 @@ void AtlantikNetwork::jailCard() void AtlantikNetwork::changeOption(int configId, const TQString &value) { - writeData( TQString(".gc%1:%2").arg(configId).arg(value) ); + writeData( TQString(".gc%1:%2").tqarg(configId).tqarg(value) ); } void AtlantikNetwork::writeData(TQString msg) @@ -607,7 +607,7 @@ void AtlantikNetwork::processNode(TQDomNode n) Estate *estate = 0; bool b_newEstate = false; - // FIXME: allow any estateId, GUI should not use it to determin its geometry + // FIXME: allow any estateId, GUI should not use it to determin its tqgeometry if (estateId >= 0 && estateId < 100 && !(estate = m_atlanticCore->findEstate(a.value().toInt()))) { // Create estate object @@ -872,7 +872,7 @@ void AtlantikNetwork::processNode(TQDomNode n) if (auction && !a.isNull()) { int status = a.value().toInt(); - auction->setStatus(status); + auction->settqStatus(status); // TODO: find a good way to visualise "sold!" if (status == 3) @@ -906,23 +906,23 @@ void AtlantikNetwork::serverConnect(const TQString host, int port) { setAddress(host, port); enableRead(true); - emit msgStatus(i18n("Connecting to %1:%2...").arg(host).arg(TQString::number(port)), "connect_creating"); + emit msgtqStatus(i18n("Connecting to %1:%2...").tqarg(host).tqarg(TQString::number(port)), "connect_creating"); startAsyncConnect(); } void AtlantikNetwork::slotLookupFinished(int count) { - emit msgStatus(i18n("Server host name lookup finished...")); + emit msgtqStatus(i18n("Server host name lookup finished...")); } void AtlantikNetwork::slotConnectionSuccess() { - emit msgStatus(i18n("Connected to %1:%2.").arg(host()).arg(port()), "connect_established"); + emit msgtqStatus(i18n("Connected to %1:%2.").tqarg(host()).tqarg(port()), "connect_established"); } void AtlantikNetwork::slotConnectionFailed(int error) { - emit msgStatus(i18n("Connection failed! Error code: %1").arg(error), "connect_no"); + emit msgtqStatus(i18n("Connection failed! Error code: %1").tqarg(error), "connect_no"); } #include "atlantik_network.moc" diff --git a/atlantik/libatlantikclient/atlantik_network.h b/atlantik/libatlantikclient/atlantik_network.h index 44099121..3164bf18 100644 --- a/atlantik/libatlantikclient/atlantik_network.h +++ b/atlantik/libatlantikclient/atlantik_network.h @@ -35,6 +35,7 @@ class Auction; class LIBATLANTIC_EXPORT AtlantikNetwork : public KExtendedSocket { Q_OBJECT + TQ_OBJECT public: AtlantikNetwork(AtlanticCore *atlanticCore); @@ -101,7 +102,7 @@ signals: void msgInfo(TQString); void msgError(TQString); void msgChat(TQString, TQString); - void msgStatus(const TQString &data, const TQString &icon = TQString::null); + void msgtqStatus(const TQString &data, const TQString &icon = TQString()); void networkEvent(const TQString &data, const TQString &icon); void displayDetails(TQString text, bool clearText, bool clearButtons, Estate *estate = 0); diff --git a/atlantik/libatlantikclient/monopdprotocol.cpp b/atlantik/libatlantikclient/monopdprotocol.cpp index f024f163..39f8fb81 100644 --- a/atlantik/libatlantikclient/monopdprotocol.cpp +++ b/atlantik/libatlantikclient/monopdprotocol.cpp @@ -36,12 +36,12 @@ MonopdProtocol::MonopdProtocol() : TQObject() void MonopdProtocol::auctionEstate() { - sendData(TQString::fromLatin1(".ea")); + sendData(TQString::tqfromLatin1(".ea")); } void MonopdProtocol::buyEstate() { - sendData(TQString::fromLatin1(".eb")); + sendData(TQString::tqfromLatin1(".eb")); } void MonopdProtocol::confirmTokenLocation(Estate *estate) @@ -53,12 +53,12 @@ void MonopdProtocol::confirmTokenLocation(Estate *estate) void MonopdProtocol::endTurn() { - sendData(TQString::fromLatin1(".E")); + sendData(TQString::tqfromLatin1(".E")); } void MonopdProtocol::rollDice() { - sendData(TQString::fromLatin1(".r")); + sendData(TQString::tqfromLatin1(".r")); } void MonopdProtocol::setName(TQString name) @@ -70,7 +70,7 @@ void MonopdProtocol::setName(TQString name) void MonopdProtocol::startGame() { - sendData(TQString::fromLatin1(".gs")); + sendData(TQString::tqfromLatin1(".gs")); } void MonopdProtocol::sendData(TQString) diff --git a/atlantik/libatlantikclient/monopdprotocol.h b/atlantik/libatlantikclient/monopdprotocol.h index b2162715..f5569d43 100644 --- a/atlantik/libatlantikclient/monopdprotocol.h +++ b/atlantik/libatlantikclient/monopdprotocol.h @@ -35,9 +35,10 @@ class Auction; class Estate; -class MonopdProtocol : public QObject +class MonopdProtocol : public TQObject { Q_OBJECT + TQ_OBJECT public: MonopdProtocol(); diff --git a/atlantik/libatlantikui/auction_widget.cpp b/atlantik/libatlantikui/auction_widget.cpp index 219c8b2b..2bb582fe 100644 --- a/atlantik/libatlantikui/auction_widget.cpp +++ b/atlantik/libatlantikui/auction_widget.cpp @@ -33,7 +33,7 @@ #include "auction_widget.moc" -AuctionWidget::AuctionWidget(AtlanticCore *atlanticCore, Auction *auction, TQWidget *parent, const char *name) : TQWidget(parent, name) +AuctionWidget::AuctionWidget(AtlanticCore *atlanticCore, Auction *auction, TQWidget *tqparent, const char *name) : TQWidget(tqparent, name) { m_atlanticCore = atlanticCore; @@ -47,7 +47,7 @@ AuctionWidget::AuctionWidget(AtlanticCore *atlanticCore, Auction *auction, TQWid // Player list Estate *estate = auction->estate(); - m_playerGroupBox = new TQVGroupBox(estate ? i18n("Auction: %1").arg(estate->name()) : i18n("Auction"), this, "groupBox"); + m_playerGroupBox = new TQVGroupBox(estate ? i18n("Auction: %1").tqarg(estate->name()) : i18n("Auction"), this, "groupBox"); m_mainLayout->addWidget(m_playerGroupBox); m_playerList = new KListView(m_playerGroupBox); @@ -80,7 +80,7 @@ AuctionWidget::AuctionWidget(AtlanticCore *atlanticCore, Auction *auction, TQWid KPushButton *bidButton = new KPushButton(i18n("Make Bid"), bidBox, "bidButton"); connect(bidButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotBidButtonClicked())); - // Status label + // tqStatus label m_statusLabel = new TQLabel(this, "statusLabel"); m_mainLayout->addWidget(m_statusLabel); } @@ -103,7 +103,7 @@ void AuctionWidget::auctionChanged() break; default: - status = TQString::null; + status = TQString(); } m_statusLabel->setText(status); } diff --git a/atlantik/libatlantikui/auction_widget.h b/atlantik/libatlantikui/auction_widget.h index 92e20c5c..5a21c95b 100644 --- a/atlantik/libatlantikui/auction_widget.h +++ b/atlantik/libatlantikui/auction_widget.h @@ -33,12 +33,13 @@ class AtlanticCore; class Player; class Auction; -class AuctionWidget : public QWidget +class AuctionWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - AuctionWidget(AtlanticCore *atlanticCore, Auction *auction, TQWidget *parent, const char *name=0); + AuctionWidget(AtlanticCore *atlanticCore, Auction *auction, TQWidget *tqparent, const char *name=0); private slots: void auctionChanged(); diff --git a/atlantik/libatlantikui/board.cpp b/atlantik/libatlantikui/board.cpp index 1b9ae0b5..6b48b40d 100644 --- a/atlantik/libatlantikui/board.cpp +++ b/atlantik/libatlantikui/board.cpp @@ -35,7 +35,7 @@ #include "board.h" #include "board.moc" -AtlantikBoard::AtlantikBoard(AtlanticCore *atlanticCore, int maxEstates, DisplayMode mode, TQWidget *parent, const char *name) : TQWidget(parent, name) +AtlantikBoard::AtlantikBoard(AtlanticCore *atlanticCore, int maxEstates, DisplayMode mode, TQWidget *tqparent, const char *name) : TQWidget(tqparent, name) { m_atlanticCore = atlanticCore; m_maxEstates = maxEstates; @@ -351,13 +351,13 @@ TQPoint AtlantikBoard::calculateTokenDestination(Token *token, Estate *eDest) int x = 0, y = 0; if (token->player()->inJail()) { - x = evDest->geometry().right() - token->width() - 2; - y = evDest->geometry().top(); + x = evDest->tqgeometry().right() - token->width() - 2; + y = evDest->tqgeometry().top(); } else { - x = evDest->geometry().center().x() - (token->width()/2); - y = evDest->geometry().center().y() - (token->height()/2); + x = evDest->tqgeometry().center().x() - (token->width()/2); + y = evDest->tqgeometry().center().y() - (token->height()/2); /* // Re-center because of EstateView headers @@ -394,8 +394,8 @@ void AtlantikBoard::slotMoveToken() } // Where are we? - int xCurrent = m_movingToken->geometry().x(); - int yCurrent = m_movingToken->geometry().y(); + int xCurrent = m_movingToken->tqgeometry().x(); + int yCurrent = m_movingToken->tqgeometry().y(); // Where do we want to go today? Estate *eDest = m_atlanticCore->estateAfter(m_movingToken->location()); @@ -560,7 +560,7 @@ void AtlantikBoard::prependEstateDetails(Estate *estate) if (m_displayQueue.getFirst() == m_lastServerDisplay) { - eDetails = new EstateDetails(estate, TQString::null, this); + eDetails = new EstateDetails(estate, TQString(), this); m_displayQueue.prepend(eDetails); connect(eDetails, TQT_SIGNAL(buttonCommand(TQString)), this, TQT_SIGNAL(buttonCommand(TQString))); @@ -572,7 +572,7 @@ void AtlantikBoard::prependEstateDetails(Estate *estate) if (eDetails) { eDetails->setEstate(estate); - eDetails->setText( TQString::null ); + eDetails->setText( TQString() ); // eDetails->clearButtons(); } else diff --git a/atlantik/libatlantikui/board.h b/atlantik/libatlantikui/board.h index 11194336..6240568d 100644 --- a/atlantik/libatlantikui/board.h +++ b/atlantik/libatlantikui/board.h @@ -32,14 +32,15 @@ class Token; class EstateView; -class LIBATLANTIKUI_EXPORT AtlantikBoard : public QWidget +class LIBATLANTIKUI_EXPORT AtlantikBoard : public TQWidget { Q_OBJECT + TQ_OBJECT public: enum DisplayMode { Play, Edit }; - AtlantikBoard(AtlanticCore *atlanticCore, int maxEstates, DisplayMode mode, TQWidget *parent, const char *name=0); + AtlantikBoard(AtlanticCore *atlanticCore, int maxEstates, DisplayMode mode, TQWidget *tqparent, const char *name=0); ~AtlantikBoard(); void reset(); diff --git a/atlantik/libatlantikui/estatedetails.cpp b/atlantik/libatlantikui/estatedetails.cpp index 3a71f25a..d2690a91 100644 --- a/atlantik/libatlantikui/estatedetails.cpp +++ b/atlantik/libatlantikui/estatedetails.cpp @@ -39,7 +39,7 @@ #include "estatedetails.h" #include "kwrappedlistviewitem.h" -EstateDetails::EstateDetails(Estate *estate, TQString text, TQWidget *parent, const char *name) : TQWidget(parent, name) +EstateDetails::EstateDetails(Estate *estate, TQString text, TQWidget *tqparent, const char *name) : TQWidget(tqparent, name) { m_pixmap = 0; m_quartzBlocks = 0; @@ -114,11 +114,11 @@ void EstateDetails::paintEvent(TQPaintEvent *) TQColor greenHouse(0, 255, 0); TQColor redHotel(255, 51, 51); TQPainter painter; - painter.begin(m_pixmap, this); + painter.tqbegin(TQT_TQPAINTDEVICE(m_pixmap), this); - painter.setPen(Qt::black); + painter.setPen(TQt::black); - painter.setBrush(m_estate ? m_estate->bgColor() : Qt::white); + painter.setBrush(m_estate ? m_estate->bgColor() : TQt::white); painter.drawRect(rect()); /* @@ -136,7 +136,7 @@ void EstateDetails::paintEvent(TQPaintEvent *) quartzBuffer->resize(25, (height()/4)-2); TQPainter quartzPainter; - quartzPainter.begin(quartzBuffer, this); + quartzPainter.tqbegin(TQT_TQPAINTDEVICE(quartzBuffer), this); painter.setBrush(titleColor); painter.drawRect(0, 0, width(), titleHeight); @@ -173,15 +173,15 @@ void EstateDetails::paintEvent(TQPaintEvent *) // TODO: steal blur code from kicker/taskbar/taskcontainer.cpp // Estate name - painter.setPen(Qt::white); + painter.setPen(TQt::white); int fontSize = KGlobalSettings::generalFont().pointSize(); if (fontSize == -1) fontSize = KGlobalSettings::generalFont().pixelSize(); painter.setFont(TQFont(KGlobalSettings::generalFont().family(), fontSize * 2, TQFont::Bold)); - painter.drawText(KDialog::marginHint(), KDialog::marginHint(), width()-KDialog::marginHint(), titleHeight, Qt::AlignJustify, m_estate->name()); + painter.drawText(KDialog::marginHint(), KDialog::marginHint(), width()-KDialog::marginHint(), titleHeight, TQt::AlignJustify, m_estate->name()); - painter.setPen(Qt::black); + painter.setPen(TQt::black); int xText = 0; @@ -190,7 +190,7 @@ void EstateDetails::paintEvent(TQPaintEvent *) { xText = titleHeight - fontSize - KDialog::marginHint(); painter.setFont(TQFont(KGlobalSettings::generalFont().family(), fontSize, TQFont::Bold)); - painter.drawText(5, xText, width()-10, titleHeight, Qt::AlignRight, m_estate->estateGroup()->name().upper()); + painter.drawText(5, xText, width()-10, titleHeight, TQt::AlignRight, m_estate->estateGroup()->name().upper()); } xText = titleHeight + fontSize + 5; @@ -217,22 +217,22 @@ void EstateDetails::addDetails() // Price if (m_estate->price()) { - infoText = new TQListViewItem(m_infoListView, m_infoListView->lastItem(), i18n("Price: %1").arg(m_estate->price())); + infoText = new TQListViewItem(m_infoListView, m_infoListView->lastItem(), i18n("Price: %1").tqarg(m_estate->price())); infoText->setPixmap(0, TQPixmap(SmallIcon("info"))); } // Owner, houses, isMortgaged if (m_estate && m_estate->canBeOwned()) { - infoText = new TQListViewItem(m_infoListView, m_infoListView->lastItem(), i18n("Owner: %1").arg(m_estate->owner() ? m_estate->owner()->name() : i18n("unowned"))); + infoText = new TQListViewItem(m_infoListView, m_infoListView->lastItem(), i18n("Owner: %1").tqarg(m_estate->owner() ? m_estate->owner()->name() : i18n("unowned"))); infoText->setPixmap(0, TQPixmap(SmallIcon("info"))); if (m_estate->isOwned()) { - infoText = new TQListViewItem(m_infoListView, m_infoListView->lastItem(), i18n("Houses: %1").arg(m_estate->houses())); + infoText = new TQListViewItem(m_infoListView, m_infoListView->lastItem(), i18n("Houses: %1").tqarg(m_estate->houses())); infoText->setPixmap(0, TQPixmap(SmallIcon("info"))); - infoText = new TQListViewItem(m_infoListView, m_infoListView->lastItem(), i18n("Mortgaged: %1").arg(m_estate->isMortgaged() ? i18n("Yes") : i18n("No"))); + infoText = new TQListViewItem(m_infoListView, m_infoListView->lastItem(), i18n("Mortgaged: %1").tqarg(m_estate->isMortgaged() ? i18n("Yes") : i18n("No"))); infoText->setPixmap(0, TQPixmap(SmallIcon("info"))); } } @@ -250,7 +250,7 @@ void EstateDetails::addButton(TQString command, TQString caption, bool enabled) { TQColor bgColor, fgColor; bgColor = m_estate->bgColor().light(110); - fgColor = ( bgColor.red() + bgColor.green() + bgColor.blue() < 255 ) ? Qt::white : Qt::black; + fgColor = ( bgColor.red() + bgColor.green() + bgColor.blue() < 255 ) ? TQt::white : TQt::black; button->setPaletteForegroundColor( fgColor ); button->setPaletteBackgroundColor( bgColor ); @@ -298,7 +298,7 @@ void EstateDetails::appendText(TQString text) KWrappedListViewItem *infoText = new KWrappedListViewItem(m_infoListView, m_infoListView->lastItem(), text); - if ( text.find( TQRegExp("rolls") ) != -1 ) + if ( text.tqfind( TQRegExp("rolls") ) != -1 ) infoText->setPixmap(0, TQPixmap(SmallIcon("roll"))); else infoText->setPixmap(0, TQPixmap(SmallIcon("atlantik"))); @@ -321,7 +321,7 @@ void EstateDetails::clearButtons() void EstateDetails::buttonPressed() { - emit buttonCommand(TQString(m_buttonCommandMap[(TQObject *)TQObject::sender()])); + emit buttonCommand(TQString(m_buttonCommandMap[(TQObject *)TQT_BASE_OBJECT_NAME::sender()])); } #include "estatedetails.moc" diff --git a/atlantik/libatlantikui/estatedetails.h b/atlantik/libatlantikui/estatedetails.h index 6659055a..315bfa5f 100644 --- a/atlantik/libatlantikui/estatedetails.h +++ b/atlantik/libatlantikui/estatedetails.h @@ -32,12 +32,13 @@ class KPushButton; class Player; class Estate; -class EstateDetails : public QWidget +class EstateDetails : public TQWidget { -Q_OBJECT + Q_OBJECT + TQ_OBJECT public: - EstateDetails(Estate *estate, TQString text, TQWidget *parent, const char *name = 0); + EstateDetails(Estate *estate, TQString text, TQWidget *tqparent, const char *name = 0); ~EstateDetails(); Estate *estate() { return m_estate; } diff --git a/atlantik/libatlantikui/estateview.cpp b/atlantik/libatlantikui/estateview.cpp index 4755ccd3..19eec4d5 100644 --- a/atlantik/libatlantikui/estateview.cpp +++ b/atlantik/libatlantikui/estateview.cpp @@ -36,7 +36,7 @@ #include "estateview.moc" #include "config.h" -EstateView::EstateView(Estate *estate, EstateOrientation orientation, const TQString &_icon, bool indicateUnowned, bool highliteUnowned, bool darkenMortgaged, bool quartzEffects, TQWidget *parent, const char *name) : TQWidget(parent, name, WResizeNoErase) +EstateView::EstateView(Estate *estate, EstateOrientation orientation, const TQString &_icon, bool indicateUnowned, bool highliteUnowned, bool darkenMortgaged, bool quartzEffects, TQWidget *tqparent, const char *name) : TQWidget(tqparent, name, WResizeNoErase) { m_estate = estate; m_orientation = orientation; @@ -72,20 +72,20 @@ void EstateView::updateToolTip() TQString toolTip = m_estate->name(); if ( m_estate->isOwned() ) { - toolTip.append( "\n" + i18n("Owner: %1").arg( m_estate->owner()->name() ) ); + toolTip.append( "\n" + i18n("Owner: %1").tqarg( m_estate->owner()->name() ) ); if ( m_estate->isMortgaged() ) - toolTip.append( "\n" + i18n("Unmortgage Price: %1").arg( m_estate->unmortgagePrice() ) ); + toolTip.append( "\n" + i18n("Unmortgage Price: %1").tqarg( m_estate->unmortgagePrice() ) ); else - toolTip.append( "\n" + i18n("Mortgage Value: %1").arg( m_estate->mortgagePrice() ) ); + toolTip.append( "\n" + i18n("Mortgage Value: %1").tqarg( m_estate->mortgagePrice() ) ); if ( m_estate->canSellHouses() ) - toolTip.append( "\n" + i18n("House Value: %1").arg( m_estate->houseSellPrice() ) ); + toolTip.append( "\n" + i18n("House Value: %1").tqarg( m_estate->houseSellPrice() ) ); if ( m_estate->canBuyHouses() ) - toolTip.append( "\n" + i18n("House Price: %1").arg( m_estate->housePrice() ) ); + toolTip.append( "\n" + i18n("House Price: %1").tqarg( m_estate->housePrice() ) ); } else if ( m_estate->canBeOwned() ) - toolTip.append( "\n" + i18n("Price: %1").arg( m_estate->price() ) ); + toolTip.append( "\n" + i18n("Price: %1").tqarg( m_estate->price() ) ); else if ( m_estate->money() ) - toolTip.append( "\n" + i18n("Money: %1").arg( m_estate->money() ) ); + toolTip.append( "\n" + i18n("Money: %1").tqarg( m_estate->money() ) ); TQToolTip::add( this, toolTip ); } @@ -255,9 +255,9 @@ void EstateView::paintEvent(TQPaintEvent *) TQColor greenHouse(0, 255, 0); TQColor redHotel(255, 51, 51); TQPainter painter; - painter.begin(qpixmap, this); + painter.tqbegin(TQT_TQPAINTDEVICE(qpixmap), this); - painter.setPen(Qt::black); + painter.setPen(TQt::black); if (m_darkenMortgaged==true && m_estate->isMortgaged()) painter.setBrush(m_estate->bgColor().light(10)); @@ -281,7 +281,7 @@ void EstateView::paintEvent(TQPaintEvent *) quartzBuffer->resize(m_titleWidth-2, 25); TQPainter quartzPainter; - quartzPainter.begin(quartzBuffer, this); + quartzPainter.tqbegin(TQT_TQPAINTDEVICE(quartzBuffer), this); painter.setBrush(m_estate->color()); switch(m_orientation) @@ -432,7 +432,7 @@ void EstateView::resizeEvent(TQResizeEvent *) void EstateView::mousePressEvent(TQMouseEvent *e) { - if (e->button()==RightButton && m_estate->isOwned()) + if (e->button()==Qt::RightButton && m_estate->isOwned()) { KPopupMenu *rmbMenu = new KPopupMenu(this); rmbMenu->insertTitle(m_estate->name()); @@ -477,7 +477,7 @@ void EstateView::mousePressEvent(TQMouseEvent *e) { // Request trade if (Player *player = m_estate->owner()) - rmbMenu->insertItem(i18n("Request Trade with %1").arg(player->name()), 3); + rmbMenu->insertItem(i18n("Request Trade with %1").tqarg(player->name()), 3); } KPopupMenu *pm = dynamic_cast(rmbMenu); @@ -488,7 +488,7 @@ void EstateView::mousePressEvent(TQMouseEvent *e) rmbMenu->exec(g); delete rmbMenu; } - else if (e->button()==LeftButton) + else if (e->button()==Qt::LeftButton) emit LMBClicked(m_estate); } diff --git a/atlantik/libatlantikui/estateview.h b/atlantik/libatlantikui/estateview.h index 7e1d8cdc..a24d6888 100644 --- a/atlantik/libatlantikui/estateview.h +++ b/atlantik/libatlantikui/estateview.h @@ -29,12 +29,13 @@ enum EstateOrientation { North=0, East=1, South=2, West=3 }; class Player; class Estate; -class EstateView : public QWidget +class EstateView : public TQWidget { Q_OBJECT + TQ_OBJECT public: - EstateView(Estate *estate, EstateOrientation orientation, const TQString &, bool indicateUnowned, bool highliteUnowned, bool darkenMortgaged, bool quartzEffects, TQWidget *parent, const char *name = 0); + EstateView(Estate *estate, EstateOrientation orientation, const TQString &, bool indicateUnowned, bool highliteUnowned, bool darkenMortgaged, bool quartzEffects, TQWidget *tqparent, const char *name = 0); void setViewProperties(bool indicateUnowned, bool highliteUnowned, bool darkenMortgaged, bool quartzEffects); Estate *estate() { return m_estate; } void updatePE(); diff --git a/atlantik/libatlantikui/kwrappedlistviewitem.cpp b/atlantik/libatlantikui/kwrappedlistviewitem.cpp index 38c0d636..81f06dd7 100644 --- a/atlantik/libatlantikui/kwrappedlistviewitem.cpp +++ b/atlantik/libatlantikui/kwrappedlistviewitem.cpp @@ -31,16 +31,16 @@ #include "kwrappedlistviewitem.h" -KWrappedListViewItem::KWrappedListViewItem( TQListView *parent, TQString text, TQString t2 ) -: TQObject(), KListViewItem( parent ) +KWrappedListViewItem::KWrappedListViewItem( TQListView *tqparent, TQString text, TQString t2 ) +: TQObject(), KListViewItem( tqparent ) { - init( parent, text, t2 ); + init( tqparent, text, t2 ); } -KWrappedListViewItem::KWrappedListViewItem( TQListView *parent, TQListViewItem *after, TQString text, TQString t2 ) -: TQObject(), KListViewItem( parent, after ) +KWrappedListViewItem::KWrappedListViewItem( TQListView *tqparent, TQListViewItem *after, TQString text, TQString t2 ) +: TQObject(), KListViewItem( tqparent, after ) { - init( parent, text, t2 ); + init( tqparent, text, t2 ); } void KWrappedListViewItem::setup() @@ -83,7 +83,7 @@ void KWrappedListViewItem::wrapColumn( int c ) KWordWrap *wrap = KWordWrap::formatText( fm, rect, 0, m_origText ); setText( c, wrap->wrappedString() ); - int lc = text(c).contains( TQChar( '\n' ) ) + 1; + int lc = text(c).tqcontains( TQChar( '\n' ) ) + 1; setHeight( wrap->boundingRect().height() + lc*lv->itemMargin() ); widthChanged( c ); @@ -91,11 +91,11 @@ void KWrappedListViewItem::wrapColumn( int c ) delete wrap; } -void KWrappedListViewItem::init( TQListView *parent, TQString text, TQString t2 ) +void KWrappedListViewItem::init( TQListView *tqparent, TQString text, TQString t2 ) { m_wrapColumn = 0; setMultiLinesEnabled( true ); - parent->setResizeMode( TQListView::LastColumn ); + tqparent->setResizeMode( TQListView::LastColumn ); m_origText = text; @@ -110,7 +110,7 @@ void KWrappedListViewItem::init( TQListView *parent, TQString text, TQString t2 wrapColumn( m_wrapColumn ); - connect( parent->header(), TQT_SIGNAL(sizeChange(int, int, int)), this, TQT_SLOT(wrapColumn(int))); + connect( tqparent->header(), TQT_SIGNAL(sizeChange(int, int, int)), this, TQT_SLOT(wrapColumn(int))); } #include "kwrappedlistviewitem.moc" diff --git a/atlantik/libatlantikui/kwrappedlistviewitem.h b/atlantik/libatlantikui/kwrappedlistviewitem.h index ceda1afe..0107fef3 100644 --- a/atlantik/libatlantikui/kwrappedlistviewitem.h +++ b/atlantik/libatlantikui/kwrappedlistviewitem.h @@ -35,10 +35,11 @@ class KWordWrap; class KWrappedListViewItem : public TQObject, public KListViewItem { Q_OBJECT + TQ_OBJECT public: - KWrappedListViewItem( TQListView *parent, TQString text, QString=TQString::null ); - KWrappedListViewItem( TQListView *parent, TQListViewItem *after, TQString text, QString=TQString::null ); + KWrappedListViewItem( TQListView *tqparent, TQString text, TQString=TQString() ); + KWrappedListViewItem( TQListView *tqparent, TQListViewItem *after, TQString text, TQString=TQString() ); void setup(); // int width(const TQFontMetrics& fm, const TQListView* lv, int c) const; @@ -46,7 +47,7 @@ private slots: void wrapColumn( int c ); private: - void init( TQListView *parent, TQString text, QString=TQString::null ); + void init( TQListView *tqparent, TQString text, TQString=TQString() ); TQString m_origText; int m_wrapColumn; }; diff --git a/atlantik/libatlantikui/portfolioestate.cpp b/atlantik/libatlantikui/portfolioestate.cpp index 3bfed677..9b55b565 100644 --- a/atlantik/libatlantikui/portfolioestate.cpp +++ b/atlantik/libatlantikui/portfolioestate.cpp @@ -21,7 +21,7 @@ #include "portfolioestate.moc" #include "estate.h" -PortfolioEstate::PortfolioEstate(Estate *estate, Player *player, bool alwaysOwned, TQWidget *parent, const char *name) : TQWidget(parent, name) +PortfolioEstate::PortfolioEstate(Estate *estate, Player *player, bool alwaysOwned, TQWidget *tqparent, const char *name) : TQWidget(tqparent, name) { m_estate = estate; m_player = player; @@ -55,7 +55,7 @@ TQPixmap PortfolioEstate::drawPixmap(Estate *estate, Player *player, bool always for (int y=5;y<=13;y+=2) painter.drawLine(2, y, 10, y); - painter.setPen(Qt::white); + painter.setPen(TQt::white); painter.drawPoint(8, 5); painter.drawPoint(8, 7); painter.drawPoint(8, 9); @@ -89,6 +89,6 @@ void PortfolioEstate::paintEvent(TQPaintEvent *) void PortfolioEstate::mousePressEvent(TQMouseEvent *e) { - if (e->button()==LeftButton) + if (e->button()==Qt::LeftButton) emit estateClicked(m_estate); } diff --git a/atlantik/libatlantikui/portfolioestate.h b/atlantik/libatlantikui/portfolioestate.h index fb1dc8d3..93ddde8d 100644 --- a/atlantik/libatlantikui/portfolioestate.h +++ b/atlantik/libatlantikui/portfolioestate.h @@ -26,12 +26,13 @@ class Estate; class Player; -class PortfolioEstate : public QWidget +class PortfolioEstate : public TQWidget { Q_OBJECT + TQ_OBJECT public: - PortfolioEstate(Estate *estate, Player *player, bool alwaysOwned, TQWidget *parent, const char *name = 0); + PortfolioEstate(Estate *estate, Player *player, bool alwaysOwned, TQWidget *tqparent, const char *name = 0); Estate *estate() { return m_estate; } static TQPixmap drawPixmap(Estate *estate, Player *player = 0, bool alwaysOwned = true); diff --git a/atlantik/libatlantikui/portfolioview.cpp b/atlantik/libatlantikui/portfolioview.cpp index 6725cbca..83d2b0d2 100644 --- a/atlantik/libatlantikui/portfolioview.cpp +++ b/atlantik/libatlantikui/portfolioview.cpp @@ -40,7 +40,7 @@ #define PE_MARGINH 2 #define ICONSIZE 48 -PortfolioView::PortfolioView(AtlanticCore *core, Player *player, TQColor activeColor, TQColor inactiveColor, TQWidget *parent, const char *name) : TQWidget(parent, name) +PortfolioView::PortfolioView(AtlanticCore *core, Player *player, TQColor activeColor, TQColor inactiveColor, TQWidget *tqparent, const char *name) : TQWidget(tqparent, name) { m_atlanticCore = core; m_player = player; @@ -52,7 +52,7 @@ PortfolioView::PortfolioView(AtlanticCore *core, Player *player, TQColor activeC b_recreate = true; m_portfolioEstates.setAutoDelete(true); - setBackgroundColor(Qt::white); + setBackgroundColor(TQt::white); setMinimumHeight(ICONSIZE); // Init icon @@ -196,26 +196,26 @@ void PortfolioView::paintEvent(TQPaintEvent *) qpixmap = new TQPixmap(width(), height()); TQPainter painter; - painter.begin(qpixmap, this); + painter.tqbegin(TQT_TQPAINTDEVICE(qpixmap), this); - painter.setPen(Qt::white); - painter.setBrush(Qt::white); + painter.setPen(TQt::white); + painter.setBrush(TQt::white); painter.drawRect(rect()); - painter.setPen(m_player->hasTurn() ? m_activeColor : Qt::black); - painter.setBrush(m_player->hasTurn() ? m_activeColor : Qt::black); + painter.setPen(m_player->hasTurn() ? m_activeColor : TQt::black); + painter.setBrush(m_player->hasTurn() ? m_activeColor : TQt::black); painter.drawRect(0, 0, width(), 20); if (m_image) { - painter.setPen(Qt::black); - painter.setBrush(Qt::white); + painter.setPen(TQt::black); + painter.setBrush(TQt::white); painter.drawRect(0, 0, ICONSIZE, ICONSIZE); painter.drawPixmap(0, 0, *m_image); } - painter.setPen(Qt::white); + painter.setPen(TQt::white); painter.setFont(TQFont(KGlobalSettings::generalFont().family(), KGlobalSettings::generalFont().pointSize(), TQFont::Bold)); painter.drawText(ICONSIZE + KDialog::marginHint(), 15, m_player->name()); @@ -223,8 +223,8 @@ void PortfolioView::paintEvent(TQPaintEvent *) painter.drawText(width() - 50, 15, TQString::number(m_player->money())); else { - painter.setPen(Qt::black); - painter.setBrush(Qt::white); + painter.setPen(TQt::black); + painter.setBrush(TQt::white); painter.setFont(TQFont(KGlobalSettings::generalFont().family(), KGlobalSettings::generalFont().pointSize(), TQFont::Normal)); painter.drawText(ICONSIZE + KDialog::marginHint(), 30, m_player->host()); @@ -252,7 +252,7 @@ void PortfolioView::mousePressEvent(TQMouseEvent *e) { Player *playerSelf = m_atlanticCore->playerSelf(); - if ( e->button()==RightButton && (m_player != playerSelf) ) + if ( e->button()==Qt::RightButton && (m_player != playerSelf) ) { KPopupMenu *rmbMenu = new KPopupMenu(this); rmbMenu->insertTitle(m_player->name()); @@ -260,12 +260,12 @@ void PortfolioView::mousePressEvent(TQMouseEvent *e) if ( m_portfolioEstates.count() ) { // Start trade - rmbMenu->insertItem(i18n("Request Trade with %1").arg(m_player->name()), 0); + rmbMenu->insertItem(i18n("Request Trade with %1").tqarg(m_player->name()), 0); } else { // Kick player - rmbMenu->insertItem(i18n("Boot Player %1 to Lounge").arg(m_player->name()), 0); + rmbMenu->insertItem(i18n("Boot Player %1 to Lounge").tqarg(m_player->name()), 0); rmbMenu->setItemEnabled( 0, m_atlanticCore->selfIsMaster() ); } diff --git a/atlantik/libatlantikui/portfolioview.h b/atlantik/libatlantikui/portfolioview.h index 524f568f..d07aacda 100644 --- a/atlantik/libatlantikui/portfolioview.h +++ b/atlantik/libatlantikui/portfolioview.h @@ -30,12 +30,13 @@ class AtlanticCore; class Player; class Estate; -class LIBATLANTIKUI_EXPORT PortfolioView : public QWidget +class LIBATLANTIKUI_EXPORT PortfolioView : public TQWidget { Q_OBJECT + TQ_OBJECT public: - PortfolioView(AtlanticCore *core, Player *_player, TQColor activeColor, TQColor inactiveColor, TQWidget *parent, const char *name = 0); + PortfolioView(AtlanticCore *core, Player *_player, TQColor activeColor, TQColor inactiveColor, TQWidget *tqparent, const char *name = 0); ~PortfolioView(); void buildPortfolio(); diff --git a/atlantik/libatlantikui/token.cpp b/atlantik/libatlantikui/token.cpp index c77aeadb..0a4f5193 100644 --- a/atlantik/libatlantikui/token.cpp +++ b/atlantik/libatlantikui/token.cpp @@ -33,11 +33,11 @@ #define TOKEN_ICONSIZE 32 -Token::Token(Player *player, AtlantikBoard *parent, const char *name) : TQWidget(parent, name) +Token::Token(Player *player, AtlantikBoard *tqparent, const char *name) : TQWidget(tqparent, name) { setBackgroundMode(NoBackground); // avoid flickering - m_parentBoard = parent; + m_parentBoard = tqparent; m_player = player; connect(m_player, TQT_SIGNAL(changed(Player *)), this, TQT_SLOT(playerChanged())); @@ -127,24 +127,24 @@ void Token::paintEvent(TQPaintEvent *) qpixmap = new TQPixmap(width(), height()); TQPainter painter; - painter.begin(qpixmap, this); + painter.tqbegin(TQT_TQPAINTDEVICE(qpixmap), this); if (m_image) { - painter.setPen(Qt::black); - painter.setBrush(Qt::white); + painter.setPen(TQt::black); + painter.setBrush(TQt::white); painter.drawRect(0, 0, TOKEN_ICONSIZE, TOKEN_ICONSIZE); painter.drawPixmap(0, 0, *m_image); } - painter.setPen(Qt::black); - painter.setBrush(Qt::black); + painter.setPen(TQt::black); + painter.setBrush(TQt::black); painter.drawRect(0, TOKEN_ICONSIZE, width(), KGlobalSettings::generalFont().pointSize()); - painter.setPen(Qt::white); + painter.setPen(TQt::white); painter.setFont(TQFont(KGlobalSettings::generalFont().family(), KGlobalSettings::generalFont().pointSize(), TQFont::DemiBold)); - painter.drawText(1, height()-1, (m_player ? m_player->name() : TQString::null)); + painter.drawText(1, height()-1, (m_player ? m_player->name() : TQString())); b_recreate = false; } diff --git a/atlantik/libatlantikui/token.h b/atlantik/libatlantikui/token.h index 30d43c61..ea45888d 100644 --- a/atlantik/libatlantikui/token.h +++ b/atlantik/libatlantikui/token.h @@ -25,12 +25,13 @@ class Player; class Estate; class AtlantikBoard; -class Token : public QWidget +class Token : public TQWidget { Q_OBJECT + TQ_OBJECT public: - Token (Player *player, AtlantikBoard *parent, const char *name = 0); + Token (Player *player, AtlantikBoard *tqparent, const char *name = 0); ~Token(); Player *player(); void setLocation(Estate *estate); diff --git a/atlantik/libatlantikui/trade_widget.cpp b/atlantik/libatlantikui/trade_widget.cpp index be8b2749..bf4eeac6 100644 --- a/atlantik/libatlantikui/trade_widget.cpp +++ b/atlantik/libatlantikui/trade_widget.cpp @@ -44,15 +44,15 @@ #include "trade_widget.moc" -TradeDisplay::TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, TQWidget *parent, const char *name) - : TQWidget(parent, name, +TradeDisplay::TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, TQWidget *tqparent, const char *name) + : TQWidget(tqparent, name, WType_Dialog | WStyle_Customize | WStyle_DialogBorder | WStyle_Title | WStyle_Minimize | WStyle_ContextHelp ) { m_trade = trade; m_atlanticCore = atlanticCore; - setCaption(i18n("Trade %1").arg(trade->tradeId())); + setCaption(i18n("Trade %1").tqarg(trade->tradeId())); TQVBoxLayout *listCompBox = new TQVBoxLayout(this, KDialog::marginHint()); @@ -143,7 +143,7 @@ TradeDisplay::TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, TQWidget *p m_status = new TQLabel(this); listCompBox->addWidget(m_status); - m_status->setText( i18n( "%1 out of %2 players accept current trade proposal." ).arg( m_trade->count( true ) ).arg( m_trade->count( false ) ) ); + m_status->setText( i18n( "%1 out of %2 players accept current trade proposal." ).tqarg( m_trade->count( true ) ).tqarg( m_trade->count( false ) ) ); // mPlayerList->header()->hide(); // mPlayerList->setRootIsDecorated(true); @@ -216,7 +216,7 @@ void TradeDisplay::tradeChanged() { // TODO: add notification whether playerSelf has accepted or not and // enable/disable accept button based on that - m_status->setText( i18n( "%1 out of %2 players accept current trade proposal." ).arg( m_trade->count( true ) ).arg( m_trade->count( false ) ) ); + m_status->setText( i18n( "%1 out of %2 players accept current trade proposal." ).tqarg( m_trade->count( true ) ).tqarg( m_trade->count( false ) ) ); } void TradeDisplay::playerChanged(Player *player) @@ -232,7 +232,7 @@ void TradeDisplay::playerChanged(Player *player) void TradeDisplay::tradeRejected(Player *player) { if (player) - m_status->setText(i18n("Trade proposal was rejected by %1.").arg(player->name())); + m_status->setText(i18n("Trade proposal was rejected by %1.").tqarg(player->name())); else m_status->setText(i18n("Trade proposal was rejected.")); diff --git a/atlantik/libatlantikui/trade_widget.h b/atlantik/libatlantikui/trade_widget.h index 73842a91..ebaba426 100644 --- a/atlantik/libatlantikui/trade_widget.h +++ b/atlantik/libatlantikui/trade_widget.h @@ -36,12 +36,13 @@ class Player; class Trade; class TradeItem; -class LIBATLANTIKUI_EXPORT TradeDisplay : public QWidget +class LIBATLANTIKUI_EXPORT TradeDisplay : public TQWidget { Q_OBJECT + TQ_OBJECT public: - TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, TQWidget *parent=0, const char *name = 0); + TradeDisplay(Trade *trade, AtlanticCore *atlanticCore, TQWidget *tqparent=0, const char *name = 0); Trade *trade() { return mTrade; } @@ -86,7 +87,7 @@ private: Trade *mTrade, *m_trade; TradeItem *m_contextTradeItem; - // TODO: Wouldn't QPair make more sense here? + // TODO: Wouldn't TQPair make more sense here? TQMap m_componentMap; TQMap m_componentRevMap; TQMap m_estateMap; diff --git a/kasteroids/ledmeter.cpp b/kasteroids/ledmeter.cpp index 1d807d18..d2250c28 100644 --- a/kasteroids/ledmeter.cpp +++ b/kasteroids/ledmeter.cpp @@ -8,7 +8,7 @@ #include "ledmeter.h" #include "ledmeter.moc" -KALedMeter::KALedMeter( TQWidget *parent ) : TQFrame( parent ) +KALedMeter::KALedMeter( TQWidget *tqparent ) : TQFrame( tqparent ) { mCRanges.setAutoDelete( true ); mRange = 100; @@ -76,7 +76,7 @@ void KALedMeter::drawContents( TQPainter *p ) unsigned cidx = 0; int ncol = mCount; - TQColor col = colorGroup().foreground(); + TQColor col = tqcolorGroup().foreground(); if ( !mCRanges.isEmpty() ) { diff --git a/kasteroids/ledmeter.h b/kasteroids/ledmeter.h index 307b5bfc..7547bcd1 100644 --- a/kasteroids/ledmeter.h +++ b/kasteroids/ledmeter.h @@ -11,11 +11,12 @@ #include -class KALedMeter : public QFrame +class KALedMeter : public TQFrame { - Q_OBJECT + Q_OBJECT + TQ_OBJECT public: - KALedMeter( TQWidget *parent ); + KALedMeter( TQWidget *tqparent ); int range() const { return mRange; } void setRange( int r ); diff --git a/kasteroids/sprites.h b/kasteroids/sprites.h index 43dc34ea..1f39e74a 100644 --- a/kasteroids/sprites.h +++ b/kasteroids/sprites.h @@ -31,7 +31,7 @@ #define MAX_POWERUP_AGE 500 #define MAX_MISSILE_AGE 40 -class KMissile : public QCanvasSprite +class KMissile : public TQCanvasSprite { public: KMissile( TQCanvasPixmapArray *s, TQCanvas *c ) : TQCanvasSprite( s, c ) @@ -46,7 +46,7 @@ private: int myAge; }; -class KBit : public QCanvasSprite +class KBit : public TQCanvasSprite { public: KBit( TQCanvasPixmapArray *s, TQCanvas *c ) : TQCanvasSprite( s, c ) @@ -62,7 +62,7 @@ private: int death; }; -class KExhaust : public QCanvasSprite +class KExhaust : public TQCanvasSprite { public: KExhaust( TQCanvasPixmapArray *s, TQCanvas *c ) : TQCanvasSprite( s, c ) @@ -78,7 +78,7 @@ private: int death; }; -class KPowerup : public QCanvasSprite +class KPowerup : public TQCanvasSprite { public: KPowerup( TQCanvasPixmapArray *s, TQCanvas *c, int t ) : TQCanvasSprite( s, c ), @@ -94,7 +94,7 @@ protected: int type; }; -class KRock : public QCanvasSprite +class KRock : public TQCanvasSprite { public: KRock (TQCanvasPixmapArray *s, TQCanvas *c, int t, int sk, int st) : TQCanvasSprite( s, c ) @@ -104,7 +104,7 @@ public: { if (cskip-- <= 0) { setFrame( (frame()+step+frameCount())%frameCount() ); - cskip = QABS(skip); + cskip = TQABS(skip); } } @@ -117,7 +117,7 @@ private: int step; }; -class KShield : public QCanvasSprite +class KShield : public TQCanvasSprite { public: KShield( TQCanvasPixmapArray *s, TQCanvas *c ) diff --git a/kasteroids/sprites/rock1/rock1.pov b/kasteroids/sprites/rock1/rock1.pov index 58298c05..bcf4c8a7 100644 --- a/kasteroids/sprites/rock1/rock1.pov +++ b/kasteroids/sprites/rock1/rock1.pov @@ -1,5 +1,5 @@ #include "colors.inc" -#include "shapes.inc" +#include "tqshapes.inc" #include "textures.inc" // #include "stones.inc" diff --git a/kasteroids/sprites/rock2/rock2.pov b/kasteroids/sprites/rock2/rock2.pov index 2f37a206..625c7854 100644 --- a/kasteroids/sprites/rock2/rock2.pov +++ b/kasteroids/sprites/rock2/rock2.pov @@ -1,5 +1,5 @@ #include "colors.inc" -#include "shapes.inc" +#include "tqshapes.inc" #include "textures.inc" // #include "stones.inc" diff --git a/kasteroids/sprites/rock3/rock3.pov b/kasteroids/sprites/rock3/rock3.pov index 2f37a206..625c7854 100644 --- a/kasteroids/sprites/rock3/rock3.pov +++ b/kasteroids/sprites/rock3/rock3.pov @@ -1,5 +1,5 @@ #include "colors.inc" -#include "shapes.inc" +#include "tqshapes.inc" #include "textures.inc" // #include "stones.inc" diff --git a/kasteroids/toplevel.cpp b/kasteroids/toplevel.cpp index d9a22a2b..ffc6b8e2 100644 --- a/kasteroids/toplevel.cpp +++ b/kasteroids/toplevel.cpp @@ -29,7 +29,7 @@ #include "toplevel.moc" -#if defined Q_WS_X11 && ! defined K_WS_QTONLY +#if defined TQ_WS_X11 && ! defined K_WS_TQTONLY #include #endif #include @@ -102,7 +102,7 @@ KAstTopLevel::KAstTopLevel() label = new TQLabel( i18n("Score"), mainWin ); label->setFont( labelFont ); label->setPalette( pal ); - label->setFixedWidth( label->sizeHint().width() ); + label->setFixedWidth( label->tqsizeHint().width() ); hb->addWidget( label ); scoreLCD = new TQLCDNumber( 6, mainWin ); @@ -116,7 +116,7 @@ KAstTopLevel::KAstTopLevel() label = new TQLabel( i18n("Level"), mainWin ); label->setFont( labelFont ); label->setPalette( pal ); - label->setFixedWidth( label->sizeHint().width() ); + label->setFixedWidth( label->tqsizeHint().width() ); hb->addWidget( label ); levelLCD = new TQLCDNumber( 2, mainWin ); @@ -129,7 +129,7 @@ KAstTopLevel::KAstTopLevel() label = new TQLabel( i18n("Ships"), mainWin ); label->setFont( labelFont ); - label->setFixedWidth( label->sizeHint().width() ); + label->setFixedWidth( label->tqsizeHint().width() ); label->setPalette( pal ); hb->addWidget( label ); @@ -151,7 +151,7 @@ KAstTopLevel::KAstTopLevel() vb->addWidget( view, 10 ); -// -- bottom layout: +// -- bottom tqlayout: TQFrame *sep2 = new TQFrame( mainWin ); sep2->setMaximumHeight( 1 ); sep2->setFrameStyle( TQFrame::HLine | TQFrame::Raised ); @@ -168,7 +168,7 @@ KAstTopLevel::KAstTopLevel() /* label = new TQLabel( i18n( "T" ), mainWin ); label->setFont( smallFont ); - label->setFixedWidth( label->sizeHint().width() ); + label->setFixedWidth( label->tqsizeHint().width() ); label->setPalette( pal ); hbd->addWidget( label ); @@ -184,7 +184,7 @@ KAstTopLevel::KAstTopLevel() TQPixmap pm( sprites_prefix + "powerups/brake.png" ); label = new TQLabel( mainWin ); label->setPixmap( pm ); - label->setFixedWidth( label->sizeHint().width() ); + label->setFixedWidth( label->tqsizeHint().width() ); label->setPalette( pal ); hbd->addWidget( label ); @@ -200,7 +200,7 @@ KAstTopLevel::KAstTopLevel() pm.load( sprites_prefix + "powerups/shield.png" ); label = new TQLabel( mainWin ); label->setPixmap( pm ); - label->setFixedWidth( label->sizeHint().width() ); + label->setFixedWidth( label->tqsizeHint().width() ); label->setPalette( pal ); hbd->addWidget( label ); @@ -216,7 +216,7 @@ KAstTopLevel::KAstTopLevel() pm.load( sprites_prefix + "powerups/shoot.png" ); label = new TQLabel( mainWin ); label->setPixmap( pm ); - label->setFixedWidth( label->sizeHint().width() ); + label->setFixedWidth( label->tqsizeHint().width() ); label->setPalette( pal ); hbd->addWidget( label ); @@ -231,7 +231,7 @@ KAstTopLevel::KAstTopLevel() label = new TQLabel( i18n( "Fuel" ), mainWin ); label->setFont( smallFont ); - label->setFixedWidth( label->sizeHint().width() + 10 ); + label->setFixedWidth( label->tqsizeHint().width() + 10 ); label->setPalette( pal ); hbd->addWidget( label ); @@ -252,7 +252,7 @@ KAstTopLevel::KAstTopLevel() setupGUI( KMainWindow::Save | Create ); - setFocusPolicy( StrongFocus ); + setFocusPolicy( TQ_StrongFocus ); setFocus(); #ifdef KA_ENABLE_SOUND @@ -267,7 +267,7 @@ KAstTopLevel::KAstTopLevel() KAstTopLevel::~KAstTopLevel() { -#if defined Q_WS_X11 && ! defined K_WS_QTONLY +#if defined TQ_WS_X11 && ! defined K_WS_TQTONLY XAutoRepeatOn( qt_xdisplay() ); #endif soundDict.setAutoDelete(true); @@ -280,24 +280,24 @@ KAstTopLevel::~KAstTopLevel() void KAstTopLevel::initKAction() { // game - KStdGameAction::gameNew( this, TQT_SLOT( slotNewGame() ), actionCollection() ); - KStdGameAction::highscores( this, TQT_SLOT( slotShowHighscores() ), actionCollection() ); - KStdGameAction::pause( this, TQT_SLOT( slotPause() ), actionCollection() ); - KStdGameAction::quit(this, TQT_SLOT( close() ), actionCollection()); + KStdGameAction::gameNew( TQT_TQOBJECT(this), TQT_SLOT( slotNewGame() ), actionCollection() ); + KStdGameAction::highscores( TQT_TQOBJECT(this), TQT_SLOT( slotShowHighscores() ), actionCollection() ); + KStdGameAction::pause( TQT_TQOBJECT(this), TQT_SLOT( slotPause() ), actionCollection() ); + KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT( close() ), actionCollection()); // settings - KStdAction::keyBindings(this, TQT_SLOT( slotKeyConfig() ), actionCollection()); - KStdAction::preferences(this, TQT_SLOT( slotPref() ), actionCollection()); + KStdAction::keyBindings(TQT_TQOBJECT(this), TQT_SLOT( slotKeyConfig() ), actionCollection()); + KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT( slotPref() ), actionCollection()); // keyboard-only actions - keycodes.insert(Thrust, new KAction(i18n("Thrust"), Qt::Key_Up, 0, 0, actionCollection(), "Thrust")); - keycodes.insert(RotateLeft, new KAction(i18n("Rotate Left"), Qt::Key_Left, 0, 0, actionCollection(), "RotateLeft")); - keycodes.insert(RotateRight, new KAction(i18n("Rotate Right"), Qt::Key_Right, 0, 0, actionCollection(), "RotateRight")); - keycodes.insert(Shoot, new KAction(i18n("Shoot"), Qt::Key_Space, 0, 0, actionCollection(), "Shoot")); -// keycodes.insert(Teleport, new KAction(i18n("Teleport"), Qt::Key_Z, 0, 0, actionCollection(), "Teleport")); - keycodes.insert(Brake, new KAction(i18n("Brake"), Qt::Key_X, 0, 0, actionCollection(), "Brake")); - keycodes.insert(Shield, new KAction(i18n("Shield"), Qt::Key_S, 0, 0, actionCollection(), "Shield")); - launchAction = new KAction(i18n("Launch"), Qt::Key_L, this, TQT_SLOT(slotLaunch()), actionCollection(), "Launch"); + keycodes.insert(Thrust, new KAction(i18n("Thrust"), TQt::Key_Up, 0, 0, actionCollection(), "Thrust")); + keycodes.insert(RotateLeft, new KAction(i18n("Rotate Left"), TQt::Key_Left, 0, 0, actionCollection(), "RotateLeft")); + keycodes.insert(RotateRight, new KAction(i18n("Rotate Right"), TQt::Key_Right, 0, 0, actionCollection(), "RotateRight")); + keycodes.insert(Shoot, new KAction(i18n("Shoot"), TQt::Key_Space, 0, 0, actionCollection(), "Shoot")); +// keycodes.insert(Teleport, new KAction(i18n("Teleport"), TQt::Key_Z, 0, 0, actionCollection(), "Teleport")); + keycodes.insert(Brake, new KAction(i18n("Brake"), TQt::Key_X, 0, 0, actionCollection(), "Brake")); + keycodes.insert(Shield, new KAction(i18n("Shield"), TQt::Key_S, 0, 0, actionCollection(), "Shield")); + launchAction = new KAction(i18n("Launch"), TQt::Key_L, TQT_TQOBJECT(this), TQT_SLOT(slotLaunch()), actionCollection(), "Launch"); } @@ -336,7 +336,7 @@ return; // remove this and the above when the sound below is working correctly bool KAstTopLevel::eventFilter( TQObject* /* object */, TQEvent *event ) { - TQKeyEvent *e = static_cast(event); + TQKeyEvent *e = TQT_TQKEYEVENT(event); if (event->type() == TQEvent::AccelOverride) { if (processKeyPress(e)) return true; @@ -457,7 +457,7 @@ bool KAstTopLevel::processKeyRelease( TQKeyEvent *event ) void KAstTopLevel::focusInEvent( TQFocusEvent *e ) { view->pause( false ); -#if defined Q_WS_X11 && ! defined K_WS_QTONLY +#if defined TQ_WS_X11 && ! defined K_WS_TQTONLY XAutoRepeatOff( qt_xdisplay() ); #endif KMainWindow::focusInEvent(e); @@ -466,7 +466,7 @@ void KAstTopLevel::focusInEvent( TQFocusEvent *e ) void KAstTopLevel::focusOutEvent( TQFocusEvent *e ) { view->pause( true ); -#if defined Q_WS_X11 && ! defined K_WS_QTONLY +#if defined TQ_WS_X11 && ! defined K_WS_TQTONLY XAutoRepeatOn( qt_xdisplay() ); #endif KMainWindow::focusOutEvent(e); @@ -484,7 +484,7 @@ void KAstTopLevel::slotNewGame() view->setRockSpeed( levels[0].rockSpeed ); view->addRocks( levels[0].nrocks ); view->showText( i18n( "Press %1 to launch." ) - .arg(launchAction->shortcut().seq(0).toString()), + .tqarg(launchAction->shortcut().seq(0).toString()), yellow ); waitShip = true; gameOver = false; @@ -492,7 +492,7 @@ void KAstTopLevel::slotNewGame() bool KAstTopLevel::queryExit() { -#if defined Q_WS_X11 && ! defined K_WS_QTONLY +#if defined TQ_WS_X11 && ! defined K_WS_TQTONLY XAutoRepeatOn( qt_xdisplay() ); #endif return true; @@ -509,7 +509,7 @@ void KAstTopLevel::slotShipKilled() { waitShip = true; view->showText( i18n( "Ship Destroyed. Press %1 to launch.") - .arg(launchAction->shortcut().seq(0).toString()), + .tqarg(launchAction->shortcut().seq(0).toString()), yellow ); } else @@ -529,7 +529,7 @@ void KAstTopLevel::slotShipKilled() } else { - TQTimer::singleShot(1000, this, TQT_SLOT(slotGameOver())); + TQTimer::singleShot(1000, TQT_TQOBJECT(this), TQT_SLOT(slotGameOver())); } } } @@ -577,7 +577,7 @@ void KAstTopLevel::slotKeyConfig() { KKeyDialog::configure( actionCollection(), this ); if ( waitShip ) view->showText( i18n( "Press %1 to launch." ) - .arg(launchAction->shortcut().seq(0).toString()), + .tqarg(launchAction->shortcut().seq(0).toString()), yellow, false ); } @@ -613,7 +613,7 @@ void KAstTopLevel::slotPref() /* Done */ dialog->addPage(w, i18n("General"), "package_settings"); - connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(loadSettings())); + connect(dialog, TQT_SIGNAL(settingsChanged()), TQT_TQOBJECT(this), TQT_SLOT(loadSettings())); dialog->show(); } @@ -637,9 +637,9 @@ void KAstTopLevel::doStats() " Hit:\t%2\n" " Missed:\t%3\n" "Hit ratio:\t%4 %\t\t") - .arg(view->shots()).arg(view->hits()) - .arg(view->shots() - view->hits()) - .arg(r); + .tqarg(view->shots()).tqarg(view->hits()) + .tqarg(view->shots() - view->hits()) + .tqarg(r); view->showText( s, green, FALSE ); } diff --git a/kasteroids/toplevel.h b/kasteroids/toplevel.h index c75710eb..54af5130 100644 --- a/kasteroids/toplevel.h +++ b/kasteroids/toplevel.h @@ -23,6 +23,7 @@ class KDialogBase; class KAstTopLevel : public KMainWindow { Q_OBJECT + TQ_OBJECT public: KAstTopLevel(); virtual ~KAstTopLevel(); diff --git a/kasteroids/view.cpp b/kasteroids/view.cpp index e203ffb5..0fea036b 100644 --- a/kasteroids/view.cpp +++ b/kasteroids/view.cpp @@ -63,8 +63,8 @@ kas_animations [] = -KAsteroidsView::KAsteroidsView( TQWidget *parent, const char *name ) - : TQWidget( parent, name ), +KAsteroidsView::KAsteroidsView( TQWidget *tqparent, const char *name ) + : TQWidget( tqparent, name ), field(640, 440), view(&field,this) { @@ -78,7 +78,7 @@ KAsteroidsView::KAsteroidsView( TQWidget *parent, const char *name ) field.setBackgroundColor(black); TQPixmap pm( locate("sprite", IMG_BACKGROUND) ); - field.setBackgroundPixmap( pm ); + field.tqsetBackgroundPixmap( pm ); textSprite = new TQCanvasText( &field ); TQFont font( KGlobalSettings::generalFont().family(), 18 ); diff --git a/kasteroids/view.h b/kasteroids/view.h index 5d62f640..48b72e9f 100644 --- a/kasteroids/view.h +++ b/kasteroids/view.h @@ -17,11 +17,12 @@ #define MAX_POWER_LEVEL 1000 -class KAsteroidsView : public QWidget +class KAsteroidsView : public TQWidget { Q_OBJECT + TQ_OBJECT public: - KAsteroidsView( TQWidget *parent = 0, const char *name = 0 ); + KAsteroidsView( TQWidget *tqparent = 0, const char *name = 0 ); virtual ~KAsteroidsView(); int refreshRate; diff --git a/katomic/configbox.cpp b/katomic/configbox.cpp index d6fcde23..30c77dd3 100644 --- a/katomic/configbox.cpp +++ b/katomic/configbox.cpp @@ -16,8 +16,8 @@ extern Options settings; -ConfigBox::ConfigBox ( TQWidget *parent, const char *name) - : KDialogBase ( parent, name, true, i18n("Configure"), Ok | Cancel, Ok, true ) +ConfigBox::ConfigBox ( TQWidget *tqparent, const char *name) + : KDialogBase ( tqparent, name, true, i18n("Configure"), Ok | Cancel, Ok, true ) { TQWidget *page = makeMainWidget(); @@ -33,7 +33,7 @@ ConfigBox::ConfigBox ( TQWidget *parent, const char *name) glay->addWidget(disp, 1, 2); disp->display(1); - speed = new TQSlider(1, 10, 1, 1, TQSlider::Horizontal, page); + speed = new TQSlider(1, 10, 1, 1, Qt::Horizontal, page); glay->addMultiCellWidget(speed, 2, 2, 2, 3); connect(speed, TQT_SIGNAL(valueChanged(int)), disp, TQT_SLOT(display(int))); diff --git a/katomic/configbox.h b/katomic/configbox.h index b3d8dfe2..5bffb932 100644 --- a/katomic/configbox.h +++ b/katomic/configbox.h @@ -16,6 +16,7 @@ class ConfigBox : public KDialogBase { Q_OBJECT + TQ_OBJECT public: ConfigBox ( TQWidget *, const char* name ); diff --git a/katomic/feld.cpp b/katomic/feld.cpp index e01060cb..48150efd 100644 --- a/katomic/feld.cpp +++ b/katomic/feld.cpp @@ -1,15 +1,15 @@ /**************************************************************** ** -** Implementation Feld class, derieved from Qt tutorial 8 +** Implementation Feld class, derieved from TQt tutorial 8 ** ****************************************************************/ // bemerkungen : wenn paintEvent aufgerufen wird, wird das komplette -// widget gelöscht und nur die sachen gezeichnet, die in +// widget gel�scht und nur die sachen gezeichnet, die in // paintEvent stehen ! sollen dinge z.b nur bei maustasten- -// druck gezeichnet werden, so muß dies in mousePressEvent +// druck gezeichnet werden, so mu� dies in mousePressEvent // stehen ! -// paintEvent wird aufgerufen, falls fenster überdeckt wird, +// paintEvent wird aufgerufen, falls fenster �berdeckt wird, // oder auch einfach bewegt wird #include @@ -26,8 +26,8 @@ extern Options settings; -Feld::Feld( TQWidget *parent, const char *name ) : - TQWidget( parent, name ), +Feld::Feld( TQWidget *tqparent, const char *name ) : + TQWidget( tqparent, name ), data(locate("appdata", "pics/abilder.png")), undoBegin (0), undoSize (0), redoSize (0) { @@ -45,7 +45,7 @@ Feld::Feld( TQWidget *parent, const char *name ) : setMouseTracking(true); - setFocusPolicy(TQWidget::StrongFocus); + setFocusPolicy(TQ_StrongFocus); setBackgroundColor( TQColor( 0, 0, 0) ); setFixedSize(15 * 30, 15 * 30); @@ -70,7 +70,7 @@ void Feld::resetValidDirs() void Feld::load (const KSimpleConfig& config) { if(moving) - killTimers(); + TQT_TQOBJECT(this)->killTimers(); mol->load(config); @@ -124,7 +124,7 @@ void Feld::mousePressEvent (TQMouseEvent *e) resetValidDirs(); chosen = false; } - emitStatus(); + emittqStatus(); } const atom& Feld::getAtom(uint index) const @@ -154,7 +154,7 @@ void Feld::nextAtom() xpos = x; ypos = y; chosen = true; resetValidDirs(); - emitStatus(); + emittqStatus(); return; } } @@ -187,7 +187,7 @@ void Feld::previousAtom() xpos = x; ypos = y; chosen = true; resetValidDirs(); - emitStatus(); + emittqStatus(); return; } } @@ -198,7 +198,7 @@ void Feld::previousAtom() } -void Feld::emitStatus() +void Feld::emittqStatus() { if (!chosen || moving) {} else { @@ -231,7 +231,7 @@ void Feld::done () if (moving) return; - emitStatus(); + emittqStatus(); if (checkDone()) emit gameOver(moves); @@ -492,7 +492,7 @@ void Feld::timerEvent (TQTimerEvent *) if (frames <= 0) { moving = false; - killTimers (); + TQT_TQOBJECT(this)->killTimers (); done(); dir = None; } @@ -574,7 +574,7 @@ void Feld::paintEvent( TQPaintEvent * ) x = i * 30; y = j * 30; - // zeichnet Randstücke + // zeichnet Randst�cke if (feld [i] [j] == 254) { putNonAtom(i, j, Feld::None, true); continue; } @@ -628,7 +628,7 @@ void Feld::paintEvent( TQPaintEvent * ) } - // zeichnet Verbindungsstäbe + // zeichnet Verbindungsst�be if (getAtom(feld [i] [j]).obj >= 'A' && getAtom(feld [i] [j]).obj <= 'F') bitBlt (this, x, y, diff --git a/katomic/feld.h b/katomic/feld.h index b48ebf39..6383441c 100644 --- a/katomic/feld.h +++ b/katomic/feld.h @@ -27,12 +27,13 @@ class Molek; #define FIELD_SIZE 15 -class Feld : public QWidget +class Feld : public TQWidget { Q_OBJECT + TQ_OBJECT public: - Feld (TQWidget *parent=0, const char *name=0); + Feld (TQWidget *tqparent=0, const char *name=0); ~Feld (); enum Direction { None = 0, @@ -64,7 +65,7 @@ protected: void paintMovingAtom(); void mousePressEvent (TQMouseEvent *); void mouseMoveEvent (TQMouseEvent *); - void emitStatus(); + void emittqStatus(); protected: struct UndoInfo { diff --git a/katomic/gamewidget.cpp b/katomic/gamewidget.cpp index 2c9ccf0a..2bda7d0f 100644 --- a/katomic/gamewidget.cpp +++ b/katomic/gamewidget.cpp @@ -1,6 +1,6 @@ /* toplevel.cpp - Copyright (C) 1998 Andreas Wüst (AndreasWuest@gmx.de) + Copyright (C) 1998 Andreas W�st (AndreasWuest@gmx.de) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -95,11 +95,11 @@ void GameWidget::doRedo () } void GameWidget::gameOver(int moves) { - KMessageBox::information(this, i18n("You solved level %1 with %2 moves!").arg(level).arg(moves), i18n("Congratulations")); + KMessageBox::information(this, i18n("You solved level %1 with %2 moves!").tqarg(level).tqarg(moves), i18n("Congratulations")); KScoreDialog high(KScoreDialog::Name | KScoreDialog::Score, this); - high.setCaption(i18n("Level %1 Highscores").arg(level)); - high.setConfigGroup(TQString("Highscores Level %1").arg(level)); + high.setCaption(i18n("Level %1 Highscores").tqarg(level)); + high.setConfigGroup(TQString("Highscores Level %1").tqarg(level)); KScoreDialog::FieldInfo scoreInfo; @@ -118,8 +118,8 @@ void GameWidget::getMoves(int moves) void GameWidget::mergeHighScores(int l) { - KConfigGroup oldConfig(kapp->config(), TQString("High Scores Level %1").arg(l).utf8()); - KConfigGroup newConfig(kapp->config(), TQString("Highscores Level %1").arg(l).utf8()); + KConfigGroup oldConfig(kapp->config(), TQString("High Scores Level %1").tqarg(l).utf8()); + KConfigGroup newConfig(kapp->config(), TQString("Highscores Level %1").tqarg(l).utf8()); newConfig.writeEntry("LastPlayer", oldConfig.readEntry("LastPlayer")); @@ -138,7 +138,7 @@ void GameWidget::mergeHighScores(int l) void GameWidget::updateLevel (int l) { level=l; - TQString levelFile = locate("appdata", TQString("levels/level_%1").arg(l)); + TQString levelFile = locate("appdata", TQString("levels/level_%1").tqarg(l)); if (levelFile.isNull()) { return updateLevel(1); } @@ -147,11 +147,11 @@ void GameWidget::updateLevel (int l) cfg.setGroup("Level"); feld->load(cfg); - if (!kapp->config()->hasGroup(TQString("Highscores Level %1").arg(level)) && - kapp->config()->hasGroup(TQString("High Scores Level %1").arg(level))) + if (!kapp->config()->hasGroup(TQString("Highscores Level %1").tqarg(level)) && + kapp->config()->hasGroup(TQString("High Scores Level %1").tqarg(level))) mergeHighScores(level); - highScore->setConfigGroup(TQString("Highscores Level %1").arg(level)); + highScore->setConfigGroup(TQString("Highscores Level %1").tqarg(level)); highest.setNum(highScore->highScore()); if (highest != "0" ) hs->setText(highest); @@ -159,7 +159,7 @@ void GameWidget::updateLevel (int l) ys->setText("0"); scrl->setValue(level); - feld->repaint(); + feld->tqrepaint(); } void GameWidget::restartLevel() @@ -167,8 +167,8 @@ void GameWidget::restartLevel() updateLevel(level); } -GameWidget::GameWidget ( TQWidget *parent, const char* name ) - : TQWidget( parent, name ) +GameWidget::GameWidget ( TQWidget *tqparent, const char* name ) + : TQWidget( tqparent, name ) { level = 1; nlevels = KGlobal::dirs()->findAllResources("appdata", "levels/level_*", @@ -188,10 +188,10 @@ GameWidget::GameWidget ( TQWidget *parent, const char* name ) // scrollbar scrl = new TQScrollBar(1, nlevels, 1, - 5, 1, TQScrollBar::Horizontal, vb, "scrl" ); + 5, 1, Qt::Horizontal, vb, "scrl" ); connect (scrl, TQT_SIGNAL (valueChanged (int)), TQT_SLOT (updateLevel (int))); - // molekül + // molek�l molek = new Molek (vb, "molek"); feld->setMolek(molek); @@ -214,7 +214,7 @@ GameWidget::GameWidget ( TQWidget *parent, const char* name ) headerFont.setBold(true); hs = new TQLabel (highest, bg); - hs->setAlignment(Qt::AlignRight); + hs->tqsetAlignment(TQt::AlignRight); hs->setFont(headerFont); slay->addWidget(hs); @@ -223,7 +223,7 @@ GameWidget::GameWidget ( TQWidget *parent, const char* name ) slay->addWidget(new TQLabel(i18n("Your score so far:"), bg)); ys = new TQLabel (current, bg); - ys->setAlignment(Qt::AlignRight); + ys->tqsetAlignment(TQt::AlignRight); ys->setFont(headerFont); slay->addWidget(ys); @@ -245,8 +245,8 @@ GameWidget::~GameWidget() void GameWidget::showHighscores () { KScoreDialog high(KScoreDialog::Name | KScoreDialog::Score, this); - high.setCaption(i18n("Level %1 Highscores").arg(level)); - high.setConfigGroup(TQString("Highscores Level %1").arg(level)); + high.setCaption(i18n("Level %1 Highscores").tqarg(level)); + high.setConfigGroup(TQString("Highscores Level %1").tqarg(level)); high.exec(); } diff --git a/katomic/gamewidget.h b/katomic/gamewidget.h index a998c80a..839faa17 100644 --- a/katomic/gamewidget.h +++ b/katomic/gamewidget.h @@ -10,13 +10,14 @@ class KScoreDialog; #include -class GameWidget : public QWidget +class GameWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - GameWidget ( TQWidget *parent, const char *name=0 ); + GameWidget ( TQWidget *tqparent, const char *name=0 ); ~GameWidget(); diff --git a/katomic/molek.cpp b/katomic/molek.cpp index 26cbcbf6..7555736b 100644 --- a/katomic/molek.cpp +++ b/katomic/molek.cpp @@ -1,15 +1,15 @@ /**************************************************************** ** -** Implementation Molek class, derieved from Qt tutorial 8 +** Implementation Molek class, derieved from TQt tutorial 8 ** ****************************************************************/ // bemerkungen : wenn paintEvent aufgerufen wird, wird das komplette -// widget gelöscht und nur die sachen gezeichnet, die in +// widget gel�scht und nur die sachen gezeichnet, die in // paintEvent stehen ! sollen dinge z.b nur bei maustasten- -// druck gezeichnet werden, so muß dies in mousePressEvent +// druck gezeichnet werden, so mu� dies in mousePressEvent // stehen ! -// paintEvent wird aufgerufen, falls fenster überdeckt wird, +// paintEvent wird aufgerufen, falls fenster �berdeckt wird, // oder auch einfach bewegt wird #include @@ -26,7 +26,7 @@ extern int level; -Molek::Molek( TQWidget *parent, const char *name ) : TQWidget( parent, name ), +Molek::Molek( TQWidget *tqparent, const char *name ) : TQWidget( tqparent, name ), data(locate("appdata", "pics/molek.png")) { setBackgroundColor (TQColor (0, 0, 0)); @@ -62,13 +62,13 @@ void Molek::load (const KSimpleConfig& config) if (value.isEmpty()) break; - current.obj = value.at(0).latin1(); + current.obj = value.tqat(0).latin1(); value = value.mid(2); if (value.isNull()) value = ""; strlcpy(current.conn, value.ascii(), sizeof(current.conn)); - kdWarning( atoms.find(current) != atoms.end() ) + kdWarning( atoms.tqfind(current) != atoms.end() ) << "OOOPS, duplicate atom definition in " << key << endl; atoms.append(current); atom_index++; @@ -82,7 +82,7 @@ void Molek::load (const KSimpleConfig& config) line = config.readEntry(key); for (int i = 0; i < MOLEK_SIZE; i++) - molek[i][j] = atom2int(line.at(i).latin1()); + molek[i][j] = atom2int(line.tqat(i).latin1()); } mname = i18n(config.readEntry("Name", I18N_NOOP("Noname")).latin1()); @@ -103,12 +103,12 @@ void Molek::load (const KSimpleConfig& config) height++; width++; - repaint (); + tqrepaint (); } void Molek::paintEvent( TQPaintEvent * ) { - TQString st = i18n("Level: %1").arg(level); + TQString st = i18n("Level: %1").tqarg(level); TQPainter paint (this); paint.setPen (TQColor (190, 190, 190)); diff --git a/katomic/molek.h b/katomic/molek.h index 354cf49b..4100fe46 100644 --- a/katomic/molek.h +++ b/katomic/molek.h @@ -20,12 +20,13 @@ class KSimpleConfig; #define MOLEK_SIZE 15 -class Molek : public QWidget +class Molek : public TQWidget { Q_OBJECT + TQ_OBJECT public: - Molek (TQWidget *parent=0, const char *name=0); + Molek (TQWidget *tqparent=0, const char *name=0); ~Molek (); void load(const KSimpleConfig& config); diff --git a/katomic/toplevel.cpp b/katomic/toplevel.cpp index bb9613f2..e2d9e745 100644 --- a/katomic/toplevel.cpp +++ b/katomic/toplevel.cpp @@ -1,6 +1,6 @@ /* toplevel.cpp - Copyright (C) 1998 Andreas Wüst (AndreasWuest@gmx.de) + Copyright (C) 1998 Andreas W�st (AndreasWuest@gmx.de) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -40,27 +40,27 @@ extern Options settings; void AtomTopLevel::createMenu() { - KAction *act = KStdGameAction::highscores(main, TQT_SLOT(showHighscores()), actionCollection()); + KAction *act = KStdGameAction::highscores(TQT_TQOBJECT(main), TQT_SLOT(showHighscores()), actionCollection()); act->setText(i18n("Show &Highscores")); - KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); - KStdGameAction::restart(main, TQT_SLOT(restartLevel()), actionCollection()); + KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); + KStdGameAction::restart(TQT_TQOBJECT(main), TQT_SLOT(restartLevel()), actionCollection()); - KStdAction::preferences(this, TQT_SLOT(configopts()), actionCollection()); + KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(configopts()), actionCollection()); - undoAction = KStdGameAction::undo (main, TQT_SLOT(doUndo()), actionCollection()); - redoAction = KStdGameAction::redo (main, TQT_SLOT(doRedo()), actionCollection()); + undoAction = KStdGameAction::undo (TQT_TQOBJECT(main), TQT_SLOT(doUndo()), actionCollection()); + redoAction = KStdGameAction::redo (TQT_TQOBJECT(main), TQT_SLOT(doRedo()), actionCollection()); undoAction->setEnabled(false); redoAction->setEnabled(false); connect (main, TQT_SIGNAL (enableRedo(bool)), TQT_SLOT(enableRedo(bool))); connect (main, TQT_SIGNAL (enableUndo(bool)), TQT_SLOT(enableUndo(bool))); - new KAction(i18n("Atom Up"), Key_Up, main, TQT_SLOT(moveUp()), actionCollection(), "atom_up"); - new KAction(i18n("Atom Down"), Key_Down, main, TQT_SLOT(moveDown()), actionCollection(), "atom_down"); - new KAction(i18n("Atom Left"), Key_Left, main, TQT_SLOT(moveLeft()), actionCollection(), "atom_left"); - new KAction(i18n("Atom Right"), Key_Right, main, TQT_SLOT(moveRight()), actionCollection(), "atom_right"); + new KAction(i18n("Atom Up"), Key_Up, TQT_TQOBJECT(main), TQT_SLOT(moveUp()), actionCollection(), "atom_up"); + new KAction(i18n("Atom Down"), Key_Down, TQT_TQOBJECT(main), TQT_SLOT(moveDown()), actionCollection(), "atom_down"); + new KAction(i18n("Atom Left"), Key_Left, TQT_TQOBJECT(main), TQT_SLOT(moveLeft()), actionCollection(), "atom_left"); + new KAction(i18n("Atom Right"), Key_Right, TQT_TQOBJECT(main), TQT_SLOT(moveRight()), actionCollection(), "atom_right"); - new KAction(i18n("Next Atom"), Key_Tab, main, TQT_SLOT(nextAtom()), actionCollection(), "next_atom"); - new KAction(i18n("Previous Atom"), SHIFT+Key_Tab, main, TQT_SLOT(previousAtom()), actionCollection(), "prev_atom"); + new KAction(i18n("Next Atom"), Key_Tab, TQT_TQOBJECT(main), TQT_SLOT(nextAtom()), actionCollection(), "next_atom"); + new KAction(i18n("Previous Atom"), SHIFT+Key_Tab, TQT_TQOBJECT(main), TQT_SLOT(previousAtom()), actionCollection(), "prev_atom"); } void AtomTopLevel::configopts() diff --git a/katomic/toplevel.h b/katomic/toplevel.h index 38c613d0..6a62a3a2 100644 --- a/katomic/toplevel.h +++ b/katomic/toplevel.h @@ -24,6 +24,7 @@ class KConfig; class AtomTopLevel : public KMainWindow { Q_OBJECT + TQ_OBJECT public: diff --git a/kbackgammon/engines/fibs/kbgfibs.cpp b/kbackgammon/engines/fibs/kbgfibs.cpp index 4e7fd2f4..1492ad2c 100644 --- a/kbackgammon/engines/fibs/kbgfibs.cpp +++ b/kbackgammon/engines/fibs/kbgfibs.cpp @@ -81,7 +81,7 @@ void KBgEngineFIBS::start() // == configuration handling =================================================== /* - * Restore settings and ask children to do the same + * Restore settings and ask tqchildren to do the same */ void KBgEngineFIBS::readConfig() { @@ -110,7 +110,7 @@ void KBgEngineFIBS::readConfig() autoMsg[MsgLos] = config->readEntry("msg-los", ""); autoMsg[MsgWin] = config->readEntry("msg-win", ""); - // ask the children to read their config options + // ask the tqchildren to read their config options playerlist->readConfig(); chatWindow->readConfig(); } @@ -145,7 +145,7 @@ void KBgEngineFIBS::saveConfig() config->writeEntry("msg-los", autoMsg[MsgLos]); config->writeEntry("msg-win", autoMsg[MsgWin]); - // ask the children to read their config options + // ask the tqchildren to read their config options playerlist->saveConfig(); chatWindow->saveConfig(); } @@ -343,7 +343,7 @@ void KBgEngineFIBS::getSetupPages(KDialogBase *nb) TQWhatsThis::add(cbk, i18n("Usually, FIBS drops the connection after one hour of inactivity. When " "you check this box, %1 will try to keep the connection alive, even " "if you are not actually playing or chatting. Use this with caution " - "if you do not have flat-rate Internet access.").arg(PROG_NAME)); + "if you do not have flat-rate Internet access.").tqarg(PROG_NAME)); cbk->setChecked(keepalive); @@ -357,7 +357,7 @@ void KBgEngineFIBS::getSetupPages(KDialogBase *nb) tc->addTab(w, i18n("&Connection")); /* - * Ask children for settings + * Ask tqchildren for settings */ chatWindow->getSetupPages(tc, nb->spacingHint()); playerlist->getSetupPages(tc, nb->spacingHint()); @@ -380,7 +380,7 @@ void KBgEngineFIBS::cancelJoin(const TQString &info) TQRegExp patt = TQRegExp("^" + info + " "); for (int i = 0; i <= numJoin; i++) { - if (actJoin[i]->text().contains(patt)) { + if (actJoin[i]->text().tqcontains(patt)) { // move all entries starting at i+1 up by one... for (int j = i; j < numJoin; j++) actJoin[j]->setText(actJoin[j+1]->text()); @@ -426,33 +426,33 @@ void KBgEngineFIBS::changeJoin(const TQString &info) for (TQStringList::Iterator it = invitations.begin(); it != invitations.end(); ++it) { - if ((*it).contains(patt)) { + if ((*it).tqcontains(patt)) { TQString text, menu; - if ((*it).contains(TQRegExp(" r$"))) { - menu = i18n("R means resume", "%1 (R)").arg(name); + if ((*it).tqcontains(TQRegExp(" r$"))) { + menu = i18n("R means resume", "%1 (R)").tqarg(name); text = i18n("%1 (experience %2, rating %3) wants to resume a saved match with you. " "If you want to play, use the corresponding menu entry to join (or type " - "'join %4').").arg(name).arg(expi_s).arg(rate_s).arg(name); + "'join %4').").tqarg(name).tqarg(expi_s).tqarg(rate_s).tqarg(name); KNotifyClient::event("invitation", i18n("%1 wants to resume a saved match with you"). arg(name)); - } else if ((*it).contains(TQRegExp(" u$"))) { - menu = i18n("U means unlimited", "%1 (U)").arg(name); + } else if ((*it).tqcontains(TQRegExp(" u$"))) { + menu = i18n("U means unlimited", "%1 (U)").tqarg(name); text = i18n("%1 (experience %2, rating %3) wants to play an unlimited match with you. " "If you want to play, use the corresponding menu entry to join (or type " - "'join %4').").arg(name).arg(expi_s).arg(rate_s).arg(name); + "'join %4').").tqarg(name).tqarg(expi_s).tqarg(rate_s).tqarg(name); KNotifyClient::event("invitation", i18n("%1 has invited you to an unlimited match"). arg(name)); } else { TQString len = (*it).right((*it).length() - name.length() - 1); menu = i18n("If the format of the (U) and (R) strings is changed, it should also be changed here", - "%1 (%2)").arg(name).arg(len); + "%1 (%2)").tqarg(name).tqarg(len); text = i18n("%1 (experience %2, rating %3) wants to play a %4 point match with you. " "If you want to play, use the corresponding menu entry to join (or type " - "'join %5').").arg(name).arg(expi_s).arg(rate_s).arg(len).arg(name); + "'join %5').").tqarg(name).tqarg(expi_s).tqarg(rate_s).tqarg(len).tqarg(name); KNotifyClient::event("invitation", i18n("%1 has invited you for a %2 point match"). - arg(name).arg(len)); + tqarg(name).tqarg(len)); } emit serverString("rawwho " + name); // this avoids a race if (whoisInvite) { @@ -493,7 +493,7 @@ void KBgEngineFIBS::changeJoin(const TQString &info) */ void KBgEngineFIBS::keepAlive() { - emit serverString("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); + emit serverString("ABCDEFGHIJKLMNOPTQRSTUVWXYZ"); } /* @@ -578,8 +578,8 @@ void KBgEngineFIBS::done() emit allowCommand(Roll, false); // Transform the string to FIBS cormat - lastMove.replace(0, 2, "move "); - lastMove.replace(pat[PlsChar], "-"); + lastMove.tqreplace(0, 2, "move "); + lastMove.tqreplace(pat[PlsChar], "-"); // sent it to the server emit serverString(lastMove); @@ -642,7 +642,7 @@ bool KBgEngineFIBS::queryClose() if (connection->state() == TQSocket::Idle) return true; - switch (KMessageBox::warningYesNoCancel((TQWidget *)parent(),i18n("Still connected. Log out first?"),TQString::null,i18n("Log Out"), i18n("Stay Connected"))) { + switch (KMessageBox::warningYesNoCancel((TQWidget *)tqparent(),i18n("Still connected. Log out first?"),TQString(),i18n("Log Out"), i18n("Stay Connected"))) { case KMessageBox::Yes : disconnectFIBS(); return true; @@ -731,7 +731,7 @@ void KBgEngineFIBS::away() bool ret; TQString msg = KLineEditDlg::getText(i18n("Please type the message that should be displayed to other\n" "users while you are away."), - lastAway, &ret, (TQWidget *)parent()); + lastAway, &ret, (TQWidget *)tqparent()); if (ret) { lastAway = msg; emit serverString("away " + msg); @@ -809,7 +809,7 @@ void KBgEngineFIBS::load() */ void KBgEngineFIBS::join(const TQString &msg) { - emit serverString("join " + msg.left(msg.find('('))); + emit serverString("join " + msg.left(msg.tqfind('('))); } void KBgEngineFIBS::join_0() { join(actJoin[0]->text()); } void KBgEngineFIBS::join_1() { join(actJoin[1]->text()); } @@ -877,7 +877,7 @@ void KBgEngineFIBS::connectFIBS() /* * Connect */ - emit infoText(i18n("Looking up %1").arg(infoFIBS[FIBSHost])); + emit infoText(i18n("Looking up %1").tqarg(infoFIBS[FIBSHost])); connection->connectToHost(infoFIBS[FIBSHost], infoFIBS[FIBSPort].toUShort()); return; @@ -888,7 +888,7 @@ void KBgEngineFIBS::connectFIBS() */ void KBgEngineFIBS::hostFound() { - emit infoText(i18n("Connecting to %1").arg(infoFIBS[FIBSHost])); + emit infoText(i18n("Connecting to %1").tqarg(infoFIBS[FIBSHost])); } /* @@ -947,7 +947,7 @@ void KBgEngineFIBS::connected() /* * Initialize the rx state machine */ - rxStatus = RxConnect; + rxtqStatus = RxConnect; rxCollect = ""; /* @@ -992,7 +992,7 @@ void KBgEngineFIBS::newAccount() if (!queryConnection(true)) return; - rxStatus = RxNewLogin; + rxtqStatus = RxNewLogin; rxCollect = ""; login = false; connectFIBS(); @@ -1052,7 +1052,7 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin) msg = KLineEditDlg::getText(i18n("Enter the name of the server you want to connect to.\n" "This should almost always be \"fibs.com\"."), - infoFIBS[FIBSHost], &ret, (TQWidget *)parent()); + infoFIBS[FIBSHost], &ret, (TQWidget *)tqparent()); if (ret) infoFIBS[FIBSHost] = msg; @@ -1064,7 +1064,7 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin) msg = KLineEditDlg::getText(i18n("Enter the port number on the server. " "It should almost always be \"4321\"."), - infoFIBS[FIBSPort], &ret, (TQWidget *)parent()); + infoFIBS[FIBSPort], &ret, (TQWidget *)tqparent()); if (ret) infoFIBS[FIBSPort] = msg; @@ -1077,24 +1077,24 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin) text = i18n("Enter the login you would like to use on the server %1. The login may not\n" "contain spaces or colons. If the login you choose is not available, you'll later be\n" - "given the opportunity to pick another one.\n\n").arg(infoFIBS[FIBSHost]); + "given the opportunity to pick another one.\n\n").tqarg(infoFIBS[FIBSHost]); else text = i18n("Enter your login on the server %1. If you don't have a login, you\n" - "should create one using the corresponding menu option.\n\n").arg(infoFIBS[FIBSHost]); + "should create one using the corresponding menu option.\n\n").tqarg(infoFIBS[FIBSHost]); first = true; do { msg = (KLineEditDlg::getText(text, infoFIBS[FIBSUser], &ret, - (TQWidget *)parent())).stripWhiteSpace(); + (TQWidget *)tqparent())).stripWhiteSpace(); if (first) { text += i18n("The login may not contain spaces or colons!"); first = false; } - } while (ret && (msg.isEmpty() || msg.contains(' ') || msg.contains(':'))); + } while (ret && (msg.isEmpty() || msg.tqcontains(' ') || msg.tqcontains(':'))); if (ret) infoFIBS[FIBSUser] = msg; @@ -1107,12 +1107,12 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin) text = i18n("Enter the password you would like to use with the login %1\n" "on the server %2. It may not contain colons.\n\n"). - arg(infoFIBS[FIBSUser]).arg(infoFIBS[FIBSHost]); + tqarg(infoFIBS[FIBSUser]).tqarg(infoFIBS[FIBSHost]); else text = i18n("Enter the password for the login %1 on the server %2.\n\n"). - arg(infoFIBS[FIBSUser]).arg(infoFIBS[FIBSHost]); + tqarg(infoFIBS[FIBSUser]).tqarg(infoFIBS[FIBSHost]); first = true; do { @@ -1130,7 +1130,7 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin) first = false; } - } while (ret && (msg.isEmpty() || msg.contains(' ') || msg.contains(':'))); + } while (ret && (msg.isEmpty() || msg.tqcontains(' ') || msg.tqcontains(':'))); if (ret) infoFIBS[FIBSPswd] = msg; @@ -1234,7 +1234,7 @@ void KBgEngineFIBS::initPattern() pat[RejAcpt] = TQRegExp("Type 'accept' or 'reject'\\.$"); pat[YouAcpt] = TQRegExp("^You accept the double\\. The cube shows [0-9]+\\."); - pat[KeepAlv] = TQRegExp("^\\*\\* Unknown command: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"); + pat[KeepAlv] = TQRegExp("^\\*\\* Unknown command: 'ABCDEFGHIJKLMNOPTQRSTUVWXYZ'"); pat[RatingY] = TQRegExp("You'll see how the rating changes are calculated\\.$"); pat[RatingN] = TQRegExp("You won't see how the rating changes are calculated\\.$"); @@ -1281,15 +1281,15 @@ void KBgEngineFIBS::handleServerData(TQString &line) /* * Fix-up any HTML-like tags in the line */ - line.replace(pat[HTML_lt], "<"); - line.replace(pat[HTML_gt], ">"); + line.tqreplace(pat[HTML_lt], "<"); + line.tqreplace(pat[HTML_gt], ">"); /* * FIBS sometimes sends tabs, where it should send 8 spaces... */ - line.replace(pat[TabChar], " "); + line.tqreplace(pat[TabChar], " "); - switch (rxStatus) { + switch (rxtqStatus) { case RxConnect: handleMessageConnect(line, rawline); @@ -1344,8 +1344,8 @@ void KBgEngineFIBS::handleServerData(TQString &line) void KBgEngineFIBS::handleMessageWhois(const TQString &line) { rxCollect += "
    " + line; - if (line.contains(pat[WhoisE1]) || line.contains(pat[WhoisE2])) { - rxStatus = RxNormal; + if (line.tqcontains(pat[WhoisE1]) || line.tqcontains(pat[WhoisE2])) { + rxtqStatus = RxNormal; emit infoText("" + rxCollect + "
"); } } @@ -1356,9 +1356,9 @@ void KBgEngineFIBS::handleMessageWhois(const TQString &line) void KBgEngineFIBS::handleMessageRating(const TQString &line) { rxCollect += "
" + line; - if (line.contains(pat[EndRate]) && ++rxCount == 2) { + if (line.tqcontains(pat[EndRate]) && ++rxCount == 2) { emit infoText("" + rxCollect + "
"); - rxStatus = RxNormal; + rxtqStatus = RxNormal; } } @@ -1367,8 +1367,8 @@ void KBgEngineFIBS::handleMessageRating(const TQString &line) */ void KBgEngineFIBS::handleMessageMotd(const TQString &line) { - if (line.contains(pat[MotdEnd])) { - rxStatus = RxNormal; + if (line.tqcontains(pat[MotdEnd])) { + rxtqStatus = RxNormal; emit infoText("
" + rxCollect + "
"); /* * just to be on the safe side, we set the value of boardstyle. @@ -1378,9 +1378,9 @@ void KBgEngineFIBS::handleMessageMotd(const TQString &line) emit serverString("set boardstyle 3"); } else { TQString tline = line; - tline.replace(pat[BoxHori], "

"); - tline.replace(pat[BoxVer1], ""); - tline.replace(pat[BoxVer2], ""); + tline.tqreplace(pat[BoxHori], "

"); + tline.tqreplace(pat[BoxVer1], ""); + tline.tqreplace(pat[BoxVer2], ""); rxCollect += "
" + tline; } } @@ -1393,14 +1393,14 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r /* * Two possibilities: either we are logged in or we sent bad password/login */ - if (line.contains("login:")) { + if (line.tqcontains("login:")) { /* * This can only happen if the password/login is wrong. */ if (rxCollect.isEmpty()) { - rxStatus = RxIgnore; + rxtqStatus = RxIgnore; int ret = KMessageBox::warningContinueCancel - ((TQWidget *)parent(), i18n("There was a problem with " + ((TQWidget *)tqparent(), i18n("There was a problem with " "your login and password. " "You can reenter\n" "your login and password and " @@ -1411,9 +1411,9 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r infoFIBS[FIBSUser] = ""; infoFIBS[FIBSPswd] = ""; login = true; - connectFIBS(); // will reset the rxStatus + connectFIBS(); // will reset the rxtqStatus } else { - rxStatus = RxConnect; + rxtqStatus = RxConnect; emit serverString(""); emit serverString(""); } @@ -1428,14 +1428,14 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r * Ok, we are logged in! Now receive personal information. These * are completely useless but what the heck. */ - if (line.contains(pat[Welcome])) { + if (line.tqcontains(pat[Welcome])) { char p[3][256]; time_t tmp; // Using latin1() is okay, since the string comes from FIBS. int words = sscanf (line.latin1(), "%255s%255s%li%255s", p[0], p[1], &tmp, p[2]); if (words >= 4) { TQDateTime d; d.setTime_t(tmp); - TQString text = i18n("%1, last logged in from %2 at %3.").arg(p[1]).arg(p[2]).arg(d.toString()); + TQString text = i18n("%1, last logged in from %2 at %3.").tqarg(p[1]).tqarg(p[2]).tqarg(d.toString()); emit infoText("

" + text); playerlist->setName(p[1]); } @@ -1471,9 +1471,9 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r * p[3] - timezone * */ - if (line.contains(pat[OwnInfo])) { + if (line.tqcontains(pat[OwnInfo])) { - rxStatus = RxNormal; + rxtqStatus = RxNormal; int fibsOptions[NumFIBSOpt]; @@ -1537,8 +1537,8 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r /* * The beginning of a new login procedure starts starts here */ - if (line.contains(pat[OneName])) { - rxStatus = RxNewLogin; + if (line.tqcontains(pat[OneName])) { + rxtqStatus = RxNewLogin; emit infoText(TQString("") + rxCollect + ""); rxCollect = ""; TQString tmp = rawline; @@ -1560,26 +1560,26 @@ void KBgEngineFIBS::handleMessageNewLogin(const TQString &line) /* * Request the new login */ - if (line.contains(pat[OneName])) { + if (line.tqcontains(pat[OneName])) { emit serverString(TQString("name ") + infoFIBS[FIBSUser]); return; } /* * Ooops, user name already exists */ - if (line.contains(pat[OthrNam])) { + if (line.tqcontains(pat[OthrNam])) { TQString text = i18n("The selected login is alreay in use! Please select another one."); bool ret, first = true; TQString msg; do { msg = (KLineEditDlg::getText(text, infoFIBS[FIBSUser], &ret, - (TQWidget *)parent())).stripWhiteSpace(); + (TQWidget *)tqparent())).stripWhiteSpace(); if (first) { text += i18n("\n\nThe login may not contain spaces or colons!"); first = false; } - } while (msg.contains(' ') || msg.contains(':')); + } while (msg.tqcontains(' ') || msg.tqcontains(':')); if (ret) { infoFIBS[FIBSUser] = msg; @@ -1592,28 +1592,28 @@ void KBgEngineFIBS::handleMessageNewLogin(const TQString &line) /* * first time we send the password */ - if (line.contains(pat[YourNam])) { + if (line.tqcontains(pat[YourNam])) { emit serverString(infoFIBS[FIBSPswd]); return; } /* * second time we send the password */ - if (line.contains(pat[GivePwd])) { + if (line.tqcontains(pat[GivePwd])) { emit serverString(infoFIBS[FIBSPswd]); return; } /* * at this point we are done creating the account */ - if (line.contains(pat[RetypeP])) { + if (line.tqcontains(pat[RetypeP])) { TQString text = i18n("Your account has been created. Your new login is %1. To fully activate " "this account, I will now close the connection. Once you reconnect, you can start " - "playing backgammon on FIBS.").arg(infoFIBS[FIBSUser]); + "playing backgammon on FIBS.").tqarg(infoFIBS[FIBSUser]); emit infoText("

" + text + "

"); emit serverString("bye"); - rxStatus = RxNormal; + rxtqStatus = RxNormal; rxCollect = ""; return; } @@ -1632,7 +1632,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) * For now, the waves are ignored. They should probably go into * the chat window -- but only optional */ - if (line.contains(pat[OneWave]) || line.contains(pat[TwoWave]) || line.contains(pat[YouWave])) { + if (line.tqcontains(pat[OneWave]) || line.tqcontains(pat[TwoWave]) || line.tqcontains(pat[YouWave])) { return; } @@ -1642,8 +1642,8 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) * ever gets a games window, they should be in there. For now, they * are ignored. */ - else if (line.contains(pat[GameBG1]) || line.contains(pat[GameBG2]) || line.contains(pat[GameRE1]) || - line.contains(pat[GameRE2]) || line.contains(pat[GameEnd])) { + else if (line.tqcontains(pat[GameBG1]) || line.tqcontains(pat[GameBG2]) || line.tqcontains(pat[GameRE1]) || + line.tqcontains(pat[GameRE2]) || line.tqcontains(pat[GameEnd])) { return; } @@ -1651,7 +1651,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) /* * Artefact caused by the login test procedure utilized. */ - else if (line.contains(pat[NoLogin])) { + else if (line.tqcontains(pat[NoLogin])) { return; } @@ -1659,7 +1659,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) /* * Connection keep-alive response */ - else if (line.contains(pat[KeepAlv])) { + else if (line.tqcontains(pat[KeepAlv])) { return; } @@ -1670,10 +1670,10 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) * Chat and personal messages - note that the chat window sends these messages * back to us so we can display them if the user wants that. */ - else if (line.contains(pat[ChatSay]) || line.contains(pat[ChatSht]) || line.contains(pat[ChatWis]) || - line.contains(pat[ChatKib]) || line.contains(pat[SelfSay]) || line.contains(pat[SelfSht]) || - line.contains(pat[SelfWis]) || line.contains(pat[SelfKib]) || line.contains(pat[SelfSlf]) || - line.contains(pat[MsgPers]) || line.contains(pat[MsgDeli]) || line.contains(pat[MsgSave])) { + else if (line.tqcontains(pat[ChatSay]) || line.tqcontains(pat[ChatSht]) || line.tqcontains(pat[ChatWis]) || + line.tqcontains(pat[ChatKib]) || line.tqcontains(pat[SelfSay]) || line.tqcontains(pat[SelfSht]) || + line.tqcontains(pat[SelfWis]) || line.tqcontains(pat[SelfKib]) || line.tqcontains(pat[SelfSlf]) || + line.tqcontains(pat[MsgPers]) || line.tqcontains(pat[MsgDeli]) || line.tqcontains(pat[MsgSave])) { emit chatMessage(line); return; @@ -1684,12 +1684,12 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) /* * Beginning of games. In all these cases we are playing and not watching. */ - else if (line.contains(pat[MatchB1]) || line.contains(pat[MatchB2])) { + else if (line.tqcontains(pat[MatchB1]) || line.tqcontains(pat[MatchB2])) { if (useAutoMsg[MsgBeg] && !autoMsg[MsgBeg].stripWhiteSpace().isEmpty()) emit serverString("kibitz " + autoMsg[MsgBeg]); } - else if (line.contains(pat[MatchB3]) || line.contains(pat[MatchB4])) { + else if (line.tqcontains(pat[MatchB3]) || line.tqcontains(pat[MatchB4])) { if (useAutoMsg[MsgBeg] && !autoMsg[MsgBeg].stripWhiteSpace().isEmpty()) emit serverString("kibitz " + autoMsg[MsgBeg]); @@ -1702,7 +1702,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) * The help should be handled separately. A fairly complete implementation of a * help parsing can be found in KFibs. */ - else if (line.contains(pat[HelpTxt])) { + else if (line.tqcontains(pat[HelpTxt])) { // do nothing } @@ -1712,12 +1712,12 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) /* * Simple cases without the need for many comments... */ - else if (line.contains(pat[RawBord])) { + else if (line.tqcontains(pat[RawBord])) { /* * Save the board string and create a new game state */ - KBgStatus *st = new KBgStatus(currBoard = rawline); + KBgtqStatus *st = new KBgtqStatus(currBoard = rawline); /* * Save important state data and stop the timeout @@ -1736,15 +1736,15 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) * Update the caption string */ if (st->turn() < 0) - caption = i18n("%1 (%2) vs. %3 (%4) - game over").arg(pname[US]). - arg(st->points(US)).arg(pname[THEM]).arg(st->points(THEM)); + caption = i18n("%1 (%2) vs. %3 (%4) - game over").tqarg(pname[US]). + tqarg(st->points(US)).tqarg(pname[THEM]).tqarg(st->points(THEM)); else if (st->length() < 0) - caption = i18n("%1 (%2) vs. %3 (%4) - unlimited match").arg(pname[US]). - arg(st->points(US)).arg(pname[THEM]).arg(st->points(THEM)); + caption = i18n("%1 (%2) vs. %3 (%4) - unlimited match").tqarg(pname[US]). + tqarg(st->points(US)).tqarg(pname[THEM]).tqarg(st->points(THEM)); else - caption = i18n("%1 (%2) vs. %3 (%4) - %5 point match").arg(pname[US]). - arg(st->points(US)).arg(pname[THEM]).arg(st->points(THEM)). - arg(st->length()); + caption = i18n("%1 (%2) vs. %3 (%4) - %5 point match").tqarg(pname[US]). + tqarg(st->points(US)).tqarg(pname[THEM]).tqarg(st->points(THEM)). + tqarg(st->length()); emit statText(caption); @@ -1766,7 +1766,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) return; } - else if (line.contains(pat[PlsMove]) || line.contains(pat[YouMove])) { + else if (line.tqcontains(pat[PlsMove]) || line.tqcontains(pat[YouMove])) { KNotifyClient::event("move", i18n("Please make your move")); @@ -1777,15 +1777,15 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) /* * Being away and coming back */ - else if (line.contains(pat[YouAway])) { + else if (line.tqcontains(pat[YouAway])) { - emit changePlayerStatus(infoFIBS[FIBSUser], KFibsPlayerList::Away, true); + emit changePlayertqStatus(infoFIBS[FIBSUser], KFibsPlayerList::Away, true); actBack->setEnabled(true); line += "
  
" + i18n("(or use the corresponding menu entry to join the match)"); } - else if (line.contains(pat[YouBack])) { + else if (line.tqcontains(pat[YouBack])) { - emit changePlayerStatus(infoFIBS[FIBSUser], KFibsPlayerList::Away, false); + emit changePlayertqStatus(infoFIBS[FIBSUser], KFibsPlayerList::Away, false); actBack->setEnabled(false); actAway->setEnabled(true); } @@ -1795,7 +1795,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) /* * Catch the response of the user responding to double or resign */ - else if (line.contains(pat[YouGive]) || line.contains(pat[RejCont]) || line.contains(pat[AcptWin])) { + else if (line.tqcontains(pat[YouGive]) || line.tqcontains(pat[RejCont]) || line.tqcontains(pat[AcptWin])) { actAccept->setEnabled(false); actReject->setEnabled(false); @@ -1806,20 +1806,20 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) /* * Catch the responses to newly set toggles */ - else if (line.contains(pat[GreedyY]) || line.contains(pat[GreedyN])) { + else if (line.tqcontains(pat[GreedyY]) || line.tqcontains(pat[GreedyN])) { - fibsOpt[OptGreedy]->setChecked(line.contains(pat[GreedyY])); + fibsOpt[OptGreedy]->setChecked(line.tqcontains(pat[GreedyY])); line = "" + line + ""; } - else if (line.contains(pat[DoubleY]) || line.contains(pat[DoubleN])) { + else if (line.tqcontains(pat[DoubleY]) || line.tqcontains(pat[DoubleN])) { - fibsOpt[OptDouble]->setChecked(line.contains(pat[DoubleY])); + fibsOpt[OptDouble]->setChecked(line.tqcontains(pat[DoubleY])); line = "" + line + ""; } - else if (line.contains(pat[RatingY]) || line.contains(pat[RatingN])) { + else if (line.tqcontains(pat[RatingY]) || line.tqcontains(pat[RatingN])) { - fibsOpt[OptRatings]->setChecked(line.contains(pat[RatingY])); + fibsOpt[OptRatings]->setChecked(line.tqcontains(pat[RatingY])); line = "" + line + ""; } @@ -1828,7 +1828,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) /* * It's our turn to roll or double */ - else if (line.contains(pat[YouTurn]) || line.contains(pat[YouRoll])) { + else if (line.tqcontains(pat[YouTurn]) || line.tqcontains(pat[YouRoll])) { emit allowCommand(Cube, playing); emit allowCommand(Roll, playing); @@ -1843,17 +1843,17 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) /* * Got an invitation for a match */ - else if (line.contains(pat[Invite0]) || line.contains(pat[Invite2]) || line.contains(pat[Invite3])) { + else if (line.tqcontains(pat[Invite0]) || line.tqcontains(pat[Invite2]) || line.tqcontains(pat[Invite3])) { - rxCollect = rawline.left(rawline.find(' ')); + rxCollect = rawline.left(rawline.tqfind(' ')); emit serverString("rawwho " + rxCollect); - if (line.contains(pat[Invite0])) { - rawline.replace(pat[Invite1], ""); - rawline = rxCollect + " "+ rawline.left(rawline.find(' ')); - } else if (line.contains(pat[Invite2])) { + if (line.tqcontains(pat[Invite0])) { + rawline.tqreplace(pat[Invite1], ""); + rawline = rxCollect + " "+ rawline.left(rawline.tqfind(' ')); + } else if (line.tqcontains(pat[Invite2])) { rawline = rxCollect + " r"; - } else if (line.contains(pat[Invite3])) { + } else if (line.tqcontains(pat[Invite3])) { invitations += rxCollect + " u"; } invitations += rawline; @@ -1862,24 +1862,24 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) // - rx status changes ------------------------------------------------------------ - else if (line.contains(pat[WhoisBG])) { - rxStatus = RxWhois; + else if (line.tqcontains(pat[WhoisBG])) { + rxtqStatus = RxWhois; rxCollect = TQString("
") + line + ""; return; } - else if (line.contains(pat[MotdBeg])) { - rxStatus = RxMotd; + else if (line.tqcontains(pat[MotdBeg])) { + rxtqStatus = RxMotd; rxCollect = ""; return; } - else if (line.contains(pat[BegRate])) { - rxStatus = RxRating; + else if (line.tqcontains(pat[BegRate])) { + rxtqStatus = RxRating; rxCount = 0; rxCollect = "
" + line; return; } - else if (line.contains(pat[Goodbye])) { - rxStatus = RxGoodbye; + else if (line.tqcontains(pat[Goodbye])) { + rxtqStatus = RxGoodbye; rxCollect = "


"; handleServerData(rawline); // danger: recursion! return; @@ -1893,7 +1893,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) /* * Continue a mutli game match? We have to either leave or continue */ - else if (line.contains(pat[ConLeav])) { + else if (line.tqcontains(pat[ConLeav])) { actConti->setEnabled(true); actLeave->setEnabled(true); line.append("
  
" + i18n("(or use the corresponding menu " @@ -1902,9 +1902,9 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) /* * Beginning and end of user updates */ - else if (line.contains(pat[WhoInfo])) { - rawline.replace(pat[WhoInfo], ""); - if (rawline.contains(TQRegExp("^" + infoFIBS[FIBSUser] + " "))) { + else if (line.tqcontains(pat[WhoInfo])) { + rawline.tqreplace(pat[WhoInfo], ""); + if (rawline.tqcontains(TQRegExp("^" + infoFIBS[FIBSUser] + " "))) { int ready; // Using latin1() is fine, since the string is coming from FIBS. sscanf(rawline.latin1(), "%*s %*s %*s %i %*s %*s %*s %*s %*s %*s %*s %*s", &ready); @@ -1913,7 +1913,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) emit fibsWhoInfo(rawline); return; } - else if (line.contains(pat[WhoEnde])) { + else if (line.tqcontains(pat[WhoEnde])) { emit fibsWhoEnd(); return; } @@ -1921,43 +1921,43 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) * This message is ignored. The instruction is given elsewhere (and slightly * delayed in the flow of time). */ - if (line.contains(pat[TypJoin])) { + if (line.tqcontains(pat[TypJoin])) { return; } /* * Watching other players */ - else if (line.contains(pat[BegWtch])) { + else if (line.tqcontains(pat[BegWtch])) { emit allowCommand(Load, true); - rawline.replace(pat[BegWtch], ""); + rawline.tqreplace(pat[BegWtch], ""); rawline.truncate(rawline.length()-1); emit fibsStartNewGame(rawline); load(); } - else if (line.contains(pat[EndWtch])) { + else if (line.tqcontains(pat[EndWtch])) { emit gameOver(); } /* * Blinding of players, the actual blind is handled by * the player list */ - else if (line.contains(pat[BegBlnd])) { - rawline.replace(pat[BegBlnd], ""); + else if (line.tqcontains(pat[BegBlnd])) { + rawline.tqreplace(pat[BegBlnd], ""); rawline.truncate(rawline.length()-1); - emit changePlayerStatus(rawline, KFibsPlayerList::Blind, true); + emit changePlayertqStatus(rawline, KFibsPlayerList::Blind, true); line = "" + line + ""; } - else if (line.contains(pat[EndBlnd])) { - rawline.replace(pat[EndBlnd], ""); + else if (line.tqcontains(pat[EndBlnd])) { + rawline.tqreplace(pat[EndBlnd], ""); rawline.truncate(rawline.length()-1); - emit changePlayerStatus(rawline, KFibsPlayerList::Blind, false); + emit changePlayertqStatus(rawline, KFibsPlayerList::Blind, false); line = "" + line + ""; } /* * Starting or reloading games or matches */ - else if (line.contains(pat[BegGame])) { - rawline.replace(pat[BegGame], ""); + else if (line.tqcontains(pat[BegGame])) { + rawline.tqreplace(pat[BegGame], ""); rawline.truncate(rawline.length()-1); emit fibsStartNewGame(rawline); fibsOpt[OptDouble]->setChecked(true); @@ -1965,9 +1965,9 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) actConti->setEnabled(false); actLeave->setEnabled(false); } - else if (line.contains(pat[Reload1])) { - rawline.replace(pat[Reload1], ""); - rawline = rawline.left(rawline.find(' ')); + else if (line.tqcontains(pat[Reload1])) { + rawline.tqreplace(pat[Reload1], ""); + rawline = rawline.left(rawline.tqfind(' ')); rawline.truncate(rawline.length()-1); emit fibsStartNewGame(rawline); fibsOpt[OptDouble]->setChecked(true); @@ -1976,8 +1976,8 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) actLeave->setEnabled(false); load(); } - else if (line.contains(pat[Reload2])) { - rawline.replace(pat[Reload2], ""); + else if (line.tqcontains(pat[Reload2])) { + rawline.tqreplace(pat[Reload2], ""); emit fibsStartNewGame(rawline); fibsOpt[OptDouble]->setChecked(true); fibsOpt[OptGreedy]->setChecked(false); @@ -1989,7 +1989,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) * Opponent offered resignation or the cube. We have to accept * or reject the offer. */ - else if (line.contains(pat[RejAcpt])) { + else if (line.tqcontains(pat[RejAcpt])) { actAccept->setEnabled(true); actReject->setEnabled(true); line += "
  
" + i18n("(or use the corresponding menu " @@ -1999,10 +1999,10 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) * This is strange: FIBS seems to not send a newline at the * end of this pattern. So we work around that. */ - else if (line.contains(pat[YouAcpt])) { + else if (line.tqcontains(pat[YouAcpt])) { actAccept->setEnabled(false); actReject->setEnabled(false); - rawline.replace(pat[YouAcpt], ""); + rawline.tqreplace(pat[YouAcpt], ""); line.truncate(line.length()-rawline.length()); if (!rawline.stripWhiteSpace().isEmpty()) { handleServerData(rawline); @@ -2011,7 +2011,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) /* * Ending of games */ - else if (line.contains(pat[EndLose])) { + else if (line.tqcontains(pat[EndLose])) { if (playing) { KNotifyClient::event("game over l", i18n("Sorry, you lost the game.")); if (useAutoMsg[MsgLos] && !autoMsg[MsgLos].stripWhiteSpace().isEmpty()) @@ -2019,7 +2019,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) } emit gameOver(); } - else if (line.contains(pat[EndVict])) { + else if (line.tqcontains(pat[EndVict])) { if (playing) { KNotifyClient::event("game over w", i18n("Congratulations, you won the game!")); if (useAutoMsg[MsgWin] && !autoMsg[MsgWin].stripWhiteSpace().isEmpty()) @@ -2027,24 +2027,24 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) } emit gameOver(); } - else if (line.contains(pat[GameSav])) { + else if (line.tqcontains(pat[GameSav])) { emit gameOver(); } /* * User logs out. This has to be signalled to the player * list. Get the true user names by working on the rawline. */ - else if (line.contains(pat[UserLot])) { - rawline.replace(pat[UserLot], ""); - emit fibsLogout(rawline.left(rawline.find(' '))); + else if (line.tqcontains(pat[UserLot])) { + rawline.tqreplace(pat[UserLot], ""); + emit fibsLogout(rawline.left(rawline.tqfind(' '))); return; } /* * Emit the name of the newly logged in user. */ - else if (line.contains(pat[UserLin])) { - rawline.replace(pat[UserLin], ""); - emit fibsLogin(rawline.left(rawline.find(' '))); + else if (line.tqcontains(pat[UserLin])) { + rawline.tqreplace(pat[UserLin], ""); + emit fibsLogin(rawline.left(rawline.tqfind(' '))); return; } /* @@ -2052,11 +2052,11 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) * the 'boardstyle' variable, since we will not be able to display * the board properly without it. */ - else if (line.contains(pat[BoardSY])) { + else if (line.tqcontains(pat[BoardSY])) { // ignored return; } - else if (line.contains(pat[BoardSN])) { + else if (line.tqcontains(pat[BoardSN])) { emit serverString("set boardstyle 3"); emit infoText(TQString("
") + i18n("You should never set the 'boardstyle' variable " @@ -2071,7 +2071,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) * hasn't been processed, make it red, since it is a server resp. * to something we just did. */ - else if (line.contains(pat[TwoStar])) { + else if (line.tqcontains(pat[TwoStar])) { line = "" + line + ""; } @@ -2091,13 +2091,13 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) /* * Constructor */ -KBgEngineFIBS::KBgEngineFIBS(TQWidget *parent, TQString *name, TQPopupMenu *pmenu) - : KBgEngine(parent, name, pmenu) +KBgEngineFIBS::KBgEngineFIBS(TQWidget *tqparent, TQString *name, TQPopupMenu *pmenu) + : KBgEngine(tqparent, name, pmenu) { /* * No connection, not playing, ready for login */ - connection = new TQSocket(parent, "fibs connection"); + connection = new TQSocket(TQT_TQOBJECT(tqparent), "fibs connection"); playing = false; login = true; @@ -2128,8 +2128,8 @@ KBgEngineFIBS::KBgEngineFIBS(TQWidget *parent, TQString *name, TQPopupMenu *pmen connect(this, TQT_SIGNAL(fibsLogout (const TQString &)), playerlist, TQT_SLOT(deletePlayer(const TQString &))); connect(this, TQT_SIGNAL(fibsWhoEnd()), playerlist, TQT_SLOT(stopUpdate())); connect(this, TQT_SIGNAL(fibsConnectionClosed()), playerlist, TQT_SLOT(stopUpdate())); - connect(this, TQT_SIGNAL(changePlayerStatus(const TQString &, int, bool)), - playerlist, TQT_SLOT(changePlayerStatus(const TQString &, int, bool))); + connect(this, TQT_SIGNAL(changePlayertqStatus(const TQString &, int, bool)), + playerlist, TQT_SLOT(changePlayertqStatus(const TQString &, int, bool))); connect(playerlist, TQT_SIGNAL(fibsCommand(const TQString &)), this, TQT_SLOT(handleCommand(const TQString &))); connect(playerlist, TQT_SIGNAL(fibsInvite(const TQString &)), this, TQT_SLOT(fibsRequestInvitation(const TQString &))); diff --git a/kbackgammon/engines/fibs/kbgfibs.h b/kbackgammon/engines/fibs/kbgfibs.h index b46ae3a2..d044c642 100644 --- a/kbackgammon/engines/fibs/kbgfibs.h +++ b/kbackgammon/engines/fibs/kbgfibs.h @@ -60,13 +60,14 @@ class KToggleAction; class KBgEngineFIBS : public KBgEngine { Q_OBJECT + TQ_OBJECT public: /** * Constructor */ - KBgEngineFIBS(TQWidget *parent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0); + KBgEngineFIBS(TQWidget *tqparent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0); /** * Destructor @@ -174,7 +175,7 @@ signals: void fibsConnectionClosed(); - void changePlayerStatus(const TQString &, int, bool); + void changePlayertqStatus(const TQString &, int, bool); void chatMessage(const TQString &msg); @@ -198,7 +199,7 @@ private: TQString currBoard, caption; - //KBgStatus *currBoard + //KBgtqStatus *currBoard //KBgFIBSBoard *boardHandler; TQStringList invitations; @@ -399,10 +400,10 @@ protected slots: protected: - enum RxStatus {RxIgnore, RxConnect, RxWhois, RxMotd, RxRating, + enum RxtqStatus {RxIgnore, RxConnect, RxWhois, RxMotd, RxRating, RxNewLogin, RxGoodbye, RxNormal}; - int rxStatus, rxCount; + int rxtqStatus, rxCount; TQString rxCollect; diff --git a/kbackgammon/engines/fibs/kbgfibschat.cpp b/kbackgammon/engines/fibs/kbgfibschat.cpp index 7b34bae0..c1eca59d 100644 --- a/kbackgammon/engines/fibs/kbgfibschat.cpp +++ b/kbackgammon/engines/fibs/kbgfibschat.cpp @@ -63,7 +63,7 @@ * Private utility class that might become more generally useful in * the future. Basically, it implements rich text TQListBox items. */ -class KLBT : public QListBoxText +class KLBT : public TQListBoxText { public: @@ -71,10 +71,10 @@ public: /* * Constructor */ - KLBT(TQWidget *parent, const TQString &text = TQString::null, const TQString &player = TQString::null) + KLBT(TQWidget *tqparent, const TQString &text = TQString(), const TQString &player = TQString()) : TQListBoxText(text) { - w = parent; + w = tqparent; n = new TQString(player); t = new TQSimpleRichText(text, w->font()); @@ -123,7 +123,7 @@ protected: */ virtual void paint(TQPainter *p) { - t->draw(p, 1, 1, TQRegion(p->viewport()), w->colorGroup()); + t->draw(p, 1, 1, TQRegion(p->viewport()), w->tqcolorGroup()); } private: @@ -189,18 +189,18 @@ public: /* * Constructor of the chat window. */ -KBgChat::KBgChat(TQWidget *parent, const char *name) - : KChat(parent, false) +KBgChat::KBgChat(TQWidget *tqparent, const char *name) + : KChat(tqparent, false) { d = new KBgChatPrivate(); KActionCollection* actions = new KActionCollection(this); - d->mName[0] = TQString::null; + d->mName[0] = TQString(); d->mChat = 0; d->mInvt = new TQPopupMenu(); setAutoAddMessages(false); // we get an echo from FIBS - setFromNickname(i18n("%1 user").arg(PROG_NAME)); + setFromNickname(i18n("%1 user").tqarg(PROG_NAME)); if (!addSendingEntry(i18n("Kibitz to watchers and players"), CLIP_YOU_KIBITZ)) kdDebug(10500) << "adding kibitz" << endl; @@ -233,31 +233,31 @@ KBgChat::KBgChat(TQWidget *parent, const char *name) d->mAct[KBgChatPrivate::Inquire] = new KAction(i18n("Info On"), TQIconSet(kapp->iconLoader()->loadIcon( "help.xpm", KIcon::Small)), - 0, this, TQT_SLOT(slotInquire()), actions); + 0, TQT_TQOBJECT(this), TQT_SLOT(slotInquire()), actions); d->mAct[KBgChatPrivate::Talk] = new KAction(i18n("Talk To"), TQIconSet(kapp->iconLoader()->loadIcon( PROG_NAME "-chat.png", KIcon::Small)), - 0, this, TQT_SLOT(slotTalk()), actions); + 0, TQT_TQOBJECT(this), TQT_SLOT(slotTalk()), actions); - d->mAct[KBgChatPrivate::InviteD] = new KAction(i18n("Use Dialog"), 0, this, + d->mAct[KBgChatPrivate::InviteD] = new KAction(i18n("Use Dialog"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInviteD()), actions); - d->mAct[KBgChatPrivate::Invite1] = new KAction(i18n("1 Point Match"), 0, this, + d->mAct[KBgChatPrivate::Invite1] = new KAction(i18n("1 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite1()), actions); - d->mAct[KBgChatPrivate::Invite2] = new KAction(i18n("2 Point Match"), 0, this, + d->mAct[KBgChatPrivate::Invite2] = new KAction(i18n("2 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite2()), actions); - d->mAct[KBgChatPrivate::Invite3] = new KAction(i18n("3 Point Match"), 0, this, + d->mAct[KBgChatPrivate::Invite3] = new KAction(i18n("3 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite3()), actions); - d->mAct[KBgChatPrivate::Invite4] = new KAction(i18n("4 Point Match"), 0, this, + d->mAct[KBgChatPrivate::Invite4] = new KAction(i18n("4 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite4()), actions); - d->mAct[KBgChatPrivate::Invite5] = new KAction(i18n("5 Point Match"), 0, this, + d->mAct[KBgChatPrivate::Invite5] = new KAction(i18n("5 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite5()), actions); - d->mAct[KBgChatPrivate::Invite6] = new KAction(i18n("6 Point Match"), 0, this, + d->mAct[KBgChatPrivate::Invite6] = new KAction(i18n("6 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite6()), actions); - d->mAct[KBgChatPrivate::Invite7] = new KAction(i18n("7 Point Match"), 0, this, + d->mAct[KBgChatPrivate::Invite7] = new KAction(i18n("7 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite7()), actions); - d->mAct[KBgChatPrivate::InviteU] = new KAction(i18n("Unlimited"), 0, this, + d->mAct[KBgChatPrivate::InviteU] = new KAction(i18n("Unlimited"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInviteU()), actions); - d->mAct[KBgChatPrivate::InviteR] = new KAction(i18n("Resume"), 0, this, + d->mAct[KBgChatPrivate::InviteR] = new KAction(i18n("Resume"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInviteR()), actions); d->mAct[KBgChatPrivate::InviteD]->plug(d->mInvt); @@ -277,13 +277,13 @@ KBgChat::KBgChat(TQWidget *parent, const char *name) d->mAct[KBgChatPrivate::InviteU]->plug(d->mInvt); d->mAct[KBgChatPrivate::InviteR]->plug(d->mInvt); - d->mAct[KBgChatPrivate::Gag] = new KAction(i18n("Gag"), 0, this, TQT_SLOT(slotGag()), actions); - d->mAct[KBgChatPrivate::Ungag] = new KAction(i18n("Ungag"), 0, this, TQT_SLOT(slotUngag()), actions); - d->mAct[KBgChatPrivate::Cleargag] = new KAction(i18n("Clear Gag List"), 0, this, TQT_SLOT(slotCleargag()), actions); - d->mAct[KBgChatPrivate::Copy] = KStdAction::copy(this, TQT_SLOT(slotCopy()), actions); - d->mAct[KBgChatPrivate::Clear] = new KAction(i18n("Clear"), 0, this, TQT_SLOT(slotClear()), actions); - d->mAct[KBgChatPrivate::Close] = KStdAction::close(this, TQT_SLOT(hide()), actions); - d->mAct[KBgChatPrivate::Silent] = new KToggleAction(i18n("Silent"), 0, this, TQT_SLOT(slotSilent()), actions); + d->mAct[KBgChatPrivate::Gag] = new KAction(i18n("Gag"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotGag()), actions); + d->mAct[KBgChatPrivate::Ungag] = new KAction(i18n("Ungag"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotUngag()), actions); + d->mAct[KBgChatPrivate::Cleargag] = new KAction(i18n("Clear Gag List"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotCleargag()), actions); + d->mAct[KBgChatPrivate::Copy] = KStdAction::copy(TQT_TQOBJECT(this), TQT_SLOT(slotCopy()), actions); + d->mAct[KBgChatPrivate::Clear] = new KAction(i18n("Clear"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotClear()), actions); + d->mAct[KBgChatPrivate::Close] = KStdAction::close(TQT_TQOBJECT(this), TQT_SLOT(hide()), actions); + d->mAct[KBgChatPrivate::Silent] = new KToggleAction(i18n("Silent"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotSilent()), actions); } @@ -416,7 +416,7 @@ void KBgChat::setupDefault() /* * Overloaded member to create a TQListBoxItem for the chat window. */ -TQListBoxItem* KBgChat::layoutMessage(const TQString& fromName, const TQString& text) +TQListBoxItem* KBgChat::tqlayoutMessage(const TQString& fromName, const TQString& text) { TQListBoxText* message = new KLBT(this, text, fromName); return message; @@ -446,11 +446,11 @@ void KBgChat::hideEvent(TQHideEvent *e) */ void KBgChat::startGame(const TQString &name) { - int *id = d->mName2ID->find(d->mName[1] = name); + int *id = d->mName2ID->tqfind(d->mName[1] = name); if (!id) { id = new int(nextId()); d->mName2ID->insert(name, id); - addSendingEntry(i18n("Talk to %1").arg(name), *id); + addSendingEntry(i18n("Talk to %1").tqarg(name), *id); } setSendingEntry(CLIP_YOU_KIBITZ); } @@ -460,7 +460,7 @@ void KBgChat::startGame(const TQString &name) */ void KBgChat::endGame() { - int *id = d->mName2ID->find(d->mName[1]); + int *id = d->mName2ID->tqfind(d->mName[1]); if (id) setSendingEntry(*id); else @@ -472,11 +472,11 @@ void KBgChat::endGame() */ void KBgChat::fibsTalk(const TQString &name) { - int *id = d->mName2ID->find(name); + int *id = d->mName2ID->tqfind(name); if (!id) { id = new int(nextId()); d->mName2ID->insert(name, id); - addSendingEntry(i18n("Talk to %1").arg(name), *id); + addSendingEntry(i18n("Talk to %1").tqarg(name), *id); } setSendingEntry(*id); } @@ -486,7 +486,7 @@ void KBgChat::fibsTalk(const TQString &name) */ void KBgChat::deletePlayer(const TQString &name) { - int *id = d->mName2ID->find(name); + int *id = d->mName2ID->tqfind(name); if (id) { removeSendingEntry(*id); d->mName2ID->remove(name); @@ -535,21 +535,21 @@ void KBgChat::handleCommand(int id, const TQString& msg) */ void KBgChat::handleData(const TQString &msg) { - TQString clip = msg.left(msg.find(' ')), user, cMsg = msg; + TQString clip = msg.left(msg.tqfind(' ')), user, cMsg = msg; TQDateTime date; bool flag = false; int cmd = clip.toInt(&flag); if (flag) { - cMsg.replace(0, cMsg.find(' ')+1, ""); + cMsg.tqreplace(0, cMsg.tqfind(' ')+1, ""); - user = cMsg.left(cMsg.find(' ')); + user = cMsg.left(cMsg.tqfind(' ')); switch (cmd) { case CLIP_SAYS: - if (!d->mGag.contains(user)) { - cMsg = i18n("%1 tells you: %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), "")); + if (!d->mGag.tqcontains(user)) { + cMsg = i18n("%1 tells you: %2").tqarg(user).tqarg(cMsg.tqreplace(TQRegExp("^" + user), "")); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); } else @@ -557,16 +557,16 @@ void KBgChat::handleData(const TQString &msg) break; case CLIP_SHOUTS: - if ((!((KToggleAction *)d->mAct[KBgChatPrivate::Silent])->isChecked()) && (!d->mGag.contains(user))) { - cMsg = i18n("%1 shouts: %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), "")); + if ((!((KToggleAction *)d->mAct[KBgChatPrivate::Silent])->isChecked()) && (!d->mGag.tqcontains(user))) { + cMsg = i18n("%1 shouts: %2").tqarg(user).tqarg(cMsg.tqreplace(TQRegExp("^" + user), "")); cMsg = "" + cMsg + ""; } else cMsg = ""; break; case CLIP_WHISPERS: - if (!d->mGag.contains(user)) { - cMsg = i18n("%1 whispers: %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), "")); + if (!d->mGag.tqcontains(user)) { + cMsg = i18n("%1 whispers: %2").tqarg(user).tqarg(cMsg.tqreplace(TQRegExp("^" + user), "")); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); } else @@ -574,8 +574,8 @@ void KBgChat::handleData(const TQString &msg) break; case CLIP_KIBITZES: - if (!d->mGag.contains(user)) { - cMsg = i18n("%1 kibitzes: %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), "")); + if (!d->mGag.tqcontains(user)) { + cMsg = i18n("%1 kibitzes: %2").tqarg(user).tqarg(cMsg.tqreplace(TQRegExp("^" + user), "")); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); } else @@ -583,56 +583,56 @@ void KBgChat::handleData(const TQString &msg) break; case CLIP_YOU_SAY: - cMsg = i18n("You tell %1: %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), "")); + cMsg = i18n("You tell %1: %2").tqarg(user).tqarg(cMsg.tqreplace(TQRegExp("^" + user), "")); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); - user = TQString::null; + user = TQString(); break; case CLIP_YOU_SHOUT: - cMsg = i18n("You shout: %1").arg(cMsg); + cMsg = i18n("You shout: %1").tqarg(cMsg); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); - user = TQString::null; + user = TQString(); break; case CLIP_YOU_WHISPER: - cMsg = i18n("You whisper: %1").arg(cMsg); + cMsg = i18n("You whisper: %1").tqarg(cMsg); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); - user = TQString::null; + user = TQString(); break; case CLIP_YOU_KIBITZ: - cMsg = i18n("You kibitz: %1").arg(cMsg); + cMsg = i18n("You kibitz: %1").tqarg(cMsg); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); - user = TQString::null; + user = TQString(); break; case CLIP_MESSAGE: - user = cMsg.left(cMsg.find(' ')+1); - cMsg.remove(0, cMsg.find(' ')+1); - date.setTime_t(cMsg.left(cMsg.find(' ')+1).toUInt()); - cMsg.remove(0, cMsg.find(' ')); - cMsg = i18n("User %1 left a message at %2: %3").arg(user).arg(date.toString()).arg(cMsg); + user = cMsg.left(cMsg.tqfind(' ')+1); + cMsg.remove(0, cMsg.tqfind(' ')+1); + date.setTime_t(cMsg.left(cMsg.tqfind(' ')+1).toUInt()); + cMsg.remove(0, cMsg.tqfind(' ')); + cMsg = i18n("User %1 left a message at %2: %3").tqarg(user).tqarg(date.toString()).tqarg(cMsg); cMsg = "" + cMsg + ""; emit personalMessage(cMsg); - user = TQString::null; + user = TQString(); break; case CLIP_MESSAGE_DELIVERED: - cMsg = i18n("Your message for %1 has been delivered.").arg(user); + cMsg = i18n("Your message for %1 has been delivered.").tqarg(user); cMsg = TQString("") + cMsg + ""; emit personalMessage(cMsg); - user = TQString::null; + user = TQString(); break; case CLIP_MESSAGE_SAVED: - cMsg = i18n("Your message for %1 has been saved.").arg(user); + cMsg = i18n("Your message for %1 has been saved.").tqarg(user); cMsg = TQString("") + cMsg + ""; emit personalMessage(cMsg); - user = TQString::null; + user = TQString(); break; default: // ignore the message @@ -644,8 +644,8 @@ void KBgChat::handleData(const TQString &msg) /* * Special treatment for non-CLIP messages */ - if (cMsg.contains(TQRegExp("^You say to yourself: "))) { - cMsg.replace(TQRegExp("^You say to yourself: "), + if (cMsg.tqcontains(TQRegExp("^You say to yourself: "))) { + cMsg.tqreplace(TQRegExp("^You say to yourself: "), i18n("You say to yourself: ")); } else { kdDebug(user.isNull(), 10500) << "KBgChat::handleData unhandled message: " @@ -667,10 +667,10 @@ void KBgChat::handleData(const TQString &msg) void KBgChat::contextMenu(TQListBoxItem *i, const TQPoint &p) { /* - * Even if i is non-null, user might still be TQString::null + * Even if i is non-null, user might still be TQString() */ - d->mName[0] = (i == 0) ? TQString::null : ((KLBT *)i)->player(); - d->mText = (i == 0) ? TQString::null : ((KLBT *)i)->text(); + d->mName[0] = (i == 0) ? TQString() : ((KLBT *)i)->player(); + d->mText = (i == 0) ? TQString() : ((KLBT *)i)->text(); /* * Get a new context menu every time. Safe to delete the 0 @@ -683,22 +683,22 @@ void KBgChat::contextMenu(TQListBoxItem *i, const TQPoint &p) */ if (!d->mName[0].isNull()) { - d->mAct[KBgChatPrivate::Talk]->setText(i18n("Talk to %1").arg(d->mName[0])); + d->mAct[KBgChatPrivate::Talk]->setText(i18n("Talk to %1").tqarg(d->mName[0])); d->mAct[KBgChatPrivate::Talk]->plug(d->mChat); - d->mAct[KBgChatPrivate::Inquire]->setText(i18n("Info on %1").arg(d->mName[0])); + d->mAct[KBgChatPrivate::Inquire]->setText(i18n("Info on %1").tqarg(d->mName[0])); d->mAct[KBgChatPrivate::Inquire]->plug(d->mChat); // invite menu is always the same - d->mChat->insertItem(i18n("Invite %1").arg(d->mName[0]), d->mInvt); + d->mChat->insertItem(i18n("Invite %1").tqarg(d->mName[0]), d->mInvt); d->mChat->insertSeparator(); - if (d->mGag.contains(d->mName[0]) <= 0) { - d->mAct[KBgChatPrivate::Gag]->setText(i18n("Gag %1").arg(d->mName[0])); + if (d->mGag.tqcontains(d->mName[0]) <= 0) { + d->mAct[KBgChatPrivate::Gag]->setText(i18n("Gag %1").tqarg(d->mName[0])); d->mAct[KBgChatPrivate::Gag]->plug(d->mChat); } else { - d->mAct[KBgChatPrivate::Ungag]->setText(i18n("Ungag %1").arg(d->mName[0])); + d->mAct[KBgChatPrivate::Ungag]->setText(i18n("Ungag %1").tqarg(d->mName[0])); d->mAct[KBgChatPrivate::Ungag]->plug(d->mChat); } } @@ -730,7 +730,7 @@ void KBgChat::slotCleargag() msg += i18n("The gag list is now empty."); msg += "
"; - addMessage(TQString::null, msg); + addMessage(TQString(), msg); } /* @@ -741,10 +741,10 @@ void KBgChat::slotGag() d->mGag.append(d->mName[0]); TQString msg(""); - msg += i18n("You won't hear what %1 says and shouts.").arg(d->mName[0]); + msg += i18n("You won't hear what %1 says and shouts.").tqarg(d->mName[0]); msg += ""; - addMessage(TQString::null, msg); + addMessage(TQString(), msg); } /* @@ -763,10 +763,10 @@ void KBgChat::slotUngag() d->mGag.remove(d->mName[0]); TQString msg(""); - msg += i18n("You will again hear what %1 says and shouts.").arg(d->mName[0]); + msg += i18n("You will again hear what %1 says and shouts.").tqarg(d->mName[0]); msg += ""; - addMessage(TQString::null, msg); + addMessage(TQString(), msg); } /* @@ -788,7 +788,7 @@ void KBgChat::slotSilent() msg = "" + i18n("You will not hear what people shout.") + ""; else msg = "" + i18n("You will hear what people shout.") + ""; - addMessage(TQString::null, msg); + addMessage(TQString(), msg); } /* @@ -797,10 +797,10 @@ void KBgChat::slotSilent() */ void KBgChat::slotCopy() { - d->mText.replace(TQRegExp(""), ""); - d->mText.replace(TQRegExp(""), ""); - d->mText.replace(TQRegExp(""), ""); - d->mText.replace(TQRegExp("^.*\">"), ""); + d->mText.tqreplace(TQRegExp(""), ""); + d->mText.tqreplace(TQRegExp(""), ""); + d->mText.tqreplace(TQRegExp(""), ""); + d->mText.tqreplace(TQRegExp("^.*\">"), ""); kapp->clipboard()->setText(d->mText); } diff --git a/kbackgammon/engines/fibs/kbgfibschat.h b/kbackgammon/engines/fibs/kbgfibschat.h index 5e1fefa4..7dc0cfaf 100644 --- a/kbackgammon/engines/fibs/kbgfibschat.h +++ b/kbackgammon/engines/fibs/kbgfibschat.h @@ -55,13 +55,14 @@ class KBgChatPrivate; class KBgChat : public KChat { Q_OBJECT + TQ_OBJECT public: /** * Constructor */ - KBgChat(TQWidget *parent = 0, const char *name = 0); + KBgChat(TQWidget *tqparent = 0, const char *name = 0); /** * Destructor @@ -170,7 +171,7 @@ protected: * Create a custom ListBoxItem that contains a formated string * for the chat window. */ - virtual TQListBoxItem* layoutMessage(const TQString& fromName, const TQString& text); + virtual TQListBoxItem* tqlayoutMessage(const TQString& fromName, const TQString& text); protected slots: diff --git a/kbackgammon/engines/fibs/kbginvite.cpp b/kbackgammon/engines/fibs/kbginvite.cpp index f43c3b6a..666ba4c5 100644 --- a/kbackgammon/engines/fibs/kbginvite.cpp +++ b/kbackgammon/engines/fibs/kbginvite.cpp @@ -75,7 +75,7 @@ KBgInvite::KBgInvite(const char *name) hLine->setFrameStyle(TQFrame::Sunken|TQFrame::HLine); /* - * Set up layouts + * Set up tqlayouts */ TQBoxLayout *vbox = new TQVBoxLayout(this); @@ -103,9 +103,9 @@ KBgInvite::KBgInvite(const char *name) * Adjust widget sizes and resize the dialog */ KDialog::resizeLayout(this, marginHint(), spacingHint()); - setMinimumSize(childrenRect().size()); + setMinimumSize(tqchildrenRect().size()); vbox->activate(); - resize(minimumSize()); + resize(tqminimumSize()); /* * Set focus and default buttons diff --git a/kbackgammon/engines/fibs/kbginvite.h b/kbackgammon/engines/fibs/kbginvite.h index 7bc5f3f7..4c33b169 100644 --- a/kbackgammon/engines/fibs/kbginvite.h +++ b/kbackgammon/engines/fibs/kbginvite.h @@ -46,6 +46,7 @@ class KBgInvitePrivate; class KBgInvite : public KDialog { Q_OBJECT + TQ_OBJECT public: diff --git a/kbackgammon/engines/fibs/kplayerlist.cpp b/kbackgammon/engines/fibs/kplayerlist.cpp index 06b724e5..a928de7e 100644 --- a/kbackgammon/engines/fibs/kplayerlist.cpp +++ b/kbackgammon/engines/fibs/kplayerlist.cpp @@ -79,7 +79,7 @@ public: /* * Constructor */ - KFibsPlayerListLVI(KFibsPlayerList *parent) : KListViewItem(parent) { _plist = parent; } + KFibsPlayerListLVI(KFibsPlayerList *tqparent) : KListViewItem(tqparent) { _plist = tqparent; } /* * Destructor @@ -101,7 +101,7 @@ public: case KFibsPlayerList::Watches: case KFibsPlayerList::Client: case KFibsPlayerList::Email: - case KFibsPlayerList::Status: + case KFibsPlayerList::tqStatus: case KFibsPlayerList::Host: s = s.lower(); break; @@ -175,7 +175,7 @@ public: /* * Short abbreviations for Blind, Ready, and Away. */ - TQString mAbrv[KFibsPlayerList::MaxStatus]; + TQString mAbrv[KFibsPlayerList::MaxtqStatus]; /* * Name of the last selected player - for internal purposes @@ -200,8 +200,8 @@ public: /* * Construct the playerlist and do some initial setup */ -KFibsPlayerList::KFibsPlayerList(TQWidget *parent, const char *name) - : KListView(parent, name) +KFibsPlayerList::KFibsPlayerList(TQWidget *tqparent, const char *name) + : KListView(tqparent, name) { d = new KFibsPlayerListPrivate(); KActionCollection* actions = new KActionCollection(this); @@ -218,7 +218,7 @@ KFibsPlayerList::KFibsPlayerList(TQWidget *parent, const char *name) d->mCol[Player]->name = i18n("Player"); d->mCol[Opponent]->name = i18n("Opponent"); d->mCol[Watches]->name = i18n("Watches"); - d->mCol[Status]->name = i18n("Status"); + d->mCol[tqStatus]->name = i18n("tqStatus"); d->mCol[Rating]->name = i18n("Rating"); d->mCol[Experience]->name = i18n("Exp."); d->mCol[Idle]->name = i18n("Idle"); @@ -231,7 +231,7 @@ KFibsPlayerList::KFibsPlayerList(TQWidget *parent, const char *name) d->mCol[Player]->key = "player"; d->mCol[Opponent]->key = "opponent"; d->mCol[Watches]->key = "watches"; - d->mCol[Status]->key = "status"; + d->mCol[tqStatus]->key = "status"; d->mCol[Rating]->key = "rating"; d->mCol[Experience]->key = "experience"; d->mCol[Idle]->key = "idle"; @@ -246,7 +246,7 @@ KFibsPlayerList::KFibsPlayerList(TQWidget *parent, const char *name) d->mAbrv[Away ] = i18n("abreviate away", "A"); d->mAbrv[Ready] = i18n("abreviate ready", "R"); - d->mName = TQString::null; + d->mName = TQString(); d->mWatch = false; @@ -289,41 +289,41 @@ KFibsPlayerList::KFibsPlayerList(TQWidget *parent, const char *name) d->mAct[KFibsPlayerListPrivate::Info] = new KAction(i18n("Info"), TQIconSet(kapp->iconLoader()->loadIcon ("help.xpm", KIcon::Small)), - 0, this, TQT_SLOT(slotInfo()), actions); + 0, TQT_TQOBJECT(this), TQT_SLOT(slotInfo()), actions); d->mAct[KFibsPlayerListPrivate::Talk] = new KAction(i18n("Talk"), TQIconSet(kapp->iconLoader()->loadIcon (PROG_NAME "-chat.png", KIcon::Small)), - 0, this, TQT_SLOT(slotTalk()), actions); + 0, TQT_TQOBJECT(this), TQT_SLOT(slotTalk()), actions); - d->mAct[KFibsPlayerListPrivate::Look] = new KAction(i18n("Look"), 0, this, TQT_SLOT(slotLook()), actions); - d->mAct[KFibsPlayerListPrivate::Watch] = new KAction(i18n("Watch"), 0, this, TQT_SLOT(slotWatch()), actions); - d->mAct[KFibsPlayerListPrivate::Unwatch] = new KAction(i18n("Unwatch"), 0, this, TQT_SLOT(slotUnwatch()),actions); - d->mAct[KFibsPlayerListPrivate::BlindAct] = new KAction(i18n("Blind"), 0, this, TQT_SLOT(slotBlind()), actions); - d->mAct[KFibsPlayerListPrivate::Update] = new KAction(i18n("Update"), 0, this, TQT_SLOT(slotUpdate()), actions); + d->mAct[KFibsPlayerListPrivate::Look] = new KAction(i18n("Look"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotLook()), actions); + d->mAct[KFibsPlayerListPrivate::Watch] = new KAction(i18n("Watch"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotWatch()), actions); + d->mAct[KFibsPlayerListPrivate::Unwatch] = new KAction(i18n("Unwatch"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotUnwatch()),actions); + d->mAct[KFibsPlayerListPrivate::BlindAct] = new KAction(i18n("Blind"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotBlind()), actions); + d->mAct[KFibsPlayerListPrivate::Update] = new KAction(i18n("Update"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotUpdate()), actions); - d->mAct[KFibsPlayerListPrivate::Reload] = KStdAction::redisplay(this, TQT_SLOT(slotReload()), actions); - d->mAct[KFibsPlayerListPrivate::Mail] = KStdAction::mail(this, TQT_SLOT(slotMail()), actions); - d->mAct[KFibsPlayerListPrivate::Close] = KStdAction::close(this, TQT_SLOT(hide()), actions); + d->mAct[KFibsPlayerListPrivate::Reload] = KStdAction::redisplay(TQT_TQOBJECT(this), TQT_SLOT(slotReload()), actions); + d->mAct[KFibsPlayerListPrivate::Mail] = KStdAction::mail(TQT_TQOBJECT(this), TQT_SLOT(slotMail()), actions); + d->mAct[KFibsPlayerListPrivate::Close] = KStdAction::close(TQT_TQOBJECT(this), TQT_SLOT(hide()), actions); - d->mAct[KFibsPlayerListPrivate::InviteD] = new KAction(i18n("Use Dialog"), 0, this, + d->mAct[KFibsPlayerListPrivate::InviteD] = new KAction(i18n("Use Dialog"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInviteD()), actions); - d->mAct[KFibsPlayerListPrivate::Invite1] = new KAction(i18n("1 Point Match"), 0, this, + d->mAct[KFibsPlayerListPrivate::Invite1] = new KAction(i18n("1 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite1()), actions); - d->mAct[KFibsPlayerListPrivate::Invite2] = new KAction(i18n("2 Point Match"), 0, this, + d->mAct[KFibsPlayerListPrivate::Invite2] = new KAction(i18n("2 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite2()), actions); - d->mAct[KFibsPlayerListPrivate::Invite3] = new KAction(i18n("3 Point Match"), 0, this, + d->mAct[KFibsPlayerListPrivate::Invite3] = new KAction(i18n("3 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite3()), actions); - d->mAct[KFibsPlayerListPrivate::Invite4] = new KAction(i18n("4 Point Match"), 0, this, + d->mAct[KFibsPlayerListPrivate::Invite4] = new KAction(i18n("4 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite4()), actions); - d->mAct[KFibsPlayerListPrivate::Invite5] = new KAction(i18n("5 Point Match"), 0, this, + d->mAct[KFibsPlayerListPrivate::Invite5] = new KAction(i18n("5 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite5()), actions); - d->mAct[KFibsPlayerListPrivate::Invite6] = new KAction(i18n("6 Point Match"), 0, this, + d->mAct[KFibsPlayerListPrivate::Invite6] = new KAction(i18n("6 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite6()), actions); - d->mAct[KFibsPlayerListPrivate::Invite7] = new KAction(i18n("7 Point Match"), 0, this, + d->mAct[KFibsPlayerListPrivate::Invite7] = new KAction(i18n("7 Point Match"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvite7()), actions); - d->mAct[KFibsPlayerListPrivate::InviteU] = new KAction(i18n("Unlimited"), 0, this, + d->mAct[KFibsPlayerListPrivate::InviteU] = new KAction(i18n("Unlimited"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInviteU()), actions); - d->mAct[KFibsPlayerListPrivate::InviteR] = new KAction(i18n("Resume"), 0, this, + d->mAct[KFibsPlayerListPrivate::InviteR] = new KAction(i18n("Resume"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInviteR()), actions); /* @@ -469,7 +469,7 @@ void KFibsPlayerList::getSetupPages(KTabCtl *nb, int space) gl = new TQGridLayout(gbl, LVEnd, 2, 20); gl->addWidget(lb, 0, 0); - // two column layout.... + // two column tqlayout.... for (i = 1; i < LVEnd/2; i++) { gl->addWidget(d->mCol[2*i-1]->cb, i, 0); gl->addWidget(d->mCol[2*i ]->cb, i, 1); @@ -483,7 +483,7 @@ void KFibsPlayerList::getSetupPages(KTabCtl *nb, int space) */ nb->addTab(w, i18n("&Playerlist")); - connect(nb, TQT_SIGNAL(applyButtonPressed()), this, TQT_SLOT(setupOk())); + connect(nb, TQT_SIGNAL(applyButtonPressed()), TQT_TQOBJECT(this), TQT_SLOT(setupOk())); } /* @@ -567,14 +567,14 @@ void KFibsPlayerList::showContextMenu(KListView *, TQListViewItem *i, const TQPo /* * Get the name of the selected player */ - d->mUser = (i ? i->text(Player) : TQString::null); + d->mUser = (i ? i->text(Player) : TQString()); - d->mAct[KFibsPlayerListPrivate::Info ]->setText(i18n("Info on %1" ).arg(d->mUser)); - d->mAct[KFibsPlayerListPrivate::Talk ]->setText(i18n("Talk to %1" ).arg(d->mUser)); - d->mAct[KFibsPlayerListPrivate::Mail ]->setText(i18n("Email to %1").arg(d->mUser)); - d->mAct[KFibsPlayerListPrivate::Look ]->setText(i18n("Look at %1" ).arg(d->mUser)); - d->mAct[KFibsPlayerListPrivate::Watch ]->setText(i18n("Watch %1" ).arg(d->mUser)); - d->mAct[KFibsPlayerListPrivate::Update]->setText(i18n("Update %1" ).arg(d->mUser)); + d->mAct[KFibsPlayerListPrivate::Info ]->setText(i18n("Info on %1" ).tqarg(d->mUser)); + d->mAct[KFibsPlayerListPrivate::Talk ]->setText(i18n("Talk to %1" ).tqarg(d->mUser)); + d->mAct[KFibsPlayerListPrivate::Mail ]->setText(i18n("Email to %1").tqarg(d->mUser)); + d->mAct[KFibsPlayerListPrivate::Look ]->setText(i18n("Look at %1" ).tqarg(d->mUser)); + d->mAct[KFibsPlayerListPrivate::Watch ]->setText(i18n("Watch %1" ).tqarg(d->mUser)); + d->mAct[KFibsPlayerListPrivate::Update]->setText(i18n("Update %1" ).tqarg(d->mUser)); d->mAct[KFibsPlayerListPrivate::Info ]->setEnabled(i); d->mAct[KFibsPlayerListPrivate::Talk ]->setEnabled(i); @@ -587,15 +587,15 @@ void KFibsPlayerList::showContextMenu(KListView *, TQListViewItem *i, const TQPo d->mAct[KFibsPlayerListPrivate::Unwatch]->setEnabled(d->mWatch); d->mPm[0]->setItemEnabled(d->mInID, i && d->mName != d->mUser); - d->mPm[0]->changeItem(d->mInID, i18n("Invite %1").arg(d->mUser)); + d->mPm[0]->changeItem(d->mInID, i18n("Invite %1").tqarg(d->mUser)); - d->mMail = (i && d->mCol[Email]->show ? i->text(d->mCol[Email]->index) : TQString::null); + d->mMail = (i && d->mCol[Email]->show ? i->text(d->mCol[Email]->index) : TQString()); d->mAct[KFibsPlayerListPrivate::Mail]->setEnabled(!d->mMail.isEmpty()); - if (i && d->mCol[Status]->show) + if (i && d->mCol[tqStatus]->show) d->mAct[KFibsPlayerListPrivate::BlindAct]->setText - ((i->text(d->mCol[Status]->index).contains(d->mAbrv[Blind])) ? - i18n("Unblind %1").arg(d->mUser) : i18n("Blind %1").arg(d->mUser)); + ((i->text(d->mCol[tqStatus]->index).tqcontains(d->mAbrv[Blind])) ? + i18n("Unblind %1").tqarg(d->mUser) : i18n("Blind %1").tqarg(d->mUser)); else d->mAct[KFibsPlayerListPrivate::BlindAct]->setText(i18n("Blind")); @@ -657,7 +657,7 @@ void KFibsPlayerList::slotLook() */ void KFibsPlayerList::slotMail() { - kapp->invokeMailer(d->mMail, TQString::null); + kapp->invokeMailer(d->mMail, TQString()); } /* @@ -721,7 +721,7 @@ void KFibsPlayerList::changePlayer(const TQString &line) TQDateTime fromEpoch; TQString str_entry[LVEnd], tmp; - entry[Status][0] = '\0'; + entry[tqStatus][0] = '\0'; // the line comes from FIBS and is 7 bit ASCII sscanf(line.latin1(), "%99s %99s %99s %1s %1s %99s %99s %99s %99s %99s %99s %99s", entry[Player], entry[Opponent], @@ -738,9 +738,9 @@ void KFibsPlayerList::changePlayer(const TQString &line) if ((str_entry[j] = entry[j]) == "-") str_entry[j] = ""; } - str_entry[Status].replace(Ready, 1, ready[0] == '0' ? "-" : d->mAbrv[Ready]); - str_entry[Status].replace(Away, 1, away [0] == '0' ? "-" : d->mAbrv[Away ]); - str_entry[Status].replace(Blind, 1, "-"); + str_entry[tqStatus].tqreplace(Ready, 1, ready[0] == '0' ? "-" : d->mAbrv[Ready]); + str_entry[tqStatus].tqreplace(Away, 1, away [0] == '0' ? "-" : d->mAbrv[Away ]); + str_entry[tqStatus].tqreplace(Blind, 1, "-"); // disable drawing until the end of update setUpdatesEnabled(false); @@ -758,9 +758,9 @@ void KFibsPlayerList::changePlayer(const TQString &line) i = new KFibsPlayerListLVI(this); // count the KFibs and KBackgammon clients - if (str_entry[Client].contains("KFibs")) + if (str_entry[Client].tqcontains("KFibs")) d->mCount[0]++; - else if (str_entry[Client].contains(PROG_NAME)) + else if (str_entry[Client].tqcontains(PROG_NAME)) d->mCount[1]++; // new entry requires an update to the player count @@ -771,7 +771,7 @@ void KFibsPlayerList::changePlayer(const TQString &line) found: // getting here means the player is in the list - update private status - str_entry[Status].replace(Blind,1,i->text(Status).contains + str_entry[tqStatus].tqreplace(Blind,1,i->text(tqStatus).tqcontains (d->mAbrv[Blind]) ? d->mAbrv[Blind] : "-"); update: @@ -794,9 +794,9 @@ void KFibsPlayerList::deletePlayer(const TQString &player) TQListViewItemIterator it(this); for ( ; it.current(); ++it) { if (it.current()->text(0) == player) { - if (it.current()->text(Client).contains(PROG_NAME)) + if (it.current()->text(Client).tqcontains(PROG_NAME)) --d->mCount[1]; - else if (it.current()->text(Client).contains("KFibs")) + else if (it.current()->text(Client).tqcontains("KFibs")) --d->mCount[0]; delete it.current(); updateCaption(); @@ -808,7 +808,7 @@ void KFibsPlayerList::deletePlayer(const TQString &player) /* * Set/Unset the status stat in the corresponding column of the list */ -void KFibsPlayerList::changePlayerStatus(const TQString &player, int stat, bool flag) +void KFibsPlayerList::changePlayertqStatus(const TQString &player, int stat, bool flag) { TQListViewItem *i = 0; @@ -827,7 +827,7 @@ void KFibsPlayerList::changePlayerStatus(const TQString &player, int stat, bool /* * Update the status flag */ - i->setText(Status, i->text(Status).replace(stat, 1, (flag) ? d->mAbrv[stat] : "-")); + i->setText(tqStatus, i->text(tqStatus).tqreplace(stat, 1, (flag) ? d->mAbrv[stat] : "-")); } @@ -886,7 +886,7 @@ void KFibsPlayerList::setName(const TQString &name) */ void KFibsPlayerList::updateCaption() { - setCaption(i18n("Player List - %1 - %2/%3").arg(childCount()).arg(d->mCount[0]).arg(d->mCount[1])); + setCaption(i18n("Player List - %1 - %2/%3").tqarg(childCount()).tqarg(d->mCount[0]).tqarg(d->mCount[1])); } /* diff --git a/kbackgammon/engines/fibs/kplayerlist.h b/kbackgammon/engines/fibs/kplayerlist.h index 27fd825f..7fe45218 100644 --- a/kbackgammon/engines/fibs/kplayerlist.h +++ b/kbackgammon/engines/fibs/kplayerlist.h @@ -46,24 +46,25 @@ class KFibsPlayerListPrivate; class KFibsPlayerList : public KListView { Q_OBJECT + TQ_OBJECT public: /** * Enumerate player status */ - enum PStatus {Ready, Away, Blind, MaxStatus}; + enum PtqStatus {Ready, Away, Blind, MaxtqStatus}; /** * Enumerate the different columns of the list */ - enum {Player, Opponent, Watches, Status, Rating, Experience, + enum {Player, Opponent, Watches, tqStatus, Rating, Experience, Idle, Time, Host, Client, Email, LVEnd}; /** * Constructor */ - KFibsPlayerList(TQWidget *parent = 0, const char *name = 0); + KFibsPlayerList(TQWidget *tqparent = 0, const char *name = 0); /** * Destructor @@ -110,7 +111,7 @@ public slots: /** * Change the status of a player */ - void changePlayerStatus(const TQString &player, int stat, bool flag); + void changePlayertqStatus(const TQString &player, int stat, bool flag); /** * Fills the playerlist page into the notebook diff --git a/kbackgammon/engines/generic/kbgengine.cpp b/kbackgammon/engines/generic/kbgengine.cpp index 59c19e2f..ac217bd0 100644 --- a/kbackgammon/engines/generic/kbgengine.cpp +++ b/kbackgammon/engines/generic/kbgengine.cpp @@ -31,10 +31,10 @@ /* - * Constructor initializes the QObject + * Constructor initializes the TQObject */ -KBgEngine::KBgEngine(TQWidget *parent, TQString *name, TQPopupMenu *pmenu) - : TQObject(parent, name->local8Bit()) +KBgEngine::KBgEngine(TQWidget *tqparent, TQString *name, TQPopupMenu *pmenu) + : TQObject(tqparent, name->local8Bit()) { menu = pmenu; cl = -1; diff --git a/kbackgammon/engines/generic/kbgengine.h b/kbackgammon/engines/generic/kbgengine.h index d254a910..c43b31b5 100644 --- a/kbackgammon/engines/generic/kbgengine.h +++ b/kbackgammon/engines/generic/kbgengine.h @@ -35,7 +35,7 @@ class TQPopupMenu; class KDialogBase; -class KBgStatus; +class KBgtqStatus; /** * @@ -58,16 +58,18 @@ class KBgStatus; * @author Jens Hoefkens * */ -class KBgEngine:public QObject +class KBgEngine:public TQObject { - Q_OBJECT public: + Q_OBJECT + TQ_OBJECT +public: enum Command { Redo, Undo, Roll, Cube, Done, Load }; /** * Constructor */ - KBgEngine (TQWidget * parent = 0, TQString * name = 0, TQPopupMenu * pmenu = 0); + KBgEngine (TQWidget * tqparent = 0, TQString * name = 0, TQPopupMenu * pmenu = 0); /** * Destructor @@ -247,12 +249,12 @@ signals: /** * Emit the most recent game state */ - void newState (const KBgStatus &); + void newState (const KBgtqStatus &); /** * Tell the board that we need the current state of the board. */ - void getState (KBgStatus *); + void getState (KBgtqStatus *); /** * Starts/ends the edit mode of the board diff --git a/kbackgammon/engines/gnubg/kbggnubg.cpp b/kbackgammon/engines/gnubg/kbggnubg.cpp index d17a6f88..e6f853a2 100644 --- a/kbackgammon/engines/gnubg/kbggnubg.cpp +++ b/kbackgammon/engines/gnubg/kbggnubg.cpp @@ -85,7 +85,7 @@ void KBgEngineGNU::handleLine(const TQString &l) /* * Start of a new game/match */ - if (line.contains(TQRegExp("^gnubg rolls [1-6], .* rolls [1-6]\\."))) { + if (line.tqcontains(TQRegExp("^gnubg rolls [1-6], .* rolls [1-6]\\."))) { KRegExp e("^gnubg rolls ([1-6]), .* rolls ([1-6])\\."); e.match(line.latin1()); if (int r = strcmp(e.group(1), e.group(2))) @@ -95,14 +95,14 @@ void KBgEngineGNU::handleLine(const TQString &l) /* * Bug fixes for older versions of GNUBG - to be removed */ - if (line.contains(TQRegExp("^.* cannot move\\..+$"))) { + if (line.tqcontains(TQRegExp("^.* cannot move\\..+$"))) { KRegExp e("(^.* cannot move.)(.*$)"); e.match(line.latin1()); handleLine(e.group(1)); handleLine(e.group(2)); return; } - if (line.contains(TQRegExp("^Are you sure you want to start a new game, and discard the one in progress\\?"))) { + if (line.tqcontains(TQRegExp("^Are you sure you want to start a new game, and discard the one in progress\\?"))) { KRegExp e("(^Are you sure you want to start a new game, and discard the one in progress\\? )(.+$)"); e.match(line.latin1()); handleLine(e.group(1)); @@ -113,25 +113,25 @@ void KBgEngineGNU::handleLine(const TQString &l) /* * Cube handling */ - if (line.contains(TQRegExp("^gnubg accepts and immediately redoubles to [0-9]+\\.$"))) { + if (line.tqcontains(TQRegExp("^gnubg accepts and immediately redoubles to [0-9]+\\.$"))) { // redoubles mess up the game counter "turn" - //KBgStatus st(board); + //KBgtqStatus st(board); //st.setCube(32, BOTH); //emit newState(st); } - if (line.contains(TQRegExp("^gnubg doubles\\.$"))) { + if (line.tqcontains(TQRegExp("^gnubg doubles\\.$"))) { // TODO: we need some generic class for this. the class // can be shared between all engines #if 0 - KBgStatus st(board); + KBgtqStatus st(board); int ret = KMessageBox::warningYesNoCancel - (0, i18n("gnubg doubles the cube to %1.").arg(2*st.cube(THEM)), + (0, i18n("gnubg doubles the cube to %1.").tqarg(2*st.cube(THEM)), i18n("gnubg doubles"), i18n("&Accept"), i18n("Re&double"), i18n("&Reject"), true); @@ -155,16 +155,16 @@ void KBgEngineGNU::handleLine(const TQString &l) /* * Ignore the following messages */ - if (line.contains(TQRegExp("^TTY boards will be given in raw format"))) { + if (line.tqcontains(TQRegExp("^TTY boards will be given in raw format"))) { line = " "; } /* * Board messages */ - if (line.contains(TQRegExp("^board:"))) { + if (line.tqcontains(TQRegExp("^board:"))) { - KBgStatus st(line); + KBgtqStatus st(line); /* * Do preliminary analysis of board @@ -199,7 +199,7 @@ void KBgEngineGNU::handleLine(const TQString &l) case uMove: st.setDice(THEM, 0, 0); st.setDice(THEM, 1, 0); - emit infoText(i18n("You roll %1 and %2.").arg(st.dice(US, 0)).arg(st.dice(US, 1))); + emit infoText(i18n("You roll %1 and %2.").tqarg(st.dice(US, 0)).tqarg(st.dice(US, 1))); switch (st.moves()) { case 0: // get a message @@ -208,7 +208,7 @@ void KBgEngineGNU::handleLine(const TQString &l) emit infoText(i18n("Please move 1 piece.")); break; default: - emit infoText(i18n("Please move %1 pieces.").arg(st.moves())); + emit infoText(i18n("Please move %1 pieces.").tqarg(st.moves())); break; } emit allowCommand(Roll, false); @@ -220,7 +220,7 @@ void KBgEngineGNU::handleLine(const TQString &l) case tMove: st.setDice(US, 0, 0); st.setDice(US, 1, 0); - emit infoText(i18n("gnubg rolls %1 and %2.").arg(st.dice(THEM, 0)).arg(st.dice(THEM, 1))); + emit infoText(i18n("gnubg rolls %1 and %2.").tqarg(st.dice(THEM, 0)).tqarg(st.dice(THEM, 1))); if (st.moves() == 0) emit infoText(i18n("gnubg cannot move.")); @@ -236,7 +236,7 @@ void KBgEngineGNU::handleLine(const TQString &l) emit allowMoving(st.turn() == US); emit newState(st); - emit statText(i18n("%1 vs. %2").arg(st.player(US)).arg(st.player(THEM))); + emit statText(i18n("%1 vs. %2").tqarg(st.player(US)).tqarg(st.player(THEM))); emit allowCommand(Load, true ); emit allowCommand(Undo, false); @@ -248,7 +248,7 @@ void KBgEngineGNU::handleLine(const TQString &l) /* * Show the line... */ - line.replace(TQRegExp(" "), " "); + line.tqreplace(TQRegExp(" "), " "); if (!line.isEmpty()) emit infoText(line); } @@ -275,10 +275,10 @@ void KBgEngineGNU::newGame() /* * If there is a game running we warn the user first */ - if (gameRunning && (KMessageBox::warningYesNo((TQWidget *)parent(), + if (gameRunning && (KMessageBox::warningYesNo((TQWidget *)tqparent(), i18n("A game is currently in progress. " "Starting a new one will terminate it."), - TQString::null, i18n("Start New Game"), i18n("Continue Old Game")) + TQString(), i18n("Start New Game"), i18n("Continue Old Game")) == KMessageBox::No)) return; @@ -422,8 +422,8 @@ void KBgEngineGNU::saveConfig() /* * Constructor */ -KBgEngineGNU::KBgEngineGNU(TQWidget *parent, TQString *name, TQPopupMenu *pmenu) - : KBgEngine(parent, name, pmenu) +KBgEngineGNU::KBgEngineGNU(TQWidget *tqparent, TQString *name, TQPopupMenu *pmenu) + : KBgEngine(tqparent, name, pmenu) { // obsolete nameUS = "US"; @@ -503,7 +503,7 @@ void KBgEngineGNU::startGNU() resAction->setEnabled(false); if (!gnubg.start(KProcess::NotifyOnExit, KProcess::All)) - KMessageBox::information((TQWidget *)parent(), + KMessageBox::information((TQWidget *)tqparent(), i18n("Could not start the GNU Backgammon process.\n" "Make sure the program is in your PATH and is " "called \"gnubg\".\n" @@ -533,7 +533,7 @@ void KBgEngineGNU::gnubgExit(KProcess *proc) emit allowMoving(false); emit infoText(TQString("
") + i18n("The GNU Backgammon process (%1) has exited. ") - .arg(proc->pid()) + "
"); + .tqarg(proc->pid()) + "
"); resAction->setEnabled(true); } @@ -564,12 +564,12 @@ void KBgEngineGNU::nextCommand() TQString s = (*it) + "\n"; if (!gnubg.writeStdin(s.latin1(), strlen(s.latin1()))) { cmdTimer->start(250, true); - cmdList.remove(TQString::null); + cmdList.remove(TQString()); return; } - (*it) = TQString::null; + (*it) = TQString(); } - cmdList.remove(TQString::null); + cmdList.remove(TQString()); cmdTimer->stop(); } @@ -625,9 +625,9 @@ void KBgEngineGNU::done() emit allowCommand(Redo, false); // Transform the string to FIBS format - lastmove.replace(0, 2, "move "); - lastmove.replace(TQRegExp("\\+"), " "); - lastmove.replace(TQRegExp("\\-"), " "); + lastmove.tqreplace(0, 2, "move "); + lastmove.tqreplace(TQRegExp("\\+"), " "); + lastmove.tqreplace(TQRegExp("\\-"), " "); // sent it to the server handleCommand(lastmove); @@ -669,7 +669,7 @@ void KBgEngineGNU::handleMove(TQString *s) lastmove = *s; int index = 0; - TQString t = s->mid(index, s->find(' ', index)); + TQString t = s->mid(index, s->tqfind(' ', index)); index += 1 + t.length(); int moves = t.toInt(); diff --git a/kbackgammon/engines/gnubg/kbggnubg.h b/kbackgammon/engines/gnubg/kbggnubg.h index acb007f1..78b4566e 100644 --- a/kbackgammon/engines/gnubg/kbggnubg.h +++ b/kbackgammon/engines/gnubg/kbggnubg.h @@ -44,13 +44,14 @@ class KBgEngineGNU : public KBgEngine { Q_OBJECT + TQ_OBJECT public: /* * Constructor and destructor */ - KBgEngineGNU(TQWidget *parent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0); + KBgEngineGNU(TQWidget *tqparent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0); virtual ~KBgEngineGNU(); /** diff --git a/kbackgammon/engines/nextgen/kbggame.cpp b/kbackgammon/engines/nextgen/kbggame.cpp index 13ae076a..d00c1966 100644 --- a/kbackgammon/engines/nextgen/kbggame.cpp +++ b/kbackgammon/engines/nextgen/kbggame.cpp @@ -31,15 +31,15 @@ /* * Constructor */ -KBgGame::KBgGame(int cookie, TQObject *parent) - : KGame(cookie, parent) +KBgGame::KBgGame(int cookie, TQObject *tqparent) + : KGame(cookie, tqparent) { // do nothing... } bool KBgGame::playerInput(TQDataStream &msg,KPlayer *player) { - Q_INT32 move; + TQ_INT32 move; msg >> move; cerr << " Player " << player->id() << " moved to " << move << endl; return true; diff --git a/kbackgammon/engines/nextgen/kbggame.h b/kbackgammon/engines/nextgen/kbggame.h index 7888be62..255a3483 100644 --- a/kbackgammon/engines/nextgen/kbggame.h +++ b/kbackgammon/engines/nextgen/kbggame.h @@ -40,12 +40,13 @@ class KPlayer; class KDE_EXPORT KBgGame : public KGame { Q_OBJECT + TQ_OBJECT public: enum MsgID {Text, Cmd, MaxMsg}; - KBgGame(int cookie = 42, TQObject *parent = 0); + KBgGame(int cookie = 42, TQObject *tqparent = 0); protected: diff --git a/kbackgammon/engines/nextgen/kbgng.cpp b/kbackgammon/engines/nextgen/kbgng.cpp index 302cbb58..f2f04066 100644 --- a/kbackgammon/engines/nextgen/kbgng.cpp +++ b/kbackgammon/engines/nextgen/kbgng.cpp @@ -51,8 +51,8 @@ /* * Constructor */ -KBgEngineNg::KBgEngineNg(TQWidget *parent, TQString *name, TQPopupMenu *pmenu) - : KBgEngine(parent, name, pmenu) +KBgEngineNg::KBgEngineNg(TQWidget *tqparent, TQString *name, TQPopupMenu *pmenu) + : KBgEngine(tqparent, name, pmenu) { // get a new game initGame(); @@ -124,7 +124,7 @@ void KBgEngineNg::setGame() // initialize a new game bool ret = false; TQString label, port_s, host_s; - Q_UINT16 port; + TQ_UINT16 port; switch (_currGame = _gameSelect->currentItem()) { @@ -140,7 +140,7 @@ void KBgEngineNg::setGame() "65535."); port_s.setNum(_port); do { - port_s = KLineEditDlg::getText(label, port_s, &ret, (TQWidget *)parent()); + port_s = KLineEditDlg::getText(label, port_s, &ret, (TQWidget *)tqparent()); if (!ret) return; port = port_s.toUShort(&ret); @@ -150,7 +150,7 @@ void KBgEngineNg::setGame() emit infoText(i18n("Now waiting for incoming connections on port %1."). arg(_port = port)); else - emit infoText(i18n("Failed to offer connections on port %1.").arg(port)); + emit infoText(i18n("Failed to offer connections on port %1.").tqarg(port)); _game->addPlayer(createPlayer(0, _name[0])); break; @@ -159,16 +159,16 @@ void KBgEngineNg::setGame() label = i18n("Type the name of the server you want to connect to:"); host_s = _host; do { - host_s = KLineEditDlg::getText(label, host_s, &ret, (TQWidget *)parent()); + host_s = KLineEditDlg::getText(label, host_s, &ret, (TQWidget *)tqparent()); if (!ret) return; } while (host_s.isEmpty()); label = i18n("Type the port number on %1 you want to connect to.\nThe " - "number should be between 1024 and 65535.").arg(host_s); + "number should be between 1024 and 65535.").tqarg(host_s); port_s.setNum(_port); do { - port_s = KLineEditDlg::getText(label, port_s, &ret, (TQWidget *)parent()); + port_s = KLineEditDlg::getText(label, port_s, &ret, (TQWidget *)tqparent()); if (!ret) return; port = port_s.toUShort(&ret); @@ -183,10 +183,10 @@ void KBgEngineNg::setGame() _game->addPlayer(createPlayer(0, _name[0])); if (_game->connectToServer(host_s, port)) - emit infoText(i18n("Now connected to %1:%2.").arg(_host = host_s). + emit infoText(i18n("Now connected to %1:%2.").tqarg(_host = host_s). arg(_port = port)); else - emit infoText(i18n("Failed to connect to %1:%2.").arg(_host = host_s). + emit infoText(i18n("Failed to connect to %1:%2.").tqarg(_host = host_s). arg(_port = port)); // @@ -202,13 +202,13 @@ void KBgEngineNg::setGame() // we are still having problems with player creation... - // FIXME - which status _game->setGameStatus(KGame::End); + // FIXME - which status _game->setGametqStatus(KGame::End); } void KBgEngineNg::slotPlayerJoinedGame(KPlayer *p) { - emit infoText(i18n("Player %1 (%2) has joined the game.").arg(p->name()).arg(p->id())); - cerr << i18n("Player %1 (%2) has joined the game.").arg(p->name()).arg(p->id()).latin1() << endl; + emit infoText(i18n("Player %1 (%2) has joined the game.").tqarg(p->name()).tqarg(p->id())); + cerr << i18n("Player %1 (%2) has joined the game.").tqarg(p->name()).tqarg(p->id()).latin1() << endl; } void KBgEngineNg::slotCreatePlayer(KPlayer *&p, int rtti, int io, bool v, KGame *g) @@ -216,16 +216,16 @@ void KBgEngineNg::slotCreatePlayer(KPlayer *&p, int rtti, int io, bool v, KGame Q_UNUSED(rtti) Q_UNUSED(g) Q_UNUSED(io) - emit infoText(i18n("creating player. virtual=%1").arg(v)); + emit infoText(i18n("creating player. virtual=%1").tqarg(v)); p = createPlayer(1); } -void KBgEngineNg::slotClientConnected(Q_UINT32) +void KBgEngineNg::slotClientConnected(TQ_UINT32) { cerr << "client has joint the game..." << endl; } -void KBgEngineNg::slotClientDisconnected(Q_UINT32, bool) +void KBgEngineNg::slotClientDisconnected(TQ_UINT32, bool) { cerr << "KBgEngineNg::slotClientDisconnected" << endl; } @@ -507,7 +507,7 @@ void KBgEngineNg::slotPropertyChanged(KGamePropertyBase *p, KPlayer *me) case KGamePropertyBase::IdName: emit infoText(i18n("Player %1 has changed the name to %2.") - .arg(_name[player]).arg(me->name())); + .tqarg(_name[player]).tqarg(me->name())); _name[player] = me->name(); break; @@ -542,14 +542,14 @@ void KBgEngineNg::changeName() TQString name; for (int i = 0; i < 2; i++) { - name = TQString::null; + name = TQString(); while (!_player[i]->isVirtual() && name.isEmpty()) { if (i == 0) name = KLineEditDlg::getText(i18n("Type the name of the first player:"), - _name[i], &ok, (TQWidget *)parent()); + _name[i], &ok, (TQWidget *)tqparent()); else name = KLineEditDlg::getText(i18n("Type the name of the second player:"), - _name[i], &ok, (TQWidget *)parent()); + _name[i], &ok, (TQWidget *)tqparent()); if (!ok) return; _player[i]->setName(name); } @@ -559,7 +559,7 @@ void KBgEngineNg::changeName() /* * Receive data sent via KBgGame::sendMessage(...) */ -void KBgEngineNg::slotNetworkData(int msgid, const TQByteArray &msg, Q_UINT32 r, Q_UINT32 s) +void KBgEngineNg::slotNetworkData(int msgid, const TQByteArray &msg, TQ_UINT32 r, TQ_UINT32 s) { Q_UNUSED(r); Q_UNUSED(s); @@ -567,8 +567,8 @@ void KBgEngineNg::slotNetworkData(int msgid, const TQByteArray &msg, Q_UINT32 r, case KBgGame::Cmd: emit infoText(msg); - emit infoText(i18n("Players are %1 and %2").arg(_player[0]->name()) - .arg(_player[1]->name())); + emit infoText(i18n("Players are %1 and %2").tqarg(_player[0]->name()) + .tqarg(_player[1]->name())); break; default: @@ -608,15 +608,15 @@ void KBgEngineNg::initGame() connect(_game, TQT_SIGNAL(signalCreatePlayer(KPlayer *&, int, int, bool, KGame *)), this, TQT_SLOT(slotCreatePlayer(KPlayer *&, int, int, bool, KGame *))); - connect(_game, TQT_SIGNAL(signalClientConnected(Q_UINT32)), - this, TQT_SLOT(slotClientConnected(Q_UINT32))); - connect(_game, TQT_SIGNAL(signalClientDisconnected(Q_UINT32, bool)), - this, TQT_SLOT(slotClientDisconnected(Q_UINT32, bool))); + connect(_game, TQT_SIGNAL(signalClientConnected(TQ_UINT32)), + this, TQT_SLOT(slotClientConnected(TQ_UINT32))); + connect(_game, TQT_SIGNAL(signalClientDisconnected(TQ_UINT32, bool)), + this, TQT_SLOT(slotClientDisconnected(TQ_UINT32, bool))); connect(_game, TQT_SIGNAL(signalPropertyChanged(KGamePropertyBase *, KGame *)), this, TQT_SLOT(slotPropertyChanged(KGamePropertyBase *, KGame *))); - connect(_game, TQT_SIGNAL(signalNetworkData(int,const TQByteArray &, Q_UINT32, Q_UINT32)), - this, TQT_SLOT(slotNetworkData(int,const TQByteArray &, Q_UINT32, Q_UINT32))); + connect(_game, TQT_SIGNAL(signalNetworkData(int,const TQByteArray &, TQ_UINT32, TQ_UINT32)), + this, TQT_SLOT(slotNetworkData(int,const TQByteArray &, TQ_UINT32, TQ_UINT32))); } // EOF diff --git a/kbackgammon/engines/nextgen/kbgng.h b/kbackgammon/engines/nextgen/kbgng.h index 99ea82c1..12c94140 100644 --- a/kbackgammon/engines/nextgen/kbgng.h +++ b/kbackgammon/engines/nextgen/kbgng.h @@ -51,13 +51,14 @@ class KBgEngineNg : public KBgEngine { Q_OBJECT + TQ_OBJECT public: /* * Constructor and destructor */ - KBgEngineNg( TQWidget *parent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0); + KBgEngineNg( TQWidget *tqparent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0); virtual ~KBgEngineNg(); /** @@ -152,11 +153,11 @@ public slots: void slotPlayerJoinedGame(KPlayer *p); - void slotNetworkData(int msgid, const TQByteArray &msg, Q_UINT32 receiver, Q_UINT32 sender); + void slotNetworkData(int msgid, const TQByteArray &msg, TQ_UINT32 receiver, TQ_UINT32 sender); void slotCreatePlayer(KPlayer *&, int, int, bool, KGame *); - void slotClientDisconnected(Q_UINT32, bool); - void slotClientConnected(Q_UINT32); + void slotClientDisconnected(TQ_UINT32, bool); + void slotClientConnected(TQ_UINT32); void slotPropertyChanged(KGamePropertyBase *p, KGame *me); void slotPropertyChanged(KGamePropertyBase *p, KPlayer *me); @@ -220,7 +221,7 @@ private: int _nplayers; TQString _host; - Q_UINT16 _port; + TQ_UINT16 _port; // ************************************************************ // ************************************************************ @@ -244,11 +245,11 @@ private: /** * Create the i-th player. Legal values for i are 0 and 1. The - * name of the player is taken from @ref _name and the parent of + * name of the player is taken from @ref _name and the tqparent of * the player is @ref _player. That means that the players are * automatically deleted. */ - KBgPlayer * createPlayer(int i, TQString name = TQString::null); + KBgPlayer * createPlayer(int i, TQString name = TQString()); private: diff --git a/kbackgammon/engines/nextgen/kbgplayer.h b/kbackgammon/engines/nextgen/kbgplayer.h index 8d6536de..c9fcdb1c 100644 --- a/kbackgammon/engines/nextgen/kbgplayer.h +++ b/kbackgammon/engines/nextgen/kbgplayer.h @@ -41,6 +41,7 @@ class KGame; class KBgPlayer : public KPlayer { Q_OBJECT + TQ_OBJECT public: diff --git a/kbackgammon/engines/offline/kbgoffline.cpp b/kbackgammon/engines/offline/kbgoffline.cpp index 4a9e1755..14197f54 100644 --- a/kbackgammon/engines/offline/kbgoffline.cpp +++ b/kbackgammon/engines/offline/kbgoffline.cpp @@ -60,7 +60,7 @@ public: /* * Store two copies of the game: one backup and a working copy */ - KBgStatus mGame[2]; + KBgtqStatus mGame[2]; /* * Use the standard method of obtaining random numbers @@ -106,8 +106,8 @@ public: /* * Constructor */ -KBgEngineOffline::KBgEngineOffline(TQWidget *parent, TQString *name, TQPopupMenu *pmenu) - : KBgEngine(parent, name, pmenu) +KBgEngineOffline::KBgEngineOffline(TQWidget *tqparent, TQString *name, TQPopupMenu *pmenu) + : KBgEngine(tqparent, name, pmenu) { d = new KBgEngineOfflinePrivate(); @@ -282,10 +282,10 @@ void KBgEngineOffline::newGame() /* * If there is a game running we warn the user first */ - if (d->mGameFlag && (KMessageBox::warningYesNo((TQWidget *)parent(), + if (d->mGameFlag && (KMessageBox::warningYesNo((TQWidget *)tqparent(), i18n("A game is currently in progress. " "Starting a new one will terminate it."), - TQString::null, i18n("Start New Game"), + TQString(), i18n("Start New Game"), i18n("Continue Old Game")) == KMessageBox::No)) return; @@ -318,14 +318,14 @@ void KBgEngineOffline::newGame() u = getRandom(); t = getRandom(); emit infoText(i18n("%1 rolls %2, %3 rolls %4."). - arg(d->mName[0]).arg(u).arg(d->mName[1]).arg(t)); + tqarg(d->mName[0]).tqarg(u).tqarg(d->mName[1]).tqarg(t)); } if (u > t) { - emit infoText(i18n("%1 makes the first move.").arg(d->mName[0])); + emit infoText(i18n("%1 makes the first move.").tqarg(d->mName[0])); d->mRoll = US; } else { - emit infoText(i18n("%1 makes the first move.").arg(d->mName[1])); + emit infoText(i18n("%1 makes the first move.").tqarg(d->mName[1])); d->mRoll = THEM; int n = u; u = t; t = n; } @@ -338,7 +338,7 @@ void KBgEngineOffline::newGame() /* * tell the user */ - emit statText(i18n("%1 vs. %2").arg(d->mName[0]).arg(d->mName[1])); + emit statText(i18n("%1 vs. %2").tqarg(d->mName[0]).tqarg(d->mName[1])); } /* @@ -397,7 +397,7 @@ bool KBgEngineOffline::queryPlayerName(int w) } do { - *name = KLineEditDlg::getText(text, *name, &ret, (TQWidget *)parent()); + *name = KLineEditDlg::getText(text, *name, &ret, (TQWidget *)tqparent()); if (!ret) break; } while (name->isEmpty()); @@ -484,7 +484,7 @@ void KBgEngineOffline::redo() void KBgEngineOffline::handleMove(TQString *s) { int index = 0; - TQString t = s->mid(index, s->find(' ', index)); + TQString t = s->mid(index, s->tqfind(' ', index)); index += 1 + t.length(); int moves = t.toInt(); @@ -510,22 +510,22 @@ void KBgEngineOffline::handleMove(TQString *s) */ for (int i = 0; i < moves; i++) { bool kick = false; - t = s->mid(index, s->find(' ', index) - index); + t = s->mid(index, s->tqfind(' ', index) - index); index += 1 + t.length(); char c = '-'; - if (t.contains('+')) { + if (t.tqcontains('+')) { c = '+'; kick = true; } - TQString r = t.left(t.find(c)); - if (r.contains("bar")) { + TQString r = t.left(t.tqfind(c)); + if (r.tqcontains("bar")) { d->mGame[0].setBar(d->mRoll, abs(d->mGame[0].bar(d->mRoll)) - 1); } else { int from = r.toInt(); d->mGame[0].setBoard(from, d->mRoll, abs(d->mGame[0].board(from)) - 1); } t.remove(0, 1 + r.length()); - if (t.contains("off")) { + if (t.tqcontains("off")) { d->mGame[0].setHome(d->mRoll, abs(d->mGame[0].home(d->mRoll)) + 1); } else { int to = t.toInt(); @@ -645,7 +645,7 @@ void KBgEngineOffline::cube() if (d->mRollFlag && d->mGame[0].cube(w) > 0) { emit allowCommand(Cube, false); - if (KMessageBox::questionYesNo((TQWidget *)parent(), + if (KMessageBox::questionYesNo((TQWidget *)tqparent(), i18n("%1 has doubled. %2, do you accept the double?"). arg((w == THEM) ? d->mName[1] : d->mName[0]). arg((w == US) ? d->mName[1] : d->mName[0]), @@ -695,9 +695,9 @@ bool KBgEngineOffline::queryClose() if (!d->mGameFlag) return true; - switch (KMessageBox::warningContinueCancel((TQWidget *)parent(), + switch (KMessageBox::warningContinueCancel((TQWidget *)tqparent(), i18n("In the middle of a game. " - "Really quit?"), TQString::null, KStdGuiItem::quit())) { + "Really quit?"), TQString(), KStdGuiItem::quit())) { case KMessageBox::Continue : return TRUE; case KMessageBox::Cancel : @@ -722,7 +722,7 @@ bool KBgEngineOffline::queryExit() void KBgEngineOffline::handleCommand(const TQString& cmd) { emit infoText(i18n("Text commands are not yet working. " - "The command '%1' has been ignored.").arg(cmd)); + "The command '%1' has been ignored.").tqarg(cmd)); } /* @@ -791,11 +791,11 @@ void KBgEngineOffline::toggleEditMode() emit allowCommand(Roll, false); emit allowCommand(Done, false); emit allowCommand(Cube, false); - emit statText(i18n("%1 vs. %2 - Edit Mode").arg(d->mName[0]).arg(d->mName[1])); + emit statText(i18n("%1 vs. %2 - Edit Mode").tqarg(d->mName[0]).tqarg(d->mName[1])); } else { d->mNew->setEnabled(true); d->mSwap->setEnabled(true); - emit statText(i18n("%1 vs. %2").arg(d->mName[0]).arg(d->mName[1])); + emit statText(i18n("%1 vs. %2").tqarg(d->mName[0]).tqarg(d->mName[1])); emit getState(&d->mGame[1]); d->mGame[0] = d->mGame[1]; emit allowCommand(Done, d->mDoneFlag); diff --git a/kbackgammon/engines/offline/kbgoffline.h b/kbackgammon/engines/offline/kbgoffline.h index 8a6448fb..a0217920 100644 --- a/kbackgammon/engines/offline/kbgoffline.h +++ b/kbackgammon/engines/offline/kbgoffline.h @@ -49,13 +49,14 @@ class KBgEngineOfflinePrivate; class KBgEngineOffline : public KBgEngine { Q_OBJECT + TQ_OBJECT public: /** * Constructor */ - KBgEngineOffline(TQWidget *parent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0); + KBgEngineOffline(TQWidget *tqparent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0); /** * Destructor diff --git a/kbackgammon/kbg.cpp b/kbackgammon/kbg.cpp index 711471ad..0c01d8f1 100644 --- a/kbackgammon/kbg.cpp +++ b/kbackgammon/kbg.cpp @@ -89,7 +89,7 @@ KBg::KBg() /* * The main view is shared between the board and a small text window */ - panner = new TQSplitter(Vertical, this, "panner"); + panner = new TQSplitter(Qt::Vertical, this, "panner"); board = new KBgBoardSetup(panner, "board"); status = new KBgTextView(panner, "status"); setCentralWidget(panner); @@ -97,45 +97,45 @@ KBg::KBg() /* * Create all actions needed by the application */ - newAction = KStdGameAction::gameNew(this, TQT_SLOT(openNew()), actionCollection()); + newAction = KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(openNew()), actionCollection()); newAction->setEnabled(false); - KStdGameAction::print(this, TQT_SLOT(print()), actionCollection()); - KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); + KStdGameAction::print(TQT_TQOBJECT(this), TQT_SLOT(print()), actionCollection()); + KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); TQStringList list; for (int i = 0; i < MaxEngine; i++) list.append(engineString[i]); - engineSet = new KSelectAction(i18n("&Engine"), 0, this, TQT_SLOT(setupEngine()), actionCollection(), + engineSet = new KSelectAction(i18n("&Engine"), 0, TQT_TQOBJECT(this), TQT_SLOT(setupEngine()), actionCollection(), "move_engine"); engineSet->setItems(list); // AB: what the heck has this to do with redisplay? perhaps use reload instead? - loadAction = KStdAction::redisplay(this, TQT_SLOT(load()), actionCollection(), "move_load"); + loadAction = KStdAction::redisplay(TQT_TQOBJECT(this), TQT_SLOT(load()), actionCollection(), "move_load"); loadAction->setEnabled(false); - undoAction = KStdGameAction::undo(this, TQT_SLOT(undo()), actionCollection()); + undoAction = KStdGameAction::undo(TQT_TQOBJECT(this), TQT_SLOT(undo()), actionCollection()); undoAction->setEnabled(false); - redoAction = KStdGameAction::redo(this, TQT_SLOT(redo()), actionCollection()); + redoAction = KStdGameAction::redo(TQT_TQOBJECT(this), TQT_SLOT(redo()), actionCollection()); redoAction->setEnabled(false); - rollAction = KStdGameAction::roll(this, TQT_SLOT(roll()), actionCollection()); + rollAction = KStdGameAction::roll(TQT_TQOBJECT(this), TQT_SLOT(roll()), actionCollection()); rollAction->setEnabled(false); - endAction = KStdGameAction::endTurn(this, TQT_SLOT(done()), actionCollection()); + endAction = KStdGameAction::endTurn(TQT_TQOBJECT(this), TQT_SLOT(done()), actionCollection()); endAction->setEnabled(false); cubeAction = new KAction(i18n("Double Cube"), TQIconSet(kapp->iconLoader()->loadIcon (PROG_NAME "-double.xpm", KIcon::Toolbar)), - 0, this, TQT_SLOT(cube()), actionCollection(), "move_cube"); + 0, TQT_TQOBJECT(this), TQT_SLOT(cube()), actionCollection(), "move_cube"); cubeAction->setEnabled(false); - KStdAction::showMenubar(this, TQT_SLOT(toggleMenubar()), actionCollection()); - KStdAction::preferences(this, TQT_SLOT(setupDlg()), actionCollection()); - KStdAction::saveOptions(this, TQT_SLOT(saveConfig()), actionCollection()); + KStdAction::showMenubar(TQT_TQOBJECT(this), TQT_SLOT(toggleMenubar()), actionCollection()); + KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(setupDlg()), actionCollection()); + KStdAction::saveOptions(TQT_TQOBJECT(this), TQT_SLOT(saveConfig()), actionCollection()); KPopupMenu *p = (new KActionMenu(i18n("&Backgammon on the Web"), actionCollection(), "help_www"))->popupMenu(); - (new KAction(helpTopic[FIBSHome][0], 0, this, TQT_SLOT(wwwFIBS()), + (new KAction(helpTopic[FIBSHome][0], 0, TQT_TQOBJECT(this), TQT_SLOT(wwwFIBS()), actionCollection(), "help_www_fibs"))->plug(p); - (new KAction(helpTopic[RuleHome][0], 0, this, TQT_SLOT(wwwRule()), + (new KAction(helpTopic[RuleHome][0], 0, TQT_TQOBJECT(this), TQT_SLOT(wwwRule()), actionCollection(), "help_www_rule"))->plug(p); /* @@ -145,11 +145,11 @@ KBg::KBg() cmdLabel = new TQLabel(i18n("Command: "), this); new KWidgetAction( cmdLabel, cmdLabel->text(), 0, 0, 0, actionCollection(), "command_label"); cmdLine = new KLineEdit(this, "commandline"); - KWidgetAction* actionCmdLine = new KWidgetAction( cmdLine, TQString::null, 0, 0, 0, actionCollection(), "command_lineedit"); + KWidgetAction* actionCmdLine = new KWidgetAction( cmdLine, TQString(), 0, 0, 0, actionCollection(), "command_lineedit"); actionCmdLine->setAutoSized(true); cmdLine->completionObject()->setOrder(KCompletion::Weighted); - connect(cmdLine, TQT_SIGNAL(returnPressed(const TQString &)), this, TQT_SLOT(handleCmd(const TQString &))); + connect(cmdLine, TQT_SIGNAL(returnPressed(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(handleCmd(const TQString &))); /* * Done with the actions, create the XML-defined parts of the * user interface @@ -275,7 +275,7 @@ void KBg::setupEngine() newAction->setEnabled(engine[currEngine]->haveNewGame()); // engine -> this - connect(engine[currEngine], TQT_SIGNAL(statText(const TQString &)), this, TQT_SLOT(updateCaption(const TQString &))); + connect(engine[currEngine], TQT_SIGNAL(statText(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(updateCaption(const TQString &))); connect(engine[currEngine], TQT_SIGNAL(infoText(const TQString &)), status, TQT_SLOT(write(const TQString &))); connect(engine[currEngine], TQT_SIGNAL(allowCommand(int, bool)), this, TQT_SLOT(allowCommand(int, bool))); @@ -293,8 +293,8 @@ void KBg::setupEngine() connect(engine[currEngine], TQT_SIGNAL(redoMove()), board, TQT_SLOT(redoMove())); connect(engine[currEngine], TQT_SIGNAL(setEditMode(const bool)), board, TQT_SLOT(setEditMode(const bool))); connect(engine[currEngine], TQT_SIGNAL(allowMoving(const bool)), board, TQT_SLOT(allowMoving(const bool))); - connect(engine[currEngine], TQT_SIGNAL(getState(KBgStatus *)), board, TQT_SLOT(getState(KBgStatus *))); - connect(engine[currEngine], TQT_SIGNAL(newState(const KBgStatus &)), board, TQT_SLOT(setState(const KBgStatus &))); + connect(engine[currEngine], TQT_SIGNAL(getState(KBgtqStatus *)), board, TQT_SLOT(getState(KBgtqStatus *))); + connect(engine[currEngine], TQT_SIGNAL(newState(const KBgtqStatus &)), board, TQT_SLOT(setState(const KBgtqStatus &))); // now that all signals are connected, start the engine engine[currEngine]->start(); @@ -371,8 +371,8 @@ void KBg::readConfig() status->setFont(config->readFontEntry("font", &kappFont)); TQValueList l; - l.append(qRound( config->readDoubleNumEntry("panner", 0.75) *panner->height())); - l.append(qRound((1-config->readDoubleNumEntry("panner", 0.75))*panner->height())); + l.append(tqRound( config->readDoubleNumEntry("panner", 0.75) *panner->height())); + l.append(tqRound((1-config->readDoubleNumEntry("panner", 0.75))*panner->height())); panner->setSizes(l); applyMainWindowSettings(config, "main window"); @@ -421,7 +421,7 @@ void KBg::setupOk() if (cbm->isChecked()) KMessageBox::enableAllMessages(); - // tell children to read their changes + // tell tqchildren to read their changes board->setupOk(); // engines @@ -575,7 +575,7 @@ void KBg::setupDlg() TQGridLayout *gle = new TQGridLayout(gbe, 1, 1, nb->spacingHint()); KURLLabel *lab = new KURLLabel("kcmshell kcmnotify", i18n("Klick here to configure the event notification"), gbe); - lab->setMaximumSize(lab->sizeHint()); + lab->setMaximumSize(lab->tqsizeHint()); gle->addWidget(lab, 0, 0); connect(lab, TQT_SIGNAL(leftClickedURL(const TQString &)), TQT_SLOT(startKCM(const TQString &))); @@ -617,12 +617,12 @@ void KBg::setupDlg() */ connect(nb, TQT_SIGNAL(okClicked()), this, TQT_SLOT(setupOk())); connect(nb, TQT_SIGNAL(applyClicked()), this, TQT_SLOT(setupOk())); - connect(nb, TQT_SIGNAL(cancelClicked()), this, TQT_SLOT(setupCancel())); + connect(nb, TQT_SIGNAL(cancelClicked()), TQT_TQOBJECT(this), TQT_SLOT(setupCancel())); connect(nb, TQT_SIGNAL(defaultClicked()),this, TQT_SLOT(setupDefault())); - connect(nb, TQT_SIGNAL(finished()), this, TQT_SLOT(setupDone())); + connect(nb, TQT_SIGNAL(finished()), TQT_TQOBJECT(this), TQT_SLOT(setupDone())); - nb->resize(nb->minimumSize()); + nb->resize(nb->tqminimumSize()); nb->show(); } @@ -646,7 +646,7 @@ void KBg::print() prt->setPageSize((KPrinter::PageSize) config->readNumEntry("pagesize", KPrinter::A4)); prt->setOrientation((KPrinter::Orientation)config->readNumEntry("orientation", KPrinter::Landscape)); - if (prt->setup(this, i18n("Print %1").arg(baseCaption))) { + if (prt->setup(this, i18n("Print %1").tqarg(baseCaption))) { TQPainter p; p.begin(prt); board->print(&p); diff --git a/kbackgammon/kbg.h b/kbackgammon/kbg.h index 94f4aab9..81c5f4fd 100644 --- a/kbackgammon/kbg.h +++ b/kbackgammon/kbg.h @@ -48,6 +48,7 @@ class KBgBoardSetup; class KBg : public KMainWindow { Q_OBJECT + TQ_OBJECT public: diff --git a/kbackgammon/kbgboard.cpp b/kbackgammon/kbgboard.cpp index fc024ab8..b47c6192 100644 --- a/kbackgammon/kbgboard.cpp +++ b/kbackgammon/kbgboard.cpp @@ -196,7 +196,7 @@ void KBgBoardSetup::getSetupPages(KDialogBase *nb) "move a checker the shortest possible distance.")); for (int i = 0; i < 3; i++) { - rbMove[i]->setMinimumSize(rbMove[i]->sizeHint()); + rbMove[i]->setMinimumSize(rbMove[i]->tqsizeHint()); blm->addWidget(rbMove[i]); rbMove[i]->setChecked(i == getShortMoveMode()); } @@ -248,8 +248,8 @@ void KBgBoardSetup::getSetupPages(KDialogBase *nb) /* * Empty constructor calls the board constructor */ -KBgBoardSetup::KBgBoardSetup(TQWidget *parent, const char *name, TQPopupMenu *menu) - : KBgBoard(parent, name, menu) +KBgBoardSetup::KBgBoardSetup(TQWidget *tqparent, const char *name, TQPopupMenu *menu) + : KBgBoard(tqparent, name, menu) { // empty } @@ -360,10 +360,10 @@ void KBgBoard::setFont(const TQFont& f) */ void KBgBoard::queryCube() { - KBgStatus *st = new KBgStatus(); + KBgtqStatus *st = new KBgtqStatus(); getState(st); - KBgBoardQCube *dlg = - new KBgBoardQCube(abs(st->cube()), (st->cube(US) > 0), (st->cube(THEM) > 0)); + KBgBoardTQCube *dlg = + new KBgBoardTQCube(abs(st->cube()), (st->cube(US) > 0), (st->cube(THEM) > 0)); if (dlg->exec()) { bool u = ((dlg->getCubeValue() == 0) || (dlg->getCubeOwner() == US )); bool t = ((dlg->getCubeValue() == 0) || (dlg->getCubeOwner() == THEM)); @@ -377,7 +377,7 @@ void KBgBoard::queryCube() /* * Constructor, creates the dialog but does not show nor execute it. */ -KBgBoardQCube::KBgBoardQCube(int val, bool us, bool them) +KBgBoardTQCube::KBgBoardTQCube(int val, bool us, bool them) : TQDialog(0, 0, true) { setCaption(i18n("Set Cube Values")); @@ -395,7 +395,7 @@ KBgBoardQCube::KBgBoardQCube(int val, bool us, bool them) "double. Note that a face value of 1 automatically allows both\n" "players to double.")); - info->setMinimumSize(info->sizeHint()); + info->setMinimumSize(info->tqsizeHint()); vbox->addWidget(info, 0); @@ -454,17 +454,17 @@ KBgBoardQCube::KBgBoardQCube(int val, bool us, bool them) else if (them) cb[1]->setCurrentItem(THEM); - cb[0]->setMinimumSize(cb[0]->sizeHint()); - cb[1]->setMinimumSize(cb[1]->sizeHint()); + cb[0]->setMinimumSize(cb[0]->tqsizeHint()); + cb[1]->setMinimumSize(cb[1]->tqsizeHint()); - ok->setMinimumSize(ok->sizeHint()); - cancel->setMinimumSize(cancel->sizeHint()); + ok->setMinimumSize(ok->tqsizeHint()); + cancel->setMinimumSize(cancel->tqsizeHint()); - setMinimumSize(childrenRect().size()); + setMinimumSize(tqchildrenRect().size()); vbox->activate(); - resize(minimumSize()); + resize(tqminimumSize()); ok->setAutoDefault (true); ok->setDefault(true); @@ -481,7 +481,7 @@ KBgBoardQCube::KBgBoardQCube(int val, bool us, bool them) /* * Deconstructor, empty. */ -KBgBoardQCube::~KBgBoardQCube() +KBgBoardTQCube::~KBgBoardTQCube() { // nothing } @@ -489,7 +489,7 @@ KBgBoardQCube::~KBgBoardQCube() /* * Get the face value of the cube */ -int KBgBoardQCube::getCubeValue() +int KBgBoardTQCube::getCubeValue() { return cb[0]->currentItem(); } @@ -497,7 +497,7 @@ int KBgBoardQCube::getCubeValue() /* * Get the owner of the cube */ -int KBgBoardQCube::getCubeOwner() +int KBgBoardTQCube::getCubeOwner() { return cb[1]->currentItem(); } @@ -505,7 +505,7 @@ int KBgBoardQCube::getCubeOwner() /* * If the cube is open, the value can only be 1 */ -void KBgBoardQCube::changeValue(int player) +void KBgBoardTQCube::changeValue(int player) { if (player == BOTH) cb[0]->setCurrentItem(0); @@ -516,7 +516,7 @@ void KBgBoardQCube::changeValue(int player) * If the value is 1, the cube has to be open; and if the value * becomes bigger than 1, the player cannot stay open. */ -void KBgBoardQCube::changePlayer(int val) +void KBgBoardTQCube::changePlayer(int val) { if (val == 0) cb[1]->setCurrentItem(BOTH); @@ -527,7 +527,7 @@ void KBgBoardQCube::changePlayer(int val) /* * Constructor, creates the dialog but does not show nor execute it. */ -KBgBoardQDice::KBgBoardQDice(const char *name) +KBgBoardTQDice::KBgBoardTQDice(const char *name) : TQDialog(0, name, true) { setCaption(i18n("Set Dice Values")); @@ -544,7 +544,7 @@ KBgBoardQDice::KBgBoardQDice(const char *name) info->setText(i18n("Set the face values of the selected dice. The other player's\n" "dice will be cleared and it will be the dice's owner's turn.")); - info->setMinimumSize(info->sizeHint()); + info->setMinimumSize(info->tqsizeHint()); vbox->addWidget(info, 0); @@ -560,17 +560,17 @@ KBgBoardQDice::KBgBoardQDice(const char *name) hbox_2->addWidget(ok); hbox_2->addWidget(cancel); - sb[0]->setMinimumSize(sb[0]->sizeHint()); - sb[1]->setMinimumSize(sb[1]->sizeHint()); + sb[0]->setMinimumSize(sb[0]->tqsizeHint()); + sb[1]->setMinimumSize(sb[1]->tqsizeHint()); - ok->setMinimumSize(ok->sizeHint()); - cancel->setMinimumSize(cancel->sizeHint()); + ok->setMinimumSize(ok->tqsizeHint()); + cancel->setMinimumSize(cancel->tqsizeHint()); - setMinimumSize(childrenRect().size()); + setMinimumSize(tqchildrenRect().size()); vbox->activate(); - resize(minimumSize()); + resize(tqminimumSize()); ok->setAutoDefault (true); ok->setDefault(true); @@ -590,7 +590,7 @@ KBgBoardQDice::KBgBoardQDice(const char *name) /* * Deconstructor, empty. */ -KBgBoardQDice::~KBgBoardQDice() +KBgBoardTQDice::~KBgBoardTQDice() { // nothing } @@ -598,7 +598,7 @@ KBgBoardQDice::~KBgBoardQDice() /* * Get the face value of the dice */ -int KBgBoardQDice::getDice(int n) +int KBgBoardTQDice::getDice(int n) { return sb[n]->value(); } @@ -628,10 +628,10 @@ bool KBgBoard::getEditMode() const } /* - * This function takes a KBgStatus object and fills it with the current + * This function takes a KBgtqStatus object and fills it with the current * board status. */ -KBgStatus* KBgBoard::getState(KBgStatus *st) const +KBgtqStatus* KBgBoard::getState(KBgtqStatus *st) const { st->setColor(color); st->setDirection(direction); @@ -915,7 +915,7 @@ void KBgBoardBar::paintCell(TQPainter *p, int xo, int yo, double sf) const * the center belongs to two(!) fields - both bars. * * If we are not printing on paper we use the fact that - * Qt will clip the drawing for us. So we print the upper + * TQt will clip the drawing for us. So we print the upper * half of the cube and the lower half on different cells. * * Since there is no such thing as clipping when we print @@ -1103,7 +1103,7 @@ void KBgBoardHome::drawDiceFrame(TQPainter *p, int col, int num, */ void KBgBoardCell::mousePressEvent(TQMouseEvent *e) { - if (e->button() == RightButton) + if (e->button() == Qt::RightButton) board->showContextMenu(); else mouseButton = e->button(); @@ -1142,7 +1142,7 @@ int KBgBoard::getShortMoveMode() */ void KBgBoardCell::checkAndMakeShortMove(TQMouseEvent *e, int m) { - if ((e->button() == LeftButton) && + if ((e->button() == Qt::LeftButton) && (board->getShortMoveMode() == m) && (dragPossible()) && (!board->getEditMode())) @@ -1166,7 +1166,7 @@ void KBgBoardBar::mouseDoubleClickEvent(TQMouseEvent *e) { TQRect r = cubeRect(cellID == BAR_THEM ? CUBE_UPPER : CUBE_LOWER, true); if (board->canDouble(US) && - board->canDouble(THEM) && r.contains(e->pos())) { + board->canDouble(THEM) && r.tqcontains(e->pos())) { if (board->getEditMode()) board->queryCube(); else @@ -1318,7 +1318,7 @@ int KBgBoard::getPipCount(const int& w) const */ void KBgBoardHome::mouseDoubleClickEvent(TQMouseEvent * e) { - if (e->button() != LeftButton) + if (e->button() != Qt::LeftButton) return; /* * Check whether this is the bookkeeping home... @@ -1332,12 +1332,12 @@ void KBgBoardHome::mouseDoubleClickEvent(TQMouseEvent * e) US : THEM); for (int i = 0; i < 2; ++i) { TQRect r = diceRect(i, true); - if (r.contains(e->pos())) { + if (r.tqcontains(e->pos())) { if (board->getEditMode()) { - KBgBoardQDice *dlg = new KBgBoardQDice(); + KBgBoardTQDice *dlg = new KBgBoardTQDice(); if (dlg->exec()) { - KBgStatus *st = new KBgStatus(); + KBgtqStatus *st = new KBgtqStatus(); board->getState(st); st->setDice(w, 0, dlg->getDice(0)); st->setDice(w, 1, dlg->getDice(1)); @@ -1356,7 +1356,7 @@ void KBgBoardHome::mouseDoubleClickEvent(TQMouseEvent * e) if (board->canDouble(w) && !(board->canDouble(US) && board->canDouble(THEM))) { TQRect r = cubeRect(w, true); - if (r.contains(e->pos())) + if (r.tqcontains(e->pos())) if (board->getEditMode()) board->queryCube(); else @@ -1367,7 +1367,7 @@ void KBgBoardHome::mouseDoubleClickEvent(TQMouseEvent * e) /* * This function determines if a checker can be dropped on this field. - * It checks whether the field is already owned, empty or contains + * It checks whether the field is already owned, empty or tqcontains * only one opponents piece. Then the dice are checked. */ bool KBgBoardField::dropPossible(int fromCellID, int newColor) @@ -1435,7 +1435,7 @@ bool KBgBoard::moveOffPossible() const KBgBoardCell* KBgBoard::getCellByPos(const TQPoint& p) const { for (int i = 0; i < 30; ++i) { - if (cells[i]->rect().contains(cells[i]->mapFromParent(p))) + if (TQT_TQRECT_OBJECT(cells[i]->rect()).tqcontains(cells[i]->mapFromParent(p))) return cells[i]; } return NULL; @@ -1610,8 +1610,8 @@ KBgBoardField::~KBgBoardField() * This is the constructor of the bars. It calls the base class' constructor * and defines the TQWhatsThis string. */ -KBgBoardBar::KBgBoardBar(TQWidget * parent, int numID) - : KBgBoardCell(parent, numID) +KBgBoardBar::KBgBoardBar(TQWidget * tqparent, int numID) + : KBgBoardCell(tqparent, numID) { TQWhatsThis::add(this, i18n("This is the bar of the backgammon board.\n\n" "Checkers that have been kicked from the board are put " @@ -1627,8 +1627,8 @@ KBgBoardBar::KBgBoardBar(TQWidget * parent, int numID) * This is the constructor of regular fields. It calls the base class' constructor * and defines the TQWhatsThis string. */ -KBgBoardField::KBgBoardField(TQWidget * parent, int numID) - : KBgBoardCell(parent, numID) +KBgBoardField::KBgBoardField(TQWidget * tqparent, int numID) + : KBgBoardCell(tqparent, numID) { TQWhatsThis::add(this, i18n("This is a regular field of the backgammon board.\n\n" "Checkers can be placed on this field and if the current state " @@ -1641,8 +1641,8 @@ KBgBoardField::KBgBoardField(TQWidget * parent, int numID) * This is the constructor of the homes. It calls the base class' constructor * and defines the TQWhatsThis string. */ -KBgBoardHome::KBgBoardHome(TQWidget * parent, int numID) - : KBgBoardCell(parent, numID) +KBgBoardHome::KBgBoardHome(TQWidget * tqparent, int numID) + : KBgBoardCell(tqparent, numID) { TQWhatsThis::add(this, i18n("This part of the backgammon board is the home.\n\n" "Depending on the direction of the game, one of the homes " @@ -1734,10 +1734,10 @@ int KBgBoard::getTurn() const * This is the constructor of the basic cells. It initializes the cell * to a sane state and connects a signal to the board. */ -KBgBoardCell::KBgBoardCell(TQWidget * parent, int numID) - : TQLabel(parent) +KBgBoardCell::KBgBoardCell(TQWidget * tqparent, int numID) + : TQLabel(tqparent) { - board = (KBgBoard *)parent; + board = (KBgBoard *)tqparent; direction = +1; color = -1; @@ -1746,10 +1746,10 @@ KBgBoardCell::KBgBoardCell(TQWidget * parent, int numID) stateChanged = false; colorChanged = false; directionChanged = false; - mouseButton = NoButton; + mouseButton = Qt::NoButton; dragInProgress = false; - connect(parent, TQT_SIGNAL(finishedUpdate()), this, TQT_SLOT(refresh())); + connect(tqparent, TQT_SIGNAL(finishedUpdate()), this, TQT_SLOT(refresh())); } /* @@ -1854,7 +1854,7 @@ void KBgBoard::updateField(int f, int v) } /* - * This function displays the context menu our parent may have given us + * This function displays the context menu our tqparent may have given us */ void KBgBoard::showContextMenu() { @@ -2085,7 +2085,7 @@ bool KBgBoard::diceAllowMove(int src, int dest) * This is the most important of all members of the board class. It takes * a single board status object and initializes the internal status. */ -void KBgBoard::setState(const KBgStatus &st) +void KBgBoard::setState(const KBgtqStatus &st) { color = st.color(); direction = st.direction(); @@ -2151,7 +2151,7 @@ void KBgBoard::setState(const KBgStatus &st) */ void KBgBoardCell::mouseMoveEvent(TQMouseEvent *) { - if ((mouseButton == LeftButton) && dragPossible()) { + if ((mouseButton == Qt::LeftButton) && dragPossible()) { dragInProgress = true; TQRect cr(0, 0, 1+getCheckerDiameter(), 1+getCheckerDiameter()); cr.moveBottomLeft(rect().bottomLeft()); @@ -2162,15 +2162,15 @@ void KBgBoardCell::mouseMoveEvent(TQMouseEvent *) board->drawSimpleChecker(&tmp, 0, 0, pcs, getCheckerDiameter()); tmp.end(); pix.setMask(pix.createHeuristicMask()); - TQBitmap mask = *(pix.mask()); + TQBitmap tqmask = *(pix.tqmask()); TQBitmap newCursor; - newCursor = pix; - board->replaceCursor(TQCursor(newCursor, mask)); + newCursor = TQBitmap(pix); + board->replaceCursor(TQCursor(newCursor, tqmask)); if (board->getEditMode()) board->storeTurn(pcs); getPiece(); } - mouseButton = NoButton; + mouseButton = Qt::NoButton; } /* @@ -2653,7 +2653,7 @@ void KBgBoard::redoMove() } /* - * This function performs and undo for the last move and updates the parent + * This function performs and undo for the last move and updates the tqparent * of the board by calling sendMove() after the undo. */ void KBgBoard::undoMove() @@ -2820,11 +2820,11 @@ void KBgBoard::getRollDice(const int w) * This is the constructor of the KBgBoard class. It creates * a backgammon board with an initial distribution of checkers, empty * dice and a cube with face value 1. The initial board is not usable! - * You have to change the status by passing a KBgStatus + * You have to change the status by passing a KBgtqStatus * object to setState(...) before you can play! */ -KBgBoard::KBgBoard(TQWidget *parent, const char *name, TQPopupMenu *menu) - : TQWidget(parent, name) +KBgBoard::KBgBoard(TQWidget *tqparent, const char *name, TQPopupMenu *menu) + : TQWidget(tqparent, name) { /* * The following lines set up internal bookkeeping data. @@ -2838,7 +2838,7 @@ KBgBoard::KBgBoard(TQWidget *parent, const char *name, TQPopupMenu *menu) checkerDiam = MINIMUM_CHECKER_SIZE; /* - * We may be initialized with a popup menu by our parent. + * We may be initialized with a popup menu by our tqparent. */ contextMenu = menu; @@ -2868,7 +2868,7 @@ KBgBoard::KBgBoard(TQWidget *parent, const char *name, TQPopupMenu *menu) * Get the default seeting of the board and initialize the * state of it. */ - KBgStatus *st = new KBgStatus(); + KBgtqStatus *st = new KBgtqStatus(); st->setCube(1, true, true); st->setDirection(+1); @@ -2907,12 +2907,12 @@ KBgBoard::KBgBoard(TQWidget *parent, const char *name, TQPopupMenu *menu) setFont(TQApplication::font()); } -TQSize KBgBoard::minimumSizeHint() const +TQSize KBgBoard::tqminimumSizeHint() const { return TQSize(MINIMUM_CHECKER_SIZE * 15, MINIMUM_CHECKER_SIZE * 11); } -TQSize KBgBoard::sizeHint() const { +TQSize KBgBoard::tqsizeHint() const { return TQSize(MINIMUM_CHECKER_SIZE *15*4,MINIMUM_CHECKER_SIZE*11*2); } diff --git a/kbackgammon/kbgboard.h b/kbackgammon/kbgboard.h index 54ad506c..04cac55f 100644 --- a/kbackgammon/kbgboard.h +++ b/kbackgammon/kbgboard.h @@ -64,9 +64,9 @@ /* * Just some internal constants and classes */ -const int US = KBgStatus::US; -const int THEM = KBgStatus::THEM; -const int BOTH = KBgStatus::BOTH; +const int US = KBgtqStatus::US; +const int THEM = KBgtqStatus::THEM; +const int BOTH = KBgtqStatus::BOTH; const int HOME_US_LEFT = 101; const int HOME_US_RIGHT = 102; @@ -87,7 +87,7 @@ class KBgBoardMove; class KBgBoardHome; class KBgBoardBar; class KBgBoardField; -class KBgBoardQDice; +class KBgBoardTQDice; /** @@ -95,9 +95,10 @@ class KBgBoardQDice; * * This class handles all game operations of the client. */ -class KBgBoard : public QWidget +class KBgBoard : public TQWidget { Q_OBJECT + TQ_OBJECT friend class KBgBoardCell; friend class KBgBoardHome; @@ -109,7 +110,7 @@ class KBgBoard : public QWidget /** * Constructor and destructor. Parameter as usual. */ - KBgBoard(TQWidget *parent = 0, const char *name = 0, + KBgBoard(TQWidget *tqparent = 0, const char *name = 0, TQPopupMenu *menu = 0); virtual ~KBgBoard(); @@ -180,7 +181,7 @@ class KBgBoard : public QWidget * This function has to be reimplemented to provide a minimum size for * the playing area. */ - TQSize minimumSizeHint() const; + TQSize tqminimumSizeHint() const; public slots: /** @@ -194,7 +195,7 @@ public slots: * Overwritten resize event handler. * * We overwrite the handler to make sure that all the cells are - * repainted as well. + * tqrepainted as well. */ virtual void resizeEvent(TQResizeEvent *); @@ -210,10 +211,10 @@ public slots: /** * This is the most important public member. It takes - * a board status - s. the KBgBoardStatus class - + * a board status - s. the KBgBoardtqStatus class - * and sets the board accordingly. */ - void setState(const KBgStatus &); + void setState(const KBgtqStatus &); /** * Set the context menu @@ -223,7 +224,7 @@ public slots: /** * Get the current state of the board. */ - KBgStatus *getState(KBgStatus *st) const; + KBgtqStatus *getState(KBgtqStatus *st) const; /** * Sets the edit mode of the board. In that mode the board can be @@ -291,7 +292,7 @@ public slots: /* ************************************************** */ protected: - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; TQColor baseColors[2]; TQFont boardFont; @@ -458,21 +459,22 @@ protected: * on a backgammon board. It has a bunch of virtual functions that * are overloaded in the derived classes. */ -class KBgBoardCell : public QLabel +class KBgBoardCell : public TQLabel { Q_OBJECT + TQ_OBJECT public: /** * Constructor and destructor */ - KBgBoardCell(TQWidget * parent, int numID); + KBgBoardCell(TQWidget * tqparent, int numID); virtual ~KBgBoardCell(); /** * sets the number and color of checkers on this cell - * takes care of repainting + * takes care of tqrepainting */ virtual void cellUpdate(const int p, const bool cubechanged = false) = 0; @@ -533,7 +535,7 @@ protected: virtual void drawContents(TQPainter *); /** - * Status numbers that store the current board status. + * tqStatus numbers that store the current board status. */ int mouseButton; int direction; @@ -550,7 +552,7 @@ protected: int cellID; /** - * Indicates whether this cell needs to repaint itself after + * Indicates whether this cell needs to tqrepaint itself after * the board has been processed. */ bool stateChanged; @@ -558,7 +560,7 @@ protected: /** * the board and the pieces are one unit (none makes - * sense without the other). So the pieces know and access their parent. + * sense without the other). So the pieces know and access their tqparent. */ KBgBoard *board; void checkAndMakeShortMove(TQMouseEvent *e, int m); @@ -615,11 +617,12 @@ protected: class KBgBoardHome : public KBgBoardCell { Q_OBJECT + TQ_OBJECT public: /** * sets the number and color of checkers on this cell - * takes care of repainting + * takes care of tqrepainting */ virtual void cellUpdate(const int p, const bool cubechanged = false); @@ -632,7 +635,7 @@ class KBgBoardHome : public KBgBoardCell /** * Constructor and destructor */ - KBgBoardHome( TQWidget * parent, int numID); + KBgBoardHome( TQWidget * tqparent, int numID); virtual ~KBgBoardHome(); /** @@ -664,7 +667,7 @@ class KBgBoardHome : public KBgBoardCell private: /** - * Save old dice to avoid repainting + * Save old dice to avoid tqrepainting */ int savedDice[2]; @@ -677,11 +680,12 @@ class KBgBoardHome : public KBgBoardCell class KBgBoardBar : public KBgBoardCell { Q_OBJECT + TQ_OBJECT public: /** * sets the number and color of checkers on this cell - * takes care of repainting + * takes care of tqrepainting */ virtual void cellUpdate(const int p, const bool cubechanged = false); @@ -694,7 +698,7 @@ class KBgBoardBar : public KBgBoardCell /** * Constructor */ - KBgBoardBar( TQWidget * parent, int numID ); + KBgBoardBar( TQWidget * tqparent, int numID ); /** * Destructor @@ -724,17 +728,18 @@ class KBgBoardBar : public KBgBoardCell class KBgBoardField : public KBgBoardCell { Q_OBJECT + TQ_OBJECT public: /** * Constructor and destructor */ - KBgBoardField( TQWidget * parent, int numID); + KBgBoardField( TQWidget * tqparent, int numID); virtual ~KBgBoardField(); /** * sets the number and color of checkers on this cell - * takes care of repainting + * takes care of tqrepainting */ virtual void cellUpdate(const int p, const bool cubechanged = false); @@ -816,22 +821,23 @@ class KBgBoardMove * * A very simple dialog with two SpinBoxes and two buttons. */ -class KBgBoardQDice : public QDialog +class KBgBoardTQDice : public TQDialog { Q_OBJECT + TQ_OBJECT public: /** * Constructor and destructor */ - KBgBoardQDice(const char *name = 0); - virtual ~KBgBoardQDice(); + KBgBoardTQDice(const char *name = 0); + virtual ~KBgBoardTQDice(); protected: /** - * Spin boxes and buttons are children + * Spin boxes and buttons are tqchildren */ TQSpinBox *sb[2]; TQPushButton *ok; @@ -849,22 +855,23 @@ public slots: /** * Simple dialog that allows to query the user for the cube value. */ -class KBgBoardQCube : public QDialog +class KBgBoardTQCube : public TQDialog { Q_OBJECT + TQ_OBJECT public: /** * Constructor and destructor */ - KBgBoardQCube(int val, bool us, bool them); - virtual ~KBgBoardQCube(); + KBgBoardTQCube(int val, bool us, bool them); + virtual ~KBgBoardTQCube(); protected: /** - * Spin boxes and buttons are children + * Spin boxes and buttons are tqchildren */ TQComboBox *cb[2]; TQPushButton *ok; @@ -897,13 +904,14 @@ protected slots: class KBgBoardSetup : public KBgBoard { Q_OBJECT + TQ_OBJECT public: /** * Constructor */ - KBgBoardSetup(TQWidget *parent = 0, const char *name = 0, + KBgBoardSetup(TQWidget *tqparent = 0, const char *name = 0, TQPopupMenu *menu = 0); /** diff --git a/kbackgammon/kbgstatus.cpp b/kbackgammon/kbgstatus.cpp index 4f5db3c0..e9e8d4e5 100644 --- a/kbackgammon/kbgstatus.cpp +++ b/kbackgammon/kbgstatus.cpp @@ -29,7 +29,7 @@ /* * Parse a rawboard description from FIBS and initialize members. */ -KBgStatus::KBgStatus(const TQString &rawboard) +KBgtqStatus::KBgtqStatus(const TQString &rawboard) { /* * This is the format string from hell... @@ -116,7 +116,7 @@ KBgStatus::KBgStatus(const TQString &rawboard) * Constructor initializes the status to an empty board with cube one * and empty dice. */ -KBgStatus::KBgStatus() +KBgtqStatus::KBgtqStatus() : TQObject() { /* @@ -131,7 +131,7 @@ KBgStatus::KBgStatus() setHome (i, 0); setBar (i, 0); setPoints(i, -1); - setPlayer(i, TQString::null); + setPlayer(i, TQString()); } setColor(White, US); setCube(1, BOTH); // also initializes maydouble @@ -146,7 +146,7 @@ KBgStatus::KBgStatus() /* * Copy constructor calls private utility function. */ -KBgStatus::KBgStatus(const KBgStatus &rhs) +KBgtqStatus::KBgtqStatus(const KBgtqStatus &rhs) : TQObject() { copy(rhs); @@ -155,7 +155,7 @@ KBgStatus::KBgStatus(const KBgStatus &rhs) /* * Destructor */ -KBgStatus::~KBgStatus() +KBgtqStatus::~KBgtqStatus() { // nothing to do } @@ -164,14 +164,14 @@ KBgStatus::~KBgStatus() * Assignment operator shares a lot of code with the copy * constructor. */ -KBgStatus& KBgStatus::operator=(const KBgStatus &rhs) +KBgtqStatus& KBgtqStatus::operator=(const KBgtqStatus &rhs) { if (this == &rhs) return *this; copy(rhs); return *this; } -void KBgStatus::copy(const KBgStatus &rhs) +void KBgtqStatus::copy(const KBgtqStatus &rhs) { for (int i = 0; i < 26; i++) board_[i] = rhs.board_[i]; @@ -199,32 +199,32 @@ void KBgStatus::copy(const KBgStatus &rhs) /* * Access functions */ -int KBgStatus::board(const int &i) const +int KBgtqStatus::board(const int &i) const { return ((0 < i && i < 25) ? color_*board_[i] : 0); } -int KBgStatus::home(const int &w) const +int KBgtqStatus::home(const int &w) const { return ((w == US || w == THEM) ? color_*home_[w] : 0); } -int KBgStatus::bar(const int &w) const +int KBgtqStatus::bar(const int &w) const { return ((w == US || w == THEM) ? color_*bar_[w] : 0); } -int KBgStatus::color(const int &w) const +int KBgtqStatus::color(const int &w) const { return ((w == THEM) ? -color_ : color_); } -int KBgStatus::direction() const +int KBgtqStatus::direction() const { return direction_; } -int KBgStatus::dice(const int &w, const int &n) const +int KBgtqStatus::dice(const int &w, const int &n) const { if ((w == US || w == THEM) && (n == 0 || n == 1)) return dice_[w][n]; @@ -232,34 +232,34 @@ int KBgStatus::dice(const int &w, const int &n) const return 0; } -int KBgStatus::cube(const int &w) const +int KBgtqStatus::cube(const int &w) const { if (w == US || w == THEM) return ((maydouble_[w]) ? cube_ : -cube_); return 0; } -int KBgStatus::points(const int& w) const +int KBgtqStatus::points(const int& w) const { return ((w == US || w == THEM) ? points_[w] : -1); } -TQString KBgStatus::player(const int &w) const +TQString KBgtqStatus::player(const int &w) const { - return ((w == US || w == THEM) ? player_[w] : TQString::null); + return ((w == US || w == THEM) ? player_[w] : TQString()); } -int KBgStatus::length() const +int KBgtqStatus::length() const { return length_; } -int KBgStatus::turn() const +int KBgtqStatus::turn() const { return turn_; } -bool KBgStatus::doubled() const +bool KBgtqStatus::doubled() const { return doubled_; } @@ -268,7 +268,7 @@ bool KBgStatus::doubled() const /* * Assignment functions */ -void KBgStatus::setBoard(const int &i, const int &w, const int &v) +void KBgtqStatus::setBoard(const int &i, const int &w, const int &v) { if (0 < i && i < 25) { if (w == US) @@ -278,7 +278,7 @@ void KBgStatus::setBoard(const int &i, const int &w, const int &v) } } -void KBgStatus::setHome(const int &w, const int &v) +void KBgtqStatus::setHome(const int &w, const int &v) { if (w == US) home_[w] = abs(v); @@ -286,7 +286,7 @@ void KBgStatus::setHome(const int &w, const int &v) home_[w] = -abs(v); } -void KBgStatus::setBar(const int& w, const int& v) +void KBgtqStatus::setBar(const int& w, const int& v) { if (w == US) bar_[w] = abs(v); @@ -294,7 +294,7 @@ void KBgStatus::setBar(const int& w, const int& v) bar_[w] = -abs(v); } -void KBgStatus::setColor(const int &c, const int &w) +void KBgtqStatus::setColor(const int &c, const int &w) { if (w == US) color_ = ((c < 0) ? Black : White); @@ -302,12 +302,12 @@ void KBgStatus::setColor(const int &c, const int &w) color_ = ((c < 0) ? White : Black); } -void KBgStatus::setDirection(const int &dir) +void KBgtqStatus::setDirection(const int &dir) { direction_ = ((dir < 0) ? -1 : +1); } -void KBgStatus::setDice(const int &w, const int &n, const int &v) +void KBgtqStatus::setDice(const int &w, const int &n, const int &v) { if ((w == US || w == THEM) && (n == 0 || n == 1)) { if (0 <= v && v <= 6) @@ -317,7 +317,7 @@ void KBgStatus::setDice(const int &w, const int &n, const int &v) } } -void KBgStatus::setCube(const int &c, const bool &us, const bool &them) +void KBgtqStatus::setCube(const int &c, const bool &us, const bool &them) { int w = NONE; if (us) w = US; @@ -326,7 +326,7 @@ void KBgStatus::setCube(const int &c, const bool &us, const bool &them) setCube(c, w); } -void KBgStatus::setCube(const int &c, const int &w) +void KBgtqStatus::setCube(const int &c, const int &w) { // assume that int has at least 32 bits... for (int i = 0; i < 31; i++) { @@ -337,24 +337,24 @@ void KBgStatus::setCube(const int &c, const int &w) maydouble_[THEM] = (w == THEM || w == BOTH); } -void KBgStatus::setPoints(const int &w, const int &p) +void KBgtqStatus::setPoints(const int &w, const int &p) { if (w == US || w == THEM) points_[w] = p; } -void KBgStatus::setPlayer(const int &w, const TQString &name) +void KBgtqStatus::setPlayer(const int &w, const TQString &name) { if (w == US || w == THEM) player_[w] = name; } -void KBgStatus::setLength(const int &l) +void KBgtqStatus::setLength(const int &l) { length_ = l; } -void KBgStatus::setTurn(const int &w) +void KBgtqStatus::setTurn(const int &w) { if (w == US || w == THEM || w == BOTH) turn_ = w; @@ -364,7 +364,7 @@ void KBgStatus::setTurn(const int &w) /* * Utility functions */ -int KBgStatus::moves() const +int KBgtqStatus::moves() const { int start, dir; @@ -407,7 +407,7 @@ int KBgStatus::moves() const * Get a copy of ourselves. That way we can mess around with * the internals of the game. */ - KBgStatus sc(*this); + KBgtqStatus sc(*this); /* * Start with getting all checkers off the bar @@ -490,7 +490,7 @@ int KBgStatus::moves() const } } -bool KBgStatus::movePossible(KBgStatus &sc, int a, int start, int dir) const +bool KBgtqStatus::movePossible(KBgtqStatus &sc, int a, int start, int dir) const { /* * Determine where the first checker in moving direction is diff --git a/kbackgammon/kbgstatus.h b/kbackgammon/kbgstatus.h index afcc2f6a..05348157 100644 --- a/kbackgammon/kbgstatus.h +++ b/kbackgammon/kbgstatus.h @@ -43,10 +43,11 @@ * @author Jens Hoefkens * @version $Id$ */ -class KBgStatus : public QObject +class KBgtqStatus : public TQObject { Q_OBJECT + TQ_OBJECT public: @@ -65,27 +66,27 @@ class KBgStatus : public QObject * The default constructor initializes the status to an "empty" * state. The board and dice are empty and the cube shows 1. */ - KBgStatus(); + KBgtqStatus(); /** * Constructor from a FIBS rawboard string */ - KBgStatus(const TQString &rawboard); + KBgtqStatus(const TQString &rawboard); /** * Copy constructor */ - KBgStatus(const KBgStatus &rhs); + KBgtqStatus(const KBgtqStatus &rhs); /** * Assignment operator */ - KBgStatus& operator=(const KBgStatus &rhs); + KBgtqStatus& operator=(const KBgtqStatus &rhs); /** * Destructor */ - virtual ~KBgStatus(); + virtual ~KBgtqStatus(); /* @@ -156,7 +157,7 @@ class KBgStatus : public QObject /* * Return the name of player w. If w is out of bounds or if - * the player names have not been set, TQString::null is + * the player names have not been set, TQString() is * returned. */ TQString player(const int &w = US) const; @@ -231,7 +232,7 @@ class KBgStatus : public QObject /* * Set the n-th dice of player w to v. Nothing is done if w is * invalid or if n is out of bounds. If v is invalid, the - * value zero is assigned (i.e., the dice is invalidated). + * value zero is assigned (i.e., the dice is tqinvalidated). */ void setDice(const int &w, const int &n, const int &v); @@ -288,12 +289,12 @@ class KBgStatus : public QObject * anywhere starting from start or later into direction * dir in the game given by sc. */ - bool movePossible(KBgStatus &sc, int a, int start, int dir) const; + bool movePossible(KBgtqStatus &sc, int a, int start, int dir) const; /* * Copy constr. and assignment share a lot of code. */ - void copy(const KBgStatus &rhs); + void copy(const KBgtqStatus &rhs); /* * Private variables with self-expalanatory names. diff --git a/kbackgammon/kbgtextview.cpp b/kbackgammon/kbgtextview.cpp index a2199b05..30b8b671 100644 --- a/kbackgammon/kbgtextview.cpp +++ b/kbackgammon/kbgtextview.cpp @@ -36,8 +36,8 @@ /* * Constructor */ -KBgTextView::KBgTextView(TQWidget *parent, const char *name) - : KTextBrowser(parent, name) +KBgTextView::KBgTextView(TQWidget *tqparent, const char *name) + : KTextBrowser(tqparent, name) { clear(); setLinkUnderline(true); diff --git a/kbackgammon/kbgtextview.h b/kbackgammon/kbgtextview.h index 8b8b8389..87d783a0 100644 --- a/kbackgammon/kbgtextview.h +++ b/kbackgammon/kbgtextview.h @@ -36,13 +36,14 @@ class KBgTextView : public KTextBrowser { Q_OBJECT + TQ_OBJECT public: /** * Constructor */ - KBgTextView(TQWidget *parent = 0, const char *name = 0); + KBgTextView(TQWidget *tqparent = 0, const char *name = 0); /** * Destructor diff --git a/kbattleship/CLIENTS b/kbattleship/CLIENTS index 393dda40..54c82ec3 100644 --- a/kbattleship/CLIENTS +++ b/kbattleship/CLIENTS @@ -1,6 +1,6 @@ Information about other KBattleship-compatible clients: -Client OS Status Homepage/Screenshots +Client OS tqStatus Homepage/Screenshots KBattleship Linux/KDE 100% http://games.kde.org/kbattleship Mac KBattleship Mac OS + Mac OS X 100% http://www.sebek.de/ diff --git a/kbattleship/kbattleship/dialogs/chatDlg.ui b/kbattleship/kbattleship/dialogs/chatDlg.ui index 40ffdbf3..ed8329cc 100644 --- a/kbattleship/kbattleship/dialogs/chatDlg.ui +++ b/kbattleship/kbattleship/dialogs/chatDlg.ui @@ -1,10 +1,10 @@ chatDlg - + chatDlg - + 0 0 @@ -25,9 +25,9 @@ 3 - + - layouter + tqlayouter @@ -39,7 +39,7 @@ 6 - + commentEdit @@ -47,7 +47,7 @@ Enter a message here - + sendBtn @@ -64,7 +64,7 @@ - + chatView @@ -75,7 +75,7 @@ true - + chatLabel @@ -87,5 +87,5 @@ - + diff --git a/kbattleship/kbattleship/dialogs/connectDlg.ui b/kbattleship/kbattleship/dialogs/connectDlg.ui index 1a5b53de..a59803ab 100644 --- a/kbattleship/kbattleship/dialogs/connectDlg.ui +++ b/kbattleship/kbattleship/dialogs/connectDlg.ui @@ -1,10 +1,10 @@ clientConnectDlg - + clientConnectDlg - + 0 0 @@ -15,15 +15,15 @@ Connect to Server - + - + unnamed - + nicknameLabel @@ -38,7 +38,7 @@ &Nick name: - + AlignVCenter|AlignLeft @@ -47,7 +47,7 @@ - + nicknameEdit @@ -58,7 +58,7 @@ Enter a name that identifies you in the game - + serverLabel @@ -73,7 +73,7 @@ &Server: - + AlignVCenter|AlignLeft @@ -82,7 +82,7 @@ - + lanLabel @@ -93,7 +93,7 @@ lanBox - + Layout4 @@ -120,7 +120,7 @@ - + portLabel @@ -135,7 +135,7 @@ &Port: - + AlignVCenter|AlignLeft @@ -146,7 +146,7 @@ - + portEdit @@ -174,7 +174,7 @@ kcombobox.h - + kcombobox.h klineedit.h diff --git a/kbattleship/kbattleship/dialogs/infoDlg.ui b/kbattleship/kbattleship/dialogs/infoDlg.ui index 3c66d854..b000b050 100644 --- a/kbattleship/kbattleship/dialogs/infoDlg.ui +++ b/kbattleship/kbattleship/dialogs/infoDlg.ui @@ -1,10 +1,10 @@ KInfoDialog - + KInfoDialog - + 0 0 @@ -25,7 +25,7 @@ 6 - + Frame8 @@ -45,7 +45,7 @@ 6 - + Layout6 @@ -59,7 +59,7 @@ 6 - + lbl_clientIdentfierLabel @@ -72,7 +72,7 @@ Client identifier: - + lbl_ClientInformationLabel @@ -91,7 +91,7 @@ Client information: - + lbl_clientVersion @@ -107,7 +107,7 @@ CV - + lbl_clientVersionLabel @@ -120,7 +120,7 @@ Client version: - + lbl_ProtocolVersionLabel @@ -133,7 +133,7 @@ Protocol version: - + lbl_ProtocolVersion @@ -149,7 +149,7 @@ PV - + lbl_ClientInformation @@ -165,7 +165,7 @@ CI - + lbl_clientIdentfier @@ -185,7 +185,7 @@ - + Layout7 @@ -210,7 +210,7 @@ Expanding - + PushButton7 @@ -244,5 +244,5 @@ accept() - + diff --git a/kbattleship/kbattleship/dialogs/serverDlg.ui b/kbattleship/kbattleship/dialogs/serverDlg.ui index f16216b5..dbd6b52f 100644 --- a/kbattleship/kbattleship/dialogs/serverDlg.ui +++ b/kbattleship/kbattleship/dialogs/serverDlg.ui @@ -1,10 +1,10 @@ serverStartDlg - + serverStartDlg - + 0 0 @@ -15,15 +15,15 @@ Start Server - + - + unnamed - + gamenameLabel @@ -34,7 +34,7 @@ gamenameEdit - + portEdit @@ -48,7 +48,7 @@ Choose a port where the server listens on - + portLabel_2 @@ -63,7 +63,7 @@ &Port: - + AlignVCenter|AlignLeft @@ -74,7 +74,7 @@ - + nicknameLabel @@ -95,7 +95,7 @@ &Nick name: - + AlignVCenter|AlignLeft @@ -104,7 +104,7 @@ - + gamenameEdit @@ -115,7 +115,7 @@ Enter a name that identifies you in the game - + nicknameEdit @@ -128,5 +128,5 @@ - + diff --git a/kbattleship/kbattleship/dialogs/statDlg.ui b/kbattleship/kbattleship/dialogs/statDlg.ui index 7ff2c202..6af104de 100644 --- a/kbattleship/kbattleship/dialogs/statDlg.ui +++ b/kbattleship/kbattleship/dialogs/statDlg.ui @@ -1,10 +1,10 @@ statDlg - + statDlg - + 0 0 @@ -32,14 +32,14 @@ Expanding - + 20 20 - + Layout8 @@ -63,14 +63,14 @@ Expanding - + 20 20 - + OwnLabel @@ -84,7 +84,7 @@ 0 - + TextLabel1 @@ -97,13 +97,13 @@ : - + AlignCenter - + EnemyLabel @@ -116,7 +116,7 @@ 0 - + AlignVCenter|AlignRight @@ -132,7 +132,7 @@ Expanding - + 20 20 @@ -151,14 +151,14 @@ Expanding - + 20 20 - + gbShots @@ -181,7 +181,7 @@ 6 - + Layout17 @@ -195,7 +195,7 @@ 6 - + pShots_2 @@ -224,14 +224,14 @@ Expanding - + 20 20 - + ShotLCD @@ -255,7 +255,7 @@ - + gbHits @@ -272,7 +272,7 @@ 6 - + Layout15 @@ -286,7 +286,7 @@ 6 - + pHits_2 @@ -315,14 +315,14 @@ Expanding - + 20 20 - + HitLCD @@ -343,7 +343,7 @@ - + gbWater @@ -360,7 +360,7 @@ 6 - + Layout18 @@ -374,7 +374,7 @@ 6 - + pWater_2 @@ -403,14 +403,14 @@ Expanding - + 20 20 - + WaterLCD @@ -441,7 +441,7 @@ Expanding - + 20 20 @@ -461,5 +461,5 @@ 789c3d98d9522b460e86efcf53504777a7a614e3dd959a0bc060035e31669b9a0bb51730c678df989a77cfef96d421247ca8b5fc92ba7d92bffe9cbd749a677ffefab5dec86632381b7cc8eaeccf703b9b1dfff3df7fffefd7ef5ce60c7f670bd9b3ecef7ffdfa1d32678333cae0af522ef29d71def8d2b86cfc9038447e331e987d9d58ed7de7b2dadbcae719b5d3dcd9ecf7c679655a189795799f38faf393f140996e94b319b31f8df3957c8cff9c7810b96a3c50e60be55cc6ec1abfec7ab8a79cea6767ab6f636cf5f3dad8ea0fb789355e30b6fef020b1da0fcaae275c39ab1e1e1bbbbe4262d533342eab9dae13abfdc3d8f487aeb2ebe76767d1f87963ef5fd6d9ece7c665657e3cf1799a273f18fb3cb789a3beeec6d8f5af945dbf8871deec7d67ebc7c2d8f4f22cb1eaf9311e987d9258ed2367ab7fa99cfaf1eeac7609c6a69fbb89b53f7563ef4727b1da73c69eef32b1da5f94f31965a6c8691f588c4dbfd48c7dbf76ce66a7c4311e358dad1f524dacf637e59ced1bb5136b3d5367ad9f5ac6b61f5475b6fd38248e76c9185b7fe822b1eaef197b7f3e136b7cd3effd09afce41cf5f19fb3c5ace6aa7983f9bf6452ac6de8f5162cdf7a29cde8799b3d5ff6cecf7efdbd9ec2563dfc7b9b3f587126bbeacb1e9a75e62ed9fc71fa81ea92be7bd9e65628d977336fd0563eb0f579dad7f2de3b29d7f30f67c711fb215d7136ace763fae8cbd7f4767d37b9358ed3fca5e3f7f2556bd0767cb3f36f67d1a385bfd569fd72f6f8987d1ee6c7ac23e71b493cea352f07d7a491ced12fb933bcff9fbfa6a6c7a65e66cf36828bbbeb04dacfd5b199b1eba74b6fedf1bfb7e1c9cadfea5b1f7b3e36cfef9c4aaef56b9e0f98fcea6b796389e0f4de382d96f126b3fe27ee5d2fce4d6d8eb3d37f6fdbd76b6fa878935de93b2d7270fcea6a79858cf4f8dbdbe4662d53b741e14e2f90be38a9dbf4eacfb5171b6f31de3a1e5ff4eacf9e3e7511ef3b2f96f8c5d6f4139f5bbe16cfbb932b6fa696fecf5349db59e3032f67a2689f57cddd9ce4f958be776be9658ebbf71b6f38fc6de2fcd2f5e5fb830b6fae4ced8ea916c62dd9f0f678b1f94bd1ef94aacf3da3a5bfefbc46a777fab8fc689d5de35f6f9c5fd2f640b05dbcf86b2e70b3fce16af6c6c7ae53db19eff74363d8bc4da0f67eb0fad9cf53ce7126bbcb9b1efd3d1d9cebf26567b4fb9e4fd89f32a88d71b06ce66ff34f6793d3b5bfdef89d5be36f67a76ce564f39b1da4bce43eddf9d72c9f76be26cfeb789d53e7436ff91b1f733be87c5acdbb9686c76ce38ab5d96c6a68f7689751e5fce966f6d6c7ac2d859ed21def762aa3fec8cbdbfe7c63edfbbc45affd6d9f23d195b3fe923b19eef3adbf94fe5b2efffccd9f4c679947229de5439d98bc6deaf92b3d95f138fa2ffc0d8ea0df1fd2b8574fec7d8f55c258efef2616c7ae8d1d9e2c5fee38f7b43cbf7ae5cf1f91612477bb8761e15238bb1d5132689357ffcefb372a8b8de7b67b3bf386b3cda185bfdd47756bbec8dadde10cf57f26ea78ab1e9e37367b57336b1fab3b2b8def83e550662fa649e58eba91b8bdabb1b26160e3ce0218f78cceffcc113fee429fef9c5337c7ff39c17bc846582af39af78cd1bde763731df8677bce7031ff9872ff892afb8cad77cc335aef32dbeeef89e1bdce4167ed386adc35d9c7ee01e3f44ff47eec3ff899f91b3c52ffcca6f9ce173ce728ef35ce02297f05319bf7be50ae2bee0dc1bef88cd7f83cafba8eb8a88845b14b844031ad288c6f44e1f34e137fa44ee6b6ed094be6846df88d2e715cdd59f167ca4254edcd08ad6b4a12ded28d09e0e74a41fe86dd305f7e91267eafc4a57885425a12a8fa3ff135dd30db886c8759aa1ca3addd21ddd53951ad4a4166a5b529bdac8dfa13d7297a94b0fd4e369f43ff57dc22fa8f791fa34e25b7aa2677aa1577aa30c9df39cb298d152274039cad3150dd1c9776a47ff211f68498553975073910aa0364fa94465aa0843fb2b1d857823c27d0950b34505797451f52ff92003be95217ed7a4aa8c507755c6f22e1ff42113f99429ede44b66f48c492fe59b6b72ea89f02afaa343b482e62f78f7a014ded496057dd2a32c29c80adf4b59d34a3694e505f5309b2ff4d0f2a3331df438275bc4cc4125b64b76b2e73b643dc8024adb3493a3fcc8858ce15fe51bb9c446d4e839eef79554e51a14d09b3636b3cf5f31f717a69fc50cdb98213443c10dcfa52675e8bcc5e97b5e46ff5bb9433fa6728fcaaad8a6be4c658f0dda4a439ad2a21769c3a3814daed1443ab8050dd94a97afa51af52fe8809343587bf07d40b706d2931d8d642d8fd297963c207f40bc23b7e409353c23ff0a3bacf39fa3b217799537c9a0febe9c43f71e9dcf626a39c11f74a881c91631a1a21cb14fd82129a19b2b91e83f96326ac3ecf95b3252917a60da7109678b98c4919e0261b773320912023ab20c03dc8a3cf2af63ff73d4912e5d85217fa303cf61848c35dc8470ea12badf44e426faf1888a3e70977a50b285da0bf5c75635b077537c8454b14b1bec721ffbbfc2366fd1f11aedc3587ab486f7845af09a8577dcc9a2d47911ebefe35e35691d3ee880fdeaf3166fd14c1ec204a74af0df05fc1bb3dc63b3dbb8b53dd83ee50691ecff4fe1a56ae34e8c30a34fd4b0a6676cef17b47e4a8f9bf2c1af612a0ff406db842e90ad717a63907f1ffd2788dae67af8a229269b0933d480b72f7ccb2eccd1c53db41c51f951821cb81d16e8de90af4fbb12fd0f889943059f88104e5b80aeb730d53195b16b3dec47239ceeffe95435ac30bd4beae2055986b5ea87822a5ebe06ee652e6c4eb700b358e06b0eef1dfcaaa77b2b6fd4099f611b7698247a110eda7fbc9c630c768f19d730f52ee2bf862366dec6bd20285923f712513be107fe1738d5c01b7d7a95a27fb80c57f0afe2b737785f6fa1af18f05606dc16fe0eb530c44f5fb0e28e40770df716d5867ab8d5fe87bb704f0bbc8105bc22d7786df0e663f7bba7379f0ea181cc43dc864e68483634d1834bbe0c2da87e228efeb7618daf76b8c21b56c31d29a136dde82ddefc1c174307113ba78d42f62a7ad8c50eddd33ce8fbbf0e0fb408f7bc878a1eb6fa0dd3bcc6e7c07778c4cf3778d1d7127f4fe8c9e9f303afd03ef4a13bfa87a7987f8d78cfdcc1fb38c73754e27daba2ceabd00a2fd0fb125e4f1cead073dddd40f53af463fe157e7a0b99b0c64b7efaf43cbde647be4435e7211bb2e8d765c885163e217a218fd8b81fe13eb45173e1f7fffffef50feb776dab - + diff --git a/kbattleship/kbattleship/kbaiplayer.h b/kbattleship/kbattleship/kbaiplayer.h index c5aa3a79..9f7128c3 100644 --- a/kbattleship/kbattleship/kbaiplayer.h +++ b/kbattleship/kbattleship/kbaiplayer.h @@ -26,9 +26,10 @@ #include "kbattlefield.h" #include "kshiplist.h" -class KBAIPlayer : public QObject +class KBAIPlayer : public TQObject { Q_OBJECT + TQ_OBJECT public: KBAIPlayer(); ~KBAIPlayer(); diff --git a/kbattleship/kbattleship/kbattlefield.cpp b/kbattleship/kbattleship/kbattlefield.cpp index c4a9e422..bb6cbd5a 100644 --- a/kbattleship/kbattleship/kbattlefield.cpp +++ b/kbattleship/kbattleship/kbattlefield.cpp @@ -20,10 +20,10 @@ #include "kbattlefield.h" -KBattleField::KBattleField(TQWidget *parent, bool grid) : KGridWidget(parent, grid) +KBattleField::KBattleField(TQWidget *tqparent, bool grid) : KGridWidget(tqparent, grid) { - m_parent = parent; - m_width = parent->width(); + m_parent = tqparent; + m_width = tqparent->width(); m_canDraw = true; m_ownfieldx = 10; @@ -91,7 +91,7 @@ void KBattleField::drawOwnField() if(!m_canDraw) return; - KBattleshipWindow *window = static_cast(m_parent->parent()->parent()); + KBattleshipWindow *window = static_cast(TQT_TQWIDGET(m_parent->tqparent()->tqparent())); KShip *ship = 0; int data; @@ -151,7 +151,7 @@ void KBattleField::drawEnemyField() if(!m_canDraw) return; - KBattleshipWindow *window = static_cast(m_parent->parent()->parent()); + KBattleshipWindow *window = static_cast(TQT_TQWIDGET(m_parent->tqparent()->tqparent())); for(int i = 0; i != m_enemyfieldx; i++) { diff --git a/kbattleship/kbattleship/kbattlefield.h b/kbattleship/kbattleship/kbattlefield.h index 94bcf3f5..51c62198 100644 --- a/kbattleship/kbattleship/kbattlefield.h +++ b/kbattleship/kbattleship/kbattlefield.h @@ -27,7 +27,7 @@ class KBattleField : public KGridWidget { public: enum{FREE, WATER, HIT, DEATH, BORDER, SHIP1P1, SHIP2P1, SHIP2P2, SHIP3P1, SHIP3P2, SHIP3P3, SHIP4P1, SHIP4P2, SHIP4P3, SHIP4P4}; - KBattleField(TQWidget *parent, bool grid); + KBattleField(TQWidget *tqparent, bool grid); void clearOwnField(); void clearEnemyField(); diff --git a/kbattleship/kbattleship/kbattleship.cpp b/kbattleship/kbattleship/kbattleship.cpp index 32759e28..62952b19 100644 --- a/kbattleship/kbattleship/kbattleship.cpp +++ b/kbattleship/kbattleship/kbattleship.cpp @@ -84,24 +84,24 @@ void KBattleshipWindow::initStatusBar() { m_ownNickname = "-"; m_enemyNickname = "-"; - statusBar()->insertItem(i18n(" Player 1: %1 ").arg(m_ownNickname), ID_PLAYER_OWN, 0, true); - statusBar()->insertItem(i18n(" Player 2: %1 ").arg(m_enemyNickname), ID_PLAYER_ENEMY, 0, true); + statusBar()->insertItem(i18n(" Player 1: %1 ").tqarg(m_ownNickname), ID_PLAYER_OWN, 0, true); + statusBar()->insertItem(i18n(" Player 2: %1 ").tqarg(m_enemyNickname), ID_PLAYER_ENEMY, 0, true); statusBar()->insertItem(i18n("Ready"), ID_STATUS_MSG, 1); statusBar()->setItemAlignment(ID_STATUS_MSG, AlignLeft); } void KBattleshipWindow::initActions() { - KStdAction::configureNotifications(this, TQT_SLOT(slotConfigureNotifications()), actionCollection()); - m_gameServerConnect = new KAction(i18n("&Connect to Server..."), "connect_no", Key_F2, this, TQT_SLOT(slotServerConnect()), actionCollection(), "game_serverconnect"); - m_gameNewServer = new KAction(i18n("&Start Server..."), "network", Key_F3, this, TQT_SLOT(slotNewServer()), actionCollection(), "game_newserver"); - m_gameSingle = new KAction(i18n("S&ingle Player..."), "gear", Key_F4, this, TQT_SLOT(slotSinglePlayer()), actionCollection(), "game_singleplayer"); - m_gameQuit = KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); - KStdGameAction::highscores(this, TQT_SLOT(slotHighscore()), actionCollection()); - m_gameEnemyInfo = new KAction(i18n("&Enemy Info"), "view_text", Key_F11, this, TQT_SLOT(slotEnemyClientInfo()), actionCollection(), "game_enemyinfo"); + KStdAction::configureNotifications(TQT_TQOBJECT(this), TQT_SLOT(slotConfigureNotifications()), actionCollection()); + m_gameServerConnect = new KAction(i18n("&Connect to Server..."), "connect_no", Key_F2, TQT_TQOBJECT(this), TQT_SLOT(slotServerConnect()), actionCollection(), "game_serverconnect"); + m_gameNewServer = new KAction(i18n("&Start Server..."), "network", Key_F3, TQT_TQOBJECT(this), TQT_SLOT(slotNewServer()), actionCollection(), "game_newserver"); + m_gameSingle = new KAction(i18n("S&ingle Player..."), "gear", Key_F4, TQT_TQOBJECT(this), TQT_SLOT(slotSinglePlayer()), actionCollection(), "game_singleplayer"); + m_gameQuit = KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); + KStdGameAction::highscores(TQT_TQOBJECT(this), TQT_SLOT(slotHighscore()), actionCollection()); + m_gameEnemyInfo = new KAction(i18n("&Enemy Info"), "view_text", Key_F11, TQT_TQOBJECT(this), TQT_SLOT(slotEnemyClientInfo()), actionCollection(), "game_enemyinfo"); m_configSound = new KToggleAction(i18n("&Play Sounds"), 0, actionCollection(), "options_configure_sound"); - m_configGrid = new KToggleAction(i18n("&Show Grid"), 0, this, TQT_SLOT(slotShowGrid()), actionCollection(), "options_show_grid"); + m_configGrid = new KToggleAction(i18n("&Show Grid"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotShowGrid()), actionCollection(), "options_show_grid"); m_configGrid->setCheckedState(i18n("Hide Grid")); m_gameEnemyInfo->setEnabled(false); @@ -111,9 +111,9 @@ void KBattleshipWindow::initActions() void KBattleshipWindow::initChat() { - connect(m_chat, TQT_SIGNAL(sigSendMessage(const TQString &)), this, TQT_SLOT(slotSendChatMessage(const TQString &))); - connect(m_chat, TQT_SIGNAL(sigChangeEnemyNickname(const TQString &)), this, TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); - connect(m_chat, TQT_SIGNAL(sigChangeOwnNickname(const TQString &)), this, TQT_SLOT(slotChangedNickCommand(const TQString &))); + connect(m_chat, TQT_SIGNAL(sigSendMessage(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotSendChatMessage(const TQString &))); + connect(m_chat, TQT_SIGNAL(sigChangeEnemyNickname(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); + connect(m_chat, TQT_SIGNAL(sigChangeOwnNickname(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotChangedNickCommand(const TQString &))); } void KBattleshipWindow::changeShipPlacementDirection(){ @@ -122,8 +122,8 @@ void KBattleshipWindow::changeShipPlacementDirection(){ void KBattleshipWindow::initShipPlacing() { - connect(m_ownshiplist, TQT_SIGNAL(sigOwnFieldDataChanged(int, int, int)), this, TQT_SLOT(slotChangeOwnFieldData(int, int, int))); - connect(m_ownshiplist, TQT_SIGNAL(sigLastShipAdded()), this, TQT_SLOT(slotShipsReady())); + connect(m_ownshiplist, TQT_SIGNAL(sigOwnFieldDataChanged(int, int, int)), TQT_TQOBJECT(this), TQT_SLOT(slotChangeOwnFieldData(int, int, int))); + connect(m_ownshiplist, TQT_SIGNAL(sigLastShipAdded()), TQT_TQOBJECT(this), TQT_SLOT(slotShipsReady())); } void KBattleshipWindow::initView() @@ -148,10 +148,10 @@ void KBattleshipWindow::initView() m_view->startDrawing(); setFocusProxy(m_view); - connect(m_view, TQT_SIGNAL(sigEnemyFieldClicked(int, int)), this, TQT_SLOT(slotEnemyFieldClick(int, int))); - connect(m_view, TQT_SIGNAL(sigOwnFieldClicked(int, int)), this, TQT_SLOT(slotPlaceShip(int, int))); - connect(m_view, TQT_SIGNAL(sigMouseOverField(int, int)), this, TQT_SLOT(slotPlaceShipPreview(int, int))); - connect(m_view, TQT_SIGNAL(changeShipPlacementDirection()), this, TQT_SLOT(changeShipPlacementDirection())); + connect(m_view, TQT_SIGNAL(sigEnemyFieldClicked(int, int)), TQT_TQOBJECT(this), TQT_SLOT(slotEnemyFieldClick(int, int))); + connect(m_view, TQT_SIGNAL(sigOwnFieldClicked(int, int)), TQT_TQOBJECT(this), TQT_SLOT(slotPlaceShip(int, int))); + connect(m_view, TQT_SIGNAL(sigMouseOverField(int, int)), TQT_TQOBJECT(this), TQT_SLOT(slotPlaceShipPreview(int, int))); + connect(m_view, TQT_SIGNAL(changeShipPlacementDirection()), TQT_TQOBJECT(this), TQT_SLOT(changeShipPlacementDirection())); } void KBattleshipWindow::slotDeleteAI() @@ -314,14 +314,14 @@ void KBattleshipWindow::slotEnemyFieldClick(int fieldx, int fieldy) slotStatusMsg(i18n("You won the game :)")); m_stat->slotAddOwnWon(); slotUpdateHighscore(); - switch(KMessageBox::questionYesNo(this, i18n("Do you want to restart the game?"),TQString::null,i18n("Restart"),i18n("Do Not Restart"))) + switch(KMessageBox::questionYesNo(this, i18n("Do you want to restart the game?"),TQString(),i18n("Restart"),i18n("Do Not Restart"))) { case KMessageBox::Yes: - TQTimer::singleShot(0, this, TQT_SLOT(slotRestartAI())); + TQTimer::singleShot(0, TQT_TQOBJECT(this), TQT_SLOT(slotRestartAI())); break; case KMessageBox::No: - TQTimer::singleShot(0, this, TQT_SLOT(slotDeleteAI())); + TQTimer::singleShot(0, TQT_TQOBJECT(this), TQT_SLOT(slotDeleteAI())); break; } return; @@ -697,8 +697,8 @@ void KBattleshipWindow::slotServerConnect() slotStatusMsg(i18n("Loading Connect-Server dialog...")); m_client = new KClientDialog(this); - connect(m_client, TQT_SIGNAL(sigConnectServer()), this, TQT_SLOT(slotConnectToBattleshipServer())); - connect(m_client, TQT_SIGNAL(sigCancelConnect()), this, TQT_SLOT(slotDeleteConnectDialog())); + connect(m_client, TQT_SIGNAL(sigConnectServer()), TQT_TQOBJECT(this), TQT_SLOT(slotConnectToBattleshipServer())); + connect(m_client, TQT_SIGNAL(sigCancelConnect()), TQT_TQOBJECT(this), TQT_SLOT(slotDeleteConnectDialog())); m_client->show(); slotStatusMsg(i18n("Ready")); @@ -715,7 +715,7 @@ void KBattleshipWindow::slotDeleteConnectDialog() void KBattleshipWindow::slotReplayRequest() { - switch(KMessageBox::questionYesNo(this, i18n("The client is asking to restart the game. Do you accept?"),TQString::null,i18n("Accept Restart"), i18n("Deny Restart"))) + switch(KMessageBox::questionYesNo(this, i18n("The client is asking to restart the game. Do you accept?"),TQString(),i18n("Accept Restart"), i18n("Deny Restart"))) { case KMessageBox::Yes: if (m_connection) @@ -735,7 +735,7 @@ void KBattleshipWindow::slotReplayRequest() void KBattleshipWindow::slotServerReplay() { KMessage *msg = new KMessage(KMessage::REPLAY); - switch(KMessageBox::questionYesNo(this, i18n("Do you want to restart the game?"), TQString::null, i18n("Restart"), i18n("Do Not Restart"))) + switch(KMessageBox::questionYesNo(this, i18n("Do you want to restart the game?"), TQString(), i18n("Restart"), i18n("Do Not Restart"))) { case KMessageBox::Yes: if (m_connection) @@ -761,7 +761,7 @@ void KBattleshipWindow::slotServerReplay() void KBattleshipWindow::slotClientReplay() { KMessage *msg = new KMessage(KMessage::REPLAY); - switch(KMessageBox::questionYesNo(this, i18n("Do you want to ask the server restarting the game?"), TQString::null, i18n("Ask to Restart"), i18n("Do Not Ask"))) + switch(KMessageBox::questionYesNo(this, i18n("Do you want to ask the server restarting the game?"), TQString(), i18n("Ask to Restart"), i18n("Do Not Ask"))) { case KMessageBox::Yes: if (m_connection) @@ -806,8 +806,8 @@ void KBattleshipWindow::slotNewServer() slotStatusMsg(i18n("Loading Start-Server dialog...")); m_server = new KServerDialog(this); - connect(m_server, TQT_SIGNAL(okClicked()), this, TQT_SLOT(slotStartBattleshipServer())); - connect(m_server, TQT_SIGNAL(cancelClicked()), this, TQT_SLOT(slotDeleteServerDialog())); + connect(m_server, TQT_SIGNAL(okClicked()), TQT_TQOBJECT(this), TQT_SLOT(slotStartBattleshipServer())); + connect(m_server, TQT_SIGNAL(cancelClicked()), TQT_TQOBJECT(this), TQT_SLOT(slotDeleteServerDialog())); m_server->show(); slotStatusMsg(i18n("Ready")); @@ -828,7 +828,7 @@ void KBattleshipWindow::slotSendVersion() msg->versionMessage(); slotSendMessage(msg); - TQTimer::singleShot(150, this, TQT_SLOT(slotSendGreet())); + TQTimer::singleShot(150, TQT_TQOBJECT(this), TQT_SLOT(slotSendGreet())); } void KBattleshipWindow::slotSendGreet() @@ -862,49 +862,49 @@ void KBattleshipWindow::slotStartBattleshipServer() if(m_connection == 0) { m_connection = new KonnectionHandling(this, m_kbserver); - connect(m_connection, TQT_SIGNAL(sigStatusBar(const TQString &)), this, TQT_SLOT(slotStatusMsg(const TQString &))); - connect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), this, TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); - connect(m_connection, TQT_SIGNAL(sigSendNickname()), this, TQT_SLOT(slotSendGreet())); - connect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), this, TQT_SLOT(slotSetPlaceable(bool))); - connect(m_connection, TQT_SIGNAL(sigShootable(bool)), this, TQT_SLOT(slotSetShootable(bool))); - connect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), this, TQT_SLOT(slotSendEnemyFieldState(int, int))); - connect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); - connect(m_connection, TQT_SIGNAL(sigClientLost()), this, TQT_SLOT(slotClientLost())); - connect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), this, TQT_SLOT(slotAbortNetworkGame())); - connect(m_connection, TQT_SIGNAL(sigReplay()), this, TQT_SLOT(slotReplayRequest())); + connect(m_connection, TQT_SIGNAL(sigStatusBar(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotStatusMsg(const TQString &))); + connect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); + connect(m_connection, TQT_SIGNAL(sigSendNickname()), TQT_TQOBJECT(this), TQT_SLOT(slotSendGreet())); + connect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), TQT_TQOBJECT(this), TQT_SLOT(slotSetPlaceable(bool))); + connect(m_connection, TQT_SIGNAL(sigShootable(bool)), TQT_TQOBJECT(this), TQT_SLOT(slotSetShootable(bool))); + connect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), TQT_TQOBJECT(this), TQT_SLOT(slotSendEnemyFieldState(int, int))); + connect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), TQT_TQOBJECT(this), TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); + connect(m_connection, TQT_SIGNAL(sigClientLost()), TQT_TQOBJECT(this), TQT_SLOT(slotClientLost())); + connect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), TQT_TQOBJECT(this), TQT_SLOT(slotAbortNetworkGame())); + connect(m_connection, TQT_SIGNAL(sigReplay()), TQT_TQOBJECT(this), TQT_SLOT(slotReplayRequest())); connect(m_connection, TQT_SIGNAL(sigChatMessage(const TQString &, const TQString &, bool)), m_chat, TQT_SLOT(slotReceivedMessage(const TQString &, const TQString &, bool))); - connect(m_connection, TQT_SIGNAL(sigClientInformation(const TQString &, const TQString &, const TQString &, const TQString &)), this, TQT_SLOT(slotReceivedClientInformation(const TQString &, const TQString &, const TQString &, const TQString &))); - connect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), this, TQT_SLOT(slotLost(KMessage *))); + connect(m_connection, TQT_SIGNAL(sigClientInformation(const TQString &, const TQString &, const TQString &, const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotReceivedClientInformation(const TQString &, const TQString &, const TQString &, const TQString &))); + connect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), TQT_TQOBJECT(this), TQT_SLOT(slotLost(KMessage *))); } else { if(m_connection->type() == KonnectionHandling::CLIENT) { - disconnect(m_kbclient, TQT_SIGNAL(sigConnected()), this, TQT_SLOT(slotSendVersion())); - disconnect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), this, TQT_SLOT(slotAbortNetworkGame())); - disconnect(m_connection, TQT_SIGNAL(sigStatusBar(const TQString &)), this, TQT_SLOT(slotStatusMsg(const TQString &))); - disconnect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), this, TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); - disconnect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), this, TQT_SLOT(slotSendEnemyFieldState(int, int))); - disconnect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); - disconnect(m_connection, TQT_SIGNAL(sigShootable(bool)), this, TQT_SLOT(slotSetShootable(bool))); - disconnect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), this, TQT_SLOT(slotSetPlaceable(bool))); - disconnect(m_connection, TQT_SIGNAL(sigServerLost()), this, TQT_SLOT(slotServerLost())); - disconnect(m_connection, TQT_SIGNAL(sigReplay()), this, TQT_SLOT(slotReplay())); + disconnect(m_kbclient, TQT_SIGNAL(sigConnected()), TQT_TQOBJECT(this), TQT_SLOT(slotSendVersion())); + disconnect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), TQT_TQOBJECT(this), TQT_SLOT(slotAbortNetworkGame())); + disconnect(m_connection, TQT_SIGNAL(sigStatusBar(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotStatusMsg(const TQString &))); + disconnect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); + disconnect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), TQT_TQOBJECT(this), TQT_SLOT(slotSendEnemyFieldState(int, int))); + disconnect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), TQT_TQOBJECT(this), TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); + disconnect(m_connection, TQT_SIGNAL(sigShootable(bool)), TQT_TQOBJECT(this), TQT_SLOT(slotSetShootable(bool))); + disconnect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), TQT_TQOBJECT(this), TQT_SLOT(slotSetPlaceable(bool))); + disconnect(m_connection, TQT_SIGNAL(sigServerLost()), TQT_TQOBJECT(this), TQT_SLOT(slotServerLost())); + disconnect(m_connection, TQT_SIGNAL(sigReplay()), TQT_TQOBJECT(this), TQT_SLOT(slotReplay())); disconnect(m_connection, TQT_SIGNAL(sigChatMessage(const TQString &, const TQString &, bool)), m_chat, TQT_SLOT(slotReceivedMessage(const TQString &, const TQString &, bool))); - disconnect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), this, TQT_SLOT(slotLost(KMessage *))); + disconnect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), TQT_TQOBJECT(this), TQT_SLOT(slotLost(KMessage *))); m_connection->updateInternal(m_kbserver); - connect(m_connection, TQT_SIGNAL(sigStatusBar(const TQString &)), this, TQT_SLOT(slotStatusMsg(const TQString &))); - connect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), this, TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); - connect(m_connection, TQT_SIGNAL(sigSendNickname()), this, TQT_SLOT(slotSendGreet())); - connect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), this, TQT_SLOT(slotSetPlaceable(bool))); - connect(m_connection, TQT_SIGNAL(sigShootable(bool)), this, TQT_SLOT(slotSetShootable(bool))); - connect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), this, TQT_SLOT(slotSendEnemyFieldState(int, int))); - connect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); - connect(m_connection, TQT_SIGNAL(sigClientLost()), this, TQT_SLOT(slotClientLost())); - connect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), this, TQT_SLOT(slotAbortNetworkGame())); - connect(m_connection, TQT_SIGNAL(sigReplay()), this, TQT_SLOT(slotReplayRequest())); + connect(m_connection, TQT_SIGNAL(sigStatusBar(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotStatusMsg(const TQString &))); + connect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); + connect(m_connection, TQT_SIGNAL(sigSendNickname()), TQT_TQOBJECT(this), TQT_SLOT(slotSendGreet())); + connect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), TQT_TQOBJECT(this), TQT_SLOT(slotSetPlaceable(bool))); + connect(m_connection, TQT_SIGNAL(sigShootable(bool)), TQT_TQOBJECT(this), TQT_SLOT(slotSetShootable(bool))); + connect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), TQT_TQOBJECT(this), TQT_SLOT(slotSendEnemyFieldState(int, int))); + connect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), TQT_TQOBJECT(this), TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); + connect(m_connection, TQT_SIGNAL(sigClientLost()), TQT_TQOBJECT(this), TQT_SLOT(slotClientLost())); + connect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), TQT_TQOBJECT(this), TQT_SLOT(slotAbortNetworkGame())); + connect(m_connection, TQT_SIGNAL(sigReplay()), TQT_TQOBJECT(this), TQT_SLOT(slotReplayRequest())); connect(m_connection, TQT_SIGNAL(sigChatMessage(const TQString &, const TQString &, bool)), m_chat, TQT_SLOT(slotReceivedMessage(const TQString &, const TQString &, bool))); - connect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), this, TQT_SLOT(slotLost(KMessage *))); + connect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), TQT_TQOBJECT(this), TQT_SLOT(slotLost(KMessage *))); } else m_connection->updateInternal(m_kbserver); @@ -1075,14 +1075,14 @@ void KBattleshipWindow::parseCommandLine() { if( !u.isValid()) { KMessageBox::sorry(this, i18n("The URL passed to KDE Battleship '%1' is not a valid url") - .arg(args->arg(0))); + .tqarg(args->arg(0))); return; } if( u.protocol() != "kbattleship" ) { KMessageBox::sorry(this, i18n("The URL passed to KDE Battleship '%1' is not recognised " "as a Battleship game.") - .arg(args->arg(0))); + .tqarg(args->arg(0))); return; } @@ -1119,51 +1119,51 @@ void KBattleshipWindow::slotConnectToBattleshipServer(const TQString &host, int if(m_connection == 0) { m_connection = new KonnectionHandling(this, m_kbclient); - connect(m_kbclient, TQT_SIGNAL(sigConnected()), this, TQT_SLOT(slotSendVersion())); - connect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), this, TQT_SLOT(slotAbortNetworkGame())); - connect(m_connection, TQT_SIGNAL(sigStatusBar(const TQString &)), this, TQT_SLOT(slotStatusMsg(const TQString &))); - connect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), this, TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); - connect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), this, TQT_SLOT(slotSendEnemyFieldState(int, int))); - connect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); - connect(m_connection, TQT_SIGNAL(sigShootable(bool)), this, TQT_SLOT(slotSetShootable(bool))); - connect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), this, TQT_SLOT(slotSetPlaceable(bool))); - connect(m_connection, TQT_SIGNAL(sigServerLost()), this, TQT_SLOT(slotServerLost())); - connect(m_connection, TQT_SIGNAL(sigReplay()), this, TQT_SLOT(slotReplay())); + connect(m_kbclient, TQT_SIGNAL(sigConnected()), TQT_TQOBJECT(this), TQT_SLOT(slotSendVersion())); + connect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), TQT_TQOBJECT(this), TQT_SLOT(slotAbortNetworkGame())); + connect(m_connection, TQT_SIGNAL(sigStatusBar(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotStatusMsg(const TQString &))); + connect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); + connect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), TQT_TQOBJECT(this), TQT_SLOT(slotSendEnemyFieldState(int, int))); + connect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), TQT_TQOBJECT(this), TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); + connect(m_connection, TQT_SIGNAL(sigShootable(bool)), TQT_TQOBJECT(this), TQT_SLOT(slotSetShootable(bool))); + connect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), TQT_TQOBJECT(this), TQT_SLOT(slotSetPlaceable(bool))); + connect(m_connection, TQT_SIGNAL(sigServerLost()), TQT_TQOBJECT(this), TQT_SLOT(slotServerLost())); + connect(m_connection, TQT_SIGNAL(sigReplay()), TQT_TQOBJECT(this), TQT_SLOT(slotReplay())); connect(m_connection, TQT_SIGNAL(sigChatMessage(const TQString &, const TQString &, bool)), m_chat, TQT_SLOT(slotReceivedMessage(const TQString &, const TQString &, bool))); - connect(m_connection, TQT_SIGNAL(sigClientInformation(const TQString &, const TQString &, const TQString &, const TQString &)), this, TQT_SLOT(slotReceivedClientInformation(const TQString &, const TQString &, const TQString &, const TQString &))); - connect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), this, TQT_SLOT(slotLost(KMessage *))); + connect(m_connection, TQT_SIGNAL(sigClientInformation(const TQString &, const TQString &, const TQString &, const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotReceivedClientInformation(const TQString &, const TQString &, const TQString &, const TQString &))); + connect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), TQT_TQOBJECT(this), TQT_SLOT(slotLost(KMessage *))); } else { if(m_connection->type() == KonnectionHandling::SERVER) { - disconnect(m_connection, TQT_SIGNAL(sigStatusBar(const TQString &)), this, TQT_SLOT(slotStatusMsg(const TQString &))); - disconnect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), this, TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); - disconnect(m_connection, TQT_SIGNAL(sigSendNickname()), this, TQT_SLOT(slotSendGreet())); - disconnect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), this, TQT_SLOT(slotSetPlaceable(bool))); - disconnect(m_connection, TQT_SIGNAL(sigShootable(bool)), this, TQT_SLOT(slotSetShootable(bool))); - disconnect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), this, TQT_SLOT(slotSendEnemyFieldState(int, int))); - disconnect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); - disconnect(m_connection, TQT_SIGNAL(sigClientLost()), this, TQT_SLOT(slotClientLost())); - disconnect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), this, TQT_SLOT(slotAbortNetworkGame())); - disconnect(m_connection, TQT_SIGNAL(sigReplay()), this, TQT_SLOT(slotReplayRequest())); + disconnect(m_connection, TQT_SIGNAL(sigStatusBar(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotStatusMsg(const TQString &))); + disconnect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); + disconnect(m_connection, TQT_SIGNAL(sigSendNickname()), TQT_TQOBJECT(this), TQT_SLOT(slotSendGreet())); + disconnect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), TQT_TQOBJECT(this), TQT_SLOT(slotSetPlaceable(bool))); + disconnect(m_connection, TQT_SIGNAL(sigShootable(bool)), TQT_TQOBJECT(this), TQT_SLOT(slotSetShootable(bool))); + disconnect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), TQT_TQOBJECT(this), TQT_SLOT(slotSendEnemyFieldState(int, int))); + disconnect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), TQT_TQOBJECT(this), TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); + disconnect(m_connection, TQT_SIGNAL(sigClientLost()), TQT_TQOBJECT(this), TQT_SLOT(slotClientLost())); + disconnect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), TQT_TQOBJECT(this), TQT_SLOT(slotAbortNetworkGame())); + disconnect(m_connection, TQT_SIGNAL(sigReplay()), TQT_TQOBJECT(this), TQT_SLOT(slotReplayRequest())); disconnect(m_connection, TQT_SIGNAL(sigChatMessage(const TQString &, const TQString &, bool)), m_chat, TQT_SLOT(slotReceivedMessage(const TQString &, const TQString &, bool))); - disconnect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), this, TQT_SLOT(slotLost(KMessage *))); + disconnect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), TQT_TQOBJECT(this), TQT_SLOT(slotLost(KMessage *))); m_connection->updateInternal(m_kbclient); - connect(m_kbclient, TQT_SIGNAL(sigConnected()), this, TQT_SLOT(slotSendVersion())); - connect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), this, TQT_SLOT(slotAbortNetworkGame())); - connect(m_connection, TQT_SIGNAL(sigStatusBar(const TQString &)), this, TQT_SLOT(slotStatusMsg(const TQString &))); - connect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), this, TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); - connect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), this, TQT_SLOT(slotSendEnemyFieldState(int, int))); - connect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); - connect(m_connection, TQT_SIGNAL(sigShootable(bool)), this, TQT_SLOT(slotSetShootable(bool))); - connect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), this, TQT_SLOT(slotSetPlaceable(bool))); - connect(m_connection, TQT_SIGNAL(sigServerLost()), this, TQT_SLOT(slotServerLost())); - connect(m_connection, TQT_SIGNAL(sigReplay()), this, TQT_SLOT(slotReplay())); + connect(m_kbclient, TQT_SIGNAL(sigConnected()), TQT_TQOBJECT(this), TQT_SLOT(slotSendVersion())); + connect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), TQT_TQOBJECT(this), TQT_SLOT(slotAbortNetworkGame())); + connect(m_connection, TQT_SIGNAL(sigStatusBar(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotStatusMsg(const TQString &))); + connect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotChangeEnemyPlayer(const TQString &))); + connect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), TQT_TQOBJECT(this), TQT_SLOT(slotSendEnemyFieldState(int, int))); + connect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), TQT_TQOBJECT(this), TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool))); + connect(m_connection, TQT_SIGNAL(sigShootable(bool)), TQT_TQOBJECT(this), TQT_SLOT(slotSetShootable(bool))); + connect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), TQT_TQOBJECT(this), TQT_SLOT(slotSetPlaceable(bool))); + connect(m_connection, TQT_SIGNAL(sigServerLost()), TQT_TQOBJECT(this), TQT_SLOT(slotServerLost())); + connect(m_connection, TQT_SIGNAL(sigReplay()), TQT_TQOBJECT(this), TQT_SLOT(slotReplay())); connect(m_connection, TQT_SIGNAL(sigChatMessage(const TQString &, const TQString &, bool)), m_chat, TQT_SLOT(slotReceivedMessage(const TQString &, const TQString &, bool))); m_kbclient->init(); - connect(m_connection, TQT_SIGNAL(sigClientInformation(const TQString &, const TQString &, const TQString &, const TQString &)), this, TQT_SLOT(slotReceivedClientInformation(const TQString &, const TQString &, const TQString &, const TQString &))); - connect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), this, TQT_SLOT(slotLost(KMessage *))); + connect(m_connection, TQT_SIGNAL(sigClientInformation(const TQString &, const TQString &, const TQString &, const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(slotReceivedClientInformation(const TQString &, const TQString &, const TQString &, const TQString &))); + connect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), TQT_TQOBJECT(this), TQT_SLOT(slotLost(KMessage *))); } else m_connection->updateInternal(m_kbclient); @@ -1198,13 +1198,13 @@ void KBattleshipWindow::slotStatusMsg(const TQString &text) void KBattleshipWindow::slotChangeOwnPlayer(const TQString &text) { statusBar()->clear(); - statusBar()->changeItem(i18n(" Player 1: %1 ").arg(text), ID_PLAYER_OWN); + statusBar()->changeItem(i18n(" Player 1: %1 ").tqarg(text), ID_PLAYER_OWN); } void KBattleshipWindow::slotChangeEnemyPlayer(const TQString &text) { statusBar()->clear(); - statusBar()->changeItem(i18n(" Player 2: %1 ").arg(text), ID_PLAYER_ENEMY); + statusBar()->changeItem(i18n(" Player 2: %1 ").tqarg(text), ID_PLAYER_ENEMY); } void KBattleshipWindow::slotSinglePlayer() @@ -1234,7 +1234,7 @@ void KBattleshipWindow::slotSinglePlayer() slotStatusMsg(i18n("Ready")); m_stat->clear(); m_chat->clear(); - TQTimer::singleShot(0, this, TQT_SLOT(slotDeleteAI())); + TQTimer::singleShot(0, TQT_TQOBJECT(this), TQT_SLOT(slotDeleteAI())); cleanup(false); } } @@ -1269,8 +1269,8 @@ void KBattleshipWindow::slotStartBattleshipGame(bool clearstat) { m_aiPlayer = new KBAIPlayer(); m_aiPlayer->init(m_view->field(), m_enemyshiplist); - connect(m_aiPlayer, TQT_SIGNAL(sigReady()), this, TQT_SLOT(slotAIReady())); - connect(m_aiPlayer, TQT_SIGNAL(sigShootAt(const TQPoint)), this, TQT_SLOT(slotAIShootsAt(const TQPoint))); + connect(m_aiPlayer, TQT_SIGNAL(sigReady()), TQT_TQOBJECT(this), TQT_SLOT(slotAIReady())); + connect(m_aiPlayer, TQT_SIGNAL(sigShootAt(const TQPoint)), TQT_TQOBJECT(this), TQT_SLOT(slotAIShootsAt(const TQPoint))); } m_aiPlayer->slotRestart(); } @@ -1317,14 +1317,14 @@ void KBattleshipWindow::slotAIShootsAt(const TQPoint pos) m_stat->slotAddEnemyWon(); slotUpdateHighscore(); m_view->drawEnemyShipsAI(m_enemyshiplist); // let's show ai player ships - switch(KMessageBox::questionYesNo(this, i18n("Do you want to restart the game?"), TQString::null, i18n("Restart"), i18n("Do Not Restart"))) + switch(KMessageBox::questionYesNo(this, i18n("Do you want to restart the game?"), TQString(), i18n("Restart"), i18n("Do Not Restart"))) { case KMessageBox::Yes: - TQTimer::singleShot(0, this, TQT_SLOT(slotRestartAI())); + TQTimer::singleShot(0, TQT_TQOBJECT(this), TQT_SLOT(slotRestartAI())); break; case KMessageBox::No: - TQTimer::singleShot(0, this, TQT_SLOT(slotDeleteAI())); + TQTimer::singleShot(0, TQT_TQOBJECT(this), TQT_SLOT(slotDeleteAI())); break; } } diff --git a/kbattleship/kbattleship/kbattleship.h b/kbattleship/kbattleship/kbattleship.h index 9ba86eac..e90c16f0 100644 --- a/kbattleship/kbattleship/kbattleship.h +++ b/kbattleship/kbattleship/kbattleship.h @@ -47,6 +47,7 @@ class KBattleshipWindow : public KMainWindow { Q_OBJECT + TQ_OBJECT public: enum{ID_STATUS_MSG, ID_PLAYER_OWN, ID_PLAYER_ENEMY}; KBattleshipWindow(); diff --git a/kbattleship/kbattleship/kbattleshipclient.cpp b/kbattleship/kbattleship/kbattleshipclient.cpp index e7d61638..550323b1 100644 --- a/kbattleship/kbattleship/kbattleshipclient.cpp +++ b/kbattleship/kbattleship/kbattleshipclient.cpp @@ -43,8 +43,8 @@ void KBattleshipClient::init() return; } - m_readNotifier = new TQSocketNotifier(fd(), TQSocketNotifier::Read, this); - TQObject::connect(m_readNotifier, TQT_SIGNAL(activated(int)), TQT_SLOT(slotReadData())); + m_readNotifier = new TQSocketNotifier(fd(), TQSocketNotifier::Read, TQT_TQOBJECT(this)); + TQT_BASE_OBJECT_NAME::connect(m_readNotifier, TQT_SIGNAL(activated(int)), TQT_SLOT(slotReadData())); emit sigConnected(); } @@ -73,7 +73,7 @@ void KBattleshipClient::slotReadData() m_readBuffer += TQString::fromUtf8(buf); delete []buf; int pos; - while ((pos = m_readBuffer.find("")) >= 0) + while ((pos = m_readBuffer.tqfind("")) >= 0) { pos += 11; // Length of "" KMessage *msg = new KMessage(); diff --git a/kbattleship/kbattleship/kbattleshipclient.h b/kbattleship/kbattleship/kbattleshipclient.h index 1f6bdd96..8ea29fb8 100644 --- a/kbattleship/kbattleship/kbattleshipclient.h +++ b/kbattleship/kbattleship/kbattleshipclient.h @@ -25,6 +25,7 @@ class KBattleshipClient : public KExtendedSocket { Q_OBJECT + TQ_OBJECT public: KBattleshipClient(const TQString &host, int port); diff --git a/kbattleship/kbattleship/kbattleshipserver.cpp b/kbattleship/kbattleship/kbattleshipserver.cpp index a90533cc..34be153d 100644 --- a/kbattleship/kbattleship/kbattleshipserver.cpp +++ b/kbattleship/kbattleship/kbattleshipserver.cpp @@ -31,7 +31,7 @@ #include "kbattleshipserver.moc" KBattleshipServer::KBattleshipServer(int port, const TQString& name) - : KExtendedSocket(TQString::null, port, inetSocket | passiveSocket), m_name(name) + : KExtendedSocket(TQString(), port, inetSocket | passiveSocket), m_name(name) { m_port = port; m_serverSocket = 0; @@ -41,7 +41,7 @@ void KBattleshipServer::init() { if(listen()) { - KMessageBox::error(0L, i18n("Failed to bind to local port \"%1\"\n\nPlease check if another KBattleship server instance\nis running or another application uses this port.").arg(m_port)); + KMessageBox::error(0L, i18n("Failed to bind to local port \"%1\"\n\nPlease check if another KBattleship server instance\nis running or another application uses this port.").tqarg(m_port)); emit sigServerFailure(); return; } @@ -49,8 +49,8 @@ void KBattleshipServer::init() m_service.setType(BATTLESHIP_SERVICE); m_service.setPort(m_port); m_service.publishAsync(); - m_connectNotifier = new TQSocketNotifier(fd(), TQSocketNotifier::Read, this); - TQObject::connect(m_connectNotifier, TQT_SIGNAL(activated(int)), TQT_SLOT(slotNewConnection())); + m_connectNotifier = new TQSocketNotifier(fd(), TQSocketNotifier::Read, TQT_TQOBJECT(this)); + TQT_BASE_OBJECT_NAME::connect(m_connectNotifier, TQT_SIGNAL(activated(int)), TQT_SLOT(slotNewConnection())); } void KBattleshipServer::slotNewConnection() @@ -61,7 +61,7 @@ void KBattleshipServer::slotNewConnection() { m_service.stop(); m_serverSocket = sock; - m_readNotifier = new TQSocketNotifier(sock->fd(), TQSocketNotifier::Read, this); + m_readNotifier = new TQSocketNotifier(sock->fd(), TQSocketNotifier::Read, TQT_TQOBJECT(this)); TQObject::connect(m_readNotifier, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotReadClient())); emit sigNewConnect(); } @@ -85,7 +85,7 @@ void KBattleshipServer::slotReadClient() m_readBuffer += TQString::fromUtf8(buf); delete []buf; int pos; - while ((pos = m_readBuffer.find("")) >= 0) + while ((pos = m_readBuffer.tqfind("")) >= 0) { pos += 11; // Length of "" KMessage *msg = new KMessage(); diff --git a/kbattleship/kbattleship/kbattleshipserver.h b/kbattleship/kbattleship/kbattleshipserver.h index bb198db8..010165ca 100644 --- a/kbattleship/kbattleship/kbattleshipserver.h +++ b/kbattleship/kbattleship/kbattleshipserver.h @@ -26,6 +26,7 @@ class KBattleshipServer : public KExtendedSocket { Q_OBJECT + TQ_OBJECT public: KBattleshipServer(int port, const TQString& name); void init(); diff --git a/kbattleship/kbattleship/kbattleshipview.cpp b/kbattleship/kbattleship/kbattleshipview.cpp index 14339d78..35e1a06a 100644 --- a/kbattleship/kbattleship/kbattleshipview.cpp +++ b/kbattleship/kbattleship/kbattleshipview.cpp @@ -22,8 +22,8 @@ #include "kbattleship.h" #include "kbattleshipview.moc" -KBattleshipView::KBattleshipView(TQWidget *parent, const char *name, bool draw) - : TQWidget(parent, name, WResizeNoErase), m_drawGrid(draw) +KBattleshipView::KBattleshipView(TQWidget *tqparent, const char *name, bool draw) + : TQWidget(tqparent, name, WResizeNoErase), m_drawGrid(draw) { setFixedSize(20 * 32 + 30, 10 * 32 + 20); setBackgroundMode(NoBackground); @@ -106,11 +106,11 @@ void KBattleshipView::drawEnemyShipsHuman(KMessage *msg, KShipList *list) int posx, posy, placedLeft; bool left; int i = 3; - while (!msg->field(TQString("ship%1").arg(i)).isNull()) + while (!msg->field(TQString("ship%1").tqarg(i)).isNull()) { - posx = msg->field(TQString("ship%1").arg(i)).section(" ", 0, 0).toInt(); - posy = msg->field(TQString("ship%1").arg(i)).section(" ", 1, 1).toInt(); - placedLeft = msg->field(TQString("ship%1").arg(i)).section(" ", 2, 2).toInt(); + posx = msg->field(TQString("ship%1").tqarg(i)).section(" ", 0, 0).toInt(); + posy = msg->field(TQString("ship%1").tqarg(i)).section(" ", 1, 1).toInt(); + placedLeft = msg->field(TQString("ship%1").tqarg(i)).section(" ", 2, 2).toInt(); if (placedLeft == 0) left = false; else left = true; list->addNewShip(!left, posx, posy); @@ -152,7 +152,7 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event) { if(event->type() == TQEvent::KeyPress && m_decide) { - TQKeyEvent *keyEvent = static_cast(event); + TQKeyEvent *keyEvent = TQT_TQKEYEVENT(event); if(keyEvent->key() == Key_Shift){ emit sigMouseOverField(m_lastX, m_lastY); emit changeShipPlacementDirection(); @@ -160,7 +160,7 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event) } else if(event->type() == TQEvent::KeyRelease && m_decide) { - TQKeyEvent *keyEvent = static_cast(event); + TQKeyEvent *keyEvent = TQT_TQKEYEVENT(event); if(keyEvent->key() == Key_Shift){ emit sigMouseOverField(m_lastX, m_lastY); emit changeShipPlacementDirection(); @@ -170,15 +170,15 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event) { m_decide = false; - TQMouseEvent *mouseEvent = static_cast(event); + TQMouseEvent *mouseEvent = TQT_TQMOUSEEVENT(event); - if(mouseEvent->button() == RightButton){ + if(mouseEvent->button() == Qt::RightButton){ emit sigMouseOverField(m_lastX, m_lastY); emit changeShipPlacementDirection(); return true; } - if(mouseEvent->button() != LeftButton) + if(mouseEvent->button() != Qt::LeftButton) return false; TQPoint point(mouseEvent->x(), mouseEvent->y()); @@ -190,9 +190,9 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event) int fieldx = 0; int fieldy = 0; - if(ownRect.contains(point)) + if(ownRect.tqcontains(point)) newRect = ownRect; - else if(enemyRect.contains(point)) + else if(enemyRect.tqcontains(point)) newRect = enemyRect; else return false; @@ -204,7 +204,7 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event) j++; TQRect tempRect(i, newRect.top(), m_battlefield->gridSize(), newRect.bottom() - newRect.top()); - if(tempRect.contains(point)) + if(tempRect.tqcontains(point)) { fieldx = j; break; @@ -218,7 +218,7 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event) j++; TQRect tempRect(newRect.left(), i, newRect.right() - newRect.left(), m_battlefield->gridSize()); - if(tempRect.contains(point)) + if(tempRect.tqcontains(point)) { fieldy = j; break; @@ -237,7 +237,7 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event) setFocus(); m_decide = true; - TQMouseEvent *mouseEvent = static_cast(event); + TQMouseEvent *mouseEvent = TQT_TQMOUSEEVENT(event); TQPoint point(mouseEvent->x(), mouseEvent->y()); TQRect ownRect = m_battlefield->ownRect(); @@ -245,7 +245,7 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event) int fieldx = 0; int fieldy = 0; - if(ownRect.contains(point)) + if(ownRect.tqcontains(point)) { int j = -1; @@ -254,7 +254,7 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event) j++; TQRect tempRect(i, ownRect.top(), m_battlefield->gridSize(), ownRect.bottom() - ownRect.top()); - if(tempRect.contains(point)) + if(tempRect.tqcontains(point)) { fieldx = j; break; @@ -268,7 +268,7 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event) j++; TQRect tempRect(ownRect.left(), i, ownRect.right() - ownRect.left(), m_battlefield->gridSize()); - if(tempRect.contains(point)) + if(tempRect.tqcontains(point)) { fieldy = j; break; diff --git a/kbattleship/kbattleship/kbattleshipview.h b/kbattleship/kbattleship/kbattleshipview.h index 51d1fcc3..7e65b9f3 100644 --- a/kbattleship/kbattleship/kbattleshipview.h +++ b/kbattleship/kbattleship/kbattleshipview.h @@ -30,11 +30,12 @@ #include "kship.h" #include "kshiplist.h" -class KBattleshipView : public QWidget +class KBattleshipView : public TQWidget { Q_OBJECT + TQ_OBJECT public: - KBattleshipView(TQWidget *parent = 0, const char *name = 0, bool draw = false); + KBattleshipView(TQWidget *tqparent = 0, const char *name = 0, bool draw = false); ~KBattleshipView(); KBattleField *field() { return m_battlefield; } diff --git a/kbattleship/kbattleship/kbchooserstrategy.cpp b/kbattleship/kbattleship/kbchooserstrategy.cpp index 6473e73b..fc832086 100644 --- a/kbattleship/kbattleship/kbchooserstrategy.cpp +++ b/kbattleship/kbattleship/kbchooserstrategy.cpp @@ -25,7 +25,7 @@ #define MAX_CHILD_NUM 4 -KBChooserStrategy::KBChooserStrategy(KBStrategy *parent) : KBStrategy(parent) +KBChooserStrategy::KBChooserStrategy(KBStrategy *tqparent) : KBStrategy(tqparent) { m_destroyer = new KBDestroyShipStrategy(this); m_destroying = false; diff --git a/kbattleship/kbattleship/kbchooserstrategy.h b/kbattleship/kbattleship/kbchooserstrategy.h index 5ac7d7c2..c2df5103 100644 --- a/kbattleship/kbattleship/kbchooserstrategy.h +++ b/kbattleship/kbattleship/kbchooserstrategy.h @@ -25,7 +25,7 @@ class KBChooserStrategy : public KBStrategy { public: - KBChooserStrategy(KBStrategy *parent = 0); + KBChooserStrategy(KBStrategy *tqparent = 0); virtual ~KBChooserStrategy(); virtual void init(KBattleField *field, const TQRect &field_rect); diff --git a/kbattleship/kbattleship/kbdestroyshipstrategy.cpp b/kbattleship/kbattleship/kbdestroyshipstrategy.cpp index a3882963..05095311 100644 --- a/kbattleship/kbattleship/kbdestroyshipstrategy.cpp +++ b/kbattleship/kbattleship/kbdestroyshipstrategy.cpp @@ -17,7 +17,7 @@ #include "kbdestroyshipstrategy.h" -KBDestroyShipStrategy::KBDestroyShipStrategy(KBStrategy *parent) : KBStrategy(parent) +KBDestroyShipStrategy::KBDestroyShipStrategy(KBStrategy *tqparent) : KBStrategy(tqparent) { m_working = false; } @@ -320,7 +320,7 @@ void KBDestroyShipStrategy::markBorderingFields() if (m_direction == VERTICAL) { - while (m_fieldRect.contains(col, row) && + while (m_fieldRect.tqcontains(col, row) && m_battleField->ownState(col, row) == KBattleField::HIT) { row--; @@ -332,24 +332,24 @@ void KBDestroyShipStrategy::markBorderingFields() row++; i = col+1; // right of the ship j = col-1; // left of the ship - while (m_fieldRect.contains(col, row) && + while (m_fieldRect.tqcontains(col, row) && m_battleField->ownState(col, row) == KBattleField::HIT) { - if (m_fieldRect.contains(i, row)) + if (m_fieldRect.tqcontains(i, row)) setViablePos(i, row, false); - if (m_fieldRect.contains(j, row)) + if (m_fieldRect.tqcontains(j, row)) setViablePos(j, row, false); setViablePos(col, row, false); row++; } - if (m_fieldRect.contains(col, row)) + if (m_fieldRect.tqcontains(col, row)) { // below the ship setViablePos(col, row, false); } } else if (m_direction == HORIZONTAL) { - while (m_fieldRect.contains(col, row) && + while (m_fieldRect.tqcontains(col, row) && m_battleField->ownState(col, row) == KBattleField::HIT) { col--; @@ -361,17 +361,17 @@ void KBDestroyShipStrategy::markBorderingFields() col++; i = row+1; // below the ship j = row-1; // above the ship - while (m_fieldRect.contains(col, row) && + while (m_fieldRect.tqcontains(col, row) && m_battleField->ownState(col, row) == KBattleField::HIT) { - if (m_fieldRect.contains(col, i)) + if (m_fieldRect.tqcontains(col, i)) setViablePos(col, i, false); - if (m_fieldRect.contains(col, j)) + if (m_fieldRect.tqcontains(col, j)) setViablePos(col, j, false); setViablePos(col, row, false); col++; } - if (m_fieldRect.contains(col, row)) + if (m_fieldRect.tqcontains(col, row)) { // right of the ship setViablePos(col, row, false); } diff --git a/kbattleship/kbattleship/kbdestroyshipstrategy.h b/kbattleship/kbattleship/kbdestroyshipstrategy.h index 41503be1..c6e758a3 100644 --- a/kbattleship/kbattleship/kbdestroyshipstrategy.h +++ b/kbattleship/kbattleship/kbdestroyshipstrategy.h @@ -23,7 +23,7 @@ class KBDestroyShipStrategy : public KBStrategy { public: - KBDestroyShipStrategy(KBStrategy *parent = 0); + KBDestroyShipStrategy(KBStrategy *tqparent = 0); virtual void init(KBattleField *field, const TQRect &field_rect); virtual const TQPoint nextShot(); diff --git a/kbattleship/kbattleship/kbdiagonalshotstrategy.cpp b/kbattleship/kbattleship/kbdiagonalshotstrategy.cpp index db83bc75..57dc317d 100644 --- a/kbattleship/kbattleship/kbdiagonalshotstrategy.cpp +++ b/kbattleship/kbattleship/kbdiagonalshotstrategy.cpp @@ -16,7 +16,7 @@ #include "kbdiagonalshotstrategy.h" -KBDiagonalShotStrategy::KBDiagonalShotStrategy(KBStrategy *parent) : KBStrategy(parent) +KBDiagonalShotStrategy::KBDiagonalShotStrategy(KBStrategy *tqparent) : KBStrategy(tqparent) { m_column = 0; m_row = 0; @@ -34,7 +34,7 @@ const TQPoint KBDiagonalShotStrategy::nextShot() bool KBDiagonalShotStrategy::advance() { - while (m_fieldRect.contains(m_column, m_row)) + while (m_fieldRect.tqcontains(m_column, m_row)) { if(enemyFieldStateAt(m_column, m_row) != KBStrategy::SHOT) return true; @@ -97,7 +97,7 @@ TQPoint KBDiagonalShotStrategy::endPoint() if(m_vertical == 0 || m_horizontal == 0) return TQPoint(col, row); - while(m_fieldRect.contains(col, row)) + while(m_fieldRect.tqcontains(col, row)) { row += m_vertical; col += m_horizontal; diff --git a/kbattleship/kbattleship/kbdiagonalshotstrategy.h b/kbattleship/kbattleship/kbdiagonalshotstrategy.h index e328fad2..47af1240 100644 --- a/kbattleship/kbattleship/kbdiagonalshotstrategy.h +++ b/kbattleship/kbattleship/kbdiagonalshotstrategy.h @@ -23,7 +23,7 @@ class KBDiagonalShotStrategy : public KBStrategy { public: enum Direction {LEFTUP, LEFTDOWN, RIGHTUP, RIGHTDOWN}; - KBDiagonalShotStrategy(KBStrategy *parent = 0); + KBDiagonalShotStrategy(KBStrategy *tqparent = 0); virtual const TQPoint nextShot(); virtual bool hasMoreShots(); diff --git a/kbattleship/kbattleship/kbdiagonalwrapstrategy.cpp b/kbattleship/kbattleship/kbdiagonalwrapstrategy.cpp index 7055403b..7f0a305e 100644 --- a/kbattleship/kbattleship/kbdiagonalwrapstrategy.cpp +++ b/kbattleship/kbattleship/kbdiagonalwrapstrategy.cpp @@ -17,11 +17,11 @@ #include #include "kbdiagonalwrapstrategy.h" -KBDiagonalWrapStrategy::KBDiagonalWrapStrategy(KBStrategy *parent) : KBStrategy(parent) +KBDiagonalWrapStrategy::KBDiagonalWrapStrategy(KBStrategy *tqparent) : KBStrategy(tqparent) { m_child = new KBDiagonalShotStrategy(this); - if(parent == 0) + if(tqparent == 0) { m_destroyer = new KBDestroyShipStrategy(this); m_destroying = false; diff --git a/kbattleship/kbattleship/kbdiagonalwrapstrategy.h b/kbattleship/kbattleship/kbdiagonalwrapstrategy.h index f4a7c28d..26c271d1 100644 --- a/kbattleship/kbattleship/kbdiagonalwrapstrategy.h +++ b/kbattleship/kbattleship/kbdiagonalwrapstrategy.h @@ -24,7 +24,7 @@ class KBDiagonalWrapStrategy : public KBStrategy { public: - KBDiagonalWrapStrategy(KBStrategy *parent = 0); + KBDiagonalWrapStrategy(KBStrategy *tqparent = 0); virtual ~KBDiagonalWrapStrategy(); virtual void init(KBattleField *field, const TQRect &field_rect); diff --git a/kbattleship/kbattleship/kbhorizontalstepstrategy.cpp b/kbattleship/kbattleship/kbhorizontalstepstrategy.cpp index a6e931da..63ee74fa 100644 --- a/kbattleship/kbattleship/kbhorizontalstepstrategy.cpp +++ b/kbattleship/kbattleship/kbhorizontalstepstrategy.cpp @@ -17,10 +17,10 @@ #include #include "kbhorizontalstepstrategy.h" -KBHorizontalStepStrategy::KBHorizontalStepStrategy(KBStrategy *parent) : KBStrategy(parent) +KBHorizontalStepStrategy::KBHorizontalStepStrategy(KBStrategy *tqparent) : KBStrategy(tqparent) { m_child = 0; - if(parent == 0) // only the master destroys ships + if(tqparent == 0) // only the master destroys ships { m_destroyer = new KBDestroyShipStrategy(this); m_destroying = false; diff --git a/kbattleship/kbattleship/kbhorizontalstepstrategy.h b/kbattleship/kbattleship/kbhorizontalstepstrategy.h index 80ec7b72..21bfac4e 100644 --- a/kbattleship/kbattleship/kbhorizontalstepstrategy.h +++ b/kbattleship/kbattleship/kbhorizontalstepstrategy.h @@ -23,7 +23,7 @@ class KBHorizontalStepStrategy : public KBStrategy { public: - KBHorizontalStepStrategy(KBStrategy *parent = 0); + KBHorizontalStepStrategy(KBStrategy *tqparent = 0); virtual ~KBHorizontalStepStrategy(); virtual void init(KBattleField *field, const TQRect &field_rect); diff --git a/kbattleship/kbattleship/kbrandomshotstrategy.cpp b/kbattleship/kbattleship/kbrandomshotstrategy.cpp index 62416350..901fbe75 100644 --- a/kbattleship/kbattleship/kbrandomshotstrategy.cpp +++ b/kbattleship/kbattleship/kbrandomshotstrategy.cpp @@ -16,7 +16,7 @@ #include "kbrandomshotstrategy.h" -KBRandomShotStrategy::KBRandomShotStrategy(KBStrategy *parent) : KBStrategy(parent) +KBRandomShotStrategy::KBRandomShotStrategy(KBStrategy *tqparent) : KBStrategy(tqparent) { m_destroyer = new KBDestroyShipStrategy(this); m_destroying = false; diff --git a/kbattleship/kbattleship/kbrandomshotstrategy.h b/kbattleship/kbattleship/kbrandomshotstrategy.h index 141961b9..79e15018 100644 --- a/kbattleship/kbattleship/kbrandomshotstrategy.h +++ b/kbattleship/kbattleship/kbrandomshotstrategy.h @@ -25,7 +25,7 @@ class KBRandomShotStrategy : public KBStrategy { public: - KBRandomShotStrategy(KBStrategy *parent = 0); + KBRandomShotStrategy(KBStrategy *tqparent = 0); virtual ~KBRandomShotStrategy(); virtual void init(KBattleField *field, const TQRect &field_rect); diff --git a/kbattleship/kbattleship/kbstrategy.cpp b/kbattleship/kbattleship/kbstrategy.cpp index be445559..e7ce823a 100644 --- a/kbattleship/kbattleship/kbstrategy.cpp +++ b/kbattleship/kbattleship/kbstrategy.cpp @@ -17,9 +17,9 @@ #include "kbstrategy.h" -KBStrategy::KBStrategy(KBStrategy *parent) +KBStrategy::KBStrategy(KBStrategy *tqparent) { - m_parent = parent; + m_parent = tqparent; m_viableShots = 0; } diff --git a/kbattleship/kbattleship/kbstrategy.h b/kbattleship/kbattleship/kbstrategy.h index 9c4cdf15..04ade696 100644 --- a/kbattleship/kbattleship/kbstrategy.h +++ b/kbattleship/kbattleship/kbstrategy.h @@ -26,7 +26,7 @@ class KBStrategy { public: enum{FREE, SHOT, SHIP}; - KBStrategy(KBStrategy *parent = 0); + KBStrategy(KBStrategy *tqparent = 0); virtual ~KBStrategy(); virtual const TQPoint nextShot() = 0; diff --git a/kbattleship/kbattleship/kbverticalstepstrategy.cpp b/kbattleship/kbattleship/kbverticalstepstrategy.cpp index 7642ccaf..a9784463 100644 --- a/kbattleship/kbattleship/kbverticalstepstrategy.cpp +++ b/kbattleship/kbattleship/kbverticalstepstrategy.cpp @@ -18,11 +18,11 @@ #include #include "kbverticalstepstrategy.h" -KBVerticalStepStrategy::KBVerticalStepStrategy(KBStrategy *parent) : KBStrategy(parent) +KBVerticalStepStrategy::KBVerticalStepStrategy(KBStrategy *tqparent) : KBStrategy(tqparent) { m_child = 0; - if(parent == 0) // only the master destroys ships + if(tqparent == 0) // only the master destroys ships { m_destroyer = new KBDestroyShipStrategy(this); m_destroying = false; diff --git a/kbattleship/kbattleship/kbverticalstepstrategy.h b/kbattleship/kbattleship/kbverticalstepstrategy.h index a5d614c6..642210ca 100644 --- a/kbattleship/kbattleship/kbverticalstepstrategy.h +++ b/kbattleship/kbattleship/kbverticalstepstrategy.h @@ -24,7 +24,7 @@ class KBVerticalStepStrategy : public KBStrategy { public: - KBVerticalStepStrategy(KBStrategy *parent = 0); + KBVerticalStepStrategy(KBStrategy *tqparent = 0); virtual ~KBVerticalStepStrategy(); virtual void init(KBattleField *field, const TQRect &field_rect); diff --git a/kbattleship/kbattleship/kchatwidget.cpp b/kbattleship/kbattleship/kchatwidget.cpp index 9d5e12af..1e9dd005 100644 --- a/kbattleship/kbattleship/kchatwidget.cpp +++ b/kbattleship/kbattleship/kchatwidget.cpp @@ -18,7 +18,7 @@ #include #include "kchatwidget.moc" -KChatWidget::KChatWidget(TQWidget *parent, const char *name) : chatDlg(parent, name) +KChatWidget::KChatWidget(TQWidget *tqparent, const char *name) : chatDlg(tqparent, name) { connect(sendBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotComputeMessage())); connect(commentEdit, TQT_SIGNAL(returnPressed()), this, TQT_SLOT(slotComputeMessage())); @@ -26,13 +26,13 @@ KChatWidget::KChatWidget(TQWidget *parent, const char *name) : chatDlg(parent, n chatView->setMinimumSize(0, 50); commentEdit->installEventFilter(this); - m_currentNickname = TQString::null; + m_currentNickname = TQString(); slotAcceptMsg(false); } void KChatWidget::clear() { - m_currentNickname = TQString::null; + m_currentNickname = TQString(); slotAcceptMsg(false); chatView->clear(); commentEdit->clear(); @@ -61,9 +61,9 @@ void KChatWidget::slotReceivedMessage(const TQString &nickname, const TQString & bool KChatWidget::eventFilter(TQObject *obj, TQEvent *e) { - if(obj == commentEdit && e->type() == TQEvent::Wheel) + if(TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(commentEdit) && e->type() == TQEvent::Wheel) { - kapp->notify(chatView, e); + kapp->notify(TQT_TQOBJECT(chatView), e); return true; } return chatDlg::eventFilter(obj, e); diff --git a/kbattleship/kbattleship/kchatwidget.h b/kbattleship/kbattleship/kchatwidget.h index 7a0f0bed..574e8648 100644 --- a/kbattleship/kbattleship/kchatwidget.h +++ b/kbattleship/kbattleship/kchatwidget.h @@ -27,8 +27,9 @@ class KChatWidget : public chatDlg { Q_OBJECT + TQ_OBJECT public: - KChatWidget(TQWidget *parent = 0, const char *name = 0); + KChatWidget(TQWidget *tqparent = 0, const char *name = 0); void clear(); void setNickname(const TQString &nickname) { m_currentNickname = nickname; } diff --git a/kbattleship/kbattleship/kclientdialog.cpp b/kbattleship/kbattleship/kclientdialog.cpp index 97015b71..37cd7fe7 100644 --- a/kbattleship/kbattleship/kclientdialog.cpp +++ b/kbattleship/kbattleship/kclientdialog.cpp @@ -25,8 +25,8 @@ #include "kbattleshipserver.h" // for BATTLESHIP_SERVICE #include "kclientdialog.moc" -KClientDialog::KClientDialog(TQWidget *parent, const char *name) - : KDialogBase(Plain, i18n("Connect to Server"), Ok|Cancel, Ok, parent, name, true, false, KGuiItem(i18n("&Connect"))) +KClientDialog::KClientDialog(TQWidget *tqparent, const char *name) + : KDialogBase(Plain, i18n("Connect to Server"), Ok|Cancel, Ok, tqparent, name, true, false, KGuiItem(i18n("&Connect"))) { TQFrame* page = plainPage(); TQGridLayout* pageLayout = new TQGridLayout(page, 1, 1, 0, 0); @@ -42,7 +42,7 @@ KClientDialog::KClientDialog(TQWidget *parent, const char *name) connect(m_mainWidget->serverEdit, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(slotCheckEnableOk())); m_config->setGroup("History"); - m_browser = new DNSSD::ServiceBrowser(TQString::fromLatin1(BATTLESHIP_SERVICE)); + m_browser = new DNSSD::ServiceBrowser(TQString::tqfromLatin1(BATTLESHIP_SERVICE)); connect(m_browser,TQT_SIGNAL(finished()),TQT_SLOT(nextBatch())); m_browser->startBrowse(); connect(m_mainWidget->lanBox,TQT_SIGNAL(activated(int)),TQT_SLOT(gameSelected(int))); diff --git a/kbattleship/kbattleship/kclientdialog.h b/kbattleship/kbattleship/kclientdialog.h index f424baf6..f46018ab 100644 --- a/kbattleship/kbattleship/kclientdialog.h +++ b/kbattleship/kbattleship/kclientdialog.h @@ -32,8 +32,9 @@ class KClientDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - KClientDialog(TQWidget *parent = 0, const char *name = 0); + KClientDialog(TQWidget *tqparent = 0, const char *name = 0); ~KClientDialog(); TQString port() const; diff --git a/kbattleship/kbattleship/kgridwidget.cpp b/kbattleship/kbattleship/kgridwidget.cpp index 6cc660d7..cb6e573e 100644 --- a/kbattleship/kbattleship/kgridwidget.cpp +++ b/kbattleship/kbattleship/kgridwidget.cpp @@ -26,10 +26,10 @@ #include "kbattlefield.h" #include "kgridwidget.h" -KGridWidget::KGridWidget(TQWidget *parent, bool draw) : m_drawGrid(draw) +KGridWidget::KGridWidget(TQWidget *tqparent, bool draw) : m_drawGrid(draw) { - m_doubleBuffer = new TQPixmap(parent->width(), parent->height()); - m_parent = parent; + m_doubleBuffer = new TQPixmap(tqparent->width(), tqparent->height()); + m_parent = tqparent; cleanBuffer(); cacheImages(); @@ -392,8 +392,8 @@ void KGridWidget::drawIcon(const TQPixmap &icon, bool hitBlend, bool waterBlend, painter.end(); else { - painter.setBrush(Qt::NoBrush); - painter.setPen(Qt::black); + painter.setBrush(TQt::NoBrush); + painter.setPen(TQt::black); painter.drawRect(m_x, m_y, m_size, m_size); painter.end(); } diff --git a/kbattleship/kbattleship/kgridwidget.h b/kbattleship/kbattleship/kgridwidget.h index 1026695b..96ecde3a 100644 --- a/kbattleship/kbattleship/kgridwidget.h +++ b/kbattleship/kbattleship/kgridwidget.h @@ -23,7 +23,7 @@ class KGridWidget { public: - KGridWidget(TQWidget *parent, bool draw); + KGridWidget(TQWidget *tqparent, bool draw); ~KGridWidget(); void enableGrid() { m_drawGrid = true; } diff --git a/kbattleship/kbattleship/kmessage.cpp b/kbattleship/kbattleship/kmessage.cpp index a316b314..f17e4bf5 100644 --- a/kbattleship/kbattleship/kmessage.cpp +++ b/kbattleship/kbattleship/kmessage.cpp @@ -78,7 +78,7 @@ TQString KMessage::field(const TQString &name) const TQDomNode xmlNode = m_xmlDocument.documentElement().namedItem(name); if(!xmlNode.isNull()) return (xmlNode.toElement()).text(); - return TQString::null; + return TQString(); } int KMessage::type() diff --git a/kbattleship/kbattleship/konnectionhandling.cpp b/kbattleship/kbattleship/konnectionhandling.cpp index 5d5c1026..dc1a5880 100644 --- a/kbattleship/kbattleship/konnectionhandling.cpp +++ b/kbattleship/kbattleship/konnectionhandling.cpp @@ -19,7 +19,7 @@ extern const char *protocolVersion; -KonnectionHandling::KonnectionHandling(TQWidget *parent, KBattleshipServer *server) : TQObject(parent) +KonnectionHandling::KonnectionHandling(TQWidget *tqparent, KBattleshipServer *server) : TQObject(tqparent) { m_kbserver = server; m_kbclient = 0; @@ -31,7 +31,7 @@ KonnectionHandling::KonnectionHandling(TQWidget *parent, KBattleshipServer *serv connect(server, TQT_SIGNAL(sigMessageSent(KMessage *)), this, TQT_SLOT(slotMessageSent(KMessage *))); } -KonnectionHandling::KonnectionHandling(TQWidget *parent, KBattleshipClient *client) : TQObject(parent) +KonnectionHandling::KonnectionHandling(TQWidget *tqparent, KBattleshipClient *client) : TQObject(tqparent) { m_kbclient = client; m_kbserver = 0; @@ -94,7 +94,7 @@ void KonnectionHandling::slotNewMessage(KMessage *msg) case KMessage::DISCARD: if(msg->field("kmversion") == TQString("true")) { - KMessageBox::error(0L, i18n("Connection dropped by enemy. The client's protocol implementation (%1) is not compatible with our (%2) version.").arg(msg->field("reason")).arg(protocolVersion)); + KMessageBox::error(0L, i18n("Connection dropped by enemy. The client's protocol implementation (%1) is not compatible with our (%2) version.").tqarg(msg->field("reason")).tqarg(protocolVersion)); emit sigAbortNetworkGame(); } else @@ -156,10 +156,10 @@ void KonnectionHandling::slotNewMessage(KMessage *msg) { // First message....got client information case KMessage::GETVERSION: - if(msg->field("protocolVersion") != TQString::fromLatin1(protocolVersion)) + if(msg->field("protocolVersion") != TQString::tqfromLatin1(protocolVersion)) { m_kbserver->slotDiscardClient(protocolVersion, true, false); - KMessageBox::error(0L, i18n("Connection to client dropped. The client's protocol implementation (%1) is not compatible with our (%2) version.").arg(msg->field("protocolVersion")).arg(protocolVersion)); + KMessageBox::error(0L, i18n("Connection to client dropped. The client's protocol implementation (%1) is not compatible with our (%2) version.").tqarg(msg->field("protocolVersion")).tqarg(protocolVersion)); } else emit sigClientInformation(msg->field("clientName"), msg->field("clientVersion"), msg->field("clientDescription"), msg->field("protocolVersion")); @@ -232,7 +232,7 @@ void KonnectionHandling::slotSocketError(int error) break; default: - KMessageBox::error(0L, i18n("Unknown error; No: %1").arg(error)); + KMessageBox::error(0L, i18n("Unknown error; No: %1").tqarg(error)); break; } diff --git a/kbattleship/kbattleship/konnectionhandling.h b/kbattleship/kbattleship/konnectionhandling.h index 95615d66..598225c5 100644 --- a/kbattleship/kbattleship/konnectionhandling.h +++ b/kbattleship/kbattleship/konnectionhandling.h @@ -27,13 +27,14 @@ #include "kbattleshipserver.h" #include "kmessage.h" -class KonnectionHandling : public QObject +class KonnectionHandling : public TQObject { Q_OBJECT + TQ_OBJECT public: enum{SERVER, CLIENT}; - KonnectionHandling(TQWidget *parent, KBattleshipServer *server); - KonnectionHandling(TQWidget *parent, KBattleshipClient *client); + KonnectionHandling(TQWidget *tqparent, KBattleshipServer *server); + KonnectionHandling(TQWidget *tqparent, KBattleshipClient *client); int type() { return m_type; } diff --git a/kbattleship/kbattleship/kserverdialog.cpp b/kbattleship/kbattleship/kserverdialog.cpp index d8fa1b1d..2574757f 100644 --- a/kbattleship/kbattleship/kserverdialog.cpp +++ b/kbattleship/kbattleship/kserverdialog.cpp @@ -21,8 +21,8 @@ #include "kserverdialog.h" -KServerDialog::KServerDialog(TQWidget *parent, const char *name) : - KDialogBase(Plain, i18n("Start Server"), Ok|Cancel, Ok, parent, name, true, false, KGuiItem(i18n("&Start"))) +KServerDialog::KServerDialog(TQWidget *tqparent, const char *name) : + KDialogBase(Plain, i18n("Start Server"), Ok|Cancel, Ok, tqparent, name, true, false, KGuiItem(i18n("&Start"))) { TQFrame* page = plainPage(); TQGridLayout* pageLayout = new TQGridLayout(page, 1, 1, 0, 0); diff --git a/kbattleship/kbattleship/kserverdialog.h b/kbattleship/kbattleship/kserverdialog.h index ca455509..ad7cc499 100644 --- a/kbattleship/kbattleship/kserverdialog.h +++ b/kbattleship/kbattleship/kserverdialog.h @@ -31,8 +31,9 @@ class KServerDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - KServerDialog(TQWidget *parent = 0, const char *name = 0); + KServerDialog(TQWidget *tqparent = 0, const char *name = 0); TQString port() const; TQString nickname() const; diff --git a/kbattleship/kbattleship/kship.cpp b/kbattleship/kbattleship/kship.cpp index a9fbb558..05e893b3 100644 --- a/kbattleship/kbattleship/kship.cpp +++ b/kbattleship/kbattleship/kship.cpp @@ -60,7 +60,7 @@ bool KShip::placedLeft() return m_placedLeft; } -bool KShip::contains(int x, int y) +bool KShip::tqcontains(int x, int y) { return (x >= m_shipxstart && x <= m_shipxstop) && (y >= m_shipystart && y <= m_shipystop); } @@ -69,7 +69,7 @@ int KShip::shipTypeEnum(int x, int y) { int ret; ret = KBattleField::WATER; - if (contains(x, y)) + if (tqcontains(x, y)) { switch(m_shiptype) { diff --git a/kbattleship/kbattleship/kship.h b/kbattleship/kbattleship/kship.h index df436c7a..6d60ac62 100644 --- a/kbattleship/kbattleship/kship.h +++ b/kbattleship/kbattleship/kship.h @@ -32,7 +32,7 @@ public: int shipTypeEnum(int x, int y); bool placedLeft(); - bool contains(int x, int y); + bool tqcontains(int x, int y); private: int m_shipxstart; diff --git a/kbattleship/kbattleship/kshiplist.cpp b/kbattleship/kbattleship/kshiplist.cpp index 6a3463af..b28f95f4 100644 --- a/kbattleship/kbattleship/kshiplist.cpp +++ b/kbattleship/kbattleship/kshiplist.cpp @@ -118,7 +118,7 @@ bool KShipList::canAddShips() void KShipList::addNewShip(int button, int fieldx, int fieldy) { - if(!addNewShip(!(button == LeftButton), fieldx, fieldy)) + if(!addNewShip(!(button == Qt::LeftButton), fieldx, fieldy)) KMessageBox::information(0L, i18n("You cannot place the ship here.")); } @@ -126,20 +126,20 @@ bool KShipList::addNewShip(bool vertical, int fieldx, int fieldy) { TQRect ship = vertical ? TQRect(fieldx, fieldy, 1, m_shipsadded) : TQRect(fieldx, fieldy, m_shipsadded, 1); TQRect field = TQRect(0, 0, m_fieldx, m_fieldy); - if(!field.contains(ship)) + if(!field.tqcontains(ship)) return false; for(KShip *placedShip = m_shiplist.first(); placedShip != 0; placedShip = m_shiplist.next()) { for(int i = fieldx-1; i < (fieldx + ship.width()+1); i++) { - if(placedShip->contains(i, fieldy - 1) || placedShip->contains(i, fieldy + ship.height())) + if(placedShip->tqcontains(i, fieldy - 1) || placedShip->tqcontains(i, fieldy + ship.height())) return false; } for(int i = fieldy-1; i < (fieldy + ship.height()+1); i++) { - if(placedShip->contains(fieldx - 1, i) || placedShip->contains(fieldx + ship.width(), i)) + if(placedShip->tqcontains(fieldx - 1, i) || placedShip->tqcontains(fieldx + ship.width(), i)) return false; } } diff --git a/kbattleship/kbattleship/kshiplist.h b/kbattleship/kbattleship/kshiplist.h index e27705b6..eddaa412 100644 --- a/kbattleship/kbattleship/kshiplist.h +++ b/kbattleship/kbattleship/kshiplist.h @@ -25,9 +25,10 @@ #include "kbattlefield.h" #include "kship.h" -class KShipList : public QObject +class KShipList : public TQObject { Q_OBJECT + TQ_OBJECT public: KShipList(); diff --git a/kbattleship/kbattleship/kstatdialog.cpp b/kbattleship/kbattleship/kstatdialog.cpp index 03bc7d41..28b9c142 100644 --- a/kbattleship/kbattleship/kstatdialog.cpp +++ b/kbattleship/kbattleship/kstatdialog.cpp @@ -19,7 +19,7 @@ #include #include "kstatdialog.moc" -KStatDialog::KStatDialog(TQWidget *parent, const char *name) : statDlg(parent, name) +KStatDialog::KStatDialog(TQWidget *tqparent, const char *name) : statDlg(tqparent, name) { } diff --git a/kbattleship/kbattleship/kstatdialog.h b/kbattleship/kbattleship/kstatdialog.h index 5657fccd..172b7e47 100644 --- a/kbattleship/kbattleship/kstatdialog.h +++ b/kbattleship/kbattleship/kstatdialog.h @@ -23,8 +23,9 @@ class KStatDialog : public statDlg { Q_OBJECT + TQ_OBJECT public: - KStatDialog(TQWidget *parent = 0, const char *name = 0); + KStatDialog(TQWidget *tqparent = 0, const char *name = 0); void setShot(); void setShot(int shot); diff --git a/kblackbox/CHANGES b/kblackbox/CHANGES index 985fa5c9..50f44446 100644 --- a/kblackbox/CHANGES +++ b/kblackbox/CHANGES @@ -11,7 +11,7 @@ - the game is active after starting - fixed bad drawing after setting the board size - config. scripts from new kexample (KDE 1.0) - - moc dependencies in Makefile.am done by automoc to + - tqmoc dependencies in Makefile.am done by autotqmoc to avoid problems on Solaris (bug report by David Faure) - some string fixes for better translation 0.2.5 from 0.2.4 (19.3.1998) diff --git a/kblackbox/kbbgame.cpp b/kblackbox/kbbgame.cpp index c663e2eb..f13c0106 100644 --- a/kblackbox/kbbgame.cpp +++ b/kblackbox/kbbgame.cpp @@ -174,7 +174,7 @@ KBBGame::~KBBGame() kConf->writeEntry( "tutorial", (int) tutorial ); delete gameBoard; - // All the rest has "this" for parent so it doesn't need to be deleted. + // All the rest has "this" for tqparent so it doesn't need to be deleted. } @@ -266,7 +266,7 @@ void KBBGame::newGame() if (running) { bool cancel; cancel = KMessageBox::warningContinueCancel(0, - i18n("Do you really want to give up this game?"),TQString::null,i18n("Give Up")) + i18n("Do you really want to give up this game?"),TQString(),i18n("Give Up")) == KMessageBox::Cancel; if (cancel) return; @@ -298,7 +298,7 @@ void KBBGame::newGame() randomBalls( balls ); remap( gameBoard, gr->getGraphicBoard() ); - gr->repaint( TRUE ); + gr->tqrepaint( TRUE ); setScore( 0 ); detourCounter = -1; ballsPlaced = 0; @@ -326,12 +326,12 @@ void KBBGame::gameFinished() "I guess you need more practice."); KMessageBox::information(this, - s.arg(KGlobal::locale()->formatNumber(score, 0))); + s.tqarg(KGlobal::locale()->formatNumber(score, 0))); } else { s = i18n( "You should place %1 balls!\n" "You have placed %2.") - .arg(KGlobal::locale()->formatNumber(balls, 0)) - .arg(KGlobal::locale()->formatNumber(ballsPlaced, 0)); + .tqarg(KGlobal::locale()->formatNumber(balls, 0)) + .tqarg(KGlobal::locale()->formatNumber(ballsPlaced, 0)); KMessageBox::sorry(this, s); } @@ -388,7 +388,7 @@ void KBBGame::giveUp() bool stop; stop = KMessageBox::warningContinueCancel(0, i18n( - "Do you really want to give up this game?"),TQString::null,i18n("Give Up")) + "Do you really want to give up this game?"),TQString(),i18n("Give Up")) == KMessageBox::Continue; if (stop) { @@ -428,7 +428,7 @@ void KBBGame::updateStats() void KBBGame::setScore( int n ) { score = n; - statusBar()->changeItem( i18n("Score: %1").arg(n), SSCORE ); + statusBar()->changeItem( i18n("Score: %1").tqarg(n), SSCORE ); } /* @@ -442,7 +442,7 @@ bool KBBGame::setSize( int w, int h ) if (running) { ok = KMessageBox::warningContinueCancel(0, i18n( - "This will be the end of the current game!"),TQString::null,i18n("End Game")) + "This will be the end of the current game!"),TQString(),i18n("End Game")) == KMessageBox::Continue; } else ok = TRUE; @@ -454,7 +454,7 @@ bool KBBGame::setSize( int w, int h ) gameBoard = new RectOnArray( gr->numC(), gr->numR() ); if (running) abortGame(); newGame(); - // gr->repaint( TRUE ); + // gr->tqrepaint( TRUE ); } } return ok; @@ -470,7 +470,7 @@ bool KBBGame::setBalls( int n ) if (balls != n) { if (running) { ok = KMessageBox::warningContinueCancel(0, - i18n("This will be the end of the current game!"),TQString::null,i18n("End Game")) + i18n("This will be the end of the current game!"),TQString(),i18n("End Game")) == KMessageBox::Continue; } else ok = TRUE; if (ok) { @@ -622,7 +622,7 @@ void KBBGame::gotInputAt( int col, int row, int state ) int w = gameBoard->width() - 2; int h = gameBoard->height() - 2; - if (state & LeftButton) { + if (state & Qt::LeftButton) { switch (type) { case WBALLBBG: // because of the tutorial mode case INNERBBG: @@ -681,7 +681,7 @@ void KBBGame::gotInputAt( int col, int row, int state ) } break; } - } else if (state & RightButton) { + } else if (state & Qt::RightButton) { switch (type) { case INNERBBG: r->set( col, row, MARK1BBG ); @@ -698,37 +698,37 @@ void KBBGame::gotInputAt( int col, int row, int state ) void KBBGame::initKAction() { // game - KStdGameAction::gameNew(this, TQT_SLOT(newGame()), actionCollection()); - (void)new KAction( i18n("&Give Up"), SmallIcon("giveup"), 0, this, TQT_SLOT(giveUp()), actionCollection(), "game_giveup" ); - (void)new KAction( i18n("&Done"), SmallIcon("done"), 0, this, TQT_SLOT(gameFinished()), actionCollection(), "game_done" ); - (void)new KAction( i18n("&Resize"), 0, this, TQT_SLOT(slotResize()), actionCollection(), "game_resize" ); - KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); + KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(newGame()), actionCollection()); + (void)new KAction( i18n("&Give Up"), SmallIcon("giveup"), 0, TQT_TQOBJECT(this), TQT_SLOT(giveUp()), actionCollection(), "game_giveup" ); + (void)new KAction( i18n("&Done"), SmallIcon("done"), 0, TQT_TQOBJECT(this), TQT_SLOT(gameFinished()), actionCollection(), "game_done" ); + (void)new KAction( i18n("&Resize"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotResize()), actionCollection(), "game_resize" ); + KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); // settings - sizeAction = new KSelectAction( i18n("&Size"), 0, this, TQT_SLOT(slotSize()), actionCollection(), "options_size"); + sizeAction = new KSelectAction( i18n("&Size"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotSize()), actionCollection(), "options_size"); TQStringList list; list.append(i18n(" 8 x 8 ")); list.append(i18n(" 10 x 10 ")); list.append(i18n(" 12 x 12 ")); sizeAction->setItems(list); - ballsAction = new KSelectAction( i18n("&Balls"), 0, this, TQT_SLOT(slotBalls()), actionCollection(), "options_balls"); + ballsAction = new KSelectAction( i18n("&Balls"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotBalls()), actionCollection(), "options_balls"); list.clear(); list.append(i18n(" 4 ")); list.append(i18n(" 6 ")); list.append(i18n(" 8 ")); ballsAction->setItems(list); - tutorialAction = new KToggleAction( i18n("&Tutorial"), 0, this, TQT_SLOT(tutorialSwitch()), actionCollection(), "options_tutorial" ); + tutorialAction = new KToggleAction( i18n("&Tutorial"), 0, TQT_TQOBJECT(this), TQT_SLOT(tutorialSwitch()), actionCollection(), "options_tutorial" ); // KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), //actionCollection()); // keyboard only - (void)new KAction( i18n("Move Down"), Qt::Key_Down, gr, TQT_SLOT(slotDown()), actionCollection(), "move_down" ); - (void)new KAction( i18n("Move Up"), Qt::Key_Up, gr, TQT_SLOT(slotUp()), actionCollection(), "move_up" ); - (void)new KAction( i18n("Move Left"), Qt::Key_Left, gr, TQT_SLOT(slotLeft()), actionCollection(), "move_left" ); - (void)new KAction( i18n("Move Right"), Qt::Key_Right, gr, TQT_SLOT(slotRight()), actionCollection(), "move_right" ); - (void)new KAction( i18n("Trigger Action"), Qt::Key_Return, gr, TQT_SLOT(slotInput()), actionCollection(), "move_trigger" ); + (void)new KAction( i18n("Move Down"), TQt::Key_Down, TQT_TQOBJECT(gr), TQT_SLOT(slotDown()), actionCollection(), "move_down" ); + (void)new KAction( i18n("Move Up"), TQt::Key_Up, TQT_TQOBJECT(gr), TQT_SLOT(slotUp()), actionCollection(), "move_up" ); + (void)new KAction( i18n("Move Left"), TQt::Key_Left, TQT_TQOBJECT(gr), TQT_SLOT(slotLeft()), actionCollection(), "move_left" ); + (void)new KAction( i18n("Move Right"), TQt::Key_Right, TQT_TQOBJECT(gr), TQT_SLOT(slotRight()), actionCollection(), "move_right" ); + (void)new KAction( i18n("Trigger Action"), TQt::Key_Return, TQT_TQOBJECT(gr), TQT_SLOT(slotInput()), actionCollection(), "move_trigger" ); } void KBBGame::slotResize() diff --git a/kblackbox/kbbgame.h b/kblackbox/kbbgame.h index 85b12e29..38b8a0fc 100644 --- a/kblackbox/kbbgame.h +++ b/kblackbox/kbbgame.h @@ -50,6 +50,7 @@ class KToggleAction; class KBBGame : public KMainWindow { Q_OBJECT + TQ_OBJECT public: KBBGame(); ~KBBGame(); diff --git a/kblackbox/kbbgfx.cpp b/kblackbox/kbbgfx.cpp index b38a2c9e..26d47952 100644 --- a/kblackbox/kbbgfx.cpp +++ b/kblackbox/kbbgfx.cpp @@ -22,13 +22,13 @@ Constructs a KBBGraphic widget. */ -KBBGraphic::KBBGraphic( TQPixmap **p, TQWidget* parent, const char* name ) - : TQWidget( parent, name ) +KBBGraphic::KBBGraphic( TQPixmap **p, TQWidget* tqparent, const char* name ) + : TQWidget( tqparent, name ) { int i; curRow = curCol = 0; - setFocusPolicy( NoFocus ); + setFocusPolicy( TQ_NoFocus ); setBackgroundColor( gray ); setCellWidth( CELLW ); // set width of cell in pixels setCellHeight( CELLH ); // set height of cell in pixels @@ -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; } -TQSize KBBGraphic::sizeHint() const { return TQSize(wHint(), hHint()); } +TQSize KBBGraphic::tqsizeHint() const { return TQSize(wHint(), hHint()); } /* Returns a pointer to graphicBoard @@ -342,7 +342,7 @@ void KBBGraphic::mousePressEvent( TQMouseEvent* e ) /* * Middle click finishes the game. */ - if (e->button() == MidButton) { + if (e->button() == Qt::MidButton) { emit endMouseClicked(); return; } @@ -413,7 +413,7 @@ void KBBGraphic::slotInput() if ( !inputAccepted ) { return; } - emit inputAt( curCol, curRow, LeftButton ); + emit inputAt( curCol, curRow, Qt::LeftButton ); // updateElement( curCol, curRow ); } @@ -434,7 +434,7 @@ void KBBGraphic::moveSelection(int drow, int dcol) void KBBGraphic::focusInEvent( TQFocusEvent* ) { - repaint( FALSE ); + tqrepaint( FALSE ); } @@ -444,7 +444,7 @@ void KBBGraphic::focusInEvent( TQFocusEvent* ) void KBBGraphic::focusOutEvent( TQFocusEvent* ) { - repaint( FALSE ); + tqrepaint( FALSE ); } /* @@ -454,8 +454,8 @@ void KBBGraphic::focusOutEvent( TQFocusEvent* ) void KBBGraphic::setInputAccepted( bool b ) { inputAccepted = b; - if (b) setFocusPolicy( StrongFocus ); - else setFocusPolicy( NoFocus ); + if (b) setFocusPolicy( TQ_StrongFocus ); + else setFocusPolicy( TQ_NoFocus ); } /* diff --git a/kblackbox/kbbgfx.h b/kblackbox/kbbgfx.h index 16d97298..5eca56c9 100644 --- a/kblackbox/kbbgfx.h +++ b/kblackbox/kbbgfx.h @@ -50,11 +50,12 @@ Negative numbers are deflected lasers... */ -class KBBGraphic : public QWidget +class KBBGraphic : public TQWidget { Q_OBJECT + TQ_OBJECT public: - KBBGraphic( TQPixmap** p=0, TQWidget* parent=0, const char* name=0 ); + KBBGraphic( TQPixmap** p=0, TQWidget* tqparent=0, const char* name=0 ); ~KBBGraphic(); friend class KBBGame; @@ -87,7 +88,7 @@ signals: void endMouseClicked(); protected: - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; void paintEvent( TQPaintEvent* ); void mousePressEvent( TQMouseEvent* ); void mouseMoveEvent( TQMouseEvent* ); diff --git a/kbounce/game.cpp b/kbounce/game.cpp index 0c5f1e2d..84cfae2f 100644 --- a/kbounce/game.cpp +++ b/kbounce/game.cpp @@ -136,8 +136,8 @@ bool Ball::collide( double dx, double dy ) /*************************************************************************/ -Wall::Wall( JezzField *field, int x, int y, Direction dir, int tile, TQObject *parent, const char *name ) - : TQObject( parent, name ), m_dir( dir ), m_field( field ), m_startX( x ), m_startY( y ), +Wall::Wall( JezzField *field, int x, int y, Direction dir, int tile, TQObject *tqparent, const char *name ) + : TQObject( tqparent, name ), m_dir( dir ), m_field( field ), m_startX( x ), m_startY( y ), m_tile( tile ), m_delay( MS2TICKS(WALL_DELAY)/2 ), m_active( true ) { //kdDebug(12008) << "Wall::Wall" << endl; @@ -236,8 +236,8 @@ void Wall::fill( bool black ) /*************************************************************************/ -JezzField::JezzField( const TQPixmap &tiles, const TQPixmap &background, TQObject* parent, const char* name ) - : TQCanvas( parent, name ), m_tiles( tiles ) +JezzField::JezzField( const TQPixmap &tiles, const TQPixmap &background, TQObject* tqparent, const char* name ) + : TQCanvas( tqparent, name ), m_tiles( tiles ) { setPixmaps( tiles, background ); } @@ -314,8 +314,8 @@ void JezzField::setPixmaps( const TQPixmap &tiles, const TQPixmap &background ) /*************************************************************************/ -JezzView::JezzView(TQCanvas* viewing, TQWidget* parent, const char* name, WFlags f) - : TQCanvasView( viewing, parent, name, f ), m_vertical( false ) +JezzView::JezzView(TQCanvas* viewing, TQWidget* tqparent, const char* name, WFlags f) + : TQCanvasView( viewing, tqparent, name, f ), m_vertical( false ) { setResizePolicy( AutoOne ); setHScrollBarMode( AlwaysOff ); @@ -326,13 +326,13 @@ JezzView::JezzView(TQCanvas* viewing, TQWidget* parent, const char* name, WFlags void JezzView::viewportMouseReleaseEvent( TQMouseEvent *ev ) { - if ( ev->button() & RightButton ) + if ( ev->button() & Qt::RightButton ) { m_vertical = !m_vertical; if ( m_vertical ) setCursor( sizeVerCursor ); else setCursor( sizeHorCursor ); } - if ( ev->button() & LeftButton ) + if ( ev->button() & Qt::LeftButton ) { emit buildWall( ev->x()/TILE_SIZE, ev->y()/TILE_SIZE, m_vertical ); } @@ -340,8 +340,8 @@ void JezzView::viewportMouseReleaseEvent( TQMouseEvent *ev ) /*************************************************************************/ -JezzGame::JezzGame( const TQPixmap &background, int ballNum, TQWidget *parent, const char *name ) - : TQWidget( parent, name ), m_wall1( 0 ), m_wall2( 0 ), +JezzGame::JezzGame( const TQPixmap &background, int ballNum, TQWidget *tqparent, const char *name ) + : TQWidget( tqparent, name ), m_wall1( 0 ), m_wall2( 0 ), m_text( 0 ), m_running( false ), m_percent( 0 ), m_pictured( false ) { TQString path = kapp->dirs()->findResourceDir( "data", "kbounce/pics/ball0000.png" ) + "kbounce/pics/"; @@ -363,7 +363,7 @@ JezzGame::JezzGame( const TQPixmap &background, int ballNum, TQWidget *parent, c "kbounce/sounds/"; // create field - m_field = new JezzField( tiles, background, this, "m_field" ); + m_field = new JezzField( tiles, background, TQT_TQOBJECT(this), "m_field" ); m_field->resize( TILE_SIZE*FIELD_WIDTH, TILE_SIZE*FIELD_HEIGHT ); for ( int x=0; xstart( GAME_DELAY ); - // setup geometry + // setup tqgeometry setFixedSize( m_view->size() ); } @@ -500,7 +500,7 @@ void JezzGame::makeBlack() } m_field->update(); - m_view->repaint(); + m_view->tqrepaint(); // count percent value of occupied area int p = percent(); @@ -586,7 +586,7 @@ void JezzGame::ballCollision( Ball */*ball*/, int /*x*/, int /*y*/, int tile ) // update view m_field->update(); - m_view->repaint(); + m_view->tqrepaint(); // send death msg emit died(); @@ -617,7 +617,7 @@ void JezzGame::buildWall( int x, int y, bool vertical ) m_wall1 = new Wall( m_field, x, y, vertical? Wall::Up : Wall::Left, vertical? TILE_WALLUP : TILE_WALLLEFT, - this, "m_wall1" ); + TQT_TQOBJECT(this), "m_wall1" ); connect( m_wall1, TQT_SIGNAL(finished(Wall *, int)), this, TQT_SLOT(wallFinished(Wall *, int)) ); } @@ -626,7 +626,7 @@ void JezzGame::buildWall( int x, int y, bool vertical ) m_wall2 = new Wall( m_field, x, y, vertical? Wall::Down: Wall::Right, vertical? TILE_WALLDOWN : TILE_WALLRIGHT, - this, "m_wall2" ); + TQT_TQOBJECT(this), "m_wall2" ); connect( m_wall2, TQT_SIGNAL(finished(Wall *, int)), this, TQT_SLOT(wallFinished(Wall *, int)) ); } @@ -671,7 +671,7 @@ void JezzGame::wallFinished( Wall *wall, int tile ) } m_field->update(); - m_view->repaint(); + m_view->tqrepaint(); makeBlack(); } diff --git a/kbounce/game.h b/kbounce/game.h index 1f66c288..d07516de 100644 --- a/kbounce/game.h +++ b/kbounce/game.h @@ -35,7 +35,7 @@ class JezzField; #define FIELD_WIDTH 32 #define FIELD_HEIGHT 20 -class Ball : public QCanvasSprite +class Ball : public TQCanvasSprite { public: Ball(TQCanvasPixmapArray* array, TQCanvas* canvas); @@ -50,14 +50,15 @@ class Ball : public QCanvasSprite }; -class Wall : public QObject +class Wall : public TQObject { Q_OBJECT + TQ_OBJECT public: enum Direction { Up, Down, Left, Right }; Wall( JezzField *field, int x, int y, Direction dir, int tile, - TQObject *parent=0, const char *name=0 ); + TQObject *tqparent=0, const char *name=0 ); void finish(); void fill( bool black ); @@ -83,11 +84,12 @@ private: }; -class JezzField : public QCanvas +class JezzField : public TQCanvas { Q_OBJECT + TQ_OBJECT public: - JezzField( const TQPixmap &tiles, const TQPixmap &background, TQObject* parent = 0, const char* name = 0 ); + JezzField( const TQPixmap &tiles, const TQPixmap &background, TQObject* tqparent = 0, const char* name = 0 ); void setGameTile( int x, int y, bool black ); void setBackground( const TQPixmap &background ); @@ -108,11 +110,12 @@ private: }; -class JezzView : public QCanvasView +class JezzView : public TQCanvasView { Q_OBJECT + TQ_OBJECT public: - JezzView(TQCanvas* viewing=0, TQWidget* parent=0, const char* name=0, WFlags f=0); + JezzView(TQCanvas* viewing=0, TQWidget* tqparent=0, const char* name=0, WFlags f=0); signals: void buildWall( int x, int y, bool vertical ); @@ -125,12 +128,13 @@ private: }; -class JezzGame : public QWidget +class JezzGame : public TQWidget { Q_OBJECT + TQ_OBJECT public: - JezzGame( const TQPixmap &background, int ballNum, TQWidget *parent=0, const char *name=0 ); + JezzGame( const TQPixmap &background, int ballNum, TQWidget *tqparent=0, const char *name=0 ); ~JezzGame(); int percent(); diff --git a/kbounce/highscores.cpp b/kbounce/highscores.cpp index fec2d1e6..5dc3bf47 100644 --- a/kbounce/highscores.cpp +++ b/kbounce/highscores.cpp @@ -6,7 +6,7 @@ using namespace KExtHighscore; ExtManager::ExtManager() { - Item *item = new Item((uint)0, i18n("Level"), Qt::AlignRight); + Item *item = new Item((uint)0, i18n("Level"), TQt::AlignRight); addScoreItem("level", item); } diff --git a/kbounce/kbounce.cpp b/kbounce/kbounce.cpp index 5bfcc320..2d4fe887 100644 --- a/kbounce/kbounce.cpp +++ b/kbounce/kbounce.cpp @@ -89,21 +89,21 @@ KJezzball::KJezzball() // create timers m_nextLevelTimer = new TQTimer( this, "m_nextLevelTimer" ); - connect( m_nextLevelTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(switchLevel()) ); + connect( m_nextLevelTimer, TQT_SIGNAL(timeout()), TQT_TQOBJECT(this), TQT_SLOT(switchLevel()) ); m_gameOverTimer = new TQTimer( this, "m_gameOverTimer" ); - connect( m_gameOverTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(gameOverNow()) ); + connect( m_gameOverTimer, TQT_SIGNAL(timeout()), TQT_TQOBJECT(this), TQT_SLOT(gameOverNow()) ); m_timer = new TQTimer( this, "m_timer" ); - connect( m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(second()) ); + connect( m_timer, TQT_SIGNAL(timeout()), TQT_TQOBJECT(this), TQT_SLOT(second()) ); // create demo game createLevel( 1 ); statusBar()->message( i18n("Press %1 to start a game!") - .arg(m_newAction->shortcut().toString()) ); + .tqarg(m_newAction->shortcut().toString()) ); //m_gameWidget->display( i18n("Press to start a game!") ); - setFocusPolicy(TQWidget::StrongFocus); + setFocusPolicy(TQ_StrongFocus); setFocus(); setupGUI(); } @@ -119,23 +119,23 @@ KJezzball::~KJezzball() */ void KJezzball::initXMLUI() { - m_newAction = KStdGameAction::gameNew( this, TQT_SLOT(newGame()), actionCollection() ); + m_newAction = KStdGameAction::gameNew( TQT_TQOBJECT(this), TQT_SLOT(newGame()), actionCollection() ); // AB: originally KBounce/KJezzball used Space for new game - but Ctrl+N is // default. We solve this by providing space as an alternative key KShortcut s = m_newAction->shortcut(); s.append(KKeySequence(TQKeySequence(Key_Space))); m_newAction->setShortcut(s); - KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection() ); - KStdGameAction::highscores(this, TQT_SLOT(showHighscore()), actionCollection() ); - m_pauseButton = KStdGameAction::pause(this, TQT_SLOT(pauseGame()), actionCollection()); - KStdGameAction::end(this, TQT_SLOT(closeGame()), actionCollection()); - KStdGameAction::configureHighscores(this, TQT_SLOT(configureHighscores()),actionCollection()); + KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection() ); + KStdGameAction::highscores(TQT_TQOBJECT(this), TQT_SLOT(showHighscore()), actionCollection() ); + m_pauseButton = KStdGameAction::pause(TQT_TQOBJECT(this), TQT_SLOT(pauseGame()), actionCollection()); + KStdGameAction::end(TQT_TQOBJECT(this), TQT_SLOT(closeGame()), actionCollection()); + KStdGameAction::configureHighscores(TQT_TQOBJECT(this), TQT_SLOT(configureHighscores()),actionCollection()); - new KAction( i18n("&Select Background Folder..."), 0, this, TQT_SLOT(selectBackground()), + new KAction( i18n("&Select Background Folder..."), 0, TQT_TQOBJECT(this), TQT_SLOT(selectBackground()), actionCollection(), "background_select" ); m_backgroundShowAction = - new KToggleAction( i18n("Show &Backgrounds"), 0, this, TQT_SLOT(showBackground()), + new KToggleAction( i18n("Show &Backgrounds"), 0, TQT_TQOBJECT(this), TQT_SLOT(showBackground()), actionCollection(), "background_show" ); m_backgroundShowAction->setCheckedState(i18n("Hide &Backgrounds")); m_backgroundShowAction->setEnabled( !m_backgroundDir.isEmpty() ); @@ -177,7 +177,7 @@ void KJezzball::closeGame() int old_state = m_state; if (old_state == Running) pauseGame(); - int ret = KMessageBox::questionYesNo( this, i18n("Do you really want to close the running game?"), TQString::null, KStdGuiItem::close(), KStdGuiItem::cancel() ); + int ret = KMessageBox::questionYesNo( this, i18n("Do you really want to close the running game?"), TQString(), KStdGuiItem::close(), KStdGuiItem::cancel() ); if ( ret==KMessageBox::Yes ) { stopLevel(); @@ -206,7 +206,7 @@ void KJezzball::pauseGame() case Suspend: m_state = Running; statusBar()->clear(); - //m_gameWidget->display( TQString::null ); + //m_gameWidget->display( TQString() ); startLevel(); break; @@ -228,7 +228,7 @@ void KJezzball::gameOverNow() TQString score; score.setNum( m_game.score ); - KMessageBox::information( this, i18n("Game Over! Score: %1").arg(score) ); + KMessageBox::information( this, i18n("Game Over! Score: %1").tqarg(score) ); statusBar()->message( i18n("Game over. Press for a new game") ); //m_gameWidget->display( i18n("Game over. Press for a new game!") ); highscore(); @@ -347,7 +347,7 @@ void KJezzball::focusInEvent ( TQFocusEvent *ev ) m_state = Running; statusBar()->clear(); m_pauseButton->setChecked(false); - //m_gameWidget->display( TQString::null ); + //m_gameWidget->display( TQString() ); } KMainWindow::focusInEvent( ev ); @@ -400,8 +400,8 @@ void KJezzball::createLevel( int level ) m_gameWidget->show(); m_layout->addWidget( m_gameWidget, 0, 0 ); - connect( m_gameWidget, TQT_SIGNAL(died()), this, TQT_SLOT(died()) ); - connect( m_gameWidget, TQT_SIGNAL(newPercent(int)), this, TQT_SLOT(newPercent(int)) ); + connect( m_gameWidget, TQT_SIGNAL(died()), TQT_TQOBJECT(this), TQT_SLOT(died()) ); + connect( m_gameWidget, TQT_SIGNAL(newPercent(int)), TQT_TQOBJECT(this), TQT_SLOT(newPercent(int)) ); connect( m_soundAction, TQT_SIGNAL(toggled(bool)), m_gameWidget, TQT_SLOT(setSound(bool)) ); // update displays @@ -461,16 +461,16 @@ void KJezzball::switchLevel() TQString foo = TQString( i18n("You have successfully cleared more than 75% of the board.\n") + -i18n("%1 points: 15 points per remaining life\n").arg(m_level.lifes*15) + -i18n("%1 points: Bonus\n").arg((m_gameWidget->percent()-75)*2*(m_game.level+5)) + -i18n("%1 points: Total score for this level\n").arg(score) + -i18n("On to level %1. Remember you get %2 lives this time!")).arg(m_game.level+1).arg(m_game.level+2); +i18n("%1 points: 15 points per remaining life\n").tqarg(m_level.lifes*15) + +i18n("%1 points: Bonus\n").tqarg((m_gameWidget->percent()-75)*2*(m_game.level+5)) + +i18n("%1 points: Total score for this level\n").tqarg(score) + +i18n("On to level %1. Remember you get %2 lives this time!")).tqarg(m_game.level+1).tqarg(m_game.level+2); KMessageBox::information( this,foo ); // KMessageBox::information( this, i18n("You've completed level %1 with " - // "a score of %2.\nGet ready for the next one!").arg(level).arg(score)); + // "a score of %2.\nGet ready for the next one!").tqarg(level).tqarg(score)); m_game.level++; m_levelLCD->display( m_game.level ); diff --git a/kbounce/kbounce.h b/kbounce/kbounce.h index 60fd49bf..4ca84600 100644 --- a/kbounce/kbounce.h +++ b/kbounce/kbounce.h @@ -30,6 +30,7 @@ class KAction; class KJezzball : public KMainWindow { Q_OBJECT + TQ_OBJECT public: KJezzball(); diff --git a/kenolaba/AbTop.cpp b/kenolaba/AbTop.cpp index a6ef7d05..f107408d 100644 --- a/kenolaba/AbTop.cpp +++ b/kenolaba/AbTop.cpp @@ -63,12 +63,12 @@ AbTop::AbTop() timer = new TQTimer; - connect( timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timerDone()) ); + connect( timer, TQT_SIGNAL(timeout()), TQT_TQOBJECT(this), TQT_SLOT(timerDone()) ); board = new Board(); setMoveNo(0); - connect( board, TQT_SIGNAL(searchBreak()), this, TQT_SLOT(searchBreak()) ); + connect( board, TQT_SIGNAL(searchBreak()), TQT_TQOBJECT(this), TQT_SLOT(searchBreak()) ); Q_CHECK_PTR(board); boardWidget = new BoardWidget(*board,this); @@ -77,7 +77,7 @@ AbTop::AbTop() #endif connect( boardWidget, TQT_SIGNAL(updateSpy(TQString)), - this, TQT_SLOT(updateSpy(TQString)) ); + TQT_TQOBJECT(this), TQT_SLOT(updateSpy(TQString)) ); setCentralWidget(boardWidget); boardWidget->show(); @@ -89,16 +89,16 @@ AbTop::AbTop() // RMB context menu connect( boardWidget, TQT_SIGNAL(rightButtonPressed(int,const TQPoint&)), - this, TQT_SLOT(rightButtonPressed(int,const TQPoint&)) ); + TQT_TQOBJECT(this), TQT_SLOT(rightButtonPressed(int,const TQPoint&)) ); connect( boardWidget, TQT_SIGNAL(edited(int)), - this, TQT_SLOT(edited(int)) ); + TQT_TQOBJECT(this), TQT_SLOT(edited(int)) ); connect( board, TQT_SIGNAL(updateBestMove(Move&,int)), - this, TQT_SLOT(updateBestMove(Move&,int)) ); + TQT_TQOBJECT(this), TQT_SLOT(updateBestMove(Move&,int)) ); connect( boardWidget, TQT_SIGNAL(moveChoosen(Move&)), - this, TQT_SLOT(moveChoosen(Move&)) ); + TQT_TQOBJECT(this), TQT_SLOT(moveChoosen(Move&)) ); /* default */ setLevel(Easy); @@ -107,7 +107,7 @@ AbTop::AbTop() showSpy = false; renderBalls = true; - updateStatus(); + updatetqStatus(); updateActions(); setupGUI(); } @@ -132,61 +132,61 @@ AbTop::~AbTop() void AbTop::setupActions() { - newAction = KStdGameAction::gameNew( this, TQT_SLOT(newGame()), actionCollection() ); - KStdGameAction::quit( this, TQT_SLOT(close()), actionCollection() ); + newAction = KStdGameAction::gameNew( TQT_TQOBJECT(this), TQT_SLOT(newGame()), actionCollection() ); + KStdGameAction::quit( TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection() ); - stopAction = new KAction( i18n("&Stop Search"), "stop", Key_S, this, + stopAction = new KAction( i18n("&Stop Search"), "stop", Key_S, TQT_TQOBJECT(this), TQT_SLOT(stopSearch()), actionCollection(), "move_stop"); backAction = new KAction( i18n("Take &Back"), "back", - KStdAccel::shortcut(KStdAccel::Prior), this, + KStdAccel::shortcut(KStdAccel::Prior), TQT_TQOBJECT(this), TQT_SLOT(back()), actionCollection(), "move_back"); forwardAction = new KAction( i18n("&Forward"), "forward", - KStdAccel::shortcut(KStdAccel::Next), this, + KStdAccel::shortcut(KStdAccel::Next), TQT_TQOBJECT(this), TQT_SLOT(forward()), actionCollection(), "move_forward"); - hintAction = KStdGameAction::hint(this, TQT_SLOT(suggestion()), actionCollection()); + hintAction = KStdGameAction::hint(TQT_TQOBJECT(this), TQT_SLOT(suggestion()), actionCollection()); - KStdAction::copy( this, TQT_SLOT(copy()), actionCollection()); - pasteAction = KStdAction::paste( this, TQT_SLOT(paste()), actionCollection()); + KStdAction::copy( TQT_TQOBJECT(this), TQT_SLOT(copy()), actionCollection()); + pasteAction = KStdAction::paste( TQT_TQOBJECT(this), TQT_SLOT(paste()), actionCollection()); (void) new KAction( i18n("&Restore Position"), KStdAccel::shortcut(KStdAccel::Open), - this, TQT_SLOT(restorePosition()), + TQT_TQOBJECT(this), TQT_SLOT(restorePosition()), actionCollection(), "edit_restore" ); (void) new KAction( i18n("&Save Position"), KStdAccel::shortcut(KStdAccel::Save), - this, TQT_SLOT(savePosition()), + TQT_TQOBJECT(this), TQT_SLOT(savePosition()), actionCollection(), "edit_save" ); KToggleAction *ta; ta = new KToggleAction( i18n("&Network Play"), "network", Key_N, actionCollection(), "game_net"); - connect(ta, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(gameNetwork(bool))); + connect(ta, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(gameNetwork(bool))); editAction = new KToggleAction( i18n("&Modify"), "edit", CTRL+Key_Insert, actionCollection(), "edit_modify"); - connect(editAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT( editModify(bool))); + connect(editAction, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT( editModify(bool))); - showMenubar = KStdAction::showMenubar(this, TQT_SLOT(toggleMenubar()), actionCollection()); - KStdAction::saveOptions( this, TQT_SLOT(writeConfig()), actionCollection()); + showMenubar = KStdAction::showMenubar(TQT_TQOBJECT(this), TQT_SLOT(toggleMenubar()), actionCollection()); + KStdAction::saveOptions( TQT_TQOBJECT(this), TQT_SLOT(writeConfig()), actionCollection()); - KStdAction::preferences( this, TQT_SLOT(configure()), actionCollection()); + KStdAction::preferences( TQT_TQOBJECT(this), TQT_SLOT(configure()), actionCollection()); moveSlowAction = new KToggleAction( i18n("&Move Slow"), 0, actionCollection(), "options_moveSlow"); - connect(moveSlowAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(optionMoveSlow(bool))); + connect(moveSlowAction, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(optionMoveSlow(bool))); renderBallsAction = new KToggleAction( i18n("&Render Balls"), 0, actionCollection(), "options_renderBalls"); - connect(renderBallsAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(optionRenderBalls(bool))); + connect(renderBallsAction, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(optionRenderBalls(bool))); showSpyAction = new KToggleAction( i18n("&Spy"), 0, actionCollection(), "options_showSpy"); - connect(showSpyAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(optionShowSpy(bool))); + connect(showSpyAction, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(optionShowSpy(bool))); levelAction = KStdGameAction::chooseGameType(0, 0, actionCollection()); @@ -381,7 +381,7 @@ void AbTop::setupStatusBar() { TQString tmp; - TQString t = i18n("Press %1 for a new game").arg( newAction->shortcut().toString()); + TQString t = i18n("Press %1 for a new game").tqarg( newAction->shortcut().toString()); statusLabel = new TQLabel( t, statusBar(), "statusLabel" ); statusBar()->addWidget(statusLabel,1,false); @@ -391,8 +391,8 @@ void AbTop::setupStatusBar() warningPix = BarIcon( "warning" ); okPix = BarIcon( "ok" ); validLabel = new TQLabel( "", statusBar(), "validLabel" ); - validLabel->setFixedSize( 18, statusLabel->sizeHint().height() ); - validLabel->setAlignment( AlignCenter ); + validLabel->setFixedSize( 18, statusLabel->tqsizeHint().height() ); + validLabel->tqsetAlignment( AlignCenter ); validLabel->hide(); validShown = false; @@ -401,11 +401,11 @@ void AbTop::setupStatusBar() noBall = BarIcon( "noball" ); ballLabel = new TQLabel( "", statusBar(), "ballLabel" ); ballLabel->setPixmap(noBall); - ballLabel->setFixedSize( 18, statusLabel->sizeHint().height() ); - ballLabel->setAlignment( AlignCenter ); + ballLabel->setFixedSize( 18, statusLabel->tqsizeHint().height() ); + ballLabel->tqsetAlignment( AlignCenter ); statusBar()->addWidget(ballLabel, 0, true); - moveLabel = new TQLabel( i18n("Move %1").arg("--"), statusBar(), "moveLabel" ); + moveLabel = new TQLabel( i18n("Move %1").tqarg("--"), statusBar(), "moveLabel" ); statusBar()->addWidget(moveLabel, 0, true); #ifdef MYTRACE @@ -422,7 +422,7 @@ void AbTop::setupStatusBar() spyPopup->insertItem(spy2, 2); spyPopup->insertItem(spy3, 3); connect( spyPopup, TQT_SIGNAL(activated(int)), - this, TQT_SLOT(setSpy(int)) ); + TQT_TQOBJECT(this), TQT_SLOT(setSpy(int)) ); tb->insertButton(spy0, 30, spyPopup, TRUE, i18n("Spy")); } @@ -436,7 +436,7 @@ void AbTop::updateSpy(TQString s) { if (showSpy) { if (s.isEmpty()) { - updateStatus(); + updatetqStatus(); // statusBar()->clear(); } else @@ -458,17 +458,17 @@ void AbTop::updateBestMove(Move& m, int value) } -void AbTop::updateStatus() +void AbTop::updatetqStatus() { TQString tmp; bool showValid = false; if (!editMode && timerState == noGame) { - tmp = i18n("Move %1").arg("--"); + tmp = i18n("Move %1").tqarg("--"); ballLabel->setPixmap(noBall); } else { - tmp = i18n("Move %1").arg(moveNo/2 + 1); + tmp = i18n("Move %1").tqarg(moveNo/2 + 1); ballLabel->setPixmap( (board->actColor() == Board::color1) ? redBall : yellowBall); } @@ -476,15 +476,15 @@ void AbTop::updateStatus() if (editMode) { tmp = TQString("%1: %2 %3 - %4 %5") - .arg( i18n("Edit") ) - .arg( i18n("Red") ).arg(boardWidget->getColor1Count()) - .arg( i18n("Yellow") ).arg(boardWidget->getColor2Count()); + .tqarg( i18n("Edit") ) + .tqarg( i18n("Red") ).tqarg(boardWidget->getColor1Count()) + .tqarg( i18n("Yellow") ).tqarg(boardWidget->getColor2Count()); validLabel->setPixmap( (board->validState() == Board::invalid) ? warningPix:okPix ); showValid = true; } else if (timerState == noGame) { - tmp = i18n("Press %1 for a new game").arg( newAction->shortcut().toString()); + tmp = i18n("Press %1 for a new game").tqarg( newAction->shortcut().toString()); } else { if (timerState == gameOver) { @@ -495,9 +495,9 @@ void AbTop::updateStatus() } else { tmp = TQString("%1 - %2") - .arg( (board->actColor() == Board::color1) ? + .tqarg( (board->actColor() == Board::color1) ? i18n("Red"):i18n("Yellow") ) - .arg( iPlayNow() ? + .tqarg( iPlayNow() ? i18n("I am thinking...") : i18n("It is your turn!") ); } } @@ -514,7 +514,7 @@ void AbTop::updateStatus() validShown = showValid; } statusBar()->clear(); - statusBar()->repaint(); + statusBar()->tqrepaint(); } void AbTop::edited(int vState) @@ -522,7 +522,7 @@ void AbTop::edited(int vState) if (vState == Board::empty) timerState = noGame; - updateStatus(); + updatetqStatus(); } /* only , , have to be updated */ @@ -662,7 +662,7 @@ void AbTop::playGame() timerState = gameOver; } - updateStatus(); + updatetqStatus(); updateActions(); boardWidget->setCursor(crossCursor); if (stop) return; @@ -733,7 +733,7 @@ void AbTop::newGame() /* Copy ASCII representation into Clipboard */ void AbTop::copy() { - QClipboard *cb = TQApplication::clipboard(); + TQClipboard *cb = TQApplication::tqclipboard(); cb->setText( board->getASCIIState( moveNo ).ascii() ); } @@ -741,7 +741,7 @@ void AbTop::paste() { if (!pastePossible) return; - QClipboard *cb = TQApplication::clipboard(); + TQClipboard *cb = TQApplication::tqclipboard(); pastePosition( cb->text().ascii() ); /* don't do this in pastePosition: RECURSION !! */ @@ -801,7 +801,7 @@ void AbTop::gameNetwork(bool on) net->addListener(h2, p); } TQObject::connect(net, TQT_SIGNAL(gotPosition(const char *)), - this, TQT_SLOT(pastePosition(const char *)) ); + TQT_TQOBJECT(this), TQT_SLOT(pastePosition(const char *)) ); } @@ -814,7 +814,7 @@ void AbTop::editModify(bool on) timerState = noGame; updateActions(); - updateStatus(); + updatetqStatus(); if (!editMode && vState == Board::valid) { actMove.type = Move::none; timerState = moveShown; @@ -864,7 +864,7 @@ void AbTop::setMoveNo(int m, bool updateGUI) board->setActColor( ((moveNo%2)==0) ? Board::color1 : Board::color2 ); if (updateGUI) { - updateStatus(); + updatetqStatus(); updateActions(); } } diff --git a/kenolaba/AbTop.h b/kenolaba/AbTop.h index ed7c8fba..049a64a2 100644 --- a/kenolaba/AbTop.h +++ b/kenolaba/AbTop.h @@ -34,6 +34,7 @@ class Spy; class AbTop: public KMainWindow { Q_OBJECT + TQ_OBJECT public: AbTop(); @@ -89,7 +90,7 @@ public slots: private: void setupActions(); - void updateStatus(); + void updatetqStatus(); void userMove(); void playGame(); void loadPixmaps(); diff --git a/kenolaba/Ball.cpp b/kenolaba/Ball.cpp index 525f919b..b0584287 100644 --- a/kenolaba/Ball.cpp +++ b/kenolaba/Ball.cpp @@ -21,14 +21,14 @@ void Ball::setSize(int x, int y) sizeX = x; sizeY = y; - invalidate(); + tqinvalidate(); } -void Ball::invalidate() +void Ball::tqinvalidate() { Ball *b; - /* invalidate all Balls... */ + /* tqinvalidate all Balls... */ for(b=first;b!=0;b=b->next) b->pm.resize(0,0); } @@ -43,7 +43,7 @@ void Ball::setLight(int x, int y, int z, const TQColor& c) lightColor = c; - invalidate(); + tqinvalidate(); } @@ -52,7 +52,7 @@ void Ball::setTexture(double c, double d) rippleCount = c; rippleDepth = d; - invalidate(); + tqinvalidate(); } @@ -155,13 +155,13 @@ void Ball::render() green = .2 * bColor.green() + .8 * ll * green; blue = .2 * bColor.blue() + .8 * ll * blue; - image.setPixel(x,y, qRgb( (int)red, (int)green, (int)blue )); + image.setPixel(x,y, tqRgb( (int)red, (int)green, (int)blue )); } } } const TQImage iMask = image.createHeuristicMask(); TQBitmap bMask; - bMask = iMask; + bMask.convertFromImage(iMask); pm.convertFromImage( image, 0 ); pm.setMask(bMask); } @@ -213,8 +213,8 @@ BallPosition::BallPosition(int xp,int yp, Ball* d) /* Class BallWidget */ -BallWidget::BallWidget( int _freq, int bFr, TQWidget *parent, const char *name ) - : TQWidget(parent,name), positions(MAX_POSITION), animations(MAX_ANIMATION) +BallWidget::BallWidget( int _freq, int bFr, TQWidget *tqparent, const char *name ) + : TQWidget(tqparent,name), positions(MAX_POSITION), animations(MAX_ANIMATION) { int i; @@ -309,12 +309,12 @@ void BallWidget::resizeEvent(TQResizeEvent *) realSize = (w>h) ? h:w; Ball::setSize( realSize/ballFraction, realSize/ballFraction ); - repaint(); + tqrepaint(); } void BallWidget::paintEvent(TQPaintEvent *) { - paint(this); + paint(TQT_TQPAINTDEVICE(this)); } @@ -414,15 +414,15 @@ void BallWidget::animate() timer->start(1000/freq,true); } - // repaint( false ); + // tqrepaint( false ); } /* Ball Test */ -BallTest::BallTest( TQWidget *parent, const char *name ) - : BallWidget(10,2,parent,name) +BallTest::BallTest( TQWidget *tqparent, const char *name ) + : BallWidget(10,2,tqparent,name) { int w,h; diff --git a/kenolaba/Ball.h b/kenolaba/Ball.h index 1fcf1b37..25fd13eb 100644 --- a/kenolaba/Ball.h +++ b/kenolaba/Ball.h @@ -49,7 +49,7 @@ class Ball { private: void render(); - static void invalidate(); + static void tqinvalidate(); //static TQImage back; static int sizeX, sizeY; @@ -94,12 +94,13 @@ class BallPosition { #define MAX_POSITION 130 #define MAX_ANIMATION 20 -class BallWidget : public QWidget +class BallWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - BallWidget(int _freq, int bFr, TQWidget *parent = 0, const char *name = 0); + BallWidget(int _freq, int bFr, TQWidget *tqparent = 0, const char *name = 0); ~BallWidget(); void createBlending(int, int, Ball* , Ball* ); @@ -140,8 +141,9 @@ class BallWidget : public QWidget class BallTest: public BallWidget { Q_OBJECT + TQ_OBJECT public: - BallTest(TQWidget *parent=0, const char *name=0 ); + BallTest(TQWidget *tqparent=0, const char *name=0 ); protected: void mousePressEvent( TQMouseEvent * ); void mouseReleaseEvent( TQMouseEvent * ); diff --git a/kenolaba/Board.cpp b/kenolaba/Board.cpp index d939ad09..119557d2 100644 --- a/kenolaba/Board.cpp +++ b/kenolaba/Board.cpp @@ -1386,13 +1386,13 @@ int Board::setASCIIState(const TQString& state) int color2Count = 0; /* get moveNo if supplied */ - if ((index = state.find("#"))>=0) + if ((index = state.tqfind("#"))>=0) moveNo = state.mid(index+1,3).toInt(); int f=12, row=0, rowEnd = 17; char c = ' '; - index=state.find("/"); + index=state.tqfind("/"); while(index>=0) { @@ -1420,17 +1420,17 @@ int Board::setASCIIState(const TQString& state) if (f == rowEnd) { row++; if (row <4) { - index = state.find("/",index); + index = state.tqfind("/",index); f = 12 + row*11; rowEnd = row*12+17; } else if (row==4) { - index = state.find("|",index); + index = state.tqfind("|",index); f = 56; rowEnd = 65; } else if (row <9) { - index = state.find("\\",index); + index = state.tqfind("\\",index); f = 8 + row*12; rowEnd = 21 + row*11; } diff --git a/kenolaba/Board.h b/kenolaba/Board.h index 81b589d9..b07a9d65 100644 --- a/kenolaba/Board.h +++ b/kenolaba/Board.h @@ -41,9 +41,10 @@ private: }; -class Board : public QObject +class Board : public TQObject { Q_OBJECT + TQ_OBJECT public: Board(); diff --git a/kenolaba/BoardWidget.cpp b/kenolaba/BoardWidget.cpp index da6358c7..af4a103a 100644 --- a/kenolaba/BoardWidget.cpp +++ b/kenolaba/BoardWidget.cpp @@ -34,8 +34,8 @@ #include "bitmaps/Arrow6" #include "bitmaps/Arrow6Mask" -BoardWidget::BoardWidget(Board& b, TQWidget *parent, const char *name) - : BallWidget(10,9,parent, name), board(b) +BoardWidget::BoardWidget(Board& b, TQWidget *tqparent, const char *name) + : BallWidget(10,9,tqparent, name), board(b) { pList =0; gettingMove = false; @@ -164,7 +164,7 @@ void BoardWidget::paintEvent(TQPaintEvent *) { if (renderMode) { pm = boardPM; - BallWidget::paint(&pm); + BallWidget::paint(TQT_TQPAINTDEVICE(&pm)); } else draw(); @@ -237,7 +237,7 @@ void BoardWidget::drawBoard() #ifndef HAVE_KIR TQColorGroup g = TQPalette( *boardColor ).active(); - TQColorGroup g2 = TQWidget::colorGroup(); + TQColorGroup g2 = TQWidget::tqcolorGroup(); int boardSize = width() *10/12; if (boardSize > height()) boardSize = height(); @@ -345,7 +345,7 @@ void BoardWidget::draw() if (renderMode) { updateBalls(); - repaint(false); + tqrepaint(false); return; } @@ -631,7 +631,7 @@ void BoardWidget::choseMove(MoveList *pl) */ int BoardWidget::positionOf(int xx, int yy) { - int boardSize = QMIN( width()*10/12, height() ); + int boardSize = TQMIN( width()*10/12, height() ); int x = (1000 * (xx- (width()-boardSize)/2)) / boardSize; int y = (1000 * (yy- (height()-boardSize)/2)) / boardSize; @@ -834,7 +834,7 @@ void BoardWidget::mousePressEvent( TQMouseEvent* pEvent ) int pos = positionOf( pEvent->x(), pEvent->y() ); int f = fieldOf(pos); - if (pEvent->button() == RightButton) { + if (pEvent->button() == Qt::RightButton) { emit rightButtonPressed(f, pEvent->globalPos()); return; } @@ -846,9 +846,9 @@ void BoardWidget::mousePressEvent( TQMouseEvent* pEvent ) if (editMode) { - editColor = (pEvent->button() == MidButton) ? + editColor = (pEvent->button() == Qt::MidButton) ? Board::color2 : Board::color1; - int newColor = (pEvent->button() == MidButton) ? + int newColor = (pEvent->button() == Qt::MidButton) ? Board::color2bright : Board::color1bright; if (field[f] == Board::free) { @@ -877,7 +877,7 @@ void BoardWidget::mousePressEvent( TQMouseEvent* pEvent ) return; } - startValid = isValidStart(pos, (pEvent->button() == MidButton)); + startValid = isValidStart(pos, (pEvent->button() == Qt::MidButton)); kdDebug(12011) << "Start pos " << pos << " is valid: " << startValid << endl; // actMove.print(); @@ -889,7 +889,7 @@ void BoardWidget::mousePressEvent( TQMouseEvent* pEvent ) TQString tmp; actValue = - board.calcEvaluation(); - tmp = i18n("Board value: %1").arg(actValue); + tmp = i18n("Board value: %1").tqarg(actValue); emit updateSpy(tmp); } @@ -918,7 +918,7 @@ void BoardWidget::mouseMoveEvent( TQMouseEvent* pEvent ) if (!startValid) { /* We haven't a valid move yet. Check if we are over a valid start */ - startValid = isValidStart(pos, (pEvent->button() == MidButton)); + startValid = isValidStart(pos, (pEvent->button() == Qt::MidButton)); kdDebug(12011) << "Start pos " << pos << " is valid: " << startValid << endl; // actMove.print(); @@ -930,7 +930,7 @@ void BoardWidget::mouseMoveEvent( TQMouseEvent* pEvent ) TQString tmp; actValue = - board.calcEvaluation(); - tmp = i18n("Board value: %1").arg(actValue); + tmp = i18n("Board value: %1").tqarg(actValue); emit updateSpy(tmp); return; } @@ -948,7 +948,7 @@ void BoardWidget::mouseMoveEvent( TQMouseEvent* pEvent ) TQString tmp; tmp.sprintf("%+d", v-actValue); - TQString str = TQString("%1 : %2").arg(actMove.name()).arg(tmp); + TQString str = TQString("%1 : %2").tqarg(actMove.name()).tqarg(tmp); emit updateSpy(str); showMove(actMove,3); @@ -961,7 +961,7 @@ void BoardWidget::mouseMoveEvent( TQMouseEvent* pEvent ) if (pos == startPos) { showStart(actMove,1); startShown = true; - tmp = i18n("Board value: %1").arg(actValue); + tmp = i18n("Board value: %1").tqarg(actValue); } else draw(); @@ -1019,7 +1019,7 @@ void BoardWidget::mouseReleaseEvent( TQMouseEvent* pEvent ) emit updateSpy(tmp); } -TQSize BoardWidget::sizeHint() const +TQSize BoardWidget::tqsizeHint() const { return TQSize(400, 350); } diff --git a/kenolaba/BoardWidget.h b/kenolaba/BoardWidget.h index f3cfd969..2f123fc9 100644 --- a/kenolaba/BoardWidget.h +++ b/kenolaba/BoardWidget.h @@ -15,9 +15,10 @@ class KIRenderer; class BoardWidget : public BallWidget { Q_OBJECT + TQ_OBJECT public: - BoardWidget(Board&, TQWidget *parent = 0, const char *name = 0); + BoardWidget(Board&, TQWidget *tqparent = 0, const char *name = 0); ~BoardWidget(); void createPos(int , int , int , Ball*); @@ -77,7 +78,7 @@ class BoardWidget : public BallWidget void updateSpy(TQString); void edited(int); protected: - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; private: int positionOf(int x, int y); diff --git a/kenolaba/EvalDlg.ui b/kenolaba/EvalDlg.ui index 06931458..ee649f2a 100644 --- a/kenolaba/EvalDlg.ui +++ b/kenolaba/EvalDlg.ui @@ -1,10 +1,10 @@ EvalDlg - + EvalDlg - + 0 0 @@ -25,13 +25,13 @@ 6 - + TabWidget2 - + - + moves @@ -48,7 +48,7 @@ 6 - + Layout17 @@ -62,11 +62,11 @@ 6 - + Layout35 - + @@ -78,7 +78,7 @@ 4 - + moveEval1 @@ -90,19 +90,19 @@ 0 - + 30 32767 - + AlignLeft - + PixmapLabel3_2 @@ -113,7 +113,7 @@ false - + moveEval2 @@ -125,19 +125,19 @@ 0 - + 30 32767 - + AlignLeft - + PixmapLabel1_2_5 @@ -148,7 +148,7 @@ false - + moveEval3 @@ -160,19 +160,19 @@ 0 - + 30 32767 - + AlignLeft - + PixmapLabel3_3 @@ -183,7 +183,7 @@ false - + unnamed @@ -194,7 +194,7 @@ false - + PixmapLabel1_2_6 @@ -205,7 +205,7 @@ false - + PixmapLabel1_2_4 @@ -216,7 +216,7 @@ false - + PixmapLabel3 @@ -227,7 +227,7 @@ false - + PixmapLabel1_2 @@ -238,7 +238,7 @@ false - + PixmapLabel1_3 @@ -262,14 +262,14 @@ - + TextLabel4_2_2 Push Out - + AlignTop|AlignLeft @@ -286,24 +286,24 @@ Expanding - + TextLabel4_2 Push - + AlignTop|AlignLeft - + Layout37 - + @@ -315,7 +315,7 @@ 4 - + PixmapLabel1_2_5_2_3 @@ -326,7 +326,7 @@ false - + PixmapLabel3_3_2_3 @@ -337,7 +337,7 @@ false - + PixmapLabel3_3_2_2 @@ -348,7 +348,7 @@ false - + moveEval4 @@ -360,19 +360,19 @@ 0 - + 30 32767 - + AlignLeft - + moveEval5 @@ -384,19 +384,19 @@ 0 - + 30 32767 - + AlignLeft - + PixmapLabel2_3 @@ -407,7 +407,7 @@ false - + PixmapLabel1_2_5_2 @@ -418,7 +418,7 @@ false - + PixmapLabel3_3_2 @@ -429,7 +429,7 @@ false - + PixmapLabel2_2_2 @@ -440,7 +440,7 @@ false - + PixmapLabel1_3_2 @@ -462,7 +462,7 @@ Expanding - + moveEval6 @@ -474,19 +474,19 @@ 0 - + 30 32767 - + AlignLeft - + PixmapLabel1_4 @@ -497,7 +497,7 @@ false - + PixmapLabel1_2_2 @@ -508,7 +508,7 @@ false - + PixmapLabel2_2 @@ -519,7 +519,7 @@ false - + PixmapLabel1_4_3 @@ -530,7 +530,7 @@ false - + PixmapLabel1_2_5_2_2 @@ -538,7 +538,7 @@ image1 - + PixmapLabel2 @@ -549,7 +549,7 @@ false - + PixmapLabel1_4_2 @@ -573,11 +573,11 @@ Expanding - + Layout38 - + @@ -589,7 +589,7 @@ 4 - + PixmapLabel2_4 @@ -600,7 +600,7 @@ false - + PixmapLabel1_3_2_2 @@ -611,7 +611,7 @@ false - + PixmapLabel1_2_5_2_2_2 @@ -630,7 +630,7 @@ Expanding - + moveEval7 @@ -642,19 +642,19 @@ 0 - + 30 32767 - + AlignLeft - + PixmapLabel1_2_2_2 @@ -665,7 +665,7 @@ false - + PixmapLabel2_2_2_3 @@ -676,7 +676,7 @@ false - + moveEval9 @@ -688,19 +688,19 @@ 0 - + 30 32767 - + AlignLeft - + PixmapLabel1_4_2_2 @@ -711,7 +711,7 @@ false - + PixmapLabel1_2_5_2_3_3 @@ -722,7 +722,7 @@ false - + moveEval8 @@ -734,19 +734,19 @@ 0 - + 30 32767 - + AlignLeft - + PixmapLabel1_4_3_2 @@ -757,7 +757,7 @@ false - + PixmapLabel1_4_4 @@ -768,7 +768,7 @@ false - + PixmapLabel1_2_5_2_4 @@ -779,7 +779,7 @@ false - + PixmapLabel2_3_3 @@ -790,7 +790,7 @@ false - + PixmapLabel2_2_3 @@ -803,14 +803,14 @@ - + TextLabel4 Normal - + AlignTop|AlignLeft @@ -818,11 +818,11 @@ - + TextLabel5 - + 0 20 @@ -831,7 +831,7 @@ For every move possible the given points are added to the Evaluation. - + WordBreak|AlignTop|AlignLeft @@ -852,7 +852,7 @@ - + position @@ -869,7 +869,7 @@ 6 - + Layout63 @@ -894,7 +894,7 @@ Expanding - + Layout62 @@ -908,7 +908,7 @@ 6 - + TextLabel1_2_3_2 @@ -916,55 +916,55 @@ Inner ring 3: - + posEval3 - + 30 32767 - + AlignLeft - + posEval5 - + 30 32767 - + AlignLeft - + posEval2 - + 30 32767 - + AlignLeft - + TextLabel1_2 @@ -972,55 +972,55 @@ Outermost ring: - + diffEval2 - + 30 32767 - + AlignLeft - + diffEval3 - + 30 32767 - + AlignLeft - + posEval4 - + 30 32767 - + AlignLeft - + TextLabel1_2_2 @@ -1028,39 +1028,39 @@ Middle position: - + diffEval5 - + 30 32767 - + AlignLeft - + posEval1 - + 30 32767 - + AlignLeft - + TextLabel1_2_3 @@ -1068,7 +1068,7 @@ Inner ring 2: - + TextLabel3_4 @@ -1076,7 +1076,7 @@ +/- - + TextLabel3_3 @@ -1084,23 +1084,23 @@ +/- - + diffEval4 - + 30 32767 - + AlignLeft - + TextLabel3_2 @@ -1108,7 +1108,7 @@ +/- - + TextLabel1_2_2_2 @@ -1116,7 +1116,7 @@ Innermost ring: - + TextLabel3 @@ -1139,14 +1139,14 @@ - + TextLabel6 For every ball, the given points are added to the evaluation depending on the balls position. The bonus for a given position is changed randomly in the +/- range. - + WordBreak|AlignTop|AlignLeft @@ -1167,7 +1167,7 @@ - + inarow @@ -1184,7 +1184,7 @@ 6 - + Layout64 @@ -1209,7 +1209,7 @@ Expanding - + Layout42 @@ -1223,71 +1223,71 @@ 6 - + rowEval3 - + 30 32767 - + AlignLeft - + rowEval2 - + 30 32767 - + AlignLeft - + rowEval5 - + 30 32767 - + AlignLeft - + rowEval4 - + 30 32767 - + AlignLeft - + TextLabel1_2_2_3_2 @@ -1295,7 +1295,7 @@ Three in-a-row: - + TextLabel1_2_2_3 @@ -1303,7 +1303,7 @@ Two in-a-row: - + TextLabel1_2_2_3_3 @@ -1311,7 +1311,7 @@ Four in-a-row: - + TextLabel1_2_2_3_4 @@ -1334,14 +1334,14 @@ - + TextLabel6_2 For a number of balls In-a-Row, the given points are added to the evaluation - + WordBreak|AlignTop|AlignLeft @@ -1362,7 +1362,7 @@ - + count @@ -1379,7 +1379,7 @@ 6 - + Layout66 @@ -1404,7 +1404,7 @@ Expanding - + Layout65 @@ -1418,23 +1418,23 @@ 6 - + countEval2 - + 40 32767 - + AlignLeft - + TextLabel1_2_2_3_4_2 @@ -1442,39 +1442,39 @@ 4 Balls more: - + countEval5 - + 40 32767 - + AlignLeft - + countEval4 - + 40 32767 - + AlignLeft - + TextLabel1_2_2_3_3_2 @@ -1482,7 +1482,7 @@ 3 Balls more: - + TextLabel1_2_2_3_4_2_2 @@ -1490,23 +1490,23 @@ 5 Balls more: - + countEval1 - + 40 32767 - + AlignLeft - + TextLabel1_2_2_3_2_2 @@ -1514,23 +1514,23 @@ 2 Balls more: - + countEval3 - + 40 32767 - + AlignLeft - + TextLabel1_2_2_3_5 @@ -1553,14 +1553,14 @@ - + TextLabel6_2_2 For a difference in the number of balls, the given points are added to the evaluation. A difference of 6 only can be a lost/won game. - + WordBreak|AlignTop|AlignLeft @@ -1581,7 +1581,7 @@ - + tab @@ -1598,12 +1598,12 @@ 6 - + evalList - + Layout13 @@ -1617,7 +1617,7 @@ 6 - + evalSaveAs @@ -1625,7 +1625,7 @@ Save As... - + evalDelete @@ -1635,14 +1635,14 @@ - + TextLabel1 Your evaluation scheme, defined in all other tabs of this dialog, can be stored here. - + WordBreak|AlignTop|AlignLeft @@ -1653,7 +1653,7 @@ - + Layout13 @@ -1678,7 +1678,7 @@ Expanding - + TextLabel9 @@ -1686,7 +1686,7 @@ Evaluation of actual position: - + actualEval @@ -1756,5 +1756,5 @@ kseparator.h - + diff --git a/kenolaba/EvalDlgImpl.cpp b/kenolaba/EvalDlgImpl.cpp index 70662629..e0ab3006 100644 --- a/kenolaba/EvalDlgImpl.cpp +++ b/kenolaba/EvalDlgImpl.cpp @@ -19,8 +19,8 @@ #include "Board.h" #include "EvalScheme.h" -EvalDlgImpl::EvalDlgImpl(TQWidget* parent, Board* board) - :EvalDlg(parent) +EvalDlgImpl::EvalDlgImpl(TQWidget* tqparent, Board* board) + :EvalDlg(tqparent) { _board = board; _origScheme = board->evalScheme(); @@ -246,7 +246,7 @@ void EvalDlgImpl::deleteEntry() void EvalDlgImpl::saveas() { - KLineEditDlg dlg(i18n("Name for scheme:"), TQString::null, this); + KLineEditDlg dlg(i18n("Name for scheme:"), TQString(), this); dlg.setCaption(i18n("Save Scheme")); if (dlg.exec()) { @@ -254,10 +254,10 @@ void EvalDlgImpl::saveas() KConfig* config = kapp->config(); config->setGroup("General"); TQStringList list = config->readListEntry("EvalSchemes"); - TQListBoxItem *it = evalList->findItem(name); + TQListBoxItem *it = evalList->tqfindItem(name); if (!it) { evalList->insertItem(name); - it = evalList->findItem(name); + it = evalList->tqfindItem(name); list << name; config->writeEntry("EvalSchemes", list); } diff --git a/kenolaba/EvalDlgImpl.h b/kenolaba/EvalDlgImpl.h index e7e4cb0d..07cb57a9 100644 --- a/kenolaba/EvalDlgImpl.h +++ b/kenolaba/EvalDlgImpl.h @@ -14,9 +14,10 @@ class Board; class EvalDlgImpl: public EvalDlg { Q_OBJECT + TQ_OBJECT public: - EvalDlgImpl(TQWidget* parent, Board* board); + EvalDlgImpl(TQWidget* tqparent, Board* board); ~EvalDlgImpl(); EvalScheme* evalScheme() { return _scheme; } diff --git a/kenolaba/EvalScheme.cpp b/kenolaba/EvalScheme.cpp index d884f398..063ca5f2 100644 --- a/kenolaba/EvalScheme.cpp +++ b/kenolaba/EvalScheme.cpp @@ -76,7 +76,7 @@ void EvalScheme::setDefaults() void EvalScheme::read(KConfig *config) { - TQString confSection = TQString("%1 Evaluation Scheme").arg(_name); + TQString confSection = TQString("%1 Evaluation Scheme").tqarg(_name); config->setGroup(confSection); TQStringList list; @@ -117,7 +117,7 @@ void EvalScheme::read(KConfig *config) void EvalScheme::save(KConfig* config) { - TQString confSection = TQString("%1 Evaluation Scheme").arg(_name); + TQString confSection = TQString("%1 Evaluation Scheme").tqarg(_name); config->setGroup(confSection); TQString entry; @@ -128,12 +128,12 @@ void EvalScheme::save(KConfig* config) entry.sprintf("%d", _moveValue[0]); for(int i=1;iwriteEntry("MoveValues", entry); entry.sprintf("%d", _inARowValue[0]); for(int i=1;iwriteEntry("InARowValues", entry); entry.sprintf("%d,%d,%d,%d,%d", _ringValue[0], _ringValue[1], @@ -184,7 +184,7 @@ void EvalScheme::setInARowValue(int stones, int value) EvalScheme* EvalScheme::create(TQString scheme) { - int pos = scheme.find('='); + int pos = scheme.tqfind('='); if (pos<0) return 0; EvalScheme* evalScheme = new EvalScheme( scheme.left(pos) ); @@ -217,15 +217,15 @@ TQString EvalScheme::ascii() res.sprintf("%s=%d", _name.ascii(), _stoneValue[1]); for(i=1;i<6;i++) - res += TQString(",%1").arg( _stoneValue[i] ); + res += TQString(",%1").tqarg( _stoneValue[i] ); for(i=0;isetText( i18n("Actual examined position:") ); - l->setFixedHeight( l->sizeHint().height() ); - l->setAlignment( AlignVCenter | AlignLeft ); + l->setFixedHeight( l->tqsizeHint().height() ); + l->tqsetAlignment( AlignVCenter | AlignLeft ); top->addWidget( l ); TQHBoxLayout* b1 = new TQHBoxLayout(); @@ -38,8 +38,8 @@ Spy::Spy(Board& b) actLabel[i] = new TQLabel(this); actLabel[i]->setText("---"); // actLabel[i]->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); - actLabel[i]->setAlignment( AlignHCenter | AlignVCenter); - actLabel[i]->setFixedHeight( actLabel[i]->sizeHint().height() ); + actLabel[i]->tqsetAlignment( AlignHCenter | AlignVCenter); + actLabel[i]->setFixedHeight( actLabel[i]->tqsizeHint().height() ); b2->addWidget( actBoard[i] ); b2->addWidget( actLabel[i] ); @@ -48,8 +48,8 @@ Spy::Spy(Board& b) l = new TQLabel(this); l->setText( i18n("Best move so far:") ); - l->setFixedHeight( l->sizeHint().height() ); - l->setAlignment( AlignVCenter | AlignLeft ); + l->setFixedHeight( l->tqsizeHint().height() ); + l->tqsetAlignment( AlignVCenter | AlignLeft ); top->addWidget( l ); b1 = new TQHBoxLayout(); @@ -63,8 +63,8 @@ Spy::Spy(Board& b) bestLabel[i] = new TQLabel(this); bestLabel[i]->setText("---"); // bestLabel[i]->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); - bestLabel[i]->setAlignment( AlignHCenter | AlignVCenter); - bestLabel[i]->setFixedHeight( bestLabel[i]->sizeHint().height() ); + bestLabel[i]->tqsetAlignment( AlignHCenter | AlignVCenter); + bestLabel[i]->setFixedHeight( bestLabel[i]->tqsizeHint().height() ); b2->addWidget( bestBoard[i] ); b2->addWidget( bestLabel[i] ); diff --git a/kenolaba/Spy.h b/kenolaba/Spy.h index cbb03ad8..719b8d4f 100644 --- a/kenolaba/Spy.h +++ b/kenolaba/Spy.h @@ -14,9 +14,10 @@ class BoardWidget; class TQLabel; -class Spy: public QWidget +class Spy: public TQWidget { Q_OBJECT + TQ_OBJECT public: Spy(Board&); diff --git a/kfouleggs/ai.h b/kfouleggs/ai.h index 86e8f5b2..9885d3c8 100644 --- a/kfouleggs/ai.h +++ b/kfouleggs/ai.h @@ -7,6 +7,7 @@ class FEAI : public AI { Q_OBJECT + TQ_OBJECT public: FEAI(); diff --git a/kfouleggs/board.cpp b/kfouleggs/board.cpp index 5383c619..e719ce2f 100644 --- a/kfouleggs/board.cpp +++ b/kfouleggs/board.cpp @@ -9,8 +9,8 @@ using namespace KGrid2D; -FEBoard::FEBoard(bool graphic, TQWidget *parent) -: Board(graphic, new GiftPool(parent), parent), +FEBoard::FEBoard(bool graphic, TQWidget *tqparent) +: Board(graphic, new GiftPool(tqparent), tqparent), _field(matrix().width(), matrix().height()), _chainedPuyos(4) { init(); diff --git a/kfouleggs/board.h b/kfouleggs/board.h index da5a6275..e3b4229e 100644 --- a/kfouleggs/board.h +++ b/kfouleggs/board.h @@ -7,8 +7,9 @@ class FEBoard : public Board { Q_OBJECT + TQ_OBJECT public: - FEBoard(bool graphic, TQWidget *parent); + FEBoard(bool graphic, TQWidget *tqparent); void copy(const GenericTetris &); void start(const GTInitData &); diff --git a/kfouleggs/field.cpp b/kfouleggs/field.cpp index ae9bcdce..997e4f48 100644 --- a/kfouleggs/field.cpp +++ b/kfouleggs/field.cpp @@ -10,8 +10,8 @@ #include "board.h" -FEField::FEField(TQWidget *parent) - : Field(parent) +FEField::FEField(TQWidget *tqparent) + : Field(tqparent) { Board *b = static_cast(board); TQWhatsThis::add(b->giftPool(), i18n("Display the amount of foul eggs sent by your opponent.")); diff --git a/kfouleggs/field.h b/kfouleggs/field.h index a1c9824e..59cdcee8 100644 --- a/kfouleggs/field.h +++ b/kfouleggs/field.h @@ -8,8 +8,9 @@ class FEField : public Field { Q_OBJECT + TQ_OBJECT public: - FEField(TQWidget *parent); + FEField(TQWidget *tqparent); private slots: virtual void removedUpdated(); diff --git a/kfouleggs/main.cpp b/kfouleggs/main.cpp index 89295d08..ce083c7c 100644 --- a/kfouleggs/main.cpp +++ b/kfouleggs/main.cpp @@ -65,9 +65,9 @@ FEFactory::FEFactory() : CommonFactory(MAIN_DATA, BASE_BOARD_INFO, COMMON_BOARD_INFO) {} -BaseInterface *FEFactory::createInterface(TQWidget *parent) +BaseInterface *FEFactory::createInterface(TQWidget *tqparent) { - return new Interface(MP_GAME_INFO, parent); + return new Interface(MP_GAME_INFO, tqparent); } diff --git a/kfouleggs/main.h b/kfouleggs/main.h index 52108b2d..12aca31f 100644 --- a/kfouleggs/main.h +++ b/kfouleggs/main.h @@ -15,11 +15,11 @@ class FEFactory : public CommonFactory FEFactory(); protected: - virtual BaseBoard *createBoard(bool graphic, TQWidget *parent) - { return new FEBoard(graphic, parent); } - virtual BaseField *createField(TQWidget *parent) - { return new FEField(parent); } - virtual BaseInterface *createInterface(TQWidget *parent); + virtual BaseBoard *createBoard(bool graphic, TQWidget *tqparent) + { return new FEBoard(graphic, tqparent); } + virtual BaseField *createField(TQWidget *tqparent) + { return new FEField(tqparent); } + virtual BaseInterface *createInterface(TQWidget *tqparent); virtual AI *createAI() { return new FEAI; } }; @@ -27,6 +27,7 @@ class FEFactory : public CommonFactory class FEMainWindow : public MainWindow { Q_OBJECT + TQ_OBJECT public: FEMainWindow() { init(); } }; diff --git a/kfouleggs/piece.cpp b/kfouleggs/piece.cpp index bb5aad42..c2e8a186 100644 --- a/kfouleggs/piece.cpp +++ b/kfouleggs/piece.cpp @@ -28,7 +28,7 @@ TQColor FEPieceInfo::defaultColor(uint i) const TQString FEPieceInfo::colorLabel(uint i) const { return (i==NB_NORM_BLOCK_TYPES ? i18n("Garbage color:") - : i18n("Color #%1:").arg(i+1)); + : i18n("Color #%1:").tqarg(i+1)); } void FEPieceInfo::draw(TQPixmap *pixmap, uint blockType, uint, @@ -44,8 +44,8 @@ void FEPieceInfo::setMask(TQPixmap *pixmap, uint blockMode) const Q_ASSERT( pixmap->width()==pixmap->height() ); // drawing code assumes that TQBitmap bitmap(pixmap->size(), true); TQPainter p(&bitmap); - p.setBrush(Qt::color1); - p.setPen( TQPen(Qt::NoPen) ); + p.setBrush(TQt::color1); + p.setPen( TQPen(TQt::NoPen) ); // base circle int w = pixmap->width(); @@ -66,7 +66,7 @@ void FEPieceInfo::setMask(TQPixmap *pixmap, uint blockMode) const if ( blockMode & BaseBoard::Left ) p.drawRect( 0, 0, a, w); // second drawing with color0 - p.setBrush(Qt::color0); + p.setBrush(TQt::color0); if ( (blockMode & BaseBoard::Up) || (blockMode & BaseBoard::Left) ) { cr.moveCenter(TQPoint(0, 0)); p.drawEllipse(cr); diff --git a/kgoldrunner/Doxyfile b/kgoldrunner/Doxyfile index e76fadd7..25996b5a 100644 --- a/kgoldrunner/Doxyfile +++ b/kgoldrunner/Doxyfile @@ -82,7 +82,7 @@ FILE_PATTERNS = *.c \ *.tlh \ *.diff \ *.patch \ - *.moc \ + *.tqmoc \ *.xpm RECURSIVE = yes EXCLUDE = diff --git a/kgoldrunner/gamedata/levels.tar b/kgoldrunner/gamedata/levels.tar index 851ff50ea19c24a931af75e5fe1862d338402b9d..1e30bd674951a716bc47b6e546fbca366fef77fc 100644 GIT binary patch delta 45 xcmZqJAl$Y=c*D*rrjo+RJF5zSRI_GvyJj^b5HoGptY)725h%8OUk-~?HUP7y5>WsE delta 36 rcmZqMAl$G)c*D-B$-Aoxnsuw&b*mYHm}$FiHS^Su+mGb1IAsF>E%Ohw diff --git a/kgoldrunner/src/kgoldrunner.cpp b/kgoldrunner/src/kgoldrunner.cpp index 13300f9e..7d5676c5 100644 --- a/kgoldrunner/src/kgoldrunner.cpp +++ b/kgoldrunner/src/kgoldrunner.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003 Ian Wadham and Marco Krüger + * Copyright (C) 2003 Ian Wadham and Marco Kr�ger */ #include @@ -130,7 +130,7 @@ KGoldrunner::KGoldrunner() show(); // Force the main widget to appear before the "Start Game" dialog does. - qApp->processEvents(); + tqApp->processEvents(); // Call the "Start Game" function and pop up the "Start Game" dialog. game->startLevelOne(); @@ -193,7 +193,7 @@ void KGoldrunner::setupActions() myPause = KStdGameAction:: pause ( - this, TQT_SLOT(stopStart()), actionCollection()); + TQT_TQOBJECT(this), TQT_SLOT(stopStart()), actionCollection()); myPause-> setShortcut (Key_Escape); // Alternate key. highScore = KStdGameAction:: highscores ( @@ -214,7 +214,7 @@ void KGoldrunner::setupActions() (void) KStdGameAction:: quit ( - this, TQT_SLOT(close()), actionCollection()); + TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); /**************************************************************************/ /*************************** GAME EDITOR MENU **************************/ @@ -228,17 +228,17 @@ void KGoldrunner::setupActions() (void) new KAction ( i18n("&Create Level"), 0, - game, TQT_SLOT(createLevel()), actionCollection(), + TQT_TQOBJECT(game), TQT_SLOT(createLevel()), actionCollection(), "create"); (void) new KAction ( i18n("&Edit Any Level..."), 0, - game, TQT_SLOT(updateLevel()), actionCollection(), + TQT_TQOBJECT(game), TQT_SLOT(updateLevel()), actionCollection(), "edit_any"); (void) new KAction ( i18n("Edit &Next Level..."), 0, - game, TQT_SLOT(updateNext()), actionCollection(), + TQT_TQOBJECT(game), TQT_SLOT(updateNext()), actionCollection(), "edit_next"); // Save Edits... @@ -249,19 +249,19 @@ void KGoldrunner::setupActions() saveEdits = new KAction ( i18n("&Save Edits..."), 0, - game, TQT_SLOT(saveLevelFile()), actionCollection(), + TQT_TQOBJECT(game), TQT_SLOT(saveLevelFile()), actionCollection(), "save_edits"); saveEdits->setEnabled (FALSE); // Nothing to save, yet. (void) new KAction ( i18n("&Move Level..."), 0, - game, TQT_SLOT(moveLevelFile()), actionCollection(), + TQT_TQOBJECT(game), TQT_SLOT(moveLevelFile()), actionCollection(), "move_level"); (void) new KAction ( i18n("&Delete Level..."), 0, - game, + TQT_TQOBJECT(game), TQT_SLOT(deleteLevelFile()), actionCollection(), "delete_level"); @@ -272,12 +272,12 @@ void KGoldrunner::setupActions() (void) new KAction ( i18n("Create Game..."), 0, - this, TQT_SLOT(createGame()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(createGame()), actionCollection(), "create_game"); (void) new KAction ( i18n("Edit Game Info..."), 0, - this, + TQT_TQOBJECT(this), TQT_SLOT(editGameInfo()), actionCollection(), "edit_game"); @@ -290,27 +290,27 @@ void KGoldrunner::setupActions() setKGoldrunner = new KRadioAction ( "K&Goldrunner", 0, // Default Shift+G - this, TQT_SLOT(lsKGoldrunner()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(lsKGoldrunner()), actionCollection(), "kgoldrunner"); setAppleII = new KRadioAction ( "&Apple II", 0, // Default Shift+A - this, TQT_SLOT(lsApple2()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(lsApple2()), actionCollection(), "apple_2"); setIceCave = new KRadioAction ( i18n("&Ice Cave"), 0, // Default Shift+I - this, TQT_SLOT(lsIceCave()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(lsIceCave()), actionCollection(), "ice_cave"); setMidnight = new KRadioAction ( i18n("&Midnight"), 0, // Default Shift+M - this, TQT_SLOT(lsMidnight()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(lsMidnight()), actionCollection(), "midnight"); setKDEKool = new KRadioAction ( i18n("&KDE Kool"), 0, // Default Shift+K - this, TQT_SLOT(lsKDEKool()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(lsKDEKool()), actionCollection(), "kde_kool"); setKGoldrunner-> setExclusiveGroup ("landscapes"); @@ -331,13 +331,13 @@ void KGoldrunner::setupActions() setMouse = new KRadioAction ( i18n("&Mouse Controls Hero"), 0, - this, + TQT_TQOBJECT(this), TQT_SLOT(setMouseMode()), actionCollection(), "mouse_mode"); setKeyboard = new KRadioAction ( i18n("&Keyboard Controls Hero"), 0, - this, + TQT_TQOBJECT(this), TQT_SLOT(setKeyBoardMode()), actionCollection(), "keyboard_mode"); @@ -355,27 +355,27 @@ void KGoldrunner::setupActions() KRadioAction * nSpeed = new KRadioAction ( i18n("Normal Speed"), 0, - this, TQT_SLOT(normalSpeed()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(normalSpeed()), actionCollection(), "normal_speed"); KRadioAction * bSpeed = new KRadioAction ( i18n("Beginner Speed"), 0, - this, TQT_SLOT(beginSpeed()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(beginSpeed()), actionCollection(), "beginner_speed"); KRadioAction * cSpeed = new KRadioAction ( i18n("Champion Speed"), 0, - this, TQT_SLOT(champSpeed()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(champSpeed()), actionCollection(), "champion_speed"); (void) new KAction ( // Repeatable action. i18n("Increase Speed"), Key_Plus, - this, TQT_SLOT(incSpeed()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(incSpeed()), actionCollection(), "increase_speed"); (void) new KAction ( // Repeatable action. i18n("Decrease Speed"), Key_Minus, - this, TQT_SLOT(decSpeed()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(decSpeed()), actionCollection(), "decrease_speed"); nSpeed-> setExclusiveGroup ("speed"); @@ -390,12 +390,12 @@ void KGoldrunner::setupActions() tradRules = new KRadioAction ( i18n("&Traditional Rules"), 0, - this, TQT_SLOT(setTradRules()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(setTradRules()), actionCollection(), "trad_rules"); kgrRules = new KRadioAction ( i18n("K&Goldrunner Rules"), 0, - this, TQT_SLOT(setKGrRules()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(setKGrRules()), actionCollection(), "kgr_rules"); tradRules-> setExclusiveGroup ("rules"); @@ -409,12 +409,12 @@ void KGoldrunner::setupActions() (void) new KAction ( i18n("Larger Playing Area"), 0, - this, TQT_SLOT(makeLarger()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(makeLarger()), actionCollection(), "larger_area"); (void) new KAction ( i18n("Smaller Playing Area"), 0, - this, TQT_SLOT(makeSmaller()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(makeSmaller()), actionCollection(), "smaller_area"); // Configure Shortcuts... @@ -422,7 +422,7 @@ void KGoldrunner::setupActions() // -------------------------- KStdAction::keyBindings ( - this, TQT_SLOT(optionsConfigureKeys()), + TQT_TQOBJECT(this), TQT_SLOT(optionsConfigureKeys()), actionCollection()); // KStdAction::configureToolbars ( // this, TQT_SLOT(optionsConfigureToolbars()), @@ -435,19 +435,19 @@ void KGoldrunner::setupActions() // Two-handed KB controls and alternate one-handed controls for the hero. (void) new KAction (i18n("Move Up"), Key_Up, - this, TQT_SLOT(goUp()), actionCollection(), "move_up"); + TQT_TQOBJECT(this), TQT_SLOT(goUp()), actionCollection(), "move_up"); (void) new KAction (i18n("Move Right"), Key_Right, - this, TQT_SLOT(goR()), actionCollection(), "move_right"); + TQT_TQOBJECT(this), TQT_SLOT(goR()), actionCollection(), "move_right"); (void) new KAction (i18n("Move Down"), Key_Down, - this, TQT_SLOT(goDown()), actionCollection(), "move_down"); + TQT_TQOBJECT(this), TQT_SLOT(goDown()), actionCollection(), "move_down"); (void) new KAction (i18n("Move Left"), Key_Left, - this, TQT_SLOT(goL()), actionCollection(), "move_left"); + TQT_TQOBJECT(this), TQT_SLOT(goL()), actionCollection(), "move_left"); (void) new KAction (i18n("Stop"), Key_Space, - this, TQT_SLOT(stop()), actionCollection(), "stop"); + TQT_TQOBJECT(this), TQT_SLOT(stop()), actionCollection(), "stop"); (void) new KAction (i18n("Dig Right"), Key_C, - this, TQT_SLOT(digR()), actionCollection(), "dig_right"); + TQT_TQOBJECT(this), TQT_SLOT(digR()), actionCollection(), "dig_right"); (void) new KAction (i18n("Dig Left"), Key_Z, - this, TQT_SLOT(digL()), actionCollection(), "dig_left"); + TQT_TQOBJECT(this), TQT_SLOT(digL()), actionCollection(), "dig_left"); // Alternate one-handed controls. Set up in "kgoldrunnerui.rc". @@ -522,7 +522,7 @@ void KGoldrunner::initStatusBar() // Set the PAUSE/RESUME key-names into the status bar message. pauseKeys = myPause->shortcut().toString(); - pauseKeys = pauseKeys.replace (';', "\" " + i18n("or") + " \""); + pauseKeys = pauseKeys.tqreplace (';', "\" " + i18n("or") + " \""); gameFreeze (FALSE); statusBar()->setItemFixed (ID_LIVES, -1); // Fix current sizes. @@ -572,10 +572,10 @@ void KGoldrunner::gameFreeze (bool on_off) { if (on_off) statusBar()->changeItem - (i18n("Press \"%1\" to RESUME").arg(pauseKeys), ID_MSG); + (i18n("Press \"%1\" to RESUME").tqarg(pauseKeys), ID_MSG); else statusBar()->changeItem - (i18n("Press \"%1\" to PAUSE").arg(pauseKeys), ID_MSG); + (i18n("Press \"%1\" to PAUSE").tqarg(pauseKeys), ID_MSG); } void KGoldrunner::adjustHintAction (bool hintAvailable) @@ -760,7 +760,7 @@ void KGoldrunner::optionsConfigureKeys() // Update the PAUSE/RESUME message in the status bar. pauseKeys = myPause->shortcut().toString(); - pauseKeys = pauseKeys.replace (';', "\" " + i18n("or") + " \""); + pauseKeys = pauseKeys.tqreplace (';', "\" " + i18n("or") + " \""); gameFreeze (KGrObject::frozen); // Refresh the status bar text. } @@ -849,7 +849,7 @@ bool KGoldrunner::getDirectories() KGrMessage::information (this, i18n("Get Folders"), i18n("Cannot find documentation sub-folder 'en/%1/' " "in area '%2' of the KDE folder ($KDEDIRS).") - .arg(myDir).arg(dirs->kde_default ("html"))); + .tqarg(myDir).tqarg(dirs->kde_default ("html"))); // result = FALSE; // Don't abort if the doc is missing. } else @@ -861,7 +861,7 @@ bool KGoldrunner::getDirectories() KGrMessage::information (this, i18n("Get Folders"), i18n("Cannot find system games sub-folder '%1/system/' " "in area '%2' of the KDE folder ($KDEDIRS).") - .arg(myDir).arg(dirs->kde_default ("data"))); + .tqarg(myDir).tqarg(dirs->kde_default ("data"))); result = FALSE; // ABORT if the games data is missing. } else @@ -874,7 +874,7 @@ bool KGoldrunner::getDirectories() KGrMessage::information (this, i18n("Get Folders"), i18n("Cannot find or create user games sub-folder '%1/user/' " "in area '%2' of the KDE user area ($KDEHOME).") - .arg(myDir).arg(dirs->kde_default ("data"))); + .tqarg(myDir).tqarg(dirs->kde_default ("data"))); // result = FALSE; // Don't abort if user area is missing. } else { @@ -882,7 +882,7 @@ bool KGoldrunner::getDirectories() if (! create) { KGrMessage::information (this, i18n("Get Folders"), i18n("Cannot find or create 'levels/' folder in " - "sub-folder '%1/user/' in the KDE user area ($KDEHOME).").arg(myDir)); + "sub-folder '%1/user/' in the KDE user area ($KDEHOME).").tqarg(myDir)); // result = FALSE; // Don't abort if user area is missing. } } @@ -987,7 +987,7 @@ void KGoldrunner::makeEditToolbar() edenemybg = edenemybg.xForm (w); } - editToolbar = new KToolBar (this, Qt::DockTop, TRUE, "Editor", TRUE); + editToolbar = new KToolBar (this, TQt::DockTop, TRUE, "Editor", TRUE); // Choose a colour that enhances visibility of the KGoldrunner pixmaps. // editToolbar->setPalette (TQPalette (TQColor (150, 150, 230))); @@ -995,7 +995,7 @@ void KGoldrunner::makeEditToolbar() // editToolbar->setHorizontallyStretchable (TRUE); // Not effective in KDE. // All those separators are just to get reasonable visual spacing of the - // pixmaps in KDE. "setHorizontallyStretchable(TRUE)" does it in Qt. + // pixmaps in KDE. "setHorizontallyStretchable(TRUE)" does it in TQt. editToolbar->insertSeparator(); @@ -1015,34 +1015,34 @@ void KGoldrunner::makeEditToolbar() editToolbar->insertSeparator(); editToolbar->insertSeparator(); - editToolbar->insertButton (freebg, (int)FREE, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (freebg, (int)FREE, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT(freeSlot()), TRUE, i18n("Empty space")); editToolbar->insertSeparator(); - editToolbar->insertButton (edherobg, (int)HERO, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (edherobg, (int)HERO, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT (edheroSlot()), TRUE, i18n("Hero")); editToolbar->insertSeparator(); - editToolbar->insertButton (edenemybg, (int)ENEMY, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (edenemybg, (int)ENEMY, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT (edenemySlot()), TRUE, i18n("Enemy")); editToolbar->insertSeparator(); - editToolbar->insertButton (brickbg, (int)BRICK, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (brickbg, (int)BRICK, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT (brickSlot()), TRUE, i18n("Brick (can dig)")); editToolbar->insertSeparator(); - editToolbar->insertButton (betonbg, (int)BETON, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (betonbg, (int)BETON, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT (betonSlot()), TRUE, i18n("Concrete (cannot dig)")); editToolbar->insertSeparator(); - editToolbar->insertButton (fbrickbg, (int)FBRICK, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (fbrickbg, (int)FBRICK, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT (fbrickSlot()), TRUE, i18n("Trap (can fall through)")); editToolbar->insertSeparator(); - editToolbar->insertButton (ladderbg, (int)LADDER, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (ladderbg, (int)LADDER, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT (ladderSlot()), TRUE, i18n("Ladder")); editToolbar->insertSeparator(); - editToolbar->insertButton (hladderbg, (int)HLADDER, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (hladderbg, (int)HLADDER, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT (hladderSlot()), TRUE, i18n("Hidden ladder")); editToolbar->insertSeparator(); - editToolbar->insertButton (polebg, (int)POLE, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (polebg, (int)POLE, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT (poleSlot()), TRUE, i18n("Pole (or bar)")); editToolbar->insertSeparator(); - editToolbar->insertButton (nuggetbg, (int)NUGGET, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (nuggetbg, (int)NUGGET, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT (nuggetSlot()), TRUE, i18n("Gold nugget")); editToolbar->setToggle ((int) FREE, TRUE); diff --git a/kgoldrunner/src/kgoldrunner.h b/kgoldrunner/src/kgoldrunner.h index 358a5561..2959b3d0 100644 --- a/kgoldrunner/src/kgoldrunner.h +++ b/kgoldrunner/src/kgoldrunner.h @@ -9,7 +9,7 @@ #include #endif -// Status bar +// tqStatus bar const int ID_LIVES = 0; // Field IDs in KDE status bar. const int ID_SCORE = 1; const int ID_LEVEL = 2; @@ -40,6 +40,7 @@ class KGrHero; class KGoldrunner : public KMainWindow { Q_OBJECT + TQ_OBJECT public: /** * Default Constructor @@ -136,7 +137,7 @@ private slots: void showLevel (int); // Show the current level number. void showLives (long); // Show how many lives are remaining. void showScore (long); // Show the player's score. - void gameFreeze (bool); // Status feedback on freeze/unfreeze. + void gameFreeze (bool); // tqStatus feedback on freeze/unfreeze. void adjustHintAction (bool); // Enable/disable "Hint" action. void markRuleType (char ruleType); // Check game's rule type in the menu. @@ -163,7 +164,7 @@ private: KAction * saveGame; // Save game, level, lives and score. KAction * myPause; // Pause or resume the game. - QString pauseKeys; // Keystroke names to put in status bar. + TQString pauseKeys; // Keystroke names to put in status bar. KAction * hintAction; // Display a hint, if available. KAction * killHero; // Kill hero (disabled during edits). diff --git a/kgoldrunner/src/kgrcanvas.cpp b/kgoldrunner/src/kgrcanvas.cpp index 111913a1..907463e5 100644 --- a/kgoldrunner/src/kgrcanvas.cpp +++ b/kgoldrunner/src/kgrcanvas.cpp @@ -2,7 +2,7 @@ kgrcanvas.cpp - description ------------------- begin : Wed Jan 23 2002 - copyright : (C) 2002 by Marco Krüger and Ian Wadham + copyright : (C) 2002 by Marco Kr�ger and Ian Wadham email : See menu "Help, About KGoldrunner" ***************************************************************************/ @@ -34,8 +34,8 @@ class KGoldrunner; -KGrCanvas::KGrCanvas (TQWidget * parent, const char *name) - : TQCanvasView (0, parent, name) +KGrCanvas::KGrCanvas (TQWidget * tqparent, const char *name) + : TQCanvasView (0, tqparent, name) { setBackgroundMode (NoBackground); m = new TQCursor (); // For handling the mouse. @@ -117,7 +117,7 @@ bool KGrCanvas::changeSize (int d) return FALSE; } - TQWMatrix wm = worldMatrix(); + TQWMatrix wm = tqworldMatrix(); double wmScale = 1.0; // Set the scale back to 1:1 and calculate the new scale factor. @@ -145,7 +145,7 @@ bool KGrCanvas::changeSize (int d) #else KGrMessage::information (this, i18n( "Change Size" ), i18n( "Sorry, you cannot change the size of the playing area. " - "That function requires Qt Library version 3 or later." )); + "That function requires TQt Library version 3 or later." )); return FALSE; #endif } @@ -196,8 +196,8 @@ void KGrCanvas::setTitle (TQString newTitle) void KGrCanvas::makeTitle () { - // This uses a calculated TQLabel and TQFont size because a QCanvasText - // object does not always display scaled-up fonts cleanly (in Qt 3.1.1). + // This uses a calculated TQLabel and TQFont size because a TQCanvasText + // object does not always display scaled-up fonts cleanly (in TQt 3.1.1). if (title != 0) title->close (TRUE); // Close and delete previous title. @@ -210,7 +210,7 @@ void KGrCanvas::makeTitle () title->setPaletteForegroundColor (textColor); title->setFont (TQFont (fontInfo().family(), (baseFontSize * scaleStep) / baseScale, TQFont::Bold)); - title->setAlignment (Qt::AlignCenter); + title->tqsetAlignment (TQt::AlignCenter); title->raise(); title->show(); } @@ -257,12 +257,12 @@ void KGrCanvas::makeHeroSprite (int i, int j, int startFrame) i++; j++; heroSprite->move (i * 4 * STEP, j * 4 * STEP, startFrame); heroSprite->setZ (1); - heroSprite->setVisible (TRUE); + heroSprite->tqsetVisible (TRUE); } void KGrCanvas::setHeroVisible (bool newState) { - heroSprite->setVisible (newState); // Show or hide the hero. + heroSprite->tqsetVisible (newState); // Show or hide the hero. } void KGrCanvas::makeEnemySprite (int i, int j, int startFrame) @@ -396,8 +396,8 @@ void KGrCanvas::initView() #else TQPixmap * pm; TQPoint * pt; - QList pmList; - QList ptList; + TQList pmList; + TQList ptList; pt = new TQPoint (0, 0); // "Hot spot" not used in KGoldrunner. @@ -469,7 +469,7 @@ void KGrCanvas::initView() #ifdef QT3 enemySprites = new TQPtrList (); #else - enemySprites = new QList (); + enemySprites = new TQList (); #endif enemySprites->setAutoDelete(TRUE); } diff --git a/kgoldrunner/src/kgrcanvas.h b/kgoldrunner/src/kgrcanvas.h index 2c0ab270..cfabc408 100644 --- a/kgoldrunner/src/kgrcanvas.h +++ b/kgoldrunner/src/kgrcanvas.h @@ -28,11 +28,12 @@ #include #include -class KGrCanvas : public QCanvasView +class KGrCanvas : public TQCanvasView { Q_OBJECT + TQ_OBJECT public: - KGrCanvas (TQWidget * parent = 0, const char *name = 0); + KGrCanvas (TQWidget * tqparent = 0, const char *name = 0); virtual ~KGrCanvas(); void changeLandscape (const TQString & name); @@ -95,7 +96,7 @@ private: #ifdef QT3 TQPtrList * enemySprites; #else - QList * enemySprites; + TQList * enemySprites; #endif void initView(); diff --git a/kgoldrunner/src/kgrconsts.h b/kgoldrunner/src/kgrconsts.h index 2006648a..ce5ada47 100644 --- a/kgoldrunner/src/kgrconsts.h +++ b/kgoldrunner/src/kgrconsts.h @@ -70,7 +70,7 @@ enum Position {RIGHTWALK1,RIGHTWALK2,RIGHTWALK3,RIGHTWALK4, LEFTCLIMB1,LEFTCLIMB2,LEFTCLIMB3,LEFTCLIMB4, CLIMB1,CLIMB2, FALL1,FALL2}; -enum Status {STANDING,FALLING,WALKING,CLIMBING,CAPTIVE}; +enum tqStatus {STANDING,FALLING,WALKING,CLIMBING,CAPTIVE}; enum Direction {RIGHT,LEFT,UP,DOWN,STAND}; enum SearchStrategy {LOW,MEDIUM,HIGH}; diff --git a/kgoldrunner/src/kgrdialog.cpp b/kgoldrunner/src/kgrdialog.cpp index 632eb617..011f56dc 100644 --- a/kgoldrunner/src/kgrdialog.cpp +++ b/kgoldrunner/src/kgrdialog.cpp @@ -29,16 +29,16 @@ #ifdef KGR_PORTABLE KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, TQPtrList & gamesList, KGrGame * theGame, - TQWidget * parent, const char * name) - : TQDialog (parent, name, TRUE, + TQWidget * tqparent, const char * name) + : TQDialog (tqparent, name, TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, TQPtrList & gamesList, KGrGame * theGame, - TQWidget * parent, const char * name) + TQWidget * tqparent, const char * name) : KDialogBase (KDialogBase::Plain, i18n("Select Game"), KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Help, - KDialogBase::Ok, parent, name) + KDialogBase::Ok, tqparent, name) #endif { slAction = action; @@ -47,7 +47,7 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, collections = gamesList; game = theGame; collection = collections.at(defaultGame); - slParent = parent; + slParent = tqparent; #ifdef KGR_PORTABLE int margin = 10; @@ -84,7 +84,7 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, if ((action == SL_START) || (action == SL_UPD_GAME)) { dad-> setCaption (i18n("Select Game")); - TQLabel * startMsg = new QLabel + TQLabel * startMsg = new TQLabel ("" + i18n("Level 1 of the selected game is:") + "", dad); mainLayout->addWidget (startMsg); } @@ -99,7 +99,7 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, // Initial range 1->150, small step 1, big step 10 and default value 1. number = new TQScrollBar (1, 150, 1, 10, 1, - TQScrollBar::Horizontal, dad); + Qt::Horizontal, dad); grid->addWidget (number, 1, 1); TQHBox * numberPair = new TQHBox (dad); @@ -117,7 +117,7 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, grid->addMultiCellWidget (thumbNail, 1, 3, 2, 2); // Set thumbnail cell size to about 1/5 of game cell size. - int cellSize = parent->width() / (5 * (FIELDWIDTH + 4)); + int cellSize = tqparent->width() / (5 * (FIELDWIDTH + 4)); thumbNail-> setFixedWidth ((FIELDWIDTH * cellSize) + 2); thumbNail-> setFixedHeight ((FIELDHEIGHT * cellSize) + 2); @@ -125,15 +125,15 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, TQHBox * buttons = new TQHBox (this); mainLayout->addWidget (buttons); buttons->setSpacing (spacing); - // Buttons are for Qt-only portability. NOT COMPILED in KDE environment. + // Buttons are for TQt-only portability. NOT COMPILED in KDE environment. HELP = new TQPushButton (i18n("Help"), buttons); OK = new TQPushButton (i18n("&OK"), buttons); CANCEL = new TQPushButton (i18n("&Cancel"), buttons); - TQPoint p = parent->mapToGlobal (TQPoint (0,0)); + TQPoint p = tqparent->mapToGlobal (TQPoint (0,0)); - // Base the geometry of the dialog box on the playing area. - int cell = parent->width() / (FIELDWIDTH + 4); + // Base the tqgeometry of the dialog box on the playing area. + int cell = tqparent->width() / (FIELDWIDTH + 4); dad-> move (p.x()+2*cell, p.y()+2*cell); dad-> setMinimumSize ((FIELDWIDTH*cell/2), (FIELDHEIGHT-1)*cell); @@ -357,7 +357,7 @@ void KGrSLDialog::slAboutColln () { // User clicked the "About" button ... int n = slCollnIndex; - QString title = i18n("About \"%1\"").arg(collections.at(n)->name); + TQString title = i18n("About \"%1\"").tqarg(collections.at(n)->name); if (collections.at(n)->about.length() > 0) { // Convert game description to ASCII and UTF-8 codes, then translate it. @@ -401,10 +401,10 @@ void KGrSLDialog::slPaintLevel () if (n < 0) { return; // Owner has no collections. } - QString filePath = game->getFilePath + TQString filePath = game->getFilePath (collections.at(n)->owner, collections.at(n), number->value()); thumbNail->setFilePath (filePath, slName); - thumbNail->repaint(); // Will call "drawContents (p)". + thumbNail->tqrepaint(); // Will call "drawContents (p)". } void KGrSLDialog::slotHelp () @@ -486,15 +486,15 @@ void KGrSLDialog::slotHelp () #ifdef KGR_PORTABLE KGrNHDialog::KGrNHDialog(const TQString & levelName, const TQString & levelHint, - TQWidget * parent, const char * name) - : TQDialog (parent, name, TRUE, + TQWidget * tqparent, const char * name) + : TQDialog (tqparent, name, TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else KGrNHDialog::KGrNHDialog(const TQString & levelName, const TQString & levelHint, - TQWidget * parent, const char * name) + TQWidget * tqparent, const char * name) : KDialogBase (KDialogBase::Plain, i18n("Edit Name & Hint"), KDialogBase::Ok | KDialogBase::Cancel, - KDialogBase::Ok, parent, name) + KDialogBase::Ok, tqparent, name) #endif { #ifdef KGR_PORTABLE @@ -530,21 +530,21 @@ KGrNHDialog::KGrNHDialog(const TQString & levelName, const TQString & levelHint, TQHBox * buttons = new TQHBox (dad); mainLayout->addWidget (buttons); buttons->setSpacing (spacing); - // Buttons are for Qt-only portability. NOT COMPILED in KDE environment. + // Buttons are for TQt-only portability. NOT COMPILED in KDE environment. TQPushButton * OK = new TQPushButton (i18n("&OK"), buttons); TQPushButton * CANCEL = new TQPushButton (i18n("&Cancel"), buttons); dad-> setCaption (i18n("Edit Name & Hint")); #endif - // Base the geometry of the text box on the playing area. - QPoint p = parent->mapToGlobal (TQPoint (0,0)); - int c = parent->width() / (FIELDWIDTH + 4); + // Base the tqgeometry of the text box on the playing area. + TQPoint p = tqparent->mapToGlobal (TQPoint (0,0)); + int c = tqparent->width() / (FIELDWIDTH + 4); dad-> move (p.x()+4*c, p.y()+4*c); mle-> setMinimumSize ((FIELDWIDTH*c/2), (FIELDHEIGHT/2)*c); // Configure the text box. - mle-> setAlignment (AlignLeft); + mle-> tqsetAlignment (AlignLeft); #ifndef QT3 mle-> setWordWrap (TQMultiLineEdit::WidgetWidth); mle-> setFixedVisibleLines (9); @@ -573,16 +573,16 @@ KGrNHDialog::~KGrNHDialog() #ifdef KGR_PORTABLE KGrECDialog::KGrECDialog (int action, int collnIndex, TQPtrList & gamesList, - TQWidget * parent, const char * name) - : TQDialog (parent, name, TRUE, + TQWidget * tqparent, const char * name) + : TQDialog (tqparent, name, TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else KGrECDialog::KGrECDialog (int action, int collnIndex, TQPtrList & gamesList, - TQWidget * parent, const char * name) + TQWidget * tqparent, const char * name) : KDialogBase (KDialogBase::Plain, i18n("Edit Game Info"), KDialogBase::Ok | KDialogBase::Cancel, - KDialogBase::Ok, parent, name) + KDialogBase::Ok, tqparent, name) #endif { collections = gamesList; @@ -612,7 +612,7 @@ KGrECDialog::KGrECDialog (int action, int collnIndex, prefixL = new TQLabel (i18n("File name prefix:"), prefixBox); ecPrefix = new TQLineEdit (prefixBox); - ecGrp = new TQButtonGroup (1, TQButtonGroup::Horizontal, 0, dad); + ecGrp = new TQButtonGroup (1, Qt::Horizontal, 0, dad); mainLayout->addWidget (ecGrp); ecTradB = new TQRadioButton (i18n("Traditional rules"), ecGrp); ecKGrB = new TQRadioButton (i18n("KGoldrunner rules"), ecGrp); @@ -636,14 +636,14 @@ KGrECDialog::KGrECDialog (int action, int collnIndex, TQHBox * buttons = new TQHBox (dad); mainLayout->addWidget (buttons); buttons->setSpacing (spacing); - // Buttons are for Qt-only portability. NOT COMPILED in KDE environment. + // Buttons are for TQt-only portability. NOT COMPILED in KDE environment. OK = new TQPushButton (i18n("&OK"), buttons); CANCEL = new TQPushButton (i18n("&Cancel"), buttons); - TQPoint p = parent->mapToGlobal (TQPoint (0,0)); + TQPoint p = tqparent->mapToGlobal (TQPoint (0,0)); - // Base the geometry of the dialog box on the playing area. - int cell = parent->width() / (FIELDWIDTH + 4); + // Base the tqgeometry of the dialog box on the playing area. + int cell = tqparent->width() / (FIELDWIDTH + 4); dad-> move (p.x()+2*cell, p.y()+2*cell); dad-> setMinimumSize ((FIELDWIDTH*cell/2), (FIELDHEIGHT-1)*cell); #endif @@ -663,13 +663,13 @@ KGrECDialog::KGrECDialog (int action, int collnIndex, // Collection already has some levels, so cannot change the prefix. ecPrefix-> setEnabled (FALSE); } - QString s; + TQString s; #ifndef KGR_PORTABLE nLevL-> setText (i18n("1 level", "%n levels", collections.at(defaultGame)->nLevels)); #else nLevL-> setText (i18n("%1 levels") - .arg(collections.at(defaultGame)->nLevels)); + .tqarg(collections.at(defaultGame)->nLevels)); #endif OKText = i18n("Save Changes"); } @@ -694,7 +694,7 @@ KGrECDialog::KGrECDialog (int action, int collnIndex, } // Configure the edit box. - mle-> setAlignment (AlignLeft); + mle-> tqsetAlignment (AlignLeft); #ifndef QT3 mle-> setWordWrap (TQMultiLineEdit::WidgetWidth); mle-> setFixedVisibleLines (8); @@ -750,16 +750,16 @@ void KGrECDialog::ecSetTrad () {ecSetRules ('T');} #ifdef KGR_PORTABLE KGrLGDialog::KGrLGDialog (TQFile * savedGames, TQPtrList & collections, - TQWidget * parent, const char * name) - : TQDialog (parent, name, TRUE, + TQWidget * tqparent, const char * name) + : TQDialog (tqparent, name, TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else KGrLGDialog::KGrLGDialog (TQFile * savedGames, TQPtrList & collections, - TQWidget * parent, const char * name) + TQWidget * tqparent, const char * name) : KDialogBase (KDialogBase::Plain, i18n("Select Saved Game"), KDialogBase::Ok | KDialogBase::Cancel, - KDialogBase::Ok, parent, name) + KDialogBase::Ok, tqparent, name) #endif { #ifdef KGR_PORTABLE @@ -780,9 +780,9 @@ KGrLGDialog::KGrLGDialog (TQFile * savedGames, lgList = new TQListBox (dad); #ifdef KGR_PORTABLE - QFont f ("courier", 12); + TQFont f ("courier", 12); #else - QFont f = KGlobalSettings::fixedFont(); // KDE version. + TQFont f = KGlobalSettings::fixedFont(); // KDE version. #endif f.setFixedPitch (TRUE); lgList-> setFont (f); @@ -795,16 +795,16 @@ KGrLGDialog::KGrLGDialog (TQFile * savedGames, #ifdef KGR_PORTABLE TQHBox * buttons = new TQHBox (dad); buttons-> setSpacing (spacing); - // Buttons are for Qt-only portability. NOT COMPILED in KDE environment. + // Buttons are for TQt-only portability. NOT COMPILED in KDE environment. TQPushButton * OK = new TQPushButton (i18n("&OK"), buttons); TQPushButton * CANCEL = new TQPushButton (i18n("&Cancel"), buttons); mainLayout-> addWidget (buttons); dad-> setCaption (i18n("Select Saved Game")); - // Base the geometry of the list box on the playing area. - QPoint p = parent->mapToGlobal (TQPoint (0,0)); - int c = parent->width() / (FIELDWIDTH + 4); + // Base the tqgeometry of the list box on the playing area. + TQPoint p = tqparent->mapToGlobal (TQPoint (0,0)); + int c = tqparent->width() / (FIELDWIDTH + 4); dad-> move (p.x()+2*c, p.y()+2*c); lgList-> setMinimumHeight ((FIELDHEIGHT/2)*c); OK-> setMaximumWidth (4*c); @@ -816,16 +816,16 @@ KGrLGDialog::KGrLGDialog (TQFile * savedGames, lgHighlight = -1; - QTextStream gameText (savedGames); - QString s = ""; - QString pr = ""; + TQTextStream gameText (savedGames); + TQString s = ""; + TQString pr = ""; int i; int imax = collections.count(); // Read the saved games into the list box. while (! gameText.endData()) { s = gameText.readLine(); // Read in one saved game. - pr = s.left (s.find (" ", 0, FALSE)); // Get the collection prefix. + pr = s.left (s.tqfind (" ", 0, FALSE)); // Get the collection prefix. for (i = 0; i < imax; i++) { // Get the collection name. if (collections.at(i)->prefix == pr) { s = s.insert (0, @@ -858,26 +858,26 @@ void KGrLGDialog::lgSelect (int n) *********************** CENTRALISED MESSAGE FUNCTIONS ************************ *******************************************************************************/ -void KGrMessage::information (TQWidget * parent, const TQString &caption, const TQString &text) +void KGrMessage::information (TQWidget * tqparent, const TQString &caption, const TQString &text) { #ifdef KGR_PORTABLE - // Force Qt to do word-wrapping (but it ignores "\n" line-breaks). - TQMessageBox::information (parent, caption, + // Force TQt to do word-wrapping (but it ignores "\n" line-breaks). + TQMessageBox::information (tqparent, caption, "" + text + ""); #else // KDE does word-wrapping and will observe "\n" line-breaks. - KMessageBox::information (parent, text, caption); + KMessageBox::information (tqparent, text, caption); #endif } -int KGrMessage::warning (TQWidget * parent, TQString caption, TQString text, +int KGrMessage::warning (TQWidget * tqparent, TQString caption, TQString text, TQString label0, TQString label1, TQString label2) { int ans = 0; #ifdef KGR_PORTABLE // Display a box with 2 or 3 buttons, depending on if label2 is empty or not. - // Force Qt to do word-wrapping (but it ignores "\n" line-breaks). - ans = TQMessageBox::warning (parent, caption, + // Force TQt to do word-wrapping (but it ignores "\n" line-breaks). + ans = TQMessageBox::warning (tqparent, caption, "" + text + "", label0, label1, label2, 0, (label2.isEmpty()) ? 1 : 2); @@ -885,13 +885,13 @@ int KGrMessage::warning (TQWidget * parent, TQString caption, TQString text, // KDE does word-wrapping and will observe "\n" line-breaks. if (label2.isEmpty()) { // Display a box with 2 buttons. - ans = KMessageBox::questionYesNo (parent, text, caption, + ans = KMessageBox::questionYesNo (tqparent, text, caption, label0, label1); ans = (ans == KMessageBox::Yes) ? 0 : 1; } else { // Display a box with 3 buttons. - ans = KMessageBox::questionYesNoCancel (parent, text, caption, + ans = KMessageBox::questionYesNoCancel (tqparent, text, caption, label0, label1); if (ans == KMessageBox::Cancel) ans = 2; @@ -906,12 +906,12 @@ int KGrMessage::warning (TQWidget * parent, TQString caption, TQString text, /********************** WORD-WRAPPED MESSAGE BOX ************************/ /******************************************************************************/ -void KGrMessage::wrapped (TQWidget * parent, TQString title, TQString contents) +void KGrMessage::wrapped (TQWidget * tqparent, TQString title, TQString contents) { #ifndef KGR_PORTABLE - KMessageBox::information (parent, contents, title); + KMessageBox::information (tqparent, contents, title); #else - TQDialog * mm = new TQDialog (parent, "wrappedMessage", TRUE, + TQDialog * mm = new TQDialog (tqparent, "wrappedMessage", TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title); int margin = 10; @@ -919,7 +919,7 @@ void KGrMessage::wrapped (TQWidget * parent, TQString title, TQString contents) TQVBoxLayout * mainLayout = new TQVBoxLayout (mm, margin, spacing); // Make text background grey not white (i.e. same as widget background). - QPalette pl = mm->palette(); + TQPalette pl = mm->palette(); #ifdef QT3 pl.setColor (TQColorGroup::Base, mm->paletteBackgroundColor()); #else @@ -936,21 +936,21 @@ void KGrMessage::wrapped (TQWidget * parent, TQString title, TQString contents) #endif mainLayout->addWidget (mle); - // Button is for Qt-only portability. NOT COMPILED in KDE environment. + // Button is for TQt-only portability. NOT COMPILED in KDE environment. TQPushButton * OK = new TQPushButton (i18n("&OK"), mm); - mainLayout->addWidget (OK, Qt::AlignHCenter); + mainLayout->addWidget (OK, TQt::AlignHCenter); mm-> setCaption (title); - // Base the geometry of the text box on the playing area. - QPoint p = parent->mapToGlobal (TQPoint (0,0)); - int c = parent->width() / (FIELDWIDTH + 4); + // Base the tqgeometry of the text box on the playing area. + TQPoint p = tqparent->mapToGlobal (TQPoint (0,0)); + int c = tqparent->width() / (FIELDWIDTH + 4); mm-> move (p.x()+4*c, p.y()+4*c); mle-> setMinimumSize ((FIELDWIDTH*c/2), (FIELDHEIGHT/2)*c); OK-> setMaximumWidth (3*c); mle-> setFrameStyle (TQFrame::NoFrame); - mle-> setAlignment (AlignLeft); + mle-> tqsetAlignment (AlignLeft); mle-> setReadOnly (TRUE); mle-> setText (contents); diff --git a/kgoldrunner/src/kgrdialog.h b/kgoldrunner/src/kgrdialog.h index 860328eb..cbf4735a 100644 --- a/kgoldrunner/src/kgrdialog.h +++ b/kgoldrunner/src/kgrdialog.h @@ -7,15 +7,15 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ -#ifndef KGRDIALOG_QT_H -#define KGRDIALOG_QT_H +#ifndef KGRDIALOG_TQT_H +#define KGRDIALOG_TQT_H // If portable version, use TQDialog and TQMessageBox. // If KDE version, use KDialogBase and KMessageBox. #ifdef KGR_PORTABLE #include -#define KGR_DIALOG QDialog +#define KGR_DIALOG TQDialog #include #else @@ -55,13 +55,14 @@ class KGrThumbNail; /******************* DIALOG TO SELECT A GAME AND LEVEL *******************/ /******************************************************************************/ -class KGrSLDialog : public KGR_DIALOG // KGR_PORTABLE sets QDialog/KDialogBase +class KGrSLDialog : public KGR_DIALOG // KGR_PORTABLE sets TQDialog/KDialogBase { Q_OBJECT + TQ_OBJECT public: KGrSLDialog (int action, int requestedLevel, int collnIndex, TQPtrList & gamesList, KGrGame * theGame, - TQWidget * parent = 0, const char *name = 0); + TQWidget * tqparent = 0, const char *name = 0); ~KGrSLDialog(); int selectedLevel() {return (number->value());} @@ -110,16 +111,17 @@ private: *************** DIALOG BOX TO CREATE/EDIT A LEVEL NAME AND HINT **************** *******************************************************************************/ -class KGrNHDialog : public KGR_DIALOG // KGR_PORTABLE sets QDialog/KDialogBase +class KGrNHDialog : public KGR_DIALOG // KGR_PORTABLE sets TQDialog/KDialogBase { Q_OBJECT + TQ_OBJECT public: KGrNHDialog (const TQString & levelName, const TQString & levelHint, - TQWidget * parent = 0, const char * name = 0); + TQWidget * tqparent = 0, const char * name = 0); ~KGrNHDialog(); - QString getName() {return (nhName->text());} - QString getHint() {return (mle->text());} + TQString getName() {return (nhName->text());} + TQString getHint() {return (mle->text());} private: TQLineEdit * nhName; @@ -134,19 +136,20 @@ private: ***************** DIALOG TO CREATE OR EDIT A GAME (COLLECTION) ***************** *******************************************************************************/ -class KGrECDialog : public KGR_DIALOG // KGR_PORTABLE sets QDialog/KDialogBase +class KGrECDialog : public KGR_DIALOG // KGR_PORTABLE sets TQDialog/KDialogBase { Q_OBJECT + TQ_OBJECT public: KGrECDialog (int action, int collnIndex, TQPtrList & gamesList, - TQWidget *parent = 0, const char *name = 0); + TQWidget *tqparent = 0, const char *name = 0); ~KGrECDialog(); - QString getName() {return (ecName->text());} - QString getPrefix() {return (ecPrefix->text());} + TQString getName() {return (ecName->text());} + TQString getPrefix() {return (ecPrefix->text());} bool isTrad() {return (ecTradB->isChecked());} - QString getAboutText() {return (mle->text());} + TQString getAboutText() {return (mle->text());} private slots: void ecSetRules (const char settings); @@ -186,12 +189,13 @@ private: #include #include -class KGrLGDialog : public KGR_DIALOG // KGR_PORTABLE sets QDialog/KDialogBase +class KGrLGDialog : public KGR_DIALOG // KGR_PORTABLE sets TQDialog/KDialogBase { Q_OBJECT + TQ_OBJECT public: KGrLGDialog (TQFile * savedGames, TQPtrList & collections, - TQWidget * parent, const char * name); + TQWidget * tqparent, const char * name); TQString getCurrentText() {return (lgList->currentText());} private slots: @@ -203,16 +207,16 @@ private: }; /******************************************************************************* -****************** PORTABLE MESSAGE FUNCTIONS (Qt Version) ******************* +****************** PORTABLE MESSAGE FUNCTIONS (TQt Version) ******************* *******************************************************************************/ -class KGrMessage : public QDialog +class KGrMessage : public TQDialog { public: - static void information (TQWidget * parent, const TQString &caption, const TQString &text); - static int warning (TQWidget * parent, TQString caption, TQString text, + static void information (TQWidget * tqparent, const TQString &caption, const TQString &text); + static int warning (TQWidget * tqparent, TQString caption, TQString text, TQString label0, TQString label1, TQString label2 = ""); - static void wrapped (TQWidget * parent, TQString caption, TQString text); + static void wrapped (TQWidget * tqparent, TQString caption, TQString text); }; #endif diff --git a/kgoldrunner/src/kgrfigure.cpp b/kgoldrunner/src/kgrfigure.cpp index 0dcb68af..7c640e88 100644 --- a/kgoldrunner/src/kgrfigure.cpp +++ b/kgoldrunner/src/kgrfigure.cpp @@ -76,7 +76,7 @@ int KGrFigure::gety() return absy; } -Status KGrFigure::getStatus() +tqStatus KGrFigure::gettqStatus() { return status; } @@ -713,7 +713,7 @@ void KGrHero::digRight(){ #ifdef QT3 void KGrHero::setEnemyList(TQPtrList *e) #else -void KGrHero::setEnemyList(QList *e) +void KGrHero::setEnemyList(TQList *e) #endif { enemies = e; @@ -733,7 +733,7 @@ bool KGrHero::standOnEnemy() (((absx - 16) < enemy->getx()) && ((absx + 16) > enemy->getx()))) { if (((absy + 12) == enemy->gety()) && - (enemy->getStatus() != FALLING)) { + (enemy->gettqStatus() != FALLING)) { absy = absy - rely; // Bounce back from overlap, to avoid rely = 0; // hero-enemy mid-cycle deadlock. walkCounter = 1; @@ -807,7 +807,7 @@ KGrEnemy :: KGrEnemy (KGrCanvas * view, int x, int y) walkCounter = 1; captiveCounter = 0; - searchStatus = HORIZONTAL; + searchtqStatus = HORIZONTAL; birthX=x; birthY=y; @@ -849,7 +849,7 @@ void KGrEnemy::showState(char option) case 's': printf (" nuggets %02d status %d walk-ctr %d ", nuggets, status, walkCounter); printf ("dirn %d search %d capt-ctr %d\n", - direction, searchStatus, captiveCounter); + direction, searchtqStatus, captiveCounter); printf (" rel (%02d,%02d) abs (%03d,%03d)", relx, rely, absx, absy); printf (" pix %02d", actualPixmap); @@ -907,7 +907,7 @@ void KGrEnemy::walkTimeDone () case RIGHT: walkRight (WALKDELAY, FALLDELAY); break; case LEFT: walkLeft (WALKDELAY, FALLDELAY); break; default: // Switch search direction in KGoldrunner search (only). - searchStatus = (searchStatus==VERTIKAL) ? + searchtqStatus = (searchtqStatus==VERTIKAL) ? HORIZONTAL : VERTIKAL; // In KGoldrunner rules, if a hole opens under an enemy @@ -942,7 +942,7 @@ void KGrEnemy::walkTimeDone () // In KGoldrunner rules, change the search strategy, // to avoid enemy-enemy deadlock. - searchStatus = (searchStatus==VERTIKAL) ? HORIZONTAL : VERTIKAL; + searchtqStatus = (searchtqStatus==VERTIKAL) ? HORIZONTAL : VERTIKAL; dirn = searchbestway (x, y, herox, heroy); if ((dirn != direction) && ((*playfield)[x][y]->whatIam() != USEDHOLE)) { @@ -1221,7 +1221,7 @@ Direction KGrEnemy::searchbestway(int ew,int eh,int hw,int hh) // KGoldrunner search strategy. case MEDIUM: case HIGH: - if(searchStatus==VERTIKAL){ + if(searchtqStatus==VERTIKAL){ if (eh > hh) return searchupway(ew,eh); if (eh < hh) @@ -1673,7 +1673,7 @@ bool KGrEnemy::willNotFall (int x, int y) #ifdef QT3 void KGrEnemy::setEnemyList(TQPtrList *e) #else -void KGrEnemy::setEnemyList(QList *e) +void KGrEnemy::setEnemyList(TQList *e) #endif { enemies = e; diff --git a/kgoldrunner/src/kgrfigure.h b/kgoldrunner/src/kgrfigure.h index 12551418..fd7de606 100644 --- a/kgoldrunner/src/kgrfigure.h +++ b/kgoldrunner/src/kgrfigure.h @@ -33,9 +33,10 @@ class KGrCanvas; class KGrObject; class KGrEnemy; -class KGrFigure : public QObject +class KGrFigure : public TQObject { Q_OBJECT + TQ_OBJECT public: KGrFigure (int, int); virtual ~KGrFigure(); @@ -53,7 +54,7 @@ public: // dependent on number of enemies. int getx(); int gety(); - Status getStatus(); + tqStatus gettqStatus(); int getnuggets(); void setNuggets(int n); @@ -80,7 +81,7 @@ protected: TQTimer *fallTimer; KGrObject *(*playfield)[30][22]; - Status status; + tqStatus status; Direction direction; bool canWalkRight(); bool canWalkLeft(); @@ -102,6 +103,7 @@ protected: class KGrHero : public KGrFigure { Q_OBJECT + TQ_OBJECT public: KGrHero(KGrCanvas *, int , int); virtual ~KGrHero(); @@ -114,7 +116,7 @@ public: #ifdef QT3 void setEnemyList(TQPtrList *); #else - void setEnemyList(QList *); + void setEnemyList(TQList *); #endif void init(int,int); void setKey(Direction); @@ -131,7 +133,7 @@ private: #ifdef QT3 TQPtrList *enemies; #else - QList *enemies; + TQList *enemies; #endif KGrCanvas * heroView; bool standOnEnemy(); @@ -161,6 +163,7 @@ signals: class KGrEnemy : public KGrFigure { Q_OBJECT + TQ_OBJECT public: KGrEnemy (KGrCanvas *, int , int); virtual ~KGrEnemy(); @@ -169,7 +172,7 @@ public: #ifdef QT3 void setEnemyList(TQPtrList *); #else - void setEnemyList(QList *); + void setEnemyList(TQList *); #endif virtual void init(int,int); static int WALKDELAY; @@ -182,14 +185,14 @@ public: private: KGrCanvas * enemyView; int birthX, birthY; - int searchStatus; + int searchtqStatus; int captiveCounter; TQTimer *captiveTimer; bool canWalkUp(); #ifdef QT3 TQPtrList *enemies; #else - QList *enemies; + TQList *enemies; #endif bool standOnEnemy(); bool bumpingFriend(); diff --git a/kgoldrunner/src/kgrgame.cpp b/kgoldrunner/src/kgrgame.cpp index 985d0783..b83b35ed 100644 --- a/kgoldrunner/src/kgrgame.cpp +++ b/kgoldrunner/src/kgrgame.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2003 by Ian Wadham and Marco Krüger * + * Copyright (C) 2003 by Ian Wadham and Marco Kr�ger * * ianw2@optusnet.com.au * * * * This program is free software; you can redistribute it and/or modify * @@ -190,7 +190,7 @@ void KGrGame::goUpOneLevel() KGrMessage::information (view, collection->name, i18n("CONGRATULATIONS !!!!" "

You have conquered the last level in the %1 game !!

") - .arg("\"" + collection->name + "\"")); + .tqarg("\"" + collection->name + "\"")); checkHighScore(); // Check if there is a high score for this game. unfreeze(); @@ -384,7 +384,7 @@ void KGrGame::startTutorial() KGrMessage::information (view, i18n("Start Tutorial"), i18n("Cannot find the tutorial game (file-prefix %1) in " "the %2 files.") - .arg("'tute'").arg("'games.dat'")); + .tqarg("'tute'").tqarg("'games.dat'")); } } @@ -514,14 +514,14 @@ bool KGrGame::openLevelFile (int levelNo, TQFile & openlevel) KGrMessage::information (view, i18n("Load Level"), i18n("Cannot find file '%1'. Please make sure '%2' has been " "run in the '%3' folder.") - .arg(filePath).arg("tar xf levels.tar").arg(systemDataDir.myStr())); + .tqarg(filePath).tqarg("tar xf levels.tar").tqarg(systemDataDir.myStr())); return (FALSE); } - // öffne Level zum lesen + // �ffne Level zum lesen if (! openlevel.open (IO_ReadOnly)) { KGrMessage::information (view, i18n("Load Level"), - i18n("Cannot open file '%1' for read-only.").arg(filePath)); + i18n("Cannot open file '%1' for read-only.").tqarg(filePath)); return (FALSE); } @@ -741,8 +741,8 @@ void KGrGame::doDig (int button) { startPlaying(); // If first player-input, start playing. } switch (button) { - case LeftButton: hero->digLeft (); break; - case RightButton: hero->digRight (); break; + case Qt::LeftButton: hero->digLeft (); break; + case Qt::RightButton: hero->digRight (); break; default: break; } } @@ -769,7 +769,7 @@ void KGrGame::saveGame() // Save game ID, score and level. { if (editMode) {myMessage (view, i18n("Save Game"), i18n("Sorry, you cannot save your game play while you are editing. " - "Please try menu item %1.").arg("\"" + i18n("&Save Edits...") + "\"")); + "Please try menu item %1.").tqarg("\"" + i18n("&Save Edits...") + "\"")); return; } if (hero->started) {myMessage (view, i18n("Save Game"), @@ -778,7 +778,7 @@ void KGrGame::saveGame() // Save game ID, score and level. "level, not as they are now.")); } - TQDate today = TQDate::currentDate(); + TQDate today = TQDate::tqcurrentDate(); TQTime now = TQTime::currentTime(); TQString saved; TQString day; @@ -800,7 +800,7 @@ void KGrGame::saveGame() // Save game ID, score and level. if (! file2.open (IO_WriteOnly)) { KGrMessage::information (view, i18n("Save Game"), i18n("Cannot open file '%1' for output.") - .arg(userDataDir + "savegame.tmp")); + .tqarg(userDataDir + "savegame.tmp")); return; } TQTextStream text2 (&file2); @@ -810,7 +810,7 @@ void KGrGame::saveGame() // Save game ID, score and level. if (! file1.open (IO_ReadOnly)) { KGrMessage::information (view, i18n("Save Game"), i18n("Cannot open file '%1' for read-only.") - .arg(userDataDir + "savegame.dat")); + .tqarg(userDataDir + "savegame.dat")); return; } @@ -848,7 +848,7 @@ void KGrGame::loadGame() // Re-load game, score and level. if (! savedGames.open (IO_ReadOnly)) { KGrMessage::information (view, i18n("Load Game"), i18n("Cannot open file '%1' for read-only.") - .arg(userDataDir + "savegame.dat")); + .tqarg(userDataDir + "savegame.dat")); return; } @@ -876,7 +876,7 @@ void KGrGame::loadGame() // Re-load game, score and level. if (! s.isNull()) { pr = s.mid (21, 7); // Get the collection prefix. - pr = pr.left (pr.find (" ", 0, FALSE)); + pr = pr.left (pr.tqfind (" ", 0, FALSE)); for (i = 0; i < imax; i++) { // Find the collection. if (collections.at(i)->prefix == pr) { @@ -899,7 +899,7 @@ void KGrGame::loadGame() // Re-load game, score and level. } else { KGrMessage::information (view, i18n("Load Game"), - i18n("Cannot find the game with prefix '%1'.").arg(pr)); + i18n("Cannot find the game with prefix '%1'.").tqarg(pr)); } } @@ -919,9 +919,9 @@ void KGrGame::loadGame() // Re-load game, score and level. void KGrGame::checkHighScore() { bool prevHigh = TRUE; - Q_INT16 prevLevel = 0; - Q_INT32 prevScore = 0; - QString thisUser = i18n("Unknown"); + TQ_INT16 prevLevel = 0; + TQ_INT32 prevScore = 0; + TQString thisUser = i18n("Unknown"); int highCount = 0; // Don't keep high scores for tutorial games. @@ -947,7 +947,7 @@ void KGrGame::checkHighScore() if (! high1.open (IO_ReadOnly)) { TQString high1_name = high1.name(); KGrMessage::information (view, i18n("Check for High Score"), - i18n("Cannot open file '%1' for read-only.").arg(high1_name)); + i18n("Cannot open file '%1' for read-only.").tqarg(high1_name)); return; } @@ -987,7 +987,7 @@ void KGrGame::checkHighScore() if (! high2.open (IO_WriteOnly)) { KGrMessage::information (view, i18n("Check for High Score"), i18n("Cannot open file '%1' for output.") - .arg(userDataDir + "hi_" + collection->prefix + ".tmp")); + .tqarg(userDataDir + "hi_" + collection->prefix + ".tmp")); return; } @@ -1014,7 +1014,7 @@ void KGrGame::checkHighScore() hsn-> setCaption (i18n("Save High Score")); - QPoint p = view->mapToGlobal (TQPoint (0,0)); + TQPoint p = view->mapToGlobal (TQPoint (0,0)); hsn-> move (p.x() + 50, p.y() + 50); OK-> setAccel (Key_Return); @@ -1034,7 +1034,7 @@ void KGrGame::checkHighScore() delete hsn; - TQDate today = TQDate::currentDate(); + TQDate today = TQDate::tqcurrentDate(); TQString hsDate; #ifdef QT3 TQString day = today.shortDayName(today.dayOfWeek()); @@ -1061,11 +1061,11 @@ void KGrGame::checkHighScore() s1 >> prevDate; if ((! scoreRecorded) && (score > prevScore)) { highCount++; - // Recode the user's name as UTF-8, in case it contains - // non-ASCII chars (e.g. "Krüger" is encoded as "Krüger"). + // Recode the user's name as UTF-8, in case it tqcontains + // non-ASCII chars (e.g. "Kr�ger" is encoded as "Krüger"). s2 << (const char *) thisUser.utf8(); - s2 << (Q_INT16) level; - s2 << (Q_INT32) score; + s2 << (TQ_INT16) level; + s2 << (TQ_INT32) score; s2 << hsDate.myStr(); scoreRecorded = TRUE; } @@ -1080,21 +1080,21 @@ void KGrGame::checkHighScore() delete prevDate; } if ((! scoreRecorded) && (highCount < 10)) { - // Recode the user's name as UTF-8, in case it contains - // non-ASCII chars (e.g. "Krüger" is encoded as "Krüger"). + // Recode the user's name as UTF-8, in case it tqcontains + // non-ASCII chars (e.g. "Kr�ger" is encoded as "Krüger"). s2 << (const char *) thisUser.utf8(); - s2 << (Q_INT16) level; - s2 << (Q_INT32) score; + s2 << (TQ_INT16) level; + s2 << (TQ_INT32) score; s2 << hsDate.myStr(); } high1.close(); } else { - // Recode the user's name as UTF-8, in case it contains - // non-ASCII chars (e.g. "Krüger" is encoded as "Krüger"). + // Recode the user's name as UTF-8, in case it tqcontains + // non-ASCII chars (e.g. "Kr�ger" is encoded as "Krüger"). s2 << (const char *) thisUser.utf8(); - s2 << (Q_INT16) level; - s2 << (Q_INT32) score; + s2 << (TQ_INT16) level; + s2 << (TQ_INT32) score; s2 << hsDate.myStr(); } @@ -1119,8 +1119,8 @@ void KGrGame::showHighScores() return; } - Q_INT16 prevLevel = 0; - Q_INT32 prevScore = 0; + TQ_INT16 prevLevel = 0; + TQ_INT32 prevScore = 0; int n = 0; // Look for user's high-score file or for a released high-score file. @@ -1132,7 +1132,7 @@ void KGrGame::showHighScores() if (! high1.exists()) { KGrMessage::information (view, i18n("Show High Scores"), i18n("Sorry, there are no high scores for the %1 game yet.") - .arg("\"" + collection->name + "\"")); + .tqarg("\"" + collection->name + "\"")); return; } } @@ -1140,7 +1140,7 @@ void KGrGame::showHighScores() if (! high1.open (IO_ReadOnly)) { TQString high1_name = high1.name(); KGrMessage::information (view, i18n("Show High Scores"), - i18n("Cannot open file '%1' for read-only.").arg(high1_name)); + i18n("Cannot open file '%1' for read-only.").tqarg(high1_name)); return; } @@ -1154,15 +1154,15 @@ void KGrGame::showHighScores() TQLabel * hsHeader = new TQLabel (i18n ( "

KGoldrunner Hall of Fame


" "

\"%1\" Game

") - .arg(collection->name), + .tqarg(collection->name), hs); TQLabel * hsColHeader = new TQLabel ( i18n(" Name " "Level Score Date"), hs); #ifdef KGR_PORTABLE - QFont f ("courier", 12); + TQFont f ("courier", 12); #else - QFont f = KGlobalSettings::fixedFont(); // KDE version. + TQFont f = KGlobalSettings::fixedFont(); // KDE version. #endif f. setFixedPitch (TRUE); f. setBold (TRUE); @@ -1183,7 +1183,7 @@ void KGrGame::showHighScores() // Set up the format for the high-score lines. f. setBold (FALSE); - QString line; + TQString line; const char * hsFormat = "%2d. %-30.30s %3d %7ld %s"; // Read and display the users, levels and scores from the high score file. @@ -1199,7 +1199,7 @@ void KGrGame::showHighScores() // TQString::sprintf expects UTF-8 encoding in its string arguments, so // prevUser has been saved on file as UTF-8 to allow non=ASCII chars - // in the user's name (e.g. "Krüger" is encoded as "Krüger" in UTF-8). + // in the user's name (e.g. "Kr�ger" is encoded as "Krüger" in UTF-8). line = line.sprintf (hsFormat, n+1, prevUser, prevLevel, prevScore, prevDate); @@ -1219,7 +1219,7 @@ void KGrGame::showHighScores() OK-> setMaximumWidth (100); mainLayout-> addWidget (buttons); - QPoint p = view->mapToGlobal (TQPoint (0,0)); + TQPoint p = view->mapToGlobal (TQPoint (0,0)); hs-> move (p.x() + 50, p.y() + 50); // Start up the dialog box. @@ -1481,7 +1481,7 @@ void KGrGame::loadEditLevel (int lev) // Retain the original language of the name and hint when editing, // but remove the final \n and convert non-ASCII, UTF-8 substrings - // to Unicode (eg. ü to ü). + // to Unicode (eg. ü to �). int len = levelHintC.length(); if (len > 0) levelHint = TQString::fromUtf8((const char *) levelHintC.left(len-1)); @@ -1584,7 +1584,7 @@ bool KGrGame::saveLevelFile() // Open the output file. if (! levelFile.open (IO_WriteOnly)) { KGrMessage::information (view, i18n("Save Level"), - i18n("Cannot open file '%1' for output.").arg(filePath)); + i18n("Cannot open file '%1' for output.").tqarg(filePath)); return (FALSE); } @@ -1596,7 +1596,7 @@ bool KGrGame::saveLevelFile() } levelFile.putch ('\n'); - // Save the level name, changing non-ASCII chars to UTF-8 (eg. ü to ü). + // Save the level name, changing non-ASCII chars to UTF-8 (eg. � to ü). TQCString levelNameC = levelName.utf8(); int len1 = levelNameC.length(); if (len1 > 0) { @@ -1605,7 +1605,7 @@ bool KGrGame::saveLevelFile() levelFile.putch ('\n'); // Add a newline. } - // Save the level hint, changing non-ASCII chars to UTF-8 (eg. ü to ü). + // Save the level hint, changing non-ASCII chars to UTF-8 (eg. � to ü). TQCString levelHintC = levelHint.utf8(); int len2 = levelHintC.length(); char ch = '\0'; @@ -1642,8 +1642,8 @@ void KGrGame::moveLevelFile () KGrMessage::information (view, i18n("Move Level"), i18n("You must first load a level to be moved. Use " "the %1 or %2 menu.") - .arg("\"" + i18n("Game") + "\"") - .arg("\"" + i18n("Editor") + "\"")); + .tqarg("\"" + i18n("Game") + "\"") + .tqarg("\"" + i18n("Editor") + "\"")); return; } @@ -1780,7 +1780,7 @@ void KGrGame::deleteLevelFile () } else { KGrMessage::information (view, i18n("Delete Level"), - i18n("Cannot find file '%1' to be deleted.").arg(filePath)); + i18n("Cannot find file '%1' to be deleted.").tqarg(filePath)); return; } @@ -1883,7 +1883,7 @@ void KGrGame::editCollection (int action) if (duplicatePrefix) { KGrMessage::information (view, i18n("Save Game Info"), i18n("The filename prefix '%1' is already in use.") - .arg(ecPrefix)); + .tqarg(ecPrefix)); continue; } } @@ -1919,7 +1919,7 @@ bool KGrGame::saveOK (bool exiting) { int i, j; bool result; - QString option2 = i18n("&Go on editing"); + TQString option2 = i18n("&Go on editing"); result = TRUE; @@ -2061,7 +2061,7 @@ bool KGrGame::reNumberLevels (int cIndex, int first, int last, int inc) if (! dir.rename (file1, file2, TRUE)) { // Allow absolute paths. KGrMessage::information (view, i18n("Save Level"), i18n("Cannot rename file '%1' to '%2'.") - .arg(file1).arg(file2)); + .tqarg(file1).tqarg(file2)); return (FALSE); } i = i + step; @@ -2090,8 +2090,8 @@ void KGrGame::doEdit (int button) i = p.x(); j = p.y(); switch (button) { - case LeftButton: - case RightButton: + case Qt::LeftButton: + case Qt::RightButton: paintEditObj = TRUE; insertEditObj (i, j); view->updateCanvas(); @@ -2113,8 +2113,8 @@ void KGrGame::endEdit (int button) i = p.x(); j = p.y(); switch (button) { - case LeftButton: - case RightButton: + case Qt::LeftButton: + case Qt::RightButton: paintEditObj = FALSE; if ((i != oldI) || (j != oldJ)) { insertEditObj (i, j); @@ -2181,8 +2181,8 @@ int KGrGame::selectLevel (int action, int requestedLevel) KGrMessage::information (view, i18n("Select Level"), i18n("There is no level %1 in %2, " "so you cannot play or edit it.") - .arg(selectedLevel) - .arg("\"" + collections.at(selectedGame)->name + "\"")); + .tqarg(selectedLevel) + .tqarg("\"" + collections.at(selectedGame)->name + "\"")); selectedLevel = 0; // Set an invalid selection. continue; // Re-run the dialog box. } @@ -2226,10 +2226,10 @@ bool KGrGame::ownerOK (Owner o) /********************** CLASS TO DISPLAY THUMBNAIL ***********************/ /******************************************************************************/ -KGrThumbNail::KGrThumbNail (TQWidget * parent, const char * name) - : TQFrame (parent, name) +KGrThumbNail::KGrThumbNail (TQWidget * tqparent, const char * name) + : TQFrame (tqparent, name) { - // Let the parent do all the work. We need a class here so that + // Let the tqparent do all the work. We need a class here so that // TQFrame::drawContents (TQPainter *) can be re-implemented and // the thumbnail can be automatically re-painted when required. } @@ -2247,8 +2247,8 @@ void KGrThumbNail::setFilePath (TQString & fp, TQLabel * sln) void KGrThumbNail::drawContents (TQPainter * p) // Activated via "paintEvent". { - QFile openFile; - QPen pen = p->pen(); + TQFile openFile; + TQPen pen = p->pen(); char obj = FREE; int fw = 1; // Set frame width. int n = width() / FIELDWIDTH; // Set thumbnail cell-size. @@ -2330,7 +2330,7 @@ void KGrThumbNail::drawContents (TQPainter * p) // Activated via "paintEvent". /******************************************************************************/ // NOTE: Macros "myStr" and "myChar", defined in "kgrgame.h", are used -// to smooth out differences between Qt 1 and Qt2 TQString classes. +// to smooth out differences between TQt 1 and TQt2 TQString classes. bool KGrGame::initCollections () { @@ -2354,11 +2354,11 @@ bool KGrGame::initCollections () void KGrGame::mapCollections() { - QDir d; + TQDir d; KGrCollection * colln; - QString d_path; - QString fileName1; - QString fileName2; + TQString d_path; + TQString fileName1; + TQString fileName2; // Find KGoldrunner level files, sorted by name (same as numerical order). for (colln = collections.first(); colln != 0; colln = collections.next()) { @@ -2372,25 +2372,25 @@ void KGrGame::mapCollections() i18n("There is no folder '%1' to hold levels for" " the '%2' game. Please make sure '%3' " "has been run in the '%4' folder.") - .arg(d_path) - .arg(colln->name) - .arg("tar xf levels.tar") - .arg(systemDataDir)); + .tqarg(d_path) + .tqarg(colln->name) + .tqarg("tar xf levels.tar") + .tqarg(systemDataDir)); } continue; } - const QFileInfoList * files = d.entryInfoList + const TQFileInfoList * files = d.entryInfoList (colln->prefix + "???.grl", TQDir::Files, TQDir::Name); - QFileInfoListIterator i (* files); + TQFileInfoListIterator i (* files); TQFileInfo * file; if ((files->count() <= 0) && (colln->nLevels > 0)) { KGrMessage::information (view, i18n("Check Games & Levels"), i18n("There are no files '%1/%2???.grl' for the %3 game.") - .arg(d_path) - .arg(colln->prefix) - .arg("\"" + colln->name + "\"")); + .tqarg(d_path) + .tqarg(colln->prefix) + .tqarg("\"" + colln->name + "\"")); continue; } @@ -2413,8 +2413,8 @@ void KGrGame::mapCollections() i18n("Check Games & Levels"), i18n("File '%1' is beyond the highest level for " "the %2 game and cannot be played.") - .arg(fileName1) - .arg("\"" + colln->name + "\"")); + .tqarg(fileName1) + .tqarg("\"" + colln->name + "\"")); break; } else if (fileName1 == fileName2) { @@ -2426,16 +2426,16 @@ void KGrGame::mapCollections() i18n("Check Games & Levels"), i18n("File '%1' is before the lowest level for " "the %2 game and cannot be played.") - .arg(fileName1) - .arg("\"" + colln->name + "\"")); + .tqarg(fileName1) + .tqarg("\"" + colln->name + "\"")); break; } else { KGrMessage::information (view, i18n("Check Games & Levels"), i18n("Cannot find file '%1' for the %2 game.") - .arg(fileName2) - .arg("\"" + colln->name + "\"")); + .tqarg(fileName2) + .tqarg("\"" + colln->name + "\"")); lev++; } } @@ -2446,7 +2446,7 @@ void KGrGame::mapCollections() bool KGrGame::loadCollections (Owner o) { - QString filePath; + TQString filePath; filePath = ((o == SYSTEM)? systemDataDir : userDataDir) + "games.dat"; @@ -2457,20 +2457,20 @@ bool KGrGame::loadCollections (Owner o) if (o == SYSTEM) { KGrMessage::information (view, i18n("Load Game Info"), i18n("Cannot find game info file '%1'.") - .arg(filePath)); + .tqarg(filePath)); } return (FALSE); } if (! c.open (IO_ReadOnly)) { KGrMessage::information (view, i18n("Load Game Info"), - i18n("Cannot open file '%1' for read-only.").arg(filePath)); + i18n("Cannot open file '%1' for read-only.").tqarg(filePath)); return (FALSE); } - QCString line = ""; - QCString name = ""; - QString prefix = ""; + TQCString line = ""; + TQCString name = ""; + TQString prefix = ""; char settings = ' '; int nLevels = -1; @@ -2496,9 +2496,9 @@ bool KGrGame::loadCollections (Owner o) line = line.simplifyWhiteSpace(); int i, j, len; len = line.length(); - i = 0; j = line.find(' ',i); nLevels = line.left(j).toInt(); - i = j+1; j = line.find(' ',i); settings = line[i]; - i = j+1; j = line.find(' ',i); prefix = line.mid(i,j-i); + i = 0; j = line.tqfind(' ',i); nLevels = line.left(j).toInt(); + i = j+1; j = line.tqfind(' ',i); settings = line[i]; + i = j+1; j = line.tqfind(' ',i); prefix = line.mid(i,j-i); i = j+1; name = line.right(len-i); } // If first character is not a digit, the line should be an "about". @@ -2513,7 +2513,7 @@ bool KGrGame::loadCollections (Owner o) // Not EOF: it's an empty line or out-of-context "about" line. KGrMessage::information (view, i18n("Load Game Info"), i18n("Format error in game info file '%1'.") - .arg(filePath)); + .tqarg(filePath)); c.close(); return (FALSE); } @@ -2527,7 +2527,7 @@ bool KGrGame::loadCollections (Owner o) bool KGrGame::saveCollections (Owner o) { - QString filePath; + TQString filePath; if (o != USER) { KGrMessage::information (view, i18n("Save Game Info"), @@ -2542,13 +2542,13 @@ bool KGrGame::saveCollections (Owner o) // Open the output file. if (! c.open (IO_WriteOnly)) { KGrMessage::information (view, i18n("Save Game Info"), - i18n("Cannot open file '%1' for output.").arg(filePath)); + i18n("Cannot open file '%1' for output.").tqarg(filePath)); return (FALSE); } // Save the collections. KGrCollection * colln; - QCString line; + TQCString line; int i, len; char ch; @@ -2588,12 +2588,12 @@ bool KGrGame::saveCollections (Owner o) /********************** WORD-WRAPPED MESSAGE BOX ************************/ /******************************************************************************/ -void KGrGame::myMessage (TQWidget * parent, TQString title, TQString contents) +void KGrGame::myMessage (TQWidget * tqparent, TQString title, TQString contents) { // Halt the game while the message is displayed. setMessageFreeze (TRUE); - KGrMessage::wrapped (parent, title, contents); + KGrMessage::wrapped (tqparent, title, contents); // Unfreeze the game, but only if it was previously unfrozen. setMessageFreeze (FALSE); diff --git a/kgoldrunner/src/kgrgame.h b/kgoldrunner/src/kgrgame.h index 18003e3c..5637329c 100644 --- a/kgoldrunner/src/kgrgame.h +++ b/kgoldrunner/src/kgrgame.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2003 by Ian Wadham and Marco Krüger * + * Copyright (C) 2003 by Ian Wadham and Marco Kr�ger * * ianw2@optusnet.com.au * * * * This program is free software; you can redistribute it and/or modify * @@ -10,14 +10,14 @@ #ifndef KGRGAME_H #define KGRGAME_H -// Macros to smooth out the differences between Qt 1 and Qt 2 classes. +// Macros to smooth out the differences between TQt 1 and TQt 2 classes. // // "myStr" converts a TQString object to a C language "char*" character string. // "myChar" extracts a C language character (type "char") from a TQString object. // "endData" checks for an end-of-file condition. // #define myStr latin1 -#define myChar(i) at((i)).latin1() +#define myChar(i) tqat((i)).latin1() #define endData atEnd #include @@ -47,9 +47,10 @@ class KGrHero; class KGrEnemy; class KGrCollection; -class KGrGame : public QObject +class KGrGame : public TQObject { Q_OBJECT + TQ_OBJECT public: KGrGame (KGrCanvas * theView, TQString theSystemDir, TQString theUserDir); ~KGrGame(); @@ -67,7 +68,7 @@ public: bool saveOK (bool exiting); // Check if edits were saved. - QString getTitle(); // Collection - Level NNN, Name. + TQString getTitle(); // Collection - Level NNN, Name. void setEditObj (char newEditObj); // Set object for editor to paint. @@ -136,16 +137,16 @@ private: private: KGrCanvas * view; // Where the game is displayed. - QString systemDataDir; // System games are stored here. - QString userDataDir; // User games are stored here. + TQString systemDataDir; // System games are stored here. + TQString userDataDir; // User games are stored here. KGrObject * playfield[30][22]; // Array of playfield objects. char editObjArray[30][22]; // Character-code equivalent. char lastSaveArray[30][22]; // Copy for use in "saveOK()". int level; // Current play/edit level. - QString levelName; // Level name (optional). - QString levelHint; // Level hint (optional). + TQString levelName; // Level name (optional). + TQString levelHint; // Level hint (optional). long lives; // Lives remaining. long score; // Current score. @@ -157,7 +158,7 @@ private: #ifdef QT3 TQPtrList enemies; // The list of enemies. #else - QList enemies; // The list of enemies. + TQList enemies; // The list of enemies. #endif int enemyCount; // How many enemies. KGrEnemy * enemy; // One of the enemies. @@ -229,7 +230,7 @@ private: bool reNumberLevels (int, int, int, int); bool ownerOK (Owner o); - // Pixmaps for repainting objects as they are edited. + // Pixmaps for tqrepainting objects as they are edited. TQPixmap digpix[10]; TQPixmap brickbg, fbrickbg; TQPixmap freebg, nuggetbg, polebg, betonbg, ladderbg, hladderbg; @@ -249,7 +250,7 @@ private: #ifdef QT3 TQPtrList collections; // List of ALL collections. #else - QList collections; // List of ALL collections. + TQList collections; // List of ALL collections. #endif KGrCollection * collection; // Collection currently in use. @@ -264,17 +265,17 @@ private: /********************** WORD-WRAPPED MESSAGE BOX ************************/ /******************************************************************************/ - void myMessage (TQWidget * parent, TQString title, TQString contents); + void myMessage (TQWidget * tqparent, TQString title, TQString contents); }; /******************************************************************************/ /********************** CLASS TO DISPLAY THUMBNAIL ***********************/ /******************************************************************************/ -class KGrThumbNail : public QFrame +class KGrThumbNail : public TQFrame { public: - KGrThumbNail (TQWidget *parent = 0, const char *name = 0); + KGrThumbNail (TQWidget *tqparent = 0, const char *name = 0); void setFilePath (TQString &, TQLabel *); // Set filepath and name field. static TQColor backgroundColor; @@ -299,11 +300,11 @@ public: KGrCollection (Owner o, const TQString & n, const TQString & p, const char s, int nl, const TQString & a); Owner owner; // Collection owner: "System" or "User". - QString name; // Collection name. - QString prefix; // Collection's filename prefix. + TQString name; // Collection name. + TQString prefix; // Collection's filename prefix. char settings; // Collection rules: KGoldrunner or Traditional. int nLevels; // Number of levels in the collection. - QString about; // Optional text about the collection. + TQString about; // Optional text about the collection. }; #endif diff --git a/kgoldrunner/src/kgrobject.h b/kgoldrunner/src/kgrobject.h index cc262d0d..e7445873 100644 --- a/kgoldrunner/src/kgrobject.h +++ b/kgoldrunner/src/kgrobject.h @@ -26,9 +26,10 @@ class KGrCanvas; -class KGrObject : public QObject +class KGrObject : public TQObject { Q_OBJECT + TQ_OBJECT public: KGrObject (char objType); virtual ~KGrObject(); @@ -53,6 +54,7 @@ protected: class KGrEditable : public KGrObject { Q_OBJECT + TQ_OBJECT public: KGrEditable (char editType); virtual ~KGrEditable (); @@ -61,6 +63,7 @@ public: class KGrFree : public KGrObject { Q_OBJECT + TQ_OBJECT public: KGrFree (char objType, int i, int j, KGrCanvas * view); virtual ~KGrFree(); @@ -73,6 +76,7 @@ protected: class KGrBrick : public KGrObject { Q_OBJECT + TQ_OBJECT public: KGrBrick (char objType, int i, int j, KGrCanvas * view); virtual ~KGrBrick(); @@ -97,6 +101,7 @@ private: class KGrHladder : public KGrFree { Q_OBJECT + TQ_OBJECT public: // BUG FIX - Ian W., 21/6/01 - must inherit "setNugget()" from "KGrFree". KGrHladder (char objType, int i, int j, KGrCanvas * view); diff --git a/kjumpingcube/kcubeboxwidget.cpp b/kjumpingcube/kcubeboxwidget.cpp index bca13210..57aecd15 100644 --- a/kjumpingcube/kcubeboxwidget.cpp +++ b/kjumpingcube/kcubeboxwidget.cpp @@ -30,8 +30,8 @@ #include "prefs.h" -KCubeBoxWidget::KCubeBoxWidget(const int d,TQWidget *parent,const char *name) - : TQWidget(parent,name), +KCubeBoxWidget::KCubeBoxWidget(const int d,TQWidget *tqparent,const char *name) + : TQWidget(tqparent,name), CubeBoxBase(d) { init(); @@ -39,8 +39,8 @@ KCubeBoxWidget::KCubeBoxWidget(const int d,TQWidget *parent,const char *name) -KCubeBoxWidget::KCubeBoxWidget(CubeBox& box,TQWidget *parent,const char *name) - :TQWidget(parent,name), +KCubeBoxWidget::KCubeBoxWidget(CubeBox& box,TQWidget *tqparent,const char *name) + :TQWidget(tqparent,name), CubeBoxBase(box.dim()) { init(); @@ -57,8 +57,8 @@ KCubeBoxWidget::KCubeBoxWidget(CubeBox& box,TQWidget *parent,const char *name) -KCubeBoxWidget::KCubeBoxWidget(const KCubeBoxWidget& box,TQWidget *parent,const char *name) - :TQWidget(parent,name), +KCubeBoxWidget::KCubeBoxWidget(const KCubeBoxWidget& box,TQWidget *tqparent,const char *name) + :TQWidget(tqparent,name), CubeBoxBase(box.dim()) { init(); @@ -453,13 +453,13 @@ void KCubeBoxWidget::initCubes() int i,j; // create Layout - layout=new TQGridLayout(this,s,s); + tqlayout=new TQGridLayout(this,s,s); for(i=0;isetRowStretch(i,1); - layout->setColStretch(i,1); + tqlayout->setRowStretch(i,1); + tqlayout->setColStretch(i,1); } @@ -474,7 +474,7 @@ void KCubeBoxWidget::initCubes() { cubes[i][j]=new KCubeWidget(this); cubes[i][j]->setCoordinates(i,j); - layout->addWidget(cubes[i][j],i,j); + tqlayout->addWidget(cubes[i][j],i,j); cubes[i][j]->show(); connect(cubes[i][j],TQT_SIGNAL(clicked(int,int,bool)),TQT_SLOT(stopHint())); connect(cubes[i][j],TQT_SIGNAL(clicked(int,int,bool)),TQT_SLOT(checkClick(int,int,bool))); @@ -504,15 +504,15 @@ void KCubeBoxWidget::initCubes() } -TQSize KCubeBoxWidget::sizeHint() const +TQSize KCubeBoxWidget::tqsizeHint() const { return TQSize(400,400); } void KCubeBoxWidget::deleteCubes() { - if(layout) - delete layout; + if(tqlayout) + delete tqlayout; CubeBoxBase::deleteCubes(); } diff --git a/kjumpingcube/kcubeboxwidget.h b/kjumpingcube/kcubeboxwidget.h index e2bf73ca..e8d0553e 100644 --- a/kjumpingcube/kcubeboxwidget.h +++ b/kjumpingcube/kcubeboxwidget.h @@ -51,11 +51,12 @@ struct Loop class KCubeBoxWidget : public TQWidget , public CubeBoxBase { Q_OBJECT + TQ_OBJECT public: - KCubeBoxWidget(const int dim=1,TQWidget *parent=0,const char *name=0); + KCubeBoxWidget(const int dim=1,TQWidget *tqparent=0,const char *name=0); - KCubeBoxWidget(CubeBox& box, TQWidget *parent=0,const char *name=0); - KCubeBoxWidget(const KCubeBoxWidget& box,TQWidget *parent=0,const char *name=0); + KCubeBoxWidget(CubeBox& box, TQWidget *tqparent=0,const char *name=0); + KCubeBoxWidget(const KCubeBoxWidget& box,TQWidget *tqparent=0,const char *name=0); virtual ~KCubeBoxWidget(); KCubeBoxWidget& operator= (CubeBox& box); @@ -130,7 +131,7 @@ signals: void stoppedThinking(); protected: - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; virtual void deleteCubes(); virtual void initCubes(); @@ -146,7 +147,7 @@ protected slots: private: void init(); - TQGridLayout *layout; + TQGridLayout *tqlayout; CubeBox *undoBox; Brain brain; diff --git a/kjumpingcube/kcubewidget.cpp b/kjumpingcube/kcubewidget.cpp index 27797683..d4556eac 100644 --- a/kjumpingcube/kcubewidget.cpp +++ b/kjumpingcube/kcubewidget.cpp @@ -73,9 +73,9 @@ TQPalette KCubeWidget::color(Owner forWhom) ** public functions ** ** ****************************************************** */ -KCubeWidget::KCubeWidget(TQWidget* parent,const char* name +KCubeWidget::KCubeWidget(TQWidget* tqparent,const char* name ,Owner owner,int value,int max) - : TQFrame(parent,name), + : TQFrame(tqparent,name), Cube(owner,value,max) { setFrameStyle(Panel|Raised); @@ -85,7 +85,7 @@ KCubeWidget::KCubeWidget(TQWidget* parent,const char* name setCoordinates(0,0); //initialize hintTimer - // will be automatically destroyed by the parent + // will be automatically destroyed by the tqparent hintTimer = new TQTimer(this); hintCounter=0; connect(hintTimer,TQT_SIGNAL(timeout()),TQT_SLOT(hint())); @@ -93,7 +93,7 @@ KCubeWidget::KCubeWidget(TQWidget* parent,const char* name setPalette(kapp->palette()); // show values - repaint(false); + tqrepaint(false); } KCubeWidget::~KCubeWidget() @@ -240,7 +240,7 @@ void KCubeWidget::mouseReleaseEvent(TQMouseEvent *e) if(e->x()< 0 || e->x() > width() || e->y() < 0 || e->y() > height()) return; - if(e->button() == LeftButton && _clicksAllowed) + if(e->button() == Qt::LeftButton && _clicksAllowed) { stopHint(); emit clicked(row(),column(),true); diff --git a/kjumpingcube/kcubewidget.h b/kjumpingcube/kcubewidget.h index 804a9db4..3f578c13 100644 --- a/kjumpingcube/kcubewidget.h +++ b/kjumpingcube/kcubewidget.h @@ -35,10 +35,11 @@ class TQTimer; class KCubeWidget : public TQFrame , public Cube { Q_OBJECT + TQ_OBJECT public: /** constructs a new KCubeWidget*/ - KCubeWidget(TQWidget* parent=0,const char* name=0 + KCubeWidget(TQWidget* tqparent=0,const char* name=0 ,Owner owner=Cube::Nobody,int value=1,int max=0); virtual ~KCubeWidget(); diff --git a/kjumpingcube/kjumpingcube.cpp b/kjumpingcube/kjumpingcube.cpp index f63665af..a35dcf19 100644 --- a/kjumpingcube/kjumpingcube.cpp +++ b/kjumpingcube/kjumpingcube.cpp @@ -64,7 +64,7 @@ KJumpingCube::KJumpingCube() statusBar()->insertItem(s,ID_STATUS_TURN_TEXT, false); statusBar()->changeItem(s,ID_STATUS_TURN_TEXT); statusBar()->setItemAlignment (ID_STATUS_TURN_TEXT, AlignLeft | AlignVCenter); - statusBar()->setFixedHeight( statusBar()->sizeHint().height() ); + statusBar()->setFixedHeight( statusBar()->tqsizeHint().height() ); currentPlayer = new TQWidget(this, "currentPlayer"); currentPlayer->setFixedWidth(40); @@ -76,19 +76,19 @@ KJumpingCube::KJumpingCube() } void KJumpingCube::initKAction() { - KStdGameAction::gameNew(this, TQT_SLOT(newGame()), actionCollection()); - KStdGameAction::load(this, TQT_SLOT(openGame()), actionCollection()); - KStdGameAction::save(this, TQT_SLOT(save()), actionCollection()); - KStdGameAction::saveAs(this, TQT_SLOT(saveAs()), actionCollection()); - KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); + KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(newGame()), actionCollection()); + KStdGameAction::load(TQT_TQOBJECT(this), TQT_SLOT(openGame()), actionCollection()); + KStdGameAction::save(TQT_TQOBJECT(this), TQT_SLOT(save()), actionCollection()); + KStdGameAction::saveAs(TQT_TQOBJECT(this), TQT_SLOT(saveAs()), actionCollection()); + KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); - hintAction = KStdGameAction::hint(view, TQT_SLOT(getHint()), actionCollection()); + hintAction = KStdGameAction::hint(TQT_TQOBJECT(view), TQT_SLOT(getHint()), actionCollection()); stopAction = new KAction(i18n("Stop &Thinking"), "stop", - Qt::Key_Escape, this, TQT_SLOT(stop()), actionCollection(), "game_stop"); + TQt::Key_Escape, TQT_TQOBJECT(this), TQT_SLOT(stop()), actionCollection(), "game_stop"); stopAction->setEnabled(false); - undoAction = KStdGameAction::undo(this, TQT_SLOT(undo()), actionCollection()); + undoAction = KStdGameAction::undo(TQT_TQOBJECT(this), TQT_SLOT(undo()), actionCollection()); undoAction->setEnabled(false); - KStdAction::preferences(this, TQT_SLOT(showOptions()), actionCollection()); + KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(showOptions()), actionCollection()); setupGUI(); } @@ -123,8 +123,8 @@ void KJumpingCube::saveGame(bool saveAs) if(KIO::NetAccess::exists(url,false,this)) { TQString mes=i18n("The file %1 exists.\n" - "Do you want to overwrite it?").arg(url.url()); - result = KMessageBox::warningContinueCancel(this, mes, TQString::null, i18n("Overwrite")); + "Do you want to overwrite it?").tqarg(url.url()); + result = KMessageBox::warningContinueCancel(this, mes, TQString(), i18n("Overwrite")); if(result==KMessageBox::Cancel) return; } @@ -147,12 +147,12 @@ void KJumpingCube::saveGame(bool saveAs) if(KIO::NetAccess::upload( tempFile.name(),gameURL,this )) { TQString s=i18n("game saved as %1"); - s=s.arg(gameURL.url()); + s=s.tqarg(gameURL.url()); statusBar()->message(s,MESSAGE_TIME); } else { - KMessageBox::sorry(this,i18n("There was an error in saving file\n%1").arg(gameURL.url())); + KMessageBox::sorry(this,i18n("There was an error in saving file\n%1").tqarg(gameURL.url())); } } @@ -168,7 +168,7 @@ void KJumpingCube::openGame() return; if(!KIO::NetAccess::exists(url,true,this)) { - TQString mes=i18n("The file %1 does not exist!").arg(url.url()); + TQString mes=i18n("The file %1 does not exist!").tqarg(url.url()); KMessageBox::sorry(this,mes); fileOk=false; } @@ -183,7 +183,7 @@ void KJumpingCube::openGame() if(!config.hasKey("Version")) { TQString mes=i18n("The file %1 isn't a KJumpingCube gamefile!") - .arg(url.url()); + .tqarg(url.url()); KMessageBox::sorry(this,mes); return; } @@ -197,7 +197,7 @@ void KJumpingCube::openGame() KIO::NetAccess::removeTempFile( tempFile ); } else - KMessageBox::sorry(this,i18n("There was an error loading file\n%1").arg( url.url() )); + KMessageBox::sorry(this,i18n("There was an error loading file\n%1").tqarg( url.url() )); } void KJumpingCube::stop() @@ -223,11 +223,11 @@ void KJumpingCube::changePlayer(int newPlayer) { undoAction->setEnabled(true); currentPlayer->setBackgroundColor(newPlayer == 1 ? Prefs::color1() : Prefs::color2()); - currentPlayer->repaint(); + currentPlayer->tqrepaint(); } void KJumpingCube::showWinner(int player) { - TQString s=i18n("Winner is Player %1!").arg(player); + TQString s=i18n("Winner is Player %1!").tqarg(player); KMessageBox::information(this,s,i18n("Winner")); view->reset(); } diff --git a/kjumpingcube/kjumpingcube.h b/kjumpingcube/kjumpingcube.h index 3d2774f4..14216922 100644 --- a/kjumpingcube/kjumpingcube.h +++ b/kjumpingcube/kjumpingcube.h @@ -42,6 +42,7 @@ class KCubeBoxWidget; */ class KJumpingCube : public KMainWindow { Q_OBJECT + TQ_OBJECT public: /** Default Constructor */ diff --git a/kjumpingcube/settings.ui b/kjumpingcube/settings.ui index 43908b76..d632e88a 100644 --- a/kjumpingcube/settings.ui +++ b/kjumpingcube/settings.ui @@ -1,10 +1,10 @@ Settings - + Settings - + 0 0 @@ -22,7 +22,7 @@ 0 - + frame3 @@ -39,7 +39,7 @@ unnamed - + groupBox3 @@ -56,7 +56,7 @@ unnamed - + kcfg_CubeDim @@ -79,7 +79,7 @@ Right - + textLabel6 @@ -87,14 +87,14 @@ 5x5 - + textLabel8 10x10 - + AlignVCenter|AlignRight @@ -110,14 +110,14 @@ Expanding - + 20 16 - + groupBox7 @@ -136,7 +136,7 @@ - + textLabel1 @@ -144,7 +144,7 @@ Player 1: - + textLabel2 @@ -162,7 +162,7 @@ - + groupBox2 @@ -173,18 +173,18 @@ unnamed - + textLabel4 Average - + AlignCenter - + textLabel3 @@ -192,18 +192,18 @@ Beginner - + textLabel5 Expert - + AlignVCenter|AlignRight - + kcfg_Skill @@ -225,7 +225,7 @@ - + groupBox1 @@ -236,7 +236,7 @@ unnamed - + kcfg_ComputerPlayer1 @@ -244,7 +244,7 @@ Player 1 - + kcfg_ComputerPlayer2 @@ -261,7 +261,7 @@ - + kcolorbutton.h diff --git a/klickety/board.cpp b/klickety/board.cpp index b60e766a..4b531b5b 100644 --- a/klickety/board.cpp +++ b/klickety/board.cpp @@ -8,7 +8,7 @@ using namespace KGrid2D; void KLBoard::contentsMouseReleaseEvent(TQMouseEvent *e) { - if ( e->button()!=LeftButton || blocked ) return; + if ( e->button()!=Qt::LeftButton || blocked ) return; TQCanvasItemList list = canvas()->collisions(e->pos()); if ( list.count()==0 ) return; @@ -26,8 +26,8 @@ void KLBoard::contentsMouseReleaseEvent(TQMouseEvent *e) } } -KLBoard::KLBoard(TQWidget *parent) - : BaseBoard(true, parent), +KLBoard::KLBoard(TQWidget *tqparent) + : BaseBoard(true, tqparent), field(matrix().width(), matrix().height()), empty(matrix().width()), blocked(false) diff --git a/klickety/board.h b/klickety/board.h index 472556b7..f67e4926 100644 --- a/klickety/board.h +++ b/klickety/board.h @@ -7,8 +7,9 @@ class KLBoard : public BaseBoard { Q_OBJECT + TQ_OBJECT public: - KLBoard(TQWidget *parent); + KLBoard(TQWidget *tqparent); void start(const GTInitData &data); diff --git a/klickety/field.cpp b/klickety/field.cpp index 67533acc..1c497eb2 100644 --- a/klickety/field.cpp +++ b/klickety/field.cpp @@ -11,8 +11,8 @@ #include "base/board.h" -Field::Field(TQWidget *parent) - : TQWidget(parent, "field"), BaseField(this) +Field::Field(TQWidget *tqparent) + : TQWidget(tqparent, "field"), BaseField(this) { KGameLCDList *sc = new KGameLCDList(i18n("Remaining blocks"), this); showScore = new KGameLCD(3, sc); @@ -37,7 +37,7 @@ Field::Field(TQWidget *parent) connect(board, TQT_SIGNAL(gameOverSignal()), TQT_SLOT(gameOver())); settingsChanged(); - connect(parent, TQT_SIGNAL(settingsChanged()), TQT_SLOT(settingsChanged())); + connect(tqparent, TQT_SIGNAL(settingsChanged()), TQT_SLOT(settingsChanged())); TQTimer::singleShot(0, this, TQT_SLOT(start())); } @@ -52,7 +52,7 @@ void Field::pause() void Field::start() { - init(false, false, true, true, TQString::null); + init(false, false, true, true, TQString()); GTInitData data; data.seed = kapp->random(); BaseField::start(data); diff --git a/klickety/field.h b/klickety/field.h index 7f1acb4f..64951006 100644 --- a/klickety/field.h +++ b/klickety/field.h @@ -11,8 +11,9 @@ class KGameLCDClock; class Field : public TQWidget, public BaseField, public BaseInterface { Q_OBJECT + TQ_OBJECT public: - Field(TQWidget *parent); + Field(TQWidget *tqparent); private slots: void scoreUpdatedSlot() { scoreUpdated(); } diff --git a/klickety/main.h b/klickety/main.h index 54443103..6ff71a4c 100644 --- a/klickety/main.h +++ b/klickety/main.h @@ -13,15 +13,16 @@ class KLFactory : public BaseFactory KLFactory(); protected: - virtual BaseBoard *createBoard(bool, TQWidget *parent) - { return new KLBoard(parent); } - virtual BaseInterface *createInterface(TQWidget *parent) - { return new Field(parent); } + virtual BaseBoard *createBoard(bool, TQWidget *tqparent) + { return new KLBoard(tqparent); } + virtual BaseInterface *createInterface(TQWidget *tqparent) + { return new Field(tqparent); } }; class KLMainWindow : public BaseMainWindow { Q_OBJECT + TQ_OBJECT public: KLMainWindow(); }; diff --git a/klickety/piece.cpp b/klickety/piece.cpp index fcc2fdff..2d35300b 100644 --- a/klickety/piece.cpp +++ b/klickety/piece.cpp @@ -17,7 +17,7 @@ TQColor KLPieceInfo::defaultColor(uint i) const TQString KLPieceInfo::colorLabel(uint i) const { - return i18n("Color #%1:").arg(i+1); + return i18n("Color #%1:").tqarg(i+1); } void KLPieceInfo::draw(TQPixmap *pixmap, uint blockType, uint bMode, diff --git a/klines/ballpainter.cpp b/klines/ballpainter.cpp index 76156f11..131b81f8 100644 --- a/klines/ballpainter.cpp +++ b/klines/ballpainter.cpp @@ -67,7 +67,7 @@ void BallPainter::createPix() locate( "appdata", "fire.jpg" )); if (balls->isNull() ||backgroundPix->isNull() || fire->isNull() ) { KMessageBox::error(0, i18n("Unable to find graphics. Check your installation."), i18n("Error")); - qApp->exit(1); + tqApp->exit(1); return; // Error } @@ -82,12 +82,12 @@ void BallPainter::createPix() if (Prefs::numberedBalls() && (t == NORMALBALL)) { if ((c == 2) || (c == 3) || (c == 6)) - p.setPen(Qt::black); + p.setPen(TQt::black); else - p.setPen(Qt::white); + p.setPen(TQt::white); TQString tmp; tmp.setNum(c+1); - p.drawText(TQRect(0,0,CELLSIZE,CELLSIZE), Qt::AlignCenter, tmp); + p.drawText(TQRect(0,0,CELLSIZE,CELLSIZE), TQt::AlignCenter, tmp); } } diff --git a/klines/ballpainter.h b/klines/ballpainter.h index 522a3928..55754117 100644 --- a/klines/ballpainter.h +++ b/klines/ballpainter.h @@ -24,9 +24,10 @@ #define CELLSIZE 32 -class BallPainter : public QObject +class BallPainter : public TQObject { Q_OBJECT + TQ_OBJECT TQPixmap* imgCash[NCOLORS][PIXTIME + FIREBALLS + BOOMBALLS + 1]; TQPixmap* backgroundPix; TQPixmap* firePix[FIREPIX]; diff --git a/klines/field.cpp b/klines/field.cpp index d8da8ec7..22211b76 100644 --- a/klines/field.cpp +++ b/klines/field.cpp @@ -19,8 +19,8 @@ #include "cfg.h" #include "field.moc" -Field::Field(TQWidget* parent, const char* name) - : TQWidget( parent, name ) +Field::Field(TQWidget* tqparent, const char* name) + : TQWidget( tqparent, name ) { clearField(); } @@ -73,7 +73,7 @@ void Field::putBall(int x, int y, char color) if( checkBounds(x,y) ){ field[y][x].setColor(color); erase5Balls(); - repaint(FALSE); + tqrepaint(FALSE); } }*/ void Field::moveBall(int xa, int ya, int xb, int yb) @@ -184,10 +184,10 @@ int Field::calcPosScore(int x, int y, int whatIf) int score = -10; int color = field[y][x].getColor(); field[y][x].setColor(whatIf); - score = QMAX(score, calcRun(x, y-4, 0, 1)); - score = QMAX(score, calcRun(x-4, y-4, 1, 1)); - score = QMAX(score, calcRun(x-4, y, 1, 0)); - score = QMAX(score, calcRun(x-4, y+4, 1, -1)); + score = TQMAX(score, calcRun(x, y-4, 0, 1)); + score = TQMAX(score, calcRun(x-4, y-4, 1, 1)); + score = TQMAX(score, calcRun(x-4, y, 1, 0)); + score = TQMAX(score, calcRun(x-4, y+4, 1, -1)); field[y][x].setColor(color); return score; } diff --git a/klines/field.h b/klines/field.h index 6fb08932..c93bac4b 100644 --- a/klines/field.h +++ b/klines/field.h @@ -25,9 +25,10 @@ #define NUMCELLSW 9 #define NUMCELLSH 9 -class Field: public QWidget +class Field: public TQWidget { Q_OBJECT + TQ_OBJECT public: void clearField(); @@ -35,7 +36,7 @@ public: void saveUndo(); protected: - Field(TQWidget* parent, const char* name); + Field(TQWidget* tqparent, const char* name); ~Field(); void putBall(int x, int y, int color); diff --git a/klines/klines.cpp b/klines/klines.cpp index 50d96163..848f6ffa 100644 --- a/klines/klines.cpp +++ b/klines/klines.cpp @@ -64,10 +64,10 @@ KLines::KLines() setCentralWidget( mwidget ); lsb = mwidget->GetLsb(); - connect(lsb, TQT_SIGNAL(endTurn()), this, TQT_SLOT(makeTurn())); - connect(lsb, TQT_SIGNAL(eraseLine(int)), this, TQT_SLOT(addScore(int))); - connect(lsb, TQT_SIGNAL(endGame()), this, TQT_SLOT(endGame())); - connect(lsb, TQT_SIGNAL(userTurn()), this, TQT_SLOT(userTurn())); + connect(lsb, TQT_SIGNAL(endTurn()), TQT_TQOBJECT(this), TQT_SLOT(makeTurn())); + connect(lsb, TQT_SIGNAL(eraseLine(int)), TQT_TQOBJECT(this), TQT_SLOT(addScore(int))); + connect(lsb, TQT_SIGNAL(endGame()), TQT_TQOBJECT(this), TQT_SLOT(endGame())); + connect(lsb, TQT_SIGNAL(userTurn()), TQT_TQOBJECT(this), TQT_SLOT(userTurn())); lPrompt = mwidget->GetPrompt(); @@ -82,9 +82,9 @@ KLines::KLines() initKAction(); - connect(&demoTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotDemo())); + connect(&demoTimer, TQT_SIGNAL(timeout()), TQT_TQOBJECT(this), TQT_SLOT(slotDemo())); - setFocusPolicy(StrongFocus); + setFocusPolicy(TQ_StrongFocus); setFocus(); startGame(); @@ -104,18 +104,18 @@ KLines::~KLines() */ void KLines::initKAction() { - KStdGameAction::gameNew(this, TQT_SLOT(startGame()), actionCollection()); - act_demo = KStdGameAction::demo(this, TQT_SLOT(startDemo()), actionCollection()); + KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(startGame()), actionCollection()); + act_demo = KStdGameAction::demo(TQT_TQOBJECT(this), TQT_SLOT(startDemo()), actionCollection()); act_demo->setText(i18n("Start &Tutorial")); - KStdGameAction::highscores(this, TQT_SLOT(viewHighScore()), actionCollection()); - KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); - endTurnAction = KStdGameAction::endTurn(this, TQT_SLOT(makeTurn()), actionCollection()); + KStdGameAction::highscores(TQT_TQOBJECT(this), TQT_SLOT(viewHighScore()), actionCollection()); + KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); + endTurnAction = KStdGameAction::endTurn(TQT_TQOBJECT(this), TQT_SLOT(makeTurn()), actionCollection()); showNextAction = new KToggleAction(i18n("&Show Next"), KShortcut(CTRL+Key_P), - this, TQT_SLOT(switchPrompt()), actionCollection(), "options_show_next"); + TQT_TQOBJECT(this), TQT_SLOT(switchPrompt()), actionCollection(), "options_show_next"); showNextAction->setCheckedState(i18n("Hide Next")); showNumberedAction = new KToggleAction(i18n("&Use Numbered Balls"), KShortcut(), - this, TQT_SLOT(switchNumbered()), actionCollection(), "options_show_numbered"); - undoAction = KStdGameAction::undo(this, TQT_SLOT(undo()), actionCollection()); + TQT_TQOBJECT(this), TQT_SLOT(switchNumbered()), actionCollection(), "options_show_numbered"); + undoAction = KStdGameAction::undo(TQT_TQOBJECT(this), TQT_SLOT(undo()), actionCollection()); levelAction = KStdGameAction::chooseGameType(0, 0, actionCollection()); TQStringList items; @@ -128,11 +128,11 @@ void KLines::initKAction() showNumberedAction->setChecked(Prefs::numberedBalls()); lPrompt->setPrompt(Prefs::showNext()); - (void)new KAction(i18n("Move Left"), Key_Left, lsb, TQT_SLOT(moveLeft()), actionCollection(), "left"); - (void)new KAction(i18n("Move Right"), Key_Right, lsb, TQT_SLOT(moveRight()), actionCollection(), "right"); - (void)new KAction(i18n("Move Up"), Key_Up, lsb, TQT_SLOT(moveUp()), actionCollection(), "up"); - (void)new KAction(i18n("Move Down"), Key_Down, lsb, TQT_SLOT(moveDown()), actionCollection(), "down"); - (void)new KAction(i18n("Move Ball"), Key_Space, lsb, TQT_SLOT(placePlayerBall()), actionCollection(), "place_ball"); + (void)new KAction(i18n("Move Left"), Key_Left, TQT_TQOBJECT(lsb), TQT_SLOT(moveLeft()), actionCollection(), "left"); + (void)new KAction(i18n("Move Right"), Key_Right, TQT_TQOBJECT(lsb), TQT_SLOT(moveRight()), actionCollection(), "right"); + (void)new KAction(i18n("Move Up"), Key_Up, TQT_TQOBJECT(lsb), TQT_SLOT(moveUp()), actionCollection(), "up"); + (void)new KAction(i18n("Move Down"), Key_Down, TQT_TQOBJECT(lsb), TQT_SLOT(moveDown()), actionCollection(), "down"); + (void)new KAction(i18n("Move Ball"), Key_Space, TQT_TQOBJECT(lsb), TQT_SLOT(placePlayerBall()), actionCollection(), "place_ball"); setupGUI( KMainWindow::Save | Keys | StatusBar | Create ); } @@ -164,7 +164,7 @@ void KLines::startGame() void KLines::setLevel(int level) { levelStr = i18n(LEVEL[level+2]); - statusBar()->changeItem(i18n(" Level: %1").arg(levelStr), 0); + statusBar()->changeItem(i18n(" Level: %1").tqarg(levelStr), 0); } void KLines::startDemo() @@ -183,7 +183,7 @@ void KLines::startDemo() bFirst = true; levelStr = i18n("Tutorial"); - statusBar()->changeItem(i18n(" Level: %1").arg(levelStr), 0); + statusBar()->changeItem(i18n(" Level: %1").tqarg(levelStr), 0); lsb->startDemoMode(); lsb->setGameOver(false); @@ -202,7 +202,7 @@ void KLines::stopDemo() bDemo = false; lsb->hideDemoText(); demoTimer.stop(); - statusBar()->changeItem(i18n(" Level: %1").arg(i18n("Tutorial - Stopped")), 0); + statusBar()->changeItem(i18n(" Level: %1").tqarg(i18n("Tutorial - Stopped")), 0); act_demo->setText(i18n("Start &Tutorial")); } @@ -380,7 +380,7 @@ void KLines::slotDemo() if (!msg.isEmpty()) { lsb->showDemoText(msg); - demoTimer.start(3500 + msg.contains("\n")*1500, true); + demoTimer.start(3500 + msg.tqcontains("\n")*1500, true); return; } if (newBalls) @@ -419,7 +419,7 @@ void KLines::focusOutEvent(TQFocusEvent *ev) { lsb->hideDemoText(); demoTimer.stop(); - statusBar()->changeItem(i18n(" Level: %1").arg(i18n("Tutorial - Paused")), 0); + statusBar()->changeItem(i18n(" Level: %1").tqarg(i18n("Tutorial - Paused")), 0); } KMainWindow::focusOutEvent(ev); } @@ -428,7 +428,7 @@ void KLines::focusInEvent(TQFocusEvent *ev) { if (bDemo) { - statusBar()->changeItem(i18n(" Level: %1").arg(levelStr), 0); + statusBar()->changeItem(i18n(" Level: %1").tqarg(levelStr), 0); slotDemo(); } KMainWindow::focusInEvent(ev); @@ -528,7 +528,7 @@ void KLines::addScore(int ballsErased) void KLines::updateStat() { - statusBar()->changeItem(i18n(" Score: %1").arg(score), 1); + statusBar()->changeItem(i18n(" Score: %1").tqarg(score), 1); } void KLines::viewHighScore() @@ -540,7 +540,7 @@ void KLines::viewHighScore() void KLines::endGame() { lsb->setGameOver(true); - lsb->repaint(false); + lsb->tqrepaint(false); if (bDemo) return; @@ -575,7 +575,7 @@ void KLines::switchUndo(bool bu) void KLines::keyPressEvent(TQKeyEvent *e) { - if (lsb->gameOver() && (e->key() == Qt::Key_Space)) + if (lsb->gameOver() && (e->key() == TQt::Key_Space)) { e->accept(); startGame(); diff --git a/klines/klines.h b/klines/klines.h index 39352b33..ba78c7fe 100644 --- a/klines/klines.h +++ b/klines/klines.h @@ -29,6 +29,7 @@ class KToggleAction; class KLines : public KMainWindow { Q_OBJECT + TQ_OBJECT public: KLines(); ~KLines(); diff --git a/klines/linesboard.cpp b/klines/linesboard.cpp index aefa1a65..fe7faee1 100644 --- a/klines/linesboard.cpp +++ b/klines/linesboard.cpp @@ -34,8 +34,8 @@ Constructs a LinesBoard widget. */ -LinesBoard::LinesBoard( BallPainter * abPainter, TQWidget* parent, const char* name ) - : Field( parent, name ) +LinesBoard::LinesBoard( BallPainter * abPainter, TQWidget* tqparent, const char* name ) + : Field( tqparent, name ) { demoLabel = 0; bGameOver = false; @@ -51,7 +51,7 @@ LinesBoard::LinesBoard( BallPainter * abPainter, TQWidget* parent, const char* n bPainter = abPainter; - setFocusPolicy( NoFocus ); + setFocusPolicy( TQ_NoFocus ); setBackgroundColor( gray ); setMouseTracking( FALSE ); @@ -163,7 +163,7 @@ void LinesBoard::placeBall( ) /*id LinesBoard::doAfterBalls() { erase5Balls(); - repaint(FALSE); + tqrepaint(FALSE); } */ /* @@ -215,7 +215,7 @@ void LinesBoard::paintEvent( TQPaintEvent* ) { paint->end(); - KPixmapEffect::fade(*pixmap, 0.5, Qt::black); + KPixmapEffect::fade(*pixmap, 0.5, TQt::black); TQPainter p(this); p.drawPixmap(0,0, *pixmap); @@ -225,9 +225,9 @@ void LinesBoard::paintEvent( TQPaintEvent* ) gameover_font.setPointSize(48); gameover_font.setBold(true); p.setFont(gameover_font); - p.setPen(Qt::white); + p.setPen(TQt::white); TQString gameover_text = i18n("Game Over"); - p.drawText(0, 0, width(), height(), AlignCenter|Qt::WordBreak, gameover_text); + p.drawText(0, 0, width(), height(), AlignCenter|TQt::WordBreak, gameover_text); } else { @@ -239,7 +239,7 @@ void LinesBoard::paintEvent( TQPaintEvent* ) r.setY(focusY*CELLSIZE+2); r.setWidth(CELLSIZE-4); r.setHeight(CELLSIZE-4); - paint->setPen(TQPen(Qt::DotLine)); + paint->setPen(TQPen(TQt::DotLine)); paint->drawRect(r); } } @@ -306,7 +306,7 @@ void LinesBoard::moveFocus(int dx, int dy) focusX = (focusX + dx + NUMCELLSW) % NUMCELLSW; focusY = (focusY + dy + NUMCELLSH) % NUMCELLSH; } - repaint(FALSE); + tqrepaint(FALSE); } void LinesBoard::moveLeft() @@ -401,7 +401,7 @@ int LinesBoard::AnimEnd( ) else if ( oldanim == ANIM_BURN ) { emit eraseLine( deleteAnimatedBalls() ); - repaint(FALSE); + tqrepaint(FALSE); if ( nextBallToPlace < BALLSDROP ) { placeBall(); @@ -455,7 +455,7 @@ void LinesBoard::AnimNext() { if ( (direction > 0 && animstep == animmax) || ( direction < 0 && animstep == 0)) direction = -direction; animstep += direction; - repaint(FALSE); + tqrepaint(FALSE); } else { if ( animstep >= animmax ) AnimEnd(); @@ -466,7 +466,7 @@ void LinesBoard::AnimNext() { moveBall(way[animstep].x,way[animstep].y,way[animstep+1].x,way[animstep+1].y); animstep++; animdelaycount = animdelaystart; - repaint( FALSE ); + tqrepaint( FALSE ); } } } @@ -698,7 +698,7 @@ void LinesBoard::undo() AnimEnd(); restoreUndo(); restoreRandomState(); - repaint( FALSE ); + tqrepaint( FALSE ); } void LinesBoard::showDemoText(const TQString &text) @@ -711,13 +711,13 @@ void LinesBoard::showDemoText(const TQString &text) demoLabel->setAutoMask( FALSE ); demoLabel->setFrameStyle( TQFrame::Plain | TQFrame::Box ); demoLabel->setLineWidth( 1 ); - demoLabel->setAlignment( AlignHCenter | AlignTop ); + demoLabel->tqsetAlignment( AlignHCenter | AlignTop ); demoLabel->setPalette(TQToolTip::palette()); demoLabel->polish(); } demoLabel->setText(text); demoLabel->adjustSize(); - TQSize s = demoLabel->sizeHint(); + TQSize s = demoLabel->tqsizeHint(); TQPoint p = TQPoint(x() + (width()-s.width())/2, y() + (height()-s.height())/2); demoLabel->move(mapToGlobal(p)); demoLabel->show(); @@ -744,7 +744,7 @@ void LinesBoard::demoClick(int x, int y) kapp->enter_loop(); } TQCursor::setPos(dest); - TQMouseEvent ev(TQEvent::MouseButtonPress, lDest, dest, LeftButton, LeftButton); + TQMouseEvent ev(TQEvent::MouseButtonPress, lDest, dest, Qt::LeftButton, Qt::LeftButton); mousePressEvent(&ev); } diff --git a/klines/linesboard.h b/klines/linesboard.h index f5e3ac37..4a6b3979 100644 --- a/klines/linesboard.h +++ b/klines/linesboard.h @@ -32,8 +32,9 @@ class LinesBoard : public Field { Q_OBJECT + TQ_OBJECT public: - LinesBoard( BallPainter * abPainter, TQWidget* parent=0, const char* name=0 ); + LinesBoard( BallPainter * abPainter, TQWidget* tqparent=0, const char* name=0 ); ~LinesBoard(); int width(); diff --git a/klines/mwidget.cpp b/klines/mwidget.cpp index c883b9ba..9f66345d 100644 --- a/klines/mwidget.cpp +++ b/klines/mwidget.cpp @@ -24,8 +24,8 @@ #include "ballpainter.h" -MainWidget::MainWidget( TQWidget* parent, const char* name ) - : TQFrame( parent, name ) +MainWidget::MainWidget( TQWidget* tqparent, const char* name ) + : TQFrame( tqparent, name ) { TQBoxLayout *grid = new TQHBoxLayout( this, 5 ); //(rows,col) bPainter = new BallPainter(); @@ -36,17 +36,17 @@ MainWidget::MainWidget( TQWidget* parent, const char* name ) TQBoxLayout *right = new TQVBoxLayout(grid, 2); TQLabel *label = new TQLabel(i18n("Next balls:"), this); lPrompt = new LinesPrompt(bPainter, this); - connect(lPrompt, TQT_SIGNAL(PromptPressed()), parent, TQT_SLOT(switchPrompt())); + connect(lPrompt, TQT_SIGNAL(PromptPressed()), tqparent, TQT_SLOT(switchPrompt())); - right->addWidget( label, 0, Qt::AlignBottom | Qt::AlignHCenter ); - right->addWidget( lPrompt, 0, Qt::AlignTop | Qt::AlignHCenter ); + right->addWidget( label, 0, TQt::AlignBottom | TQt::AlignHCenter ); + right->addWidget( lPrompt, 0, TQt::AlignTop | TQt::AlignHCenter ); grid->activate(); grid->freeze(0,0); // warning("width: %i height: %i", width(), height() ); -// warning("wh: %i hh: %i", sizeHint().width(), sizeHint().height() ); +// warning("wh: %i hh: %i", tqsizeHint().width(), tqsizeHint().height() ); } diff --git a/klines/mwidget.h b/klines/mwidget.h index 18f48720..11133a2f 100644 --- a/klines/mwidget.h +++ b/klines/mwidget.h @@ -27,15 +27,16 @@ class BallPainter; -class MainWidget : public QFrame +class MainWidget : public TQFrame { Q_OBJECT + TQ_OBJECT LinesBoard * lsb; LinesPrompt * lPrompt; BallPainter *bPainter; public: - MainWidget( TQWidget* parent=0, const char* name=0 ); + MainWidget( TQWidget* tqparent=0, const char* name=0 ); ~MainWidget(); LinesBoard * GetLsb(); LinesPrompt * GetPrompt(); diff --git a/klines/povray/balls.sh b/klines/povray/balls.sh index 1897afaa..66b6ddc2 100755 --- a/klines/povray/balls.sh +++ b/klines/povray/balls.sh @@ -7,7 +7,7 @@ povray -w30 -h30 -V1 -P +A +KI5 +KF6 +KFF6 +SF2 +EF5 -Iball.pov +Ob$1.tga #### burning balls balls povray -w30 -h30 -V1 -P +A +KI0 +KF1 +KFF11 +SF1 +EF5 -Iball.pov +Oe$1.tga -montage -geometry 30x30 -tile 100x1 -page 570x30 a$1??.tga b$1?.tga e$1??.tga bl_$1.tga +montage -tqgeometry 30x30 -tile 100x1 -page 570x30 a$1??.tga b$1?.tga e$1??.tga bl_$1.tga mogrify -crop 570x30+0+0 bl_$1.tga diff --git a/klines/povray/fire.sh b/klines/povray/fire.sh index 2b6b5f9a..c3eaa319 100755 --- a/klines/povray/fire.sh +++ b/klines/povray/fire.sh @@ -3,7 +3,7 @@ echo "#declare BallColor = White" >clr.inc if (povray -w30 -h30 -V1 -P +A +KI0 +KF1 +KFF11 +SF6 +EF10 -Iball.pov \ +Ofire.tga) then # mogrify -raise 1x1 e$1??.tga - montage -geometry 30x30 -tile 100x1 -page 150x30 fire*.tga fire.tga + montage -tqgeometry 30x30 -tile 100x1 -page 150x30 fire*.tga fire.tga mogrify -crop 150x30+0+0 fire.tga # animate -delay 7 $1??.tga fi diff --git a/klines/povray/makeballs.sh b/klines/povray/makeballs.sh index 62769605..0d937415 100755 --- a/klines/povray/makeballs.sh +++ b/klines/povray/makeballs.sh @@ -17,7 +17,7 @@ balls.sh Brown "rgb<1/2,1/3,0>" #### montage balls ( 20x7 cells each 30x30) -montage -geometry 570x30 -tile 1x10 bl_*.tga balls.tga +montage -tqgeometry 570x30 -tile 1x10 bl_*.tga balls.tga mogrify -crop 570x210+0+0 balls.tga #### convert to jpeg diff --git a/klines/povray/povray.ini b/klines/povray/povray.ini index 22ddf8ec..6c01d50a 100644 --- a/klines/povray/povray.ini +++ b/klines/povray/povray.ini @@ -10,7 +10,7 @@ ; ; The general form of the options is "Variable=value". Everything ; between the equals sign and the end of the line is considered part -; of the value. The spacing and layout is free-form but only one option +; of the value. The spacing and tqlayout is free-form but only one option ; per line is allowed. Variables and values are not case-sensitive. ; ; Note: characters after a semi-colon are treated as a comment diff --git a/klines/prompt.cpp b/klines/prompt.cpp index 7a9ec36a..1233abf5 100644 --- a/klines/prompt.cpp +++ b/klines/prompt.cpp @@ -19,13 +19,13 @@ #include "prompt.h" #include "prompt.moc" -LinesPrompt::LinesPrompt( BallPainter * abPainter, TQWidget* parent, const char* name ) - : TQWidget( parent, name ) +LinesPrompt::LinesPrompt( BallPainter * abPainter, TQWidget* tqparent, const char* name ) + : TQWidget( tqparent, name ) { bPainter = abPainter; - setFocusPolicy( NoFocus ); + setFocusPolicy( TQ_NoFocus ); setBackgroundColor( gray ); setMouseTracking( FALSE ); diff --git a/klines/prompt.h b/klines/prompt.h index 3ddf6335..e1decfd5 100644 --- a/klines/prompt.h +++ b/klines/prompt.h @@ -21,9 +21,10 @@ #include #include "ballpainter.h" -class LinesPrompt : public QWidget +class LinesPrompt : public TQWidget { Q_OBJECT + TQ_OBJECT BallPainter* bPainter; bool PromptEnabled; @@ -33,7 +34,7 @@ class LinesPrompt : public QWidget void mousePressEvent( TQMouseEvent* ); public: - LinesPrompt( BallPainter * abPainter, TQWidget * parent=0, const char * name=0 ); + LinesPrompt( BallPainter * abPainter, TQWidget * tqparent=0, const char * name=0 ); ~LinesPrompt(); void setPrompt(bool enabled); diff --git a/kmahjongg/Background.cpp b/kmahjongg/Background.cpp index 432ae5fb..2cf7296f 100644 --- a/kmahjongg/Background.cpp +++ b/kmahjongg/Background.cpp @@ -78,8 +78,8 @@ void Background::sourceToBackground() { if (tile) { // copy new to background wrapping on w and height for (int y=0; yheight(); y++) { - QRgb *dest = (QRgb *) backgroundImage->scanLine(y); - QRgb *src = (QRgb *) sourceImage->scanLine(y % sourceImage->height()); + TQRgb *dest = (TQRgb *) backgroundImage->scanLine(y); + TQRgb *src = (TQRgb *) sourceImage->scanLine(y % sourceImage->height()); for (int x=0; x< backgroundImage->width(); x++) { *dest = *(src + (x % sourceImage->width())); dest++; @@ -99,8 +99,8 @@ void Background::sourceToBackground() { TQImage tmp; tmp.create(backgroundImage->width(), backgroundImage->height(), 32); for (int ys=0; ys < tmp.height(); ys++) { - QRgb *src = (QRgb *) backgroundImage->scanLine(ys); - QRgb *dst = (QRgb *) tmp.scanLine(ys); + TQRgb *src = (TQRgb *) backgroundImage->scanLine(ys); + TQRgb *dst = (TQRgb *) tmp.scanLine(ys); for (int xs=0; xs < tmp.width(); xs++) { *dst=TQColor(*src).dark(133).rgb(); src++; diff --git a/kmahjongg/BoardLayout.cpp b/kmahjongg/BoardLayout.cpp index 8da404ae..c9fd188e 100644 --- a/kmahjongg/BoardLayout.cpp +++ b/kmahjongg/BoardLayout.cpp @@ -29,7 +29,7 @@ bool BoardLayout::saveBoardLayout(const TQString where) { return false; } - TQCString tmp = layoutMagic1_0.utf8(); + TQCString tmp = tqlayoutMagic1_0.utf8(); if (f.writeBlock(tmp, tmp.length()) == -1) { return(false); } @@ -71,7 +71,7 @@ bool BoardLayout::loadBoardLayout(const TQString from) t.setCodec(TQTextCodec::codecForName("UTF-8")); TQString s; s = t.readLine(); - if (s != layoutMagic1_0) { + if (s != tqlayoutMagic1_0) { f.close(); return(false); } diff --git a/kmahjongg/BoardLayout.h b/kmahjongg/BoardLayout.h index 468bf5bc..7bf58003 100644 --- a/kmahjongg/BoardLayout.h +++ b/kmahjongg/BoardLayout.h @@ -4,7 +4,7 @@ #include #include "KmTypes.h" -const TQString layoutMagic1_0 = "kmahjongg-layout-v1.0"; +const TQString tqlayoutMagic1_0 = "kmahjongg-tqlayout-v1.0"; class BoardLayout { diff --git a/kmahjongg/Editor.cpp b/kmahjongg/Editor.cpp index d11ff7b2..833718c3 100644 --- a/kmahjongg/Editor.cpp +++ b/kmahjongg/Editor.cpp @@ -35,17 +35,17 @@ // When we assign a tile to draw in a slot we do it in order from te following -// table, wrapping on the tile number. It makes the tile layout look more +// table, wrapping on the tile number. It makes the tile tqlayout look more // random. Editor::Editor ( - TQWidget* parent, + TQWidget* tqparent, const char* name ) : - TQDialog( parent, name, true, 0 ), tiles(false) + TQDialog( tqparent, name, true, 0 ), tiles(false) { clean= true; @@ -61,7 +61,7 @@ Editor::Editor drawFrame->setGeometry( 10, 40 ,sWidth ,sHeight); drawFrame->setMinimumSize( 0, 0 ); drawFrame->setMaximumSize( 32767, 32767 ); - drawFrame->setFocusPolicy( TQWidget::NoFocus ); + drawFrame->setFocusPolicy( TQ_NoFocus ); drawFrame->setBackgroundMode( TQWidget::PaletteBackground ); drawFrame->setFrameStyle( 49 ); drawFrame->setMouseTracking(true); @@ -69,10 +69,10 @@ Editor::Editor // setup the tool bar setupToolbar(); - TQVBoxLayout *layout = new TQVBoxLayout(this, 1); - layout->addWidget(topToolbar,0); - layout->addWidget(drawFrame,1); - layout->activate(); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this, 1); + tqlayout->addWidget(topToolbar,0); + tqlayout->addWidget(drawFrame,1); + tqlayout->activate(); resize( sWidth+60, sHeight+60); setMinimumSize( sWidth+60, sHeight+60); @@ -170,7 +170,7 @@ void Editor::setupToolbar() // status in the toolbar for now (ick) theLabel = new TQLabel(statusText(), topToolbar); - int lWidth = theLabel->sizeHint().width(); + int lWidth = theLabel->tqsizeHint().width(); topToolbar->insertWidget(ID_TOOL_STATUS,lWidth, theLabel ); topToolbar->alignItemRight( ID_TOOL_STATUS, true ); @@ -209,19 +209,19 @@ void Editor::topToolbarOption(int option) { break; case ID_TOOL_LEFT: theBoard.shiftLeft(); - repaint(false); + tqrepaint(false); break; case ID_TOOL_RIGHT: theBoard.shiftRight(); - repaint(false); + tqrepaint(false); break; case ID_TOOL_UP: theBoard.shiftUp(); - repaint(false); + tqrepaint(false); break; case ID_TOOL_DOWN: theBoard.shiftDown(); - repaint(false); + tqrepaint(false); break; case ID_TOOL_DEL: mode=remove; @@ -260,7 +260,7 @@ TQString Editor::statusText() { if (x >=BoardLayout::width || x <0 || y >=BoardLayout::height || y <0) x = y = z = 0; - buf = i18n("Tiles: %1 Pos: %2,%3,%4").arg(numTiles).arg(x).arg(y).arg(z); + buf = i18n("Tiles: %1 Pos: %2,%3,%4").tqarg(numTiles).tqarg(x).tqarg(y).tqarg(z); return buf; } @@ -272,7 +272,7 @@ void Editor::loadBoard() { KURL url = KFileDialog::getOpenURL( NULL, - i18n("*.layout|Board Layout (*.layout)\n" + i18n("*.tqlayout|Board Layout (*.tqlayout)\n" "*|All Files"), this, i18n("Open Board Layout" )); @@ -283,7 +283,7 @@ void Editor::loadBoard() { theBoard.loadBoardLayout( url.path() ); - repaint(false); + tqrepaint(false); } @@ -302,14 +302,14 @@ void Editor::newBoard() { clean=true; numTiles=0; statusChanged(); - repaint(false); + tqrepaint(false); } bool Editor::saveBoard() { // get a save file name KURL url = KFileDialog::getSaveURL( NULL, - i18n("*.layout|Board Layout (*.layout)\n" + i18n("*.tqlayout|Board Layout (*.tqlayout)\n" "*|All Files"), this, i18n("Save Board Layout" )); @@ -356,7 +356,7 @@ bool Editor::testSave() int res; res=KMessageBox::warningYesNoCancel(this, i18n("The board has been modified. Would you " - "like to save the changes?"),TQString::null,KStdGuiItem::save(),KStdGuiItem::dontSave()); + "like to save the changes?"),TQString(),KStdGuiItem::save(),KStdGuiItem::dontSave()); if (res == KMessageBox::Yes) { // yes to save @@ -373,7 +373,7 @@ bool Editor::testSave() // The main paint event, draw in the grid and blit in -// the tiles as specified by the layout. +// the tiles as specified by the tqlayout. void Editor::paintEvent( TQPaintEvent* ) { @@ -386,7 +386,7 @@ void Editor::paintEvent( TQPaintEvent* ) { drawTiles(&buff); bitBlt(dest, 0,0,&buff, 0,0,buff.width(), buff.height(), CopyROP); - drawFrame->repaint(false); + drawFrame->tqrepaint(false); } void Editor::drawBackground(TQPixmap *pixmap) { @@ -564,7 +564,7 @@ void Editor::drawFrameMousePressEvent( TQMouseEvent* e ) numTiles--; statusChanged(); drawFrameMouseMovedEvent(e); - repaint(false); + tqrepaint(false); } break; case insert: { @@ -577,7 +577,7 @@ void Editor::drawFrameMousePressEvent( TQMouseEvent* e ) theBoard.insertTile(n); numTiles++; statusChanged(); - repaint(false); + tqrepaint(false); } } break; @@ -599,7 +599,7 @@ void Editor::drawCursor(POSITION &p, bool visible) if (p.e==100 || !visible) x = -1; drawFrame->setRect(x,y,w,h, tiles.shadowSize(), mode-remove); - drawFrame->repaint(false); + drawFrame->tqrepaint(false); diff --git a/kmahjongg/Editor.h b/kmahjongg/Editor.h index edc8f912..a42f237d 100644 --- a/kmahjongg/Editor.h +++ b/kmahjongg/Editor.h @@ -13,16 +13,17 @@ #include "Preview.h" -class Editor: public QDialog +class Editor: public TQDialog { Q_OBJECT + TQ_OBJECT public: Editor ( - TQWidget* parent = NULL, + TQWidget* tqparent = NULL, const char* name = NULL ); diff --git a/kmahjongg/GameTimer.cpp b/kmahjongg/GameTimer.cpp index f3ce4f52..d4fc4009 100644 --- a/kmahjongg/GameTimer.cpp +++ b/kmahjongg/GameTimer.cpp @@ -8,11 +8,11 @@ // -// Constructs a GameTimer widget with a parent and a name. +// Constructs a GameTimer widget with a tqparent and a name. // -GameTimer::GameTimer( TQWidget *parent, const char *name ) - : TQLCDNumber( parent, name ) +GameTimer::GameTimer( TQWidget *tqparent, const char *name ) + : TQLCDNumber( tqparent, name ) { showingColon = false; setNumDigits(7); diff --git a/kmahjongg/GameTimer.h b/kmahjongg/GameTimer.h index 10d97e13..cae1961e 100644 --- a/kmahjongg/GameTimer.h +++ b/kmahjongg/GameTimer.h @@ -8,7 +8,7 @@ ** ** Copyright (C) 1992-1998 Troll Tech AS. All rights reserved. ** -** This file is part of an example program for Qt. This example +** This file is part of an example program for TQt. This example ** program may be used, distributed and modified without limitation. ** *****************************************************************************/ @@ -24,8 +24,9 @@ enum TimerMode {running = -53 , stopped= -54 , paused = -55}; class GameTimer: public TQLCDNumber { Q_OBJECT + TQ_OBJECT public: - GameTimer( TQWidget *parent=0, const char *name=0 ); + GameTimer( TQWidget *tqparent=0, const char *name=0 ); int toInt(); TQString toString() {return theTimer.toString();} @@ -45,7 +46,7 @@ private slots: // internal slots private: // internal data bool showingColon; - QTime theTimer; + TQTime theTimer; TimerMode timerMode; }; diff --git a/kmahjongg/HighScore.cpp b/kmahjongg/HighScore.cpp index f59e782b..856ed7fb 100644 --- a/kmahjongg/HighScore.cpp +++ b/kmahjongg/HighScore.cpp @@ -43,11 +43,11 @@ int defTimes[numScores] = {ages, ages-1, ages-2, ages-3, HighScore::HighScore ( - TQWidget* parent, + TQWidget* tqparent, const char* name ) : - TQDialog( parent, name, true, 0 ) + TQDialog( tqparent, name, true, 0 ) { // form the target name @@ -62,7 +62,7 @@ HighScore::HighScore qtarch_Label_3->setGeometry( 10, 45, 30, 30 ); qtarch_Label_3->setFrameStyle( 50 ); qtarch_Label_3->setText( i18n("Pos") ); - qtarch_Label_3->setAlignment( AlignCenter ); + qtarch_Label_3->tqsetAlignment( AlignCenter ); fnt = qtarch_Label_3->font(); fnt.setBold(true); qtarch_Label_3->setFont(fnt); @@ -112,7 +112,7 @@ HighScore::HighScore qtarch_PushButton_1->setGeometry( 110+35, 340+50, 100, 30 ); qtarch_PushButton_1->setMinimumSize( 0, 0 ); qtarch_PushButton_1->setMaximumSize( 32767, 32767 ); - qtarch_PushButton_1->setFocusPolicy( TQWidget::TabFocus ); + qtarch_PushButton_1->setFocusPolicy( TQ_TabFocus ); qtarch_PushButton_1->setAutoRepeat( false ); qtarch_PushButton_1->setAutoResize( false ); qtarch_PushButton_1->setDefault(true); @@ -122,7 +122,7 @@ HighScore::HighScore resetBtn->setGeometry( 10, 5, 25, 25); resetBtn->setMinimumSize( 0, 0 ); resetBtn->setMaximumSize( 32767, 32767 ); - resetBtn->setFocusPolicy( TQWidget::TabFocus ); + resetBtn->setFocusPolicy( TQ_TabFocus ); //resetBtn->setText(i18n( "Reset" )); resetBtn->setAutoRepeat( false ); resetBtn->setAutoResize( false ); @@ -138,7 +138,7 @@ HighScore::HighScore lineEdit = new TQLineEdit(this, ""); lineEdit->setGeometry( 50, 40+(20*30), 190, 30 ); - lineEdit->setFocusPolicy(TQWidget::StrongFocus); + lineEdit->setFocusPolicy(TQ_StrongFocus); lineEdit->setFrame(true); lineEdit->setEchoMode(TQLineEdit::Normal); lineEdit->setText(""); @@ -149,7 +149,7 @@ HighScore::HighScore combo->setGeometry( 65, 5, 220, 25 ); combo->setMinimumSize( 0, 0 ); combo->setMaximumSize( 32767, 32767 ); - combo->setFocusPolicy( TQWidget::StrongFocus ); + combo->setFocusPolicy( TQ_StrongFocus ); combo->setSizeLimit( 10 ); combo->setAutoResize( false ); connect( combo, TQT_SIGNAL(activated(int)), TQT_SLOT(selectionChanged(int)) ); @@ -341,7 +341,7 @@ void HighScore::addRow(int num) { numbersWidgets[num] = new TQLabel( this); numbersWidgets[num]->setGeometry( 10, 75+(num*30), 30, 30 ); numbersWidgets[num]->setFrameStyle( 50 ); - numbersWidgets[num]->setAlignment( AlignRight | AlignVCenter ); + numbersWidgets[num]->tqsetAlignment( AlignRight | AlignVCenter ); numbersWidgets[num]->setNum(num+1); @@ -349,13 +349,13 @@ void HighScore::addRow(int num) { namesWidgets[num] = new TQLabel( this); namesWidgets[num]->setGeometry( 40, 75+(num*30), 150, 30 ); namesWidgets[num]->setFrameStyle( 50 ); - namesWidgets[num]->setAlignment( 289 ); + namesWidgets[num]->tqsetAlignment( 289 ); // board boardWidgets[num] = new TQLabel( this); boardWidgets[num]->setGeometry( 190, 75+(num*30), 80, 30 ); boardWidgets[num]->setFrameStyle( 50 ); - boardWidgets[num]->setAlignment( 289 ); + boardWidgets[num]->tqsetAlignment( 289 ); // score scoresWidgets[num] = new TQLabel( this); @@ -396,11 +396,11 @@ void HighScore::copyTableToScreen(const TQString &name) { elapsedWidgets[p]->setText(buff); } - repaint(false); + tqrepaint(false); } -int HighScore::exec(TQString &layout) { - copyTableToScreen(layout); +int HighScore::exec(TQString &tqlayout) { + copyTableToScreen(tqlayout); return(TQDialog::exec()); } diff --git a/kmahjongg/HighScore.h b/kmahjongg/HighScore.h index d6935ab5..bd593c09 100644 --- a/kmahjongg/HighScore.h +++ b/kmahjongg/HighScore.h @@ -26,21 +26,22 @@ typedef struct TableInstance { }; -class HighScore : public QDialog +class HighScore : public TQDialog { Q_OBJECT + TQ_OBJECT public: HighScore ( - TQWidget* parent = NULL, + TQWidget* tqparent = NULL, const char* name = NULL ); virtual ~HighScore(); - int exec(TQString &layout); + int exec(TQString &tqlayout); void checkHighScore(int score, int elapsed, long game, TQString &board); @@ -58,7 +59,7 @@ private: void selectTable(const TQString &name); void setComboTo(const TQString &to); void copyTableToScreen(const TQString &name); - QString &highScoreFile(); + TQString &highScoreFile(); int selectedLine; TQLineEdit *lineEdit; diff --git a/kmahjongg/Preview.cpp b/kmahjongg/Preview.cpp index 11fbcdbd..5c5871bf 100644 --- a/kmahjongg/Preview.cpp +++ b/kmahjongg/Preview.cpp @@ -19,7 +19,7 @@ static const char * themeMagicV1_0= "kmahjongg-theme-v1.0"; -Preview::Preview(TQWidget* parent) : KDialogBase(parent), m_tiles(true) +Preview::Preview(TQWidget* tqparent) : KDialogBase(tqparent), m_tiles(true) { KPushButton *loadButton; TQGroupBox *group; @@ -41,7 +41,7 @@ Preview::Preview(TQWidget* parent) : KDialogBase(parent), m_tiles(true) m_changed = false; setMainWidget(page); - setFixedSize(sizeHint()); + setFixedSize(tqsizeHint()); } Preview::~Preview() @@ -52,7 +52,7 @@ void Preview::selectionChanged(int which) { m_selectedFile = m_fileList[which]; drawPreview(); - m_drawFrame->repaint(0,0,-1,-1,false); + m_drawFrame->tqrepaint(0,0,-1,-1,false); markChanged(); } @@ -76,7 +76,7 @@ void Preview::initialise(const PreviewType type) TQString extension; TQString tile = Prefs::tileSet(); TQString back = Prefs::background(); - TQString layout = Prefs::layout(); + TQString tqlayout = Prefs::layout(); // set up the concept of the current file. Initialised to the preferences // value initially. Set the caption to indicate what we are doing @@ -98,10 +98,10 @@ void Preview::initialise(const PreviewType type) break; case board: - m_fileSelector = i18n("*.layout|Board Layout File (*.layout)\n"); + m_fileSelector = i18n("*.tqlayout|Board Layout File (*.tqlayout)\n"); setCaption(i18n("Change Board Layout")); - m_selectedFile = layout; - extension = "*.layout"; + m_selectedFile = tqlayout; + extension = "*.tqlayout"; break; case theme: @@ -158,16 +158,16 @@ void Preview::slotOk() { } void Preview::load() { - KURL url = KFileDialog::getOpenURL(TQString::null, m_fileSelector, this, i18n("Open Board Layout" )); + KURL url = KFileDialog::getOpenURL(TQString(), m_fileSelector, this, i18n("Open Board Layout" )); if ( !url.isEmpty() ) { m_selectedFile = url.path(); drawPreview(); - m_drawFrame->repaint(0,0,-1,-1,false); + m_drawFrame->tqrepaint(0,0,-1,-1,false); markChanged(); } } -// Top level preview drawing method. Background, tileset and layout +// Top level preview drawing method. Background, tileset and tqlayout // are initialised from the preferences. Depending on the type // of preview dialog we pick up the selected file for one of these // chaps. @@ -176,7 +176,7 @@ void Preview::drawPreview() { TQString tile = Prefs::tileSet(); TQString back = Prefs::background(); - TQString layout = Prefs::layout(); + TQString tqlayout = Prefs::layout(); switch (m_previewType) { @@ -189,15 +189,15 @@ void Preview::drawPreview() break; case board: - layout = m_selectedFile; + tqlayout = m_selectedFile; break; case theme: // a theme is quite a bit of work. We load the - // specified bits in (layout, background and tileset + // specified bits in (tqlayout, background and tileset if (!m_selectedFile.isEmpty()) { - TQString backRaw, layoutRaw, tilesetRaw, magic; + TQString backRaw, tqlayoutRaw, tilesetRaw, magic; TQFile in(m_selectedFile); if (in.open(IO_ReadOnly)) @@ -212,38 +212,38 @@ void Preview::drawPreview() } tilesetRaw = stream.readLine(); backRaw = stream.readLine(); - layoutRaw = stream.readLine(); + tqlayoutRaw = stream.readLine(); in.close(); tile = tilesetRaw; - tile.replace(":", "/kmahjongg/pics/"); + tile.tqreplace(":", "/kmahjongg/pics/"); if (!TQFile::exists(tile)) { tile = tilesetRaw; - tile = "pics/" + tile.right(tile.length() - tile.find(":") - 1 ); + tile = "pics/" + tile.right(tile.length() - tile.tqfind(":") - 1 ); tile = locate("appdata", tile); } back = backRaw; - back.replace(":", "/kmahjongg/pics/"); + back.tqreplace(":", "/kmahjongg/pics/"); if (!TQFile::exists(back)) { back = backRaw; - back = "pics/" + back.right(back.length() - back.find(":") - 1); + back = "pics/" + back.right(back.length() - back.tqfind(":") - 1); back = locate("appdata", back); } - layout = layoutRaw; - layout.replace(":", "/kmahjongg/pics/"); - if (!TQFile::exists(layout)) + tqlayout = tqlayoutRaw; + tqlayout.tqreplace(":", "/kmahjongg/pics/"); + if (!TQFile::exists(tqlayout)) { - layout = layoutRaw; - layout = "pics/" + layout.right(layout.length() - layout.find(":") - 1); - layout = locate("appdata", layout); + tqlayout = tqlayoutRaw; + tqlayout = "pics/" + tqlayout.right(tqlayout.length() - tqlayout.tqfind(":") - 1); + tqlayout = locate("appdata", tqlayout); } m_themeBack=back; - m_themeLayout=layout; + m_themeLayout=tqlayout; m_themeTileset=tile; } } @@ -251,16 +251,16 @@ void Preview::drawPreview() } renderBackground(back); - renderTiles(tile, layout); + renderTiles(tile, tqlayout); } void Preview::paintEvent( TQPaintEvent* ){ - m_drawFrame->repaint(false); + m_drawFrame->tqrepaint(false); } // the user selected ok, or apply. This method passes the changes // across to the game widget and if necessary forces a board redraw -// (unnecessary on layout changes since it only effects the next game) +// (unnecessary on tqlayout changes since it only effects the next game) void Preview::applyChange() { switch (m_previewType) @@ -287,8 +287,8 @@ void Preview::applyChange() break; } - // don't redraw for a layout change - if (m_previewType == board || m_previewType == theme) layoutChange(); + // don't redraw for a tqlayout change + if (m_previewType == board || m_previewType == theme) tqlayoutChange(); else boardRedraw(true); // either way we mark the current value as unchanged @@ -310,9 +310,9 @@ void Preview::renderBackground(const TQString &bg) { // This method draws a mini-tiled board with no tiles missing. -void Preview::renderTiles(const TQString &file, const TQString &layout) { +void Preview::renderTiles(const TQString &file, const TQString &tqlayout) { m_tiles.loadTileset(file, true); - m_boardLayout.loadBoardLayout(layout); + m_boardLayout.loadBoardLayout(tqlayout); TQPixmap *dest = m_drawFrame->getPreviewPixmap(); int xOffset = m_tiles.width()/2; @@ -366,23 +366,23 @@ void Preview::renderTiles(const TQString &file, const TQString &layout) { void Preview::saveTheme() { TQString tile = Prefs::tileSet(); TQString back = Prefs::background(); - TQString layout = Prefs::layout(); + TQString tqlayout = Prefs::layout(); TQString with = ":"; // we want to replace any path in the default store // with a + TQRegExp p(locate("data_dir", "/kmahjongg/pics/")); - back.replace(p,with); - tile.replace(p,with); - layout.replace(p,with); + back.tqreplace(p,with); + tile.tqreplace(p,with); + tqlayout.tqreplace(p,with); // Get the name of the file to save KURL url = KFileDialog::getSaveURL( NULL, "*.theme", - parentWidget(), + tqparentWidget(), i18n("Save Theme" )); if ( url.isEmpty() ) return; @@ -402,7 +402,7 @@ void Preview::saveTheme() { int res=KMessageBox::warningContinueCancel(this, i18n("A file with that name " "already exists. Do you " - "wish to overwrite it?"),TQString::null,i18n("Overwrite")); + "wish to overwrite it?"),TQString(),i18n("Overwrite")); if (res != KMessageBox::Continue) return ; } @@ -417,12 +417,12 @@ void Preview::saveTheme() { themeMagicV1_0, tile.utf8().data(), back.utf8().data(), - layout.utf8().data()); + tqlayout.utf8().data()); fclose(outFile); } -FrameImage::FrameImage (TQWidget *parent, const char *name) - : TQFrame(parent, name) +FrameImage::FrameImage (TQWidget *tqparent, const char *name) + : TQFrame(tqparent, name) { rx = -1; thePixmap = new TQPixmap(); @@ -448,11 +448,11 @@ void FrameImage::paintEvent( TQPaintEvent* pa ) TQPen line; - line.setStyle(DotLine); + line.setStyle(Qt::DotLine); line.setWidth(2); line.setColor(yellow); p.setPen(line); - p.setBackgroundMode(OpaqueMode); + p.setBackgroundMode(Qt::OpaqueMode); p.setBackgroundColor(black); int x = pa->rect().left(); diff --git a/kmahjongg/Preview.h b/kmahjongg/Preview.h index 96aae3ef..0c4b37c2 100644 --- a/kmahjongg/Preview.h +++ b/kmahjongg/Preview.h @@ -12,11 +12,12 @@ class TQComboBox; class TQPixmap; -class FrameImage: public QFrame +class FrameImage: public TQFrame { Q_OBJECT + TQ_OBJECT public: - FrameImage(TQWidget *parent=NULL, const char *name = NULL); + FrameImage(TQWidget *tqparent=NULL, const char *name = NULL); ~FrameImage(); void setGeometry(int x, int y, int w, int h); TQPixmap *getPreviewPixmap() {return thePixmap;} @@ -43,11 +44,12 @@ private: class Preview: public KDialogBase { Q_OBJECT + TQ_OBJECT public: enum PreviewType {background, tileset, board, theme}; - Preview(TQWidget* parent); + Preview(TQWidget* tqparent); ~Preview(); void initialise(const PreviewType type); @@ -61,7 +63,7 @@ protected: virtual void drawPreview(); void applyChange() ; void renderBackground(const TQString &bg); - void renderTiles(const TQString &file, const TQString &layout); + void renderTiles(const TQString &file, const TQString &tqlayout); void paintEvent( TQPaintEvent* pa ); signals: @@ -69,7 +71,7 @@ signals: void loadTileset(const TQString &); void loadBackground(const TQString &, bool); void loadBoard(const TQString &); - void layoutChange(); + void tqlayoutChange(); public slots: void selectionChanged(int which); diff --git a/kmahjongg/Tileset.cpp b/kmahjongg/Tileset.cpp index b7e04f4e..fb4b1d05 100644 --- a/kmahjongg/Tileset.cpp +++ b/kmahjongg/Tileset.cpp @@ -16,9 +16,9 @@ static unsigned char mini_bits[] = { 0xff, 0xff, 0x0f, 0xff, 0xff, 0x0f, 0xff, 0xff, 0x07, 0xff, 0xff, 0x03, }; -#define mask_width 40 -#define mask_height 56 -static unsigned char mask_bits[] = { +#define tqmask_width 40 +#define tqmask_height 56 +static unsigned char tqmask_bits[] = { 0xf0, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -48,8 +48,8 @@ static unsigned char mask_bits[] = { // --------------------------------------------------------- Tileset::Tileset(bool scale): - maskBits(mask_width, mask_height, mask_bits, true), - maskBitsMini(mini_width, mini_height, mini_bits, true) + tqmaskBits(tqmask_width, tqmask_height, tqmask_bits, true), + tqmaskBitsMini(mini_width, mini_height, mini_bits, true) { isScaled = scale; divisor = (isScaled) ? 2 : 1; @@ -62,12 +62,12 @@ Tileset::Tileset(bool scale): s = w*h; // RGBA's required per tile // Allocate memory for the 9*5 tile arrays - tiles = new QRgb [9*5*s]; - selectedTiles = new QRgb [9*5*s]; + tiles = new TQRgb [9*5*s]; + selectedTiles = new TQRgb [9*5*s]; // allocate memory for single tile storage - selectedFace = new QRgb [s]; - unselectedFace = new QRgb [s]; + selectedFace = new TQRgb [s]; + unselectedFace = new TQRgb [s]; // quarter widths are used as an offset when // overlaying tiles in 3 dimensions. @@ -94,14 +94,14 @@ Tileset::~Tileset() { // method returns the address of the byte after the copied image // and can be used to fill a larger array of tiles. -QRgb *Tileset::copyTileImage(short tileX, short tileY, QRgb *to, TQImage &from) { - QRgb *dest = to; - QRgb *src; +TQRgb *Tileset::copyTileImage(short tileX, short tileY, TQRgb *to, TQImage &from) { + TQRgb *dest = to; + TQRgb *src; - src = (QRgb *) from.scanLine(tileY * h) + src = (TQRgb *) from.scanLine(tileY * h) +(tileX * w); for (short pos=0; pos < h; pos++) { - memcpy(dest, src, w*sizeof(QRgb)); + memcpy(dest, src, w*sizeof(TQRgb)); dest+=w; src += from.width(); } @@ -117,16 +117,16 @@ QRgb *Tileset::copyTileImage(short tileX, short tileY, QRgb *to, TQImage &from) // color). -QRgb *Tileset::createTile(short x, short y, - QRgb *det, TQImage &allTiles , QRgb *face) { - QRgb *image ; - QRgb *to = det; +TQRgb *Tileset::createTile(short x, short y, + TQRgb *det, TQImage &allTiles , TQRgb *face) { + TQRgb *image ; + TQRgb *to = det; // Alloc the space - image = new QRgb[s]; + image = new TQRgb[s]; // copy in the background - memcpy(to, face, s*sizeof(QRgb)); + memcpy(to, face, s*sizeof(TQRgb)); // get the tile gylph copyTileImage(x, y , image, allTiles); @@ -135,7 +135,7 @@ QRgb *Tileset::createTile(short x, short y, // top left colour as the transparency. We step over // the shadow and the boarder - QRgb* src = image+ // image + TQRgb* src = image+ // image ss+ // past the left shadow bs+ // then the tile border (bs * w); // then step past the top border @@ -144,7 +144,7 @@ QRgb *Tileset::createTile(short x, short y, to += (((ss+bs))+(bs*w)); - QRgb trans = *src; + TQRgb trans = *src; // start after the top border rows and go through all rows for( short YP=0; YP < h-ss - (2*bs); YP++) { @@ -173,17 +173,17 @@ QRgb *Tileset::createTile(short x, short y, // version, which can be used for mini tile requirements. // this gives us a small tile for previews and showing // removed tiles. -void Tileset::createPixmap(QRgb *src, TQPixmap &dest, bool scale, bool shadow) +void Tileset::createPixmap(TQRgb *src, TQPixmap &dest, bool scale, bool shadow) { TQImage buff; - QRgb *line; + TQRgb *line; buff.create(w, h, 32); for (int y=0; yquit(); } @@ -55,17 +55,17 @@ BoardWidget::BoardWidget( TQWidget* parent, const char *name ) if( ! loadBackground(tFile, false ) ) { KMessageBox::error(this, - i18n("An error occurred when loading the background image\n%1").arg(tFile)+ + i18n("An error occurred when loading the background image\n%1").tqarg(tFile)+ i18n("KMahjongg will now terminate.")); kapp->quit(); } - getFileOrDefault(Prefs::layout(), "layout", tFile); + getFileOrDefault(Prefs::layout(), "tqlayout", tFile); if( ! loadBoardLayout(tFile) ) { KMessageBox::error(this, - i18n("An error occurred when loading the board layout %1\n" - "KMahjongg will now terminate.").arg(tFile)); + i18n("An error occurred when loading the board tqlayout %1\n" + "KMahjongg will now terminate.").tqarg(tFile)); kapp->quit(); } setDisplayedWidth(); @@ -92,7 +92,7 @@ void BoardWidget::saveSettings(){ //config->writePathEntry("Tileset_file", tileFile); //config->writePathEntry("Background_file", backgroundFile); - //config->writePathEntry("Layout_file", layout); + //config->writePathEntry("Layout_file", tqlayout); } void BoardWidget::getFileOrDefault(TQString filename, TQString type, TQString &res) @@ -111,7 +111,7 @@ void BoardWidget::getFileOrDefault(TQString filename, TQString type, TQString &r if (res.isEmpty()) { KMessageBox::error(this, i18n("KMahjongg could not locate the file: %1\n" "or the default file of type: %2\n" - "KMahjongg will now terminate").arg(filename).arg(type) ); + "KMahjongg will now terminate").tqarg(filename).tqarg(type) ); kapp->quit(); } } @@ -264,7 +264,7 @@ void BoardWidget::paintEvent( TQPaintEvent* pa ) return; } - // if the repaint is because of a window redraw after a move + // if the tqrepaint is because of a window redraw after a move // or a menu roll up, then just blit in the last rendered image if (!updateBackBuffer) { bitBlt(this, xx,pa->rect().top(), @@ -440,7 +440,7 @@ void BoardWidget::stackTiles(unsigned char t, unsigned short h, unsigned short x int ss = theTiles.shadowSize(); TQPainter p(&backBuffer); TQPen line; - p.setBackgroundMode(OpaqueMode); + p.setBackgroundMode(Qt::OpaqueMode); p.setBackgroundColor(black); @@ -766,7 +766,7 @@ void BoardWidget::calculateNewGame( int gNumber) } // --------------------------------------------------------- -// Generate the position data for the layout from contents of Game.Map. +// Generate the position data for the tqlayout from contents of Game.Map. void BoardWidget::generateTilePositions() { numTiles = 0; @@ -788,7 +788,7 @@ void BoardWidget::generateTilePositions() { } // --------------------------------------------------------- -// Generate the dependency data for the layout from the position data. +// Generate the dependency data for the tqlayout from the position data. // Note that the coordinates of each tile in tilePositions are those of // the upper left quarter of the tile. void BoardWidget::generatePositionDepends() { @@ -882,7 +882,7 @@ int BoardWidget::tileAt(int x, int y, int z) { bool BoardWidget::generateSolvableGame() { // Initially we want to mark positions on layer 0 so that we have only - // one free position per apparent horizontal line. + // one free position per aptqparent horizontal line. for (int i = 0; i < numTiles; i++) { // Pick a random tile on layer 0 @@ -894,7 +894,7 @@ bool BoardWidget::generateSolvableGame() { } } while (tilePositions[position].e != 0); - // If there are no other free positions on the same apparent + // If there are no other free positions on the same aptqparent // horizontal line, we can mark that position as free. if (onlyFreeInLine(position)) { positionDepends[position].free = true; @@ -965,7 +965,7 @@ bool BoardWidget::generateSolvableGame() { // --------------------------------------------------------- // Determines whether it is ok to mark this position as "free" because -// there are no other positions marked "free" in its apparent horizontal +// there are no other positions marked "free" in its aptqparent horizontal // line. bool BoardWidget::onlyFreeInLine(int position) { @@ -1104,7 +1104,7 @@ void BoardWidget::updateDepend(int position) { } } - // If position is first free on apparent horizontal, it is + // If position is first free on aptqparent horizontal, it is // now free to be filled. if (onlyFreeInLine(position)) { positionDepends[position].free = true; @@ -1393,7 +1393,7 @@ bool BoardWidget::findMove( POSITION& posA, POSITION& posB ) iPosCount = 0; // Hier Anzahl der gefunden Paare merken - // The new tile layout with non-contiguos horizantle spans + // The new tile tqlayout with non-contiguos horizantle spans // can lead to huge numbers of matching pairs being exposed. // we alter the loop to bail out when BoardLayout::maxTiles/2 pairs are found // (or less); @@ -1623,7 +1623,7 @@ void BoardWidget::mousePressEvent ( TQMouseEvent* event ) if (gamePaused) return; - if( event->button() == LeftButton ) + if( event->button() == Qt::LeftButton ) { if( TimerState == Demo ) { @@ -1804,7 +1804,7 @@ bool BoardWidget::loadBackground( if( ! theBackground.load( pszFileName, requiredWidth(), requiredHeight()) ) { if( bShowError ) - KMessageBox::sorry(this, i18n("Failed to load image:\n%1").arg(pszFileName) ); + KMessageBox::sorry(this, i18n("Failed to load image:\n%1").tqarg(pszFileName) ); return( false ); } Prefs::setBackground(pszFileName); @@ -2010,7 +2010,7 @@ void BoardWidget::shuffle() { // force a redraw updateBackBuffer=true; - repaint(false); + tqrepaint(false); // I consider this s very bad cheat so, I punish the user diff --git a/kmahjongg/boardwidget.h b/kmahjongg/boardwidget.h index 3fe7c3b7..749f5452 100644 --- a/kmahjongg/boardwidget.h +++ b/kmahjongg/boardwidget.h @@ -86,12 +86,13 @@ typedef struct gamedata { /** * @author Mathias Mueller */ -class BoardWidget : public QWidget +class BoardWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - BoardWidget( TQWidget* parent = 0, const char *name = 0 ); + BoardWidget( TQWidget* tqparent = 0, const char *name = 0 ); ~BoardWidget(); void calculateNewGame(int num = -1 ); @@ -204,7 +205,7 @@ class BoardWidget : public QWidget - bool updateBackBuffer; // does board need redrawing. Not if it is just a repaint + bool updateBackBuffer; // does board need redrawing. Not if it is just a tqrepaint bool gamePaused; diff --git a/kmahjongg/kmahjongg.cpp b/kmahjongg/kmahjongg.cpp index dd49fedd..d9f20522 100644 --- a/kmahjongg/kmahjongg.cpp +++ b/kmahjongg/kmahjongg.cpp @@ -4,7 +4,7 @@ kmahjongg, the classic mahjongg game for KDE project - Requires the Qt widget libraries, available at no cost at + Requires the TQt widget libraries, available at no cost at http://www.troll.no Copyright (C) 1997 Mathias Mueller @@ -57,8 +57,8 @@ int is_paused = 0; /** Constructor. */ -KMahjongg::KMahjongg( TQWidget* parent, const char *name) - : KMainWindow(parent, name) +KMahjongg::KMahjongg( TQWidget* tqparent, const char *name) + : KMainWindow(tqparent, name) { boardEditor = 0; @@ -100,7 +100,7 @@ KMahjongg::KMahjongg( TQWidget* parent, const char *name) connect( previewLoad, TQT_SIGNAL( boardRedraw(bool) ), bw, TQT_SLOT( drawBoard(bool) ) ); - connect( previewLoad, TQT_SIGNAL( layoutChange() ), + connect( previewLoad, TQT_SIGNAL( tqlayoutChange() ), this, TQT_SLOT( newGame() ) ); @@ -128,41 +128,41 @@ KMahjongg::~KMahjongg() void KMahjongg::setupKAction() { // game - KStdGameAction::gameNew(this, TQT_SLOT(newGame()), actionCollection()); - KStdGameAction::load(this, TQT_SLOT(loadGame()), actionCollection()); - KStdGameAction::save(this, TQT_SLOT(saveGame()), actionCollection()); - KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); - KStdGameAction::restart(this, TQT_SLOT(restartGame()), actionCollection()); - new KAction(i18n("New Numbered Game..."), "newnum", 0, this, TQT_SLOT(startNewNumeric()), actionCollection(), "game_new_numeric"); - new KAction(i18n("Open Th&eme..."), 0, this, TQT_SLOT(openTheme()), actionCollection(), "game_open_theme"); - new KAction(i18n("Open &Tileset..."), 0, this, TQT_SLOT(openTileset()), actionCollection(), "game_open_tileset"); - new KAction(i18n("Open &Background..."), 0, this, TQT_SLOT(openBackground()), actionCollection(), "game_open_background"); - new KAction(i18n("Open La&yout..."), 0, this, TQT_SLOT(openLayout()), actionCollection(), "game_open_layout"); - new KAction(i18n("Sa&ve Theme..."), 0, this, TQT_SLOT(saveTheme()), actionCollection(), "game_save_theme"); + KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(newGame()), actionCollection()); + KStdGameAction::load(TQT_TQOBJECT(this), TQT_SLOT(loadGame()), actionCollection()); + KStdGameAction::save(TQT_TQOBJECT(this), TQT_SLOT(saveGame()), actionCollection()); + KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); + KStdGameAction::restart(TQT_TQOBJECT(this), TQT_SLOT(restartGame()), actionCollection()); + new KAction(i18n("New Numbered Game..."), "newnum", 0, TQT_TQOBJECT(this), TQT_SLOT(startNewNumeric()), actionCollection(), "game_new_numeric"); + new KAction(i18n("Open Th&eme..."), 0, TQT_TQOBJECT(this), TQT_SLOT(openTheme()), actionCollection(), "game_open_theme"); + new KAction(i18n("Open &Tileset..."), 0, TQT_TQOBJECT(this), TQT_SLOT(openTileset()), actionCollection(), "game_open_tileset"); + new KAction(i18n("Open &Background..."), 0, TQT_TQOBJECT(this), TQT_SLOT(openBackground()), actionCollection(), "game_open_background"); + new KAction(i18n("Open La&yout..."), 0, TQT_TQOBJECT(this), TQT_SLOT(openLayout()), actionCollection(), "game_open_layout"); + new KAction(i18n("Sa&ve Theme..."), 0, TQT_TQOBJECT(this), TQT_SLOT(saveTheme()), actionCollection(), "game_save_theme"); // originally "file" ends here - KStdGameAction::hint(bw, TQT_SLOT(helpMove()), actionCollection()); - new KAction(i18n("Shu&ffle"), "reload", 0, bw, TQT_SLOT(shuffle()), actionCollection(), "move_shuffle"); - demoAction = KStdGameAction::demo(this, TQT_SLOT(demoMode()), actionCollection()); - showMatchingTilesAction = new KToggleAction(i18n("Show &Matching Tiles"), 0, this, TQT_SLOT(showMatchingTiles()), actionCollection(), "options_show_matching_tiles"); + KStdGameAction::hint(TQT_TQOBJECT(bw), TQT_SLOT(helpMove()), actionCollection()); + new KAction(i18n("Shu&ffle"), "reload", 0, TQT_TQOBJECT(bw), TQT_SLOT(shuffle()), actionCollection(), "move_shuffle"); + demoAction = KStdGameAction::demo(TQT_TQOBJECT(this), TQT_SLOT(demoMode()), actionCollection()); + showMatchingTilesAction = new KToggleAction(i18n("Show &Matching Tiles"), 0, TQT_TQOBJECT(this), TQT_SLOT(showMatchingTiles()), actionCollection(), "options_show_matching_tiles"); showMatchingTilesAction->setCheckedState(i18n("Hide &Matching Tiles")); showMatchingTilesAction->setChecked(Prefs::showMatchingTiles()); bw->setShowMatch( Prefs::showMatchingTiles() ); - KStdGameAction::highscores(this, TQT_SLOT(showHighscores()), actionCollection()); - pauseAction = KStdGameAction::pause(this, TQT_SLOT(pause()), actionCollection()); + KStdGameAction::highscores(TQT_TQOBJECT(this), TQT_SLOT(showHighscores()), actionCollection()); + pauseAction = KStdGameAction::pause(TQT_TQOBJECT(this), TQT_SLOT(pause()), actionCollection()); // TODO: store the background ; open on startup - // TODO: same about layout + // TODO: same about tqlayout // TODO: same about theme // move - undoAction = KStdGameAction::undo(this, TQT_SLOT(undo()), actionCollection()); - redoAction = KStdGameAction::redo(this, TQT_SLOT(redo()), actionCollection()); + undoAction = KStdGameAction::undo(TQT_TQOBJECT(this), TQT_SLOT(undo()), actionCollection()); + redoAction = KStdGameAction::redo(TQT_TQOBJECT(this), TQT_SLOT(redo()), actionCollection()); // edit - new KAction(i18n("&Board Editor"), 0, this, TQT_SLOT(slotBoardEditor()), actionCollection(), "edit_board_editor"); + new KAction(i18n("&Board Editor"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotBoardEditor()), actionCollection(), "edit_board_editor"); // settings - KStdAction::preferences(this, TQT_SLOT(showSettings()), actionCollection()); + KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(showSettings()), actionCollection()); setupGUI(); } @@ -179,19 +179,19 @@ void KMahjongg::setupStatusBar() tilesLeftLabel= new TQLabel("Removed: 0000/0000", statusBar()); tilesLeftLabel->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); - statusBar()->addWidget(tilesLeftLabel, tilesLeftLabel->sizeHint().width(), ID_STATUS_GAME); + statusBar()->addWidget(tilesLeftLabel, tilesLeftLabel->tqsizeHint().width(), ID_STATUS_GAME); gameNumLabel = new TQLabel("Game: 000000000000000000000", statusBar()); gameNumLabel->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); - statusBar()->addWidget(gameNumLabel, gameNumLabel->sizeHint().width(), ID_STATUS_TILENUMBER); + statusBar()->addWidget(gameNumLabel, gameNumLabel->tqsizeHint().width(), ID_STATUS_TILENUMBER); statusLabel= new TQLabel("Kmahjongg", statusBar()); statusLabel->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); - statusBar()->addWidget(statusLabel, statusLabel->sizeHint().width(), ID_STATUS_MESSAGE); + statusBar()->addWidget(statusLabel, statusLabel->tqsizeHint().width(), ID_STATUS_MESSAGE); - // pStatusBar->setAlignment( ID_STATUS_TILENUMBER, AlignCenter ); + // pStatusBar->tqsetAlignment( ID_STATUS_TILENUMBER, AlignCenter ); } void KMahjongg::setDisplayedWidth() @@ -239,7 +239,7 @@ void KMahjongg::showSettings(){ KConfigDialog *dialog = new KConfigDialog(this, "settings", Prefs::self(), KDialogBase::Swallow); dialog->addPage(new Settings(0, "General"), i18n("General"), "package_settings"); connect(dialog, TQT_SIGNAL(settingsChanged()), bw, TQT_SLOT(loadSettings())); - connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(setDisplayedWidth())); + connect(dialog, TQT_SIGNAL(settingsChanged()), TQT_TQOBJECT(this), TQT_SLOT(setDisplayedWidth())); dialog->show(); } @@ -397,7 +397,7 @@ void KMahjongg::gameOver( void KMahjongg::showStatusText( const TQString &msg, long board ) { statusLabel->setText(msg); - TQString str = i18n("Game number: %1").arg(board); + TQString str = i18n("Game number: %1").tqarg(board); gameNumLabel->setText(str); } @@ -406,8 +406,8 @@ void KMahjongg::showStatusText( const TQString &msg, long board ) void KMahjongg::showTileNumber( int iMaximum, int iCurrent, int iLeft ) { // Hmm... seems iCurrent is the number of remaining tiles, not removed ... - //TQString szBuffer = i18n("Removed: %1/%2").arg(iCurrent).arg(iMaximum); - TQString szBuffer = i18n("Removed: %1/%2 Combinations left: %3").arg(iMaximum-iCurrent).arg(iMaximum).arg(iLeft); + //TQString szBuffer = i18n("Removed: %1/%2").tqarg(iCurrent).tqarg(iMaximum); + TQString szBuffer = i18n("Removed: %1/%2 Combinations left: %3").tqarg(iMaximum-iCurrent).tqarg(iMaximum).tqarg(iLeft); tilesLeftLabel->setText(szBuffer); // Update here since undo allow is effected by demo mode diff --git a/kmahjongg/kmahjongg.h b/kmahjongg/kmahjongg.h index a1e14efa..54c5ca92 100644 --- a/kmahjongg/kmahjongg.h +++ b/kmahjongg/kmahjongg.h @@ -4,7 +4,7 @@ kmahjongg, the classic mahjongg game for KDE project - Requires the Qt widget libraries, available at no cost at + Requires the TQt widget libraries, available at no cost at http://www.troll.no Copyright (C) 1997 Mathias Mueller @@ -51,9 +51,10 @@ class TQLabel; class KMahjongg : public KMainWindow { Q_OBJECT + TQ_OBJECT public: - KMahjongg( TQWidget* parent = 0, const char *name = 0); + KMahjongg( TQWidget* tqparent = 0, const char *name = 0); ~KMahjongg(); public slots: diff --git a/kmahjongg/pics/cross.layout b/kmahjongg/pics/cross.layout index 39c58f1e..de71a115 100644 --- a/kmahjongg/pics/cross.layout +++ b/kmahjongg/pics/cross.layout @@ -1,4 +1,4 @@ -kmahjongg-layout-v1.0 +kmahjongg-tqlayout-v1.0 12....12121212121212121212....12 4312..43434343434343434343..1243 124312........1212........124312 diff --git a/kmahjongg/pics/default.layout b/kmahjongg/pics/default.layout index f72ed794..005254ed 100644 --- a/kmahjongg/pics/default.layout +++ b/kmahjongg/pics/default.layout @@ -1,4 +1,4 @@ -kmahjongg-layout-v1.0 +kmahjongg-tqlayout-v1.0 # Level 0 ------------------------- ...121212121212121212121212..... ...434343434343434343434343..... diff --git a/kmahjongg/pics/default.theme b/kmahjongg/pics/default.theme index 9ba994bc..49502e04 100644 --- a/kmahjongg/pics/default.theme +++ b/kmahjongg/pics/default.theme @@ -1,4 +1,4 @@ kmahjongg-theme-v1.0 :default.tileset :default.bgnd -:default.layout +:default.tqlayout diff --git a/kmahjongg/pics/pirates.layout b/kmahjongg/pics/pirates.layout index c5bb895c..3cce44e3 100644 --- a/kmahjongg/pics/pirates.layout +++ b/kmahjongg/pics/pirates.layout @@ -1,4 +1,4 @@ -kmahjongg-layout-v1.0 +kmahjongg-tqlayout-v1.0 .............121212.......12..12 .............434343.......43..43 .............12.............12.. diff --git a/kmahjongg/pics/pirates.theme b/kmahjongg/pics/pirates.theme index 748b3ffa..51b6ec88 100644 --- a/kmahjongg/pics/pirates.theme +++ b/kmahjongg/pics/pirates.theme @@ -1,5 +1,5 @@ kmahjongg-theme-v1.0 :pirates.tileset :pirates.bgnd -:pirates.layout +:pirates.tqlayout diff --git a/kmahjongg/pics/pyramid.layout b/kmahjongg/pics/pyramid.layout index edd634dc..0239212b 100644 --- a/kmahjongg/pics/pyramid.layout +++ b/kmahjongg/pics/pyramid.layout @@ -1,4 +1,4 @@ -kmahjongg-layout-v1.0 +kmahjongg-tqlayout-v1.0 # Level 0 ------------------------- ....121212121212121212121212.... ....434343434343434343434343.... diff --git a/kmahjongg/pics/stax.layout b/kmahjongg/pics/stax.layout index f5595dca..abc7e969 100644 --- a/kmahjongg/pics/stax.layout +++ b/kmahjongg/pics/stax.layout @@ -1,4 +1,4 @@ -kmahjongg-layout-v1.0 +kmahjongg-tqlayout-v1.0 ................................ 12121212..121212121212..12121212 43434343..434343434343..43434343 diff --git a/kmahjongg/pics/test.layout b/kmahjongg/pics/test.layout index d46a4e21..2c76ddec 100644 --- a/kmahjongg/pics/test.layout +++ b/kmahjongg/pics/test.layout @@ -1,4 +1,4 @@ -kmahjongg-layout-v1.0 +kmahjongg-tqlayout-v1.0 .1212121212121212121212121212... .4343434343434343434343434343... .1212121212121212121212121212... diff --git a/kmahjongg/pics/test2.layout b/kmahjongg/pics/test2.layout index aedc6290..9ab29fdf 100644 --- a/kmahjongg/pics/test2.layout +++ b/kmahjongg/pics/test2.layout @@ -1,4 +1,4 @@ -kmahjongg-layout-v1.0 +kmahjongg-tqlayout-v1.0 ................................ ................................ .121212121212121212............. diff --git a/kmahjongg/pics/tower.layout b/kmahjongg/pics/tower.layout index 76fe96a0..3ca7bfc6 100644 --- a/kmahjongg/pics/tower.layout +++ b/kmahjongg/pics/tower.layout @@ -1,4 +1,4 @@ -kmahjongg-layout-v1.0 +kmahjongg-tqlayout-v1.0 # Level 0 ------------------------- ....121212121212121212121212.... ....434343434343434343434343.... diff --git a/kmahjongg/pics/triangle.layout b/kmahjongg/pics/triangle.layout index e1dd4891..e04c405a 100644 --- a/kmahjongg/pics/triangle.layout +++ b/kmahjongg/pics/triangle.layout @@ -1,4 +1,4 @@ -kmahjongg-layout-v1.0 +kmahjongg-tqlayout-v1.0 # Level 0 ------------------------- .121212121212121212121212121212. .434343434343434343434343434343. diff --git a/kmahjongg/settings.ui b/kmahjongg/settings.ui index e53c6e37..81f40b8a 100644 --- a/kmahjongg/settings.ui +++ b/kmahjongg/settings.ui @@ -1,10 +1,10 @@ Settings - + Settings - + 0 0 @@ -22,7 +22,7 @@ 0 - + frame3 @@ -39,7 +39,7 @@ unnamed - + groupBox1 @@ -50,7 +50,7 @@ unnamed - + kcfg_ShowRemoved @@ -58,7 +58,7 @@ Show removed tiles - + kcfg_SolvableGames @@ -69,7 +69,7 @@ true - + kcfg_PlayAnimation @@ -92,14 +92,14 @@ Expanding - + 20 16 - + kcfg_TiledBackground @@ -110,7 +110,7 @@ unnamed - + Background_scale @@ -118,7 +118,7 @@ Scale - + Background_tiled @@ -131,7 +131,7 @@ - + groupBox2 @@ -142,7 +142,7 @@ unnamed - + kcfg_ShowShadows @@ -153,7 +153,7 @@ false - + kcfg_MiniTiles @@ -167,5 +167,5 @@ - + diff --git a/kmines/dialogs.cpp b/kmines/dialogs.cpp index ad956c30..a81c8d91 100644 --- a/kmines/dialogs.cpp +++ b/kmines/dialogs.cpp @@ -61,8 +61,8 @@ void Smiley::setMood(Mood mood) } //----------------------------------------------------------------------------- -DigitalClock::DigitalClock(TQWidget *parent) -: KGameLCDClock(parent, "digital_clock") +DigitalClock::DigitalClock(TQWidget *tqparent) +: KGameLCDClock(tqparent, "digital_clock") { setFrameStyle(Panel | Sunken); setDefaultBackgroundColor(black); @@ -165,7 +165,7 @@ void CustomConfig::updateNbMines() Level l(_width->value(), _height->value(), _mines->value()); _mines->setRange(1, Level::maxNbMines(l.width(), l.height())); _mines->setLabel(i18n("Mines (%1%):") - .arg( (100*l.nbMines()) / (l.width() * l.height()) )); + .tqarg( (100*l.nbMines()) / (l.width() * l.height()) )); _gameType->setCurrentItem(l.type()); _block = false; } @@ -249,7 +249,7 @@ GameConfig::GameConfig() void GameConfig::magicModified(bool on) { if ( !_magicDialogEnabled || !on ) return; - KMessageBox::information(this, i18n("When the \"magic\" reveal is on, you lose the ability to enter the highscores."), TQString::null, "magic_reveal_warning"); + KMessageBox::information(this, i18n("When the \"magic\" reveal is on, you lose the ability to enter the highscores."), TQString(), "magic_reveal_warning"); } //----------------------------------------------------------------------------- diff --git a/kmines/dialogs.h b/kmines/dialogs.h index 15321a49..f900f7e6 100644 --- a/kmines/dialogs.h +++ b/kmines/dialogs.h @@ -34,9 +34,10 @@ class KIntNumInput; class Smiley : public TQPushButton, public KMines { Q_OBJECT + TQ_OBJECT public: - Smiley(TQWidget *parent, const char *name = 0) - : TQPushButton(TQString::null, parent, name) {} + Smiley(TQWidget *tqparent, const char *name = 0) + : TQPushButton(TQString(), tqparent, name) {} public slots: void setMood(Mood); @@ -49,8 +50,9 @@ class Smiley : public TQPushButton, public KMines class DigitalClock : public KGameLCDClock { Q_OBJECT + TQ_OBJECT public: - DigitalClock(TQWidget *parent); + DigitalClock(TQWidget *tqparent); void reset(bool customGame); @@ -76,6 +78,7 @@ class DigitalClock : public KGameLCDClock class CustomConfig : public TQWidget, public KMines { Q_OBJECT + TQ_OBJECT public: CustomConfig(); @@ -100,6 +103,7 @@ class CustomConfig : public TQWidget, public KMines class GameConfig : public TQWidget, public KMines { Q_OBJECT + TQ_OBJECT public: GameConfig(); @@ -118,6 +122,7 @@ class GameConfig : public TQWidget, public KMines class AppearanceConfig : public TQWidget, public KMines { Q_OBJECT + TQ_OBJECT public: AppearanceConfig(); }; diff --git a/kmines/field.cpp b/kmines/field.cpp index ff3b4e46..582e6663 100644 --- a/kmines/field.cpp +++ b/kmines/field.cpp @@ -44,8 +44,8 @@ const Field::ActionData Field::ACTION_DATA[Nb_Actions] = { { "UnsetUncertain", "unset_uncertain", I18N_NOOP("Question mark unset") } }; -Field::Field(TQWidget *parent) - : FieldFrame(parent), _state(Init), _solvingState(Regular), _level(Level::Easy) +Field::Field(TQWidget *tqparent) + : FieldFrame(tqparent), _state(Init), _solvingState(Regular), _level(Level::Easy) {} void Field::readSettings() @@ -57,7 +57,7 @@ void Field::readSettings() if ( Settings::magicReveal() ) emit setCheating(); } -TQSize Field::sizeHint() const +TQSize Field::tqsizeHint() const { return TQSize(2*frameWidth() + _level.width()*Settings::caseSize(), 2*frameWidth() + _level.height()*Settings::caseSize()); @@ -117,7 +117,7 @@ void Field::changeCase(const Coord &p, CaseState newState) BaseField::changeCase(p, newState); TQPainter painter(this); drawCase(painter, p); - if ( isActive() ) emit updateStatus( hasMine(p) ); + if ( isActive() ) emit updatetqStatus( hasMine(p) ); } TQPoint Field::toPoint(const Coord &p) const diff --git a/kmines/field.h b/kmines/field.h index 7e079d65..4d17358f 100644 --- a/kmines/field.h +++ b/kmines/field.h @@ -27,6 +27,7 @@ class Field : public FieldFrame, public BaseField { Q_OBJECT + TQ_OBJECT public: enum ActionType { Reveal = 0, AutoReveal, SetFlag, UnsetFlag, SetUncertain, UnsetUncertain, Nb_Actions }; @@ -36,9 +37,9 @@ class Field : public FieldFrame, public BaseField static const ActionData ACTION_DATA[Nb_Actions]; public: - Field(TQWidget *parent); + Field(TQWidget *tqparent); - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; void setLevel(const Level &level); void setReplayField(const TQString &field); @@ -67,7 +68,7 @@ class Field : public FieldFrame, public BaseField SolvingState solvingState() const { return _solvingState; } signals: - void updateStatus(bool); + void updatetqStatus(bool); void gameStateChanged(GameState); void setMood(Mood); void setCheating(); diff --git a/kmines/frame.cpp b/kmines/frame.cpp index 6c9446c2..7c712383 100644 --- a/kmines/frame.cpp +++ b/kmines/frame.cpp @@ -26,8 +26,8 @@ #include "settings.h" -FieldFrame::FieldFrame(TQWidget *parent) - : TQFrame(parent, "field"), _button(0) +FieldFrame::FieldFrame(TQWidget *tqparent) + : TQFrame(tqparent, "field"), _button(0) { setFrameStyle( TQFrame::Box | TQFrame::Raised ); setLineWidth(2); @@ -36,65 +36,67 @@ FieldFrame::FieldFrame(TQWidget *parent) void FieldFrame::adjustSize() { - setFixedSize(sizeHint()); + setFixedSize(tqsizeHint()); _button.resize(Settings::caseSize(), Settings::caseSize()); - TQBitmap mask; + TQBitmap tqmask; for (uint i=0; iconfig(), group); - TQString name = cg.config()->readEntry("Name", TQString::null); + TQString name = cg.config()->readEntry("Name", TQString()); if ( name.isNull() ) return; if ( name.isEmpty() ) name = i18n("anonymous"); uint minutes = cg.config()->readUnsignedNumEntry("Min", 0); diff --git a/kmines/kzoommainwindow.cpp b/kmines/kzoommainwindow.cpp index 4e1b85a5..1d0f5319 100644 --- a/kmines/kzoommainwindow.cpp +++ b/kmines/kzoommainwindow.cpp @@ -30,11 +30,11 @@ KZoomMainWindow::KZoomMainWindow(uint min, uint max, uint step, const char *name { installEventFilter(this); - _zoomInAction = KStdAction::zoomIn(this, TQT_SLOT(zoomIn()), actionCollection()); + _zoomInAction = KStdAction::zoomIn(TQT_TQOBJECT(this), TQT_SLOT(zoomIn()), actionCollection()); _zoomOutAction = - KStdAction::zoomOut(this, TQT_SLOT(zoomOut()), actionCollection()); + KStdAction::zoomOut(TQT_TQOBJECT(this), TQT_SLOT(zoomOut()), actionCollection()); _menu = - KStdAction::showMenubar(this, TQT_SLOT(toggleMenubar()), actionCollection()); + KStdAction::showMenubar(TQT_TQOBJECT(this), TQT_SLOT(toggleMenubar()), actionCollection()); } void KZoomMainWindow::init(const char *popupName) @@ -58,7 +58,7 @@ void KZoomMainWindow::init(const char *popupName) void KZoomMainWindow::addWidget(TQWidget *widget) { widget->adjustSize(); - TQWidget *tlw = widget->topLevelWidget(); + TQWidget *tlw = widget->tqtopLevelWidget(); KZoomMainWindow *zm = static_cast(tlw->qt_cast("KZoomMainWindow")); Q_ASSERT(zm); @@ -74,7 +74,7 @@ void KZoomMainWindow::widgetDestroyed() bool KZoomMainWindow::eventFilter(TQObject *o, TQEvent *e) { if ( e->type()==TQEvent::LayoutHint ) - setFixedSize(minimumSize()); // because K/QMainWindow + setFixedSize(tqminimumSize()); // because K/TQMainWindow // does not manage fixed central widget // with hidden menubar... return KMainWindow::eventFilter(o, e); diff --git a/kmines/kzoommainwindow.h b/kmines/kzoommainwindow.h index d5c80bd4..e4353c2d 100644 --- a/kmines/kzoommainwindow.h +++ b/kmines/kzoommainwindow.h @@ -42,6 +42,7 @@ class KToggleAction; class KZoomMainWindow : public KMainWindow { Q_OBJECT + TQ_OBJECT public: /** Constructor. */ KZoomMainWindow(uint minZoom, uint maxZoom, uint zoomStep, @@ -49,7 +50,7 @@ public: /** Add a widget to be managed i.e. the adjustSize() method of the * widget is called whenever the zoom is changed. - * This function assumes that the topLevelWidget() is the KZoomMainWindow. + * This function assumes that the tqtopLevelWidget() is the KZoomMainWindow. */ static void addWidget(TQWidget *widget); diff --git a/kmines/main.cpp b/kmines/main.cpp index 6752e7a5..cead0eab 100644 --- a/kmines/main.cpp +++ b/kmines/main.cpp @@ -62,34 +62,34 @@ MainWidget::MainWidget() { KNotifyClient::startDaemon(); - _status = new Status(this); + _status = new tqStatus(this); connect(_status, TQT_SIGNAL(gameStateChangedSignal(KMines::GameState)), TQT_SLOT(gameStateChanged(KMines::GameState))); connect(_status, TQT_SIGNAL(pause()), TQT_SLOT(pause())); // Game & Popup - KStdGameAction::gameNew(_status, TQT_SLOT(restartGame()), actionCollection()); - _pause = KStdGameAction::pause(_status, TQT_SLOT(pauseGame()), + KStdGameAction::gameNew(TQT_TQOBJECT(_status), TQT_SLOT(restartGame()), actionCollection()); + _pause = KStdGameAction::pause(TQT_TQOBJECT(_status), TQT_SLOT(pauseGame()), actionCollection()); - KStdGameAction::highscores(this, TQT_SLOT(showHighscores()), + KStdGameAction::highscores(TQT_TQOBJECT(this), TQT_SLOT(showHighscores()), actionCollection()); - KStdGameAction::quit(qApp, TQT_SLOT(quit()), actionCollection()); + KStdGameAction::quit(TQT_TQOBJECT(tqApp), TQT_SLOT(quit()), actionCollection()); // keyboard _keybCollection = new KActionCollection(this); for (uint i=0; isetItems(list); - connect(_levels, TQT_SIGNAL(activated(int)), _status, TQT_SLOT(newGame(int))); + connect(_levels, TQT_SIGNAL(activated(int)), TQT_TQOBJECT(_status), TQT_SLOT(newGame(int))); // Adviser _advise = - KStdGameAction::hint(_status, TQT_SLOT(advise()), actionCollection()); - _solve = KStdGameAction::solve(_status, TQT_SLOT(solve()), actionCollection()); - (void)new KAction(i18n("Solving Rate..."), 0, _status, TQT_SLOT(solveRate()), + KStdGameAction::hint(TQT_TQOBJECT(_status), TQT_SLOT(advise()), actionCollection()); + _solve = KStdGameAction::solve(TQT_TQOBJECT(_status), TQT_SLOT(solve()), actionCollection()); + (void)new KAction(i18n("Solving Rate..."), 0, TQT_TQOBJECT(_status), TQT_SLOT(solveRate()), actionCollection(), "solve_rate"); // Log (void)new KAction(KGuiItem(i18n("View Log"), "viewmag"), 0, - _status, TQT_SLOT(viewLog()), + TQT_TQOBJECT(_status), TQT_SLOT(viewLog()), actionCollection(), "log_view"); (void)new KAction(KGuiItem(i18n("Replay Log"), "player_play"), - 0, _status, TQT_SLOT(replayLog()), + 0, TQT_TQOBJECT(_status), TQT_SLOT(replayLog()), actionCollection(), "log_replay"); (void)new KAction(KGuiItem(i18n("Save Log..."), "filesave"), 0, - _status, TQT_SLOT(saveLog()), + TQT_TQOBJECT(_status), TQT_SLOT(saveLog()), actionCollection(), "log_save"); (void)new KAction(KGuiItem(i18n("Load Log..."), "fileopen"), 0, - _status, TQT_SLOT(loadLog()), + TQT_TQOBJECT(_status), TQT_SLOT(loadLog()), actionCollection(), "log_load"); setupGUI( KMainWindow::Save | Create ); diff --git a/kmines/main.h b/kmines/main.h index 8cae018a..7fb10eda 100644 --- a/kmines/main.h +++ b/kmines/main.h @@ -26,11 +26,12 @@ class KAction; class KToggleAction; class KSelectAction; -class Status; +class tqStatus; class MainWidget : public KZoomMainWindow, public KMines { Q_OBJECT + TQ_OBJECT public: MainWidget(); @@ -49,7 +50,7 @@ class MainWidget : public KZoomMainWindow, public KMines virtual bool queryExit(); private: - Status *_status; + tqStatus *_status; KToggleAction *_pause; KSelectAction *_levels; KAction *_advise, *_solve; @@ -57,7 +58,7 @@ class MainWidget : public KZoomMainWindow, public KMines struct KeyData { const char *label, *name; - Qt::Key keycode; + TQt::Key keycode; const char *slot; }; enum Key { NB_KEYS = 11 }; diff --git a/kmines/solver/advFastRules.cpp b/kmines/solver/advFastRules.cpp index 79c42bba..56b97b72 100644 --- a/kmines/solver/advFastRules.cpp +++ b/kmines/solver/advFastRules.cpp @@ -159,9 +159,9 @@ void AdviseFast::RuleSet::addGeneral(Coord p){ int AdviseFast::Rule::leaks = 0; #endif -AdviseFast::Rule::Rule(RuleSet *parent) : - _parent(parent), - _facts(parent->facts) +AdviseFast::Rule::Rule(RuleSet *tqparent) : + _parent(tqparent), + _facts(tqparent->facts) { #if defined(DEBUG) && DEBUG >= 2 cout << "Rule::Rule, leaks = " << ++leaks << endl; @@ -177,8 +177,8 @@ AdviseFast::Rule::~Rule() AdviseFast::GeneralRule::GeneralRule( Coord fact, - RuleSet *parent) : - Rule(parent), + RuleSet *tqparent) : + Rule(tqparent), _fact(fact) {} @@ -242,8 +242,8 @@ bool AdviseFast::GeneralRule::apply(CoordSet *) AdviseFast::EmptyRule::EmptyRule( Coord fact, - RuleSet *parent) : - Rule(parent), + RuleSet *tqparent) : + Rule(tqparent), _fact(fact) {} @@ -285,8 +285,8 @@ bool AdviseFast::EmptyRule::apply( AdviseFast::FullRule::FullRule( Coord fact, - RuleSet *parent) : - Rule(parent), + RuleSet *tqparent) : + Rule(tqparent), _fact(fact) {} @@ -336,8 +336,8 @@ bool AdviseFast::FullRule::apply( AdviseFast::InclusionRule::InclusionRule( Coord bigger, Coord smaller, - RuleSet *parent) : - Rule(parent), + RuleSet *tqparent) : + Rule(tqparent), _bigger(bigger), _smaller(smaller) {} @@ -402,8 +402,8 @@ bool AdviseFast::InclusionRule::apply( AdviseFast::IntersectionRule::IntersectionRule( Coord bigger, Coord smaller, - RuleSet *parent) : - Rule(parent), + RuleSet *tqparent) : + Rule(tqparent), _bigger(bigger), _smaller(smaller) {} diff --git a/kmines/solver/headerP.h b/kmines/solver/headerP.h index 984e3113..6cecd458 100644 --- a/kmines/solver/headerP.h +++ b/kmines/solver/headerP.h @@ -107,7 +107,7 @@ namespace AdviseFast { */ class RuleSet; struct Rule { - Rule(RuleSet *parent); + Rule(RuleSet *tqparent); virtual ~Rule(); virtual bool apply(CoordSet *surePoints) = 0; diff --git a/kmines/solver/solver.cpp b/kmines/solver/solver.cpp index f8607b79..36519043 100644 --- a/kmines/solver/solver.cpp +++ b/kmines/solver/solver.cpp @@ -50,8 +50,8 @@ class SolverPrivate #endif }; -Solver::Solver(TQObject *parent) - : TQObject(parent) +Solver::Solver(TQObject *tqparent) + : TQObject(tqparent) { d = new SolverPrivate; @@ -186,9 +186,9 @@ bool Solver::solveOneStep(BaseField &field) //----------------------------------------------------------------------------- -SolvingRateDialog::SolvingRateDialog(const BaseField &field, TQWidget *parent) +SolvingRateDialog::SolvingRateDialog(const BaseField &field, TQWidget *tqparent) : KDialogBase(Plain, i18n("Compute Solving Rate"), Ok|Close, - Close, parent, "compute_solving_rate", true, true), + Close, tqparent, "compute_solving_rate", true, true), _refField(field) { connect(&_solver, TQT_SIGNAL(solvingDone(bool)), TQT_SLOT(solvingDone(bool))); @@ -198,13 +198,13 @@ SolvingRateDialog::SolvingRateDialog(const BaseField &field, TQWidget *parent) setButtonOK(item); TQVBoxLayout *top = new TQVBoxLayout(plainPage(), 0, spacingHint()); - TQLabel *label = new TQLabel(i18n("Width: %1").arg(field.width()), + TQLabel *label = new TQLabel(i18n("Width: %1").tqarg(field.width()), plainPage()); top->addWidget(label); - label = new TQLabel(i18n("Height: %1").arg(field.height()), plainPage()); + label = new TQLabel(i18n("Height: %1").tqarg(field.height()), plainPage()); top->addWidget(label); - label = new TQLabel(i18n("Mines: %1 (%2%)").arg(field.nbMines()) - .arg( field.nbMines() * 100.0 / field.size()), + label = new TQLabel(i18n("Mines: %1 (%2%)").tqarg(field.nbMines()) + .tqarg( field.nbMines() * 100.0 / field.size()), plainPage()); top->addWidget(label); @@ -243,7 +243,7 @@ void SolvingRateDialog::solvingDone(bool success) { if (success) _success++; _label->setText(i18n("Success rate: %1%") - .arg(_success * 100.0 / _i, 0, 'f', 3)); + .tqarg(_success * 100.0 / _i, 0, 'f', 3)); _progress->advance(1); TQTimer::singleShot(0, this, TQT_SLOT(step())); } diff --git a/kmines/solver/solver.h b/kmines/solver/solver.h index c90c56d1..07b8881a 100644 --- a/kmines/solver/solver.h +++ b/kmines/solver/solver.h @@ -29,11 +29,12 @@ class TQLabel; class KProgress; class SolverPrivate; -class Solver : public QObject +class Solver : public TQObject { Q_OBJECT + TQ_OBJECT public: - Solver(TQObject *parent = 0); + Solver(TQObject *tqparent = 0); ~Solver(); /** A method to advice a point placement */ @@ -62,8 +63,9 @@ class Solver : public QObject class SolvingRateDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - SolvingRateDialog(const BaseField &field, TQWidget *parent); + SolvingRateDialog(const BaseField &field, TQWidget *tqparent); private slots: void step(); diff --git a/kmines/status.cpp b/kmines/status.cpp index ec9dfc3e..6d20bf97 100644 --- a/kmines/status.cpp +++ b/kmines/status.cpp @@ -45,16 +45,16 @@ #include "version.h" -Status::Status(TQWidget *parent) - : TQWidget(parent, "status"), _oldLevel(Level::Easy) +tqStatus::tqStatus(TQWidget *tqparent) + : TQWidget(tqparent, "status"), _oldLevel(Level::Easy) { _timer = new TQTimer(this); connect(_timer, TQT_SIGNAL(timeout()), TQT_SLOT(replayStep())); - _solver = new Solver(this); + _solver = new Solver(TQT_TQOBJECT(this)); connect(_solver, TQT_SIGNAL(solvingDone(bool)), TQT_SLOT(solvingDone(bool))); -// top layout +// top tqlayout TQGridLayout *top = new TQGridLayout(this, 2, 5, 10, 10); top->setColStretch(1, 1); top->setColStretch(3, 1); @@ -74,7 +74,7 @@ Status::Status(TQWidget *parent) // smiley smiley = new Smiley(this); connect(smiley, TQT_SIGNAL(clicked()), TQT_SLOT(smileyClicked())); - smiley->setFocusPolicy(TQWidget::NoFocus); + smiley->setFocusPolicy(TQ_NoFocus); TQWhatsThis::add(smiley, i18n("Press to start a new game")); top->addWidget(smiley, 0, 2); @@ -93,7 +93,7 @@ Status::Status(TQWidget *parent) _field = new Field(_fieldContainer); _field->readSettings(); g->addWidget(_field, 0, 0, AlignCenter); - connect( _field, TQT_SIGNAL(updateStatus(bool)), TQT_SLOT(updateStatus(bool)) ); + connect( _field, TQT_SIGNAL(updatetqStatus(bool)), TQT_SLOT(updatetqStatus(bool)) ); connect(_field, TQT_SIGNAL(gameStateChanged(GameState)), TQT_SLOT(gameStateChangedSlot(GameState)) ); connect(_field, TQT_SIGNAL(setMood(Mood)), smiley, TQT_SLOT(setMood(Mood))); @@ -120,13 +120,13 @@ Status::Status(TQWidget *parent) top->addMultiCellWidget(_stack, 1, 1, 0, 4); } -void Status::smileyClicked() +void tqStatus::smileyClicked() { if ( _field->gameState()==Paused ) emit pause(); else restartGame(); } -void Status::newGame(int t) +void tqStatus::newGame(int t) { if ( _field->gameState()==Paused ) emit pause(); Level::Type type = (Level::Type)t; @@ -135,7 +135,7 @@ void Status::newGame(int t) else newGame( Settings::customLevel() ); } -void Status::newGame(const Level &level) +void tqStatus::newGame(const Level &level) { _timer->stop(); if ( level.type()!=Level::Custom ) @@ -143,14 +143,14 @@ void Status::newGame(const Level &level) _field->setLevel(level); } -bool Status::checkBlackMark() +bool tqStatus::checkBlackMark() { bool bm = ( _field->gameState()==Playing ); if (bm) KExtHighscore::submitScore(KExtHighscore::Lost, this); return bm; } -void Status::restartGame() +void tqStatus::restartGame() { if ( _field->gameState()==Paused ) emit pause(); else if ( _field->gameState()==Replaying ) { @@ -162,7 +162,7 @@ void Status::restartGame() } } -void Status::settingsChanged() +void tqStatus::settingsChanged() { _field->readSettings(); @@ -173,7 +173,7 @@ void Status::settingsChanged() newGame(l); } -void Status::updateStatus(bool mine) +void tqStatus::updatetqStatus(bool mine) { int r = _field->nbMines() - _field->nbMarked(); TQColor color = (r<0 && !_field->isSolved() ? red : white); @@ -184,7 +184,7 @@ void Status::updateStatus(bool mine) gameStateChanged(GameOver, true); // ends only for wins } -void Status::setGameOver(bool won) +void tqStatus::setGameOver(bool won) { if ( !won ) KNotifyClient::event(winId(), "explosion", i18n("Explosion!")); @@ -218,16 +218,16 @@ void Status::setGameOver(bool won) f.appendChild(data); } -void Status::setStopped() +void tqStatus::setStopped() { smiley->setMood(Normal); - updateStatus(false); + updatetqStatus(false); bool custom = ( _field->level().type()==Level::Custom ); dg->reset(custom); _field->setSolvingState(Regular); } -void Status::setPlaying() +void tqStatus::setPlaying() { smiley->setMood(Normal); dg->start(); @@ -238,7 +238,7 @@ void Status::setPlaying() _log = TQDomDocument("kmineslog"); _logRoot = _log.createElement("kmineslog"); _logRoot.setAttribute("version", SHORT_VERSION); - TQDateTime date = TQDateTime::currentDateTime(); + TQDateTime date = TQDateTime::tqcurrentDateTime(); _logRoot.setAttribute("date", date.toString(Qt::ISODate)); _logRoot.setAttribute("width", level.width()); _logRoot.setAttribute("height", level.height()); @@ -248,7 +248,7 @@ void Status::setPlaying() _logRoot.appendChild(_logList); } -void Status::gameStateChanged(GameState state, bool won) +void tqStatus::gameStateChanged(GameState state, bool won) { TQWidget *w = _fieldContainer; @@ -280,7 +280,7 @@ void Status::gameStateChanged(GameState state, bool won) emit gameStateChangedSignal(state); } -void Status::addAction(const KGrid2D::Coord &c, Field::ActionType type) +void tqStatus::addAction(const KGrid2D::Coord &c, Field::ActionType type) { TQDomElement action = _log.createElement("Action"); action.setAttribute("time", dg->pretty()); @@ -291,12 +291,12 @@ void Status::addAction(const KGrid2D::Coord &c, Field::ActionType type) dg->addAction(); } -void Status::advise() +void tqStatus::advise() { int res = KMessageBox::warningContinueCancel(this, i18n("When the solver gives " "you advice, your score will not be added to the highscores."), - TQString::null, TQString::null, "advice_warning"); + TQString(), TQString(), "advice_warning"); if ( res==KMessageBox::Cancel ) return; dg->setCheating(); float probability; @@ -304,25 +304,25 @@ void Status::advise() _field->setAdvised(c, probability); } -void Status::solve() +void tqStatus::solve() { dg->setCheating(); _solver->solve(*_field, false); _field->setSolvingState(Solved); } -void Status::solvingDone(bool success) +void tqStatus::solvingDone(bool success) { if ( !success ) gameStateChanged(GameOver, false); } -void Status::solveRate() +void tqStatus::solveRate() { SolvingRateDialog sd(*_field, this); sd.exec(); } -void Status::viewLog() +void tqStatus::viewLog() { KDialogBase d(this, "view_log", true, i18n("View Game Log"), KDialogBase::Close, KDialogBase::Close); @@ -335,9 +335,9 @@ void Status::viewLog() d.exec(); } -void Status::saveLog() +void tqStatus::saveLog() { - KURL url = KFileDialog::getSaveURL(TQString::null, TQString::null, this); + KURL url = KFileDialog::getSaveURL(TQString(), TQString(), this); if ( url.isEmpty() ) return; if ( KIO::NetAccess::exists(url, false, this) ) { KGuiItem gi = KStdGuiItem::save(); @@ -354,9 +354,9 @@ void Status::saveLog() tmp.unlink(); } -void Status::loadLog() +void tqStatus::loadLog() { - KURL url = KFileDialog::getOpenURL(TQString::null, TQString::null, this); + KURL url = KFileDialog::getOpenURL(TQString(), TQString(), this); if ( url.isEmpty() ) return; TQString tmpFile; bool success = false; @@ -368,7 +368,7 @@ void Status::loadLog() bool ok = doc.setContent(&file, 0, &errorLine); if ( !ok ) { KMessageBox::sorry(this, i18n("Cannot read XML file on line %1") - .arg(errorLine)); + .tqarg(errorLine)); return; } success = true; @@ -390,7 +390,7 @@ void Status::loadLog() } } -bool Status::checkLog(const TQDomDocument &doc) +bool tqStatus::checkLog(const TQDomDocument &doc) { // check root element if ( doc.doctype().name()!="kmineslog" ) return false; @@ -435,7 +435,7 @@ bool Status::checkLog(const TQDomDocument &doc) } -void Status::replayLog() +void tqStatus::replayLog() { uint w = _logRoot.attribute("width").toUInt(); uint h = _logRoot.attribute("height").toUInt(); @@ -454,7 +454,7 @@ void Status::replayLog() _timer->start(500); } -void Status::replayStep() +void tqStatus::replayStep() { if ( _index>=_actions.count() ) { _timer->stop(); diff --git a/kmines/status.h b/kmines/status.h index c7d44b36..3626473a 100644 --- a/kmines/status.h +++ b/kmines/status.h @@ -30,11 +30,12 @@ class Solver; class TQWidgetStack; class TQTimer; -class Status : public TQWidget, public KMines +class tqStatus : public TQWidget, public KMines { Q_OBJECT + TQ_OBJECT public : - Status(TQWidget *parent); + tqStatus(TQWidget *tqparent); const Level ¤tLevel() const { return _field->level(); } bool isPlaying() const { return _field->gameState()==Playing; } @@ -50,7 +51,7 @@ class Status : public TQWidget, public KMines public slots: void newGame(int type); void restartGame(); - void updateStatus(bool); + void updatetqStatus(bool); void pauseGame() { _field->pause(); } void moveUp() { _field->moveCursor(KGrid2D::SquareBase::Up); } diff --git a/knetwalk/src/cell.cpp b/knetwalk/src/cell.cpp index a08b0d78..7df96806 100644 --- a/knetwalk/src/cell.cpp +++ b/knetwalk/src/cell.cpp @@ -52,16 +52,16 @@ void Cell::initPixmaps() TQImage image = connectedpixmap[it.key()]->convertToImage(); for(int y = 0; y < image.height(); y++) { - QRgb* line = (QRgb*)image.scanLine(y); + TQRgb* line = (TQRgb*)image.scanLine(y); for(int x = 0; x < image.width(); x++) { - QRgb pix = line[x]; - if(qAlpha(pix) == 255) + TQRgb pix = line[x]; + if(tqAlpha(pix) == 255) { - int g = (255 + 4 * qGreen(pix)) / 5; - int b = (255 + 4 * qBlue(pix)) / 5; - int r = (255 + 4 * qRed(pix)) / 5; - line[x] = qRgb(r, g, b); + int g = (255 + 4 * tqGreen(pix)) / 5; + int b = (255 + 4 * tqBlue(pix)) / 5; + int r = (255 + 4 * tqRed(pix)) / 5; + line[x] = tqRgb(r, g, b); } } } @@ -69,7 +69,7 @@ void Cell::initPixmaps() } } -Cell::Cell(TQWidget* parent, int i) : TQWidget(parent, 0, WNoAutoErase) +Cell::Cell(TQWidget* tqparent, int i) : TQWidget(tqparent, 0, WNoAutoErase) { angle = 0; light = 0; @@ -203,11 +203,11 @@ void Cell::paintEvent(TQPaintEvent*) void Cell::mousePressEvent(TQMouseEvent* e) { - if(e->button() == LeftButton) + if(e->button() == Qt::LeftButton) emit lClicked(iindex); - else if(e->button() == RightButton) + else if(e->button() == Qt::RightButton) emit rClicked(iindex); - else if(e->button() == MidButton) + else if(e->button() == Qt::MidButton) emit mClicked(iindex); } diff --git a/knetwalk/src/cell.h b/knetwalk/src/cell.h index 8e51e349..f2423362 100644 --- a/knetwalk/src/cell.h +++ b/knetwalk/src/cell.h @@ -18,12 +18,13 @@ #include #include -class Cell : public QWidget +class Cell : public TQWidget { Q_OBJECT + TQ_OBJECT public: enum Dirs { Free = 0, U = 1, R = 2, D = 4, L = 8, None = 16 }; - Cell(TQWidget* parent, int i); + Cell(TQWidget* tqparent, int i); int index() const; void rotate(int a); void setDirs(Dirs d); diff --git a/knetwalk/src/highscores.cpp b/knetwalk/src/highscores.cpp index 4bcbf922..c0144002 100644 --- a/knetwalk/src/highscores.cpp +++ b/knetwalk/src/highscores.cpp @@ -34,7 +34,7 @@ namespace KExtHighscore TQMemArray s; s.duplicate(RANGE, 16); setScoreHistogram(s, ScoreNotBound); - //Item *item = new Item((uint)0, i18n("Clicks"), Qt::AlignRight); + //Item *item = new Item((uint)0, i18n("Clicks"), TQt::AlignRight); //addScoreItem("nb_actions", item); } @@ -47,7 +47,7 @@ namespace KExtHighscore case I18N: return i18n(level[gameType]); case WW: return data.wwLabel; } - return TQString::null;*/ + return TQString();*/ return i18n(levels[gameType]); } @@ -64,7 +64,7 @@ namespace KExtHighscore } KConfigGroupSaver cg(kapp->config(), group); - TQString name = cg.config()->readEntry("Name", TQString::null); + TQString name = cg.config()->readEntry("Name", TQString()); if ( name.isNull() ) return; if ( name.isEmpty() ) name = i18n("anonymous"); int score = cg.config()->readNumEntry("score", 0); diff --git a/knetwalk/src/mainwindow.cpp b/knetwalk/src/mainwindow.cpp index 17fa9b82..21de29c0 100644 --- a/knetwalk/src/mainwindow.cpp +++ b/knetwalk/src/mainwindow.cpp @@ -52,8 +52,8 @@ static TQMap contrdirs; -MainWindow::MainWindow(TQWidget *parent, const char* name, WFlags /*fl*/) : - KMainWindow(parent, name, WStyle_NoBorder) +MainWindow::MainWindow(TQWidget *tqparent, const char* name, WFlags /*fl*/) : + KMainWindow(tqparent, name, WStyle_NoBorder) { m_clickcount = 0; @@ -64,11 +64,11 @@ MainWindow::MainWindow(TQWidget *parent, const char* name, WFlags /*fl*/) : KNotifyClient::startDaemon(); - KStdGameAction::gameNew(this, TQT_SLOT(slotNewGame()), actionCollection()); + KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(slotNewGame()), actionCollection()); - KStdGameAction::highscores(this, TQT_SLOT(showHighscores()), actionCollection()); - KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); - KStdGameAction::configureHighscores(this, TQT_SLOT(configureHighscores()), actionCollection()); + KStdGameAction::highscores(TQT_TQOBJECT(this), TQT_SLOT(showHighscores()), actionCollection()); + KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); + KStdGameAction::configureHighscores(TQT_TQOBJECT(this), TQT_SLOT(configureHighscores()), actionCollection()); m_levels = KStdGameAction::chooseGameType(0, 0, actionCollection()); TQStringList lst; @@ -78,7 +78,7 @@ MainWindow::MainWindow(TQWidget *parent, const char* name, WFlags /*fl*/) : lst += i18n("Master"); m_levels->setItems(lst); - setFixedSize(minimumSizeHint()); + setFixedSize(tqminimumSizeHint()); statusBar()->insertItem("abcdefghijklmnopqrst: 0 ",1); setAutoSaveSettings(); @@ -149,7 +149,7 @@ void MainWindow::newGame(int sk) m_clickcount = 0; TQString clicks = i18n("Click: %1"); - statusBar()->changeItem(clicks.arg(TQString::number(m_clickcount)),1); + statusBar()->changeItem(clicks.tqarg(TQString::number(m_clickcount)),1); KNotifyClient::event(winId(), "startsound", i18n("New Game")); for(int i = 0; i < MasterBoardSize * MasterBoardSize; i++) @@ -370,7 +370,7 @@ void MainWindow::rotate(int index, bool toleft) m_clickcount++; TQString clicks = i18n("Click: %1"); - statusBar()->changeItem(clicks.arg(TQString::number(m_clickcount)),1); + statusBar()->changeItem(clicks.tqarg(TQString::number(m_clickcount)),1); if (isGameOver()) { diff --git a/knetwalk/src/mainwindow.h b/knetwalk/src/mainwindow.h index e88fab6a..40402930 100644 --- a/knetwalk/src/mainwindow.h +++ b/knetwalk/src/mainwindow.h @@ -27,8 +27,9 @@ class KSelectAction; class MainWindow : public KMainWindow { Q_OBJECT + TQ_OBJECT public: - MainWindow(TQWidget *parent=0, const char* name=0, WFlags fl=0); + MainWindow(TQWidget *tqparent=0, const char* name=0, WFlags fl=0); protected: virtual void closeEvent(TQCloseEvent*); private: diff --git a/kolf/ball.cpp b/kolf/ball.cpp index 9ac849bc..569a5ba2 100644 --- a/kolf/ball.cpp +++ b/kolf/ball.cpp @@ -33,7 +33,7 @@ Ball::Ball(TQCanvas *canvas) //font.setPixelSize(10); label = new TQCanvasText("", font, canvas); label->setColor(white); - label->setVisible(false); + label->tqsetVisible(false); // this sets z setState(Stopped); @@ -249,7 +249,7 @@ void Ball::collisionDetect(double oldx, double oldy) m_collisionLock = true; // move this ball to where it was barely touching double ballAngle = m_vector.direction(); - while (collisions(true).contains(item) > 0) + while (collisions(true).tqcontains(item) > 0) move(x() - cos(ballAngle) / 2.0, y() + sin(ballAngle) / 2.0); // make a 2 pixel separation @@ -308,10 +308,10 @@ void Ball::collisionDetect(double oldx, double oldy) for (iterpoint = points.first(); iterpoint; iterpoint = points.next()) { //kdDebug(12007) << "-----\n"; - const Wall *parentWall = iterpoint->parentWall(); - const TQPoint qp(iterpoint->x() + parentWall->x(), iterpoint->y() + parentWall->y()); + const Wall *tqparentWall = iterpoint->tqparentWall(); + const TQPoint qp(iterpoint->x() + tqparentWall->x(), iterpoint->y() + tqparentWall->y()); const Point p(qp.x(), qp.y()); - const TQPoint qother = TQPoint(parentWall->startPoint() == qp? parentWall->endPoint() : parentWall->startPoint()) + TQPoint(parentWall->x(), parentWall->y()); + const TQPoint qother = TQPoint(tqparentWall->startPoint() == qp? tqparentWall->endPoint() : tqparentWall->startPoint()) + TQPoint(tqparentWall->x(), tqparentWall->y()); const Point other(qother.x(), qother.y()); // vector of wall @@ -438,12 +438,12 @@ BallState Ball::currentState() void Ball::showInfo() { - label->setVisible(isVisible()); + label->tqsetVisible(isVisible()); } void Ball::hideInfo() { - label->setVisible(false); + label->tqsetVisible(false); } void Ball::setName(const TQString &name) @@ -459,8 +459,8 @@ void Ball::setCanvas(TQCanvas *c) void Ball::setVisible(bool yes) { - TQCanvasEllipse::setVisible(yes); + TQCanvasEllipse::tqsetVisible(yes); - label->setVisible(yes && game && game->isInfoShowing()); + label->tqsetVisible(yes && game && game->isInfoShowing()); } diff --git a/kolf/canvasitem.h b/kolf/canvasitem.h index ed897d27..277fb15d 100644 --- a/kolf/canvasitem.h +++ b/kolf/canvasitem.h @@ -113,7 +113,7 @@ public: */ virtual void clean() {}; /** - * scale factor changed (game->scaleFactor(), the world matrix is game->worldMatrix()) + * scale factor changed (game->scaleFactor(), the world matrix is game->tqworldMatrix()) * NOTE: not used in Kolf 1.1, which comes with KDE 3.1. */ virtual void scaleChanged() {}; @@ -125,7 +125,7 @@ public: * returns a Config that can be used to configure this item by the user. * The default implementation returns one that says 'No configuration options'. */ - virtual Config *config(TQWidget *parent) { return new DefaultConfig(parent); } + virtual Config *config(TQWidget *tqparent) { return new DefaultConfig(tqparent); } /** * returns other items that should be moveable (besides this one of course). */ diff --git a/kolf/config.cpp b/kolf/config.cpp index 7c333755..54618a45 100644 --- a/kolf/config.cpp +++ b/kolf/config.cpp @@ -6,8 +6,8 @@ #include "config.h" -Config::Config(TQWidget *parent, const char *name) - : TQFrame(parent, name) +Config::Config(TQWidget *tqparent, const char *name) + : TQFrame(tqparent, name) { startedUp = false; } @@ -33,15 +33,15 @@ void Config::changed() emit modified(); } -MessageConfig::MessageConfig(TQString text, TQWidget *parent, const char *name) - : Config(parent, name) +MessageConfig::MessageConfig(TQString text, TQWidget *tqparent, const char *name) + : Config(tqparent, name) { - TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); - layout->addWidget(new TQLabel(text, this)); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); + tqlayout->addWidget(new TQLabel(text, this)); } -DefaultConfig::DefaultConfig(TQWidget *parent, const char *name) - : MessageConfig(i18n("No configuration options"), parent, name) +DefaultConfig::DefaultConfig(TQWidget *tqparent, const char *name) + : MessageConfig(i18n("No configuration options"), tqparent, name) { } diff --git a/kolf/config.h b/kolf/config.h index 4e0f26a6..5ca9892f 100644 --- a/kolf/config.h +++ b/kolf/config.h @@ -3,12 +3,13 @@ #include -class Config : public QFrame +class Config : public TQFrame { Q_OBJECT + TQ_OBJECT public: - Config(TQWidget *parent, const char *name = 0); + Config(TQWidget *tqparent, const char *name = 0); void ctorDone(); signals: @@ -25,18 +26,20 @@ protected: class MessageConfig : public Config { Q_OBJECT + TQ_OBJECT public: - MessageConfig(TQString text, TQWidget *parent, const char *name = 0); + MessageConfig(TQString text, TQWidget *tqparent, const char *name = 0); }; // internal class DefaultConfig : public MessageConfig { Q_OBJECT + TQ_OBJECT public: - DefaultConfig(TQWidget *parent, const char *name = 0); + DefaultConfig(TQWidget *tqparent, const char *name = 0); }; #endif diff --git a/kolf/editor.cpp b/kolf/editor.cpp index ae9cde32..88e3c375 100644 --- a/kolf/editor.cpp +++ b/kolf/editor.cpp @@ -9,19 +9,19 @@ #include "editor.h" #include "game.h" -Editor::Editor(ObjectList *list, TQWidget *parent, const char *name) - : TQWidget(parent, name) +Editor::Editor(ObjectList *list, TQWidget *tqparent, const char *name) + : TQWidget(tqparent, name) { this->list = list; config = 0; - hlayout = new TQHBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + htqlayout = new TQHBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); - TQVBoxLayout *vlayout = new TQVBoxLayout(hlayout, KDialog::spacingHint()); - vlayout->addWidget(new TQLabel(i18n("Add object:"), this)); + TQVBoxLayout *vtqlayout = new TQVBoxLayout(htqlayout, KDialog::spacingHint()); + vtqlayout->addWidget(new TQLabel(i18n("Add object:"), this)); listbox = new KListBox(this, "Listbox"); - vlayout->addWidget(listbox); - hlayout->setStretchFactor(vlayout, 2); + vtqlayout->addWidget(listbox); + htqlayout->setStretchFactor(vtqlayout, 2); TQStringList items; Object *obj = 0; @@ -49,8 +49,8 @@ void Editor::setItem(CanvasItem *item) if (!config) return; config->ctorDone(); - hlayout->addWidget(config); - hlayout->setStretchFactor(config, 2); + htqlayout->addWidget(config); + htqlayout->setStretchFactor(config, 2); config->setFrameStyle(TQFrame::Box | TQFrame::Raised); config->setLineWidth(1); config->show(); diff --git a/kolf/editor.h b/kolf/editor.h index 1280772f..8ee1b93a 100644 --- a/kolf/editor.h +++ b/kolf/editor.h @@ -10,9 +10,10 @@ class TQHBoxLayout; class TQListBoxItem; class Config; -class Editor : public QWidget +class Editor : public TQWidget { Q_OBJECT + TQ_OBJECT public: Editor(ObjectList *list, TQWidget * = 0, const char * = 0); @@ -29,7 +30,7 @@ private slots: private: ObjectList *list; - TQHBoxLayout *hlayout; + TQHBoxLayout *htqlayout; KListBox *listbox; Config *config; }; diff --git a/kolf/floater.cpp b/kolf/floater.cpp index ff42398a..1d33a2ca 100644 --- a/kolf/floater.cpp +++ b/kolf/floater.cpp @@ -39,9 +39,9 @@ void FloaterGuide::setPoints(int xa, int ya, int xb, int yb) } } -Config *FloaterGuide::config(TQWidget *parent) +Config *FloaterGuide::config(TQWidget *tqparent) { - return floater->config(parent); + return floater->config(tqparent); } ///////////////////////// @@ -253,18 +253,18 @@ void Floater::firstMove(int x, int y) ///////////////////////// -FloaterConfig::FloaterConfig(Floater *floater, TQWidget *parent) - : BridgeConfig(floater, parent) +FloaterConfig::FloaterConfig(Floater *floater, TQWidget *tqparent) + : BridgeConfig(floater, tqparent) { this->floater = floater; - m_vlayout->addStretch(); + m_vtqlayout->addStretch(); - m_vlayout->addWidget(new TQLabel(i18n("Moving speed"), this)); - TQHBoxLayout *hlayout = new TQHBoxLayout(m_vlayout, spacingHint()); - hlayout->addWidget(new TQLabel(i18n("Slow"), this)); + m_vtqlayout->addWidget(new TQLabel(i18n("Moving speed"), this)); + TQHBoxLayout *htqlayout = new TQHBoxLayout(m_vtqlayout, spacingHint()); + htqlayout->addWidget(new TQLabel(i18n("Slow"), this)); TQSlider *slider = new TQSlider(0, 20, 2, floater->curSpeed(), Qt::Horizontal, this); - hlayout->addWidget(slider); - hlayout->addWidget(new TQLabel(i18n("Fast"), this)); + htqlayout->addWidget(slider); + htqlayout->addWidget(new TQLabel(i18n("Fast"), this)); connect(slider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(speedChanged(int))); } diff --git a/kolf/floater.h b/kolf/floater.h index c22a8084..fbbe10ec 100644 --- a/kolf/floater.h +++ b/kolf/floater.h @@ -7,9 +7,10 @@ class Floater; class FloaterConfig : public BridgeConfig { Q_OBJECT + TQ_OBJECT public: - FloaterConfig(Floater *floater, TQWidget *parent); + FloaterConfig(Floater *floater, TQWidget *tqparent); private slots: void speedChanged(int news); @@ -24,7 +25,7 @@ public: FloaterGuide(Floater *floater, TQCanvas *canvas) : Wall(canvas) { this->floater = floater; almostDead = false; } virtual void setPoints(int xa, int ya, int xb, int yb); virtual void moveBy(double dx, double dy); - virtual Config *config(TQWidget *parent); + virtual Config *config(TQWidget *tqparent); virtual void aboutToDelete(); virtual void aboutToDie(); @@ -51,7 +52,7 @@ public: virtual void editModeChanged(bool changed); virtual bool moveable() const { return false; } virtual void moveBy(double dx, double dy); - virtual Config *config(TQWidget *parent) { return new FloaterConfig(this, parent); } + virtual Config *config(TQWidget *tqparent) { return new FloaterConfig(this, tqparent); } virtual TQPtrList moveableItems() const; virtual void advance(int phase); void setSpeed(int news); diff --git a/kolf/game.cpp b/kolf/game.cpp index d76ec2bc..1a7bfe4d 100644 --- a/kolf/game.cpp +++ b/kolf/game.cpp @@ -58,12 +58,12 @@ inline TQString makeGroup(int id, int hole, TQString name, int x, int y) { - return TQString("%1-%2@%3,%4|%5").arg(hole).arg(name).arg(x).arg(y).arg(id); + return TQString("%1-%2@%3,%4|%5").tqarg(hole).tqarg(name).tqarg(x).tqarg(y).tqarg(id); } inline TQString makeStateGroup(int id, const TQString &name) { - return TQString("%1|%2").arg(name).arg(id); + return TQString("%1|%2").tqarg(name).tqarg(id); } ///////////////////////// @@ -101,13 +101,13 @@ void RectPoint::moveBy(double dx, double dy) rect->newSize(nw, nh); } -Config *RectPoint::config(TQWidget *parent) +Config *RectPoint::config(TQWidget *tqparent) { CanvasItem *citem = dynamic_cast(rect); if (citem) - return citem->config(parent); + return citem->config(tqparent); else - return CanvasItem::config(parent); + return CanvasItem::config(tqparent); } ///////////////////////// @@ -144,9 +144,9 @@ void Arrow::setZ(double newz) void Arrow::setVisible(bool yes) { - TQCanvasLine::setVisible(yes); - line1->setVisible(yes); - line2->setVisible(yes); + TQCanvasLine::tqsetVisible(yes); + line1->tqsetVisible(yes); + line2->tqsetVisible(yes); } void Arrow::moveBy(double dx, double dy) @@ -192,28 +192,28 @@ void Arrow::updateSelf() ///////////////////////// -BridgeConfig::BridgeConfig(Bridge *bridge, TQWidget *parent) - : Config(parent) +BridgeConfig::BridgeConfig(Bridge *bridge, TQWidget *tqparent) + : Config(tqparent) { this->bridge = bridge; - m_vlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); - TQGridLayout *layout = new TQGridLayout(m_vlayout, 2, 3, spacingHint()); - layout->addWidget(new TQLabel(i18n("Walls on:"), this), 0, 0); + m_vtqlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); + TQGridLayout *tqlayout = new TQGridLayout(m_vtqlayout, 2, 3, spacingHint()); + tqlayout->addWidget(new TQLabel(i18n("Walls on:"), this), 0, 0); top = new TQCheckBox(i18n("&Top"), this); - layout->addWidget(top, 0, 1); + tqlayout->addWidget(top, 0, 1); connect(top, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(topWallChanged(bool))); top->setChecked(bridge->topWallVisible()); bot = new TQCheckBox(i18n("&Bottom"), this); - layout->addWidget(bot, 1, 1); + tqlayout->addWidget(bot, 1, 1); connect(bot, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(botWallChanged(bool))); bot->setChecked(bridge->botWallVisible()); left = new TQCheckBox(i18n("&Left"), this); - layout->addWidget(left, 1, 0); + tqlayout->addWidget(left, 1, 0); connect(left, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(leftWallChanged(bool))); left->setChecked(bridge->leftWallVisible()); right = new TQCheckBox(i18n("&Right"), this); - layout->addWidget(right, 1, 2); + tqlayout->addWidget(right, 1, 2); connect(right, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(rightWallChanged(bool))); right->setChecked(bridge->rightWallVisible()); } @@ -249,7 +249,7 @@ Bridge::Bridge(TQRect rect, TQCanvas *canvas) { TQColor color("#92772D"); setBrush(TQBrush(color)); - setPen(NoPen); + setPen(Qt::NoPen); setZ(998); topWall = new Wall(canvas); @@ -264,10 +264,10 @@ Bridge::Bridge(TQRect rect, TQCanvas *canvas) setWallZ(z() + 0.01); setWallColor(color); - topWall->setVisible(false); - botWall->setVisible(false); - leftWall->setVisible(false); - rightWall->setVisible(false); + topWall->tqsetVisible(false); + botWall->tqsetVisible(false); + leftWall->tqsetVisible(false); + rightWall->tqsetVisible(false); point = new RectPoint(color, this, canvas); editModeChanged(false); @@ -321,7 +321,7 @@ void Bridge::aboutToDie() void Bridge::editModeChanged(bool changed) { - point->setVisible(changed); + point->tqsetVisible(changed); moveBy(0, 0); } @@ -401,22 +401,22 @@ void Bridge::setSize(int width, int height) ///////////////////////// -WindmillConfig::WindmillConfig(Windmill *windmill, TQWidget *parent) - : BridgeConfig(windmill, parent) +WindmillConfig::WindmillConfig(Windmill *windmill, TQWidget *tqparent) + : BridgeConfig(windmill, tqparent) { this->windmill = windmill; - m_vlayout->addStretch(); + m_vtqlayout->addStretch(); TQCheckBox *check = new TQCheckBox(i18n("Windmill on bottom"), this); check->setChecked(windmill->bottom()); connect(check, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(endChanged(bool))); - m_vlayout->addWidget(check); + m_vtqlayout->addWidget(check); - TQHBoxLayout *hlayout = new TQHBoxLayout(m_vlayout, spacingHint()); - hlayout->addWidget(new TQLabel(i18n("Slow"), this)); + TQHBoxLayout *htqlayout = new TQHBoxLayout(m_vtqlayout, spacingHint()); + htqlayout->addWidget(new TQLabel(i18n("Slow"), this)); TQSlider *slider = new TQSlider(1, 10, 1, windmill->curSpeed(), Qt::Horizontal, this); - hlayout->addWidget(slider); - hlayout->addWidget(new TQLabel(i18n("Fast"), this)); + htqlayout->addWidget(slider); + htqlayout->addWidget(new TQLabel(i18n("Fast"), this)); connect(slider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(speedChanged(int))); endChanged(check->isChecked()); @@ -454,7 +454,7 @@ Windmill::Windmill(TQRect rect, TQCanvas *canvas) { guard = new WindmillGuard(canvas); guard->setPen(TQPen(black, 5)); - guard->setVisible(true); + guard->tqsetVisible(true); guard->setAlwaysShow(true); setSpeed(5); guard->setZ(wallZ() + .1); @@ -467,8 +467,8 @@ Windmill::Windmill(TQRect rect, TQCanvas *canvas) right->setAlwaysShow(true); left->setZ(wallZ()); right->setZ(wallZ()); - left->setVisible(true); - right->setVisible(true); + left->tqsetVisible(true); + right->tqsetVisible(true); setTopWallVisible(false); setBotWallVisible(false); @@ -629,24 +629,24 @@ void Sign::draw(TQPainter &painter) TQSimpleRichText txt(m_text, kapp->font()); const int indent = wallPen().width() + 3; txt.setWidth(width() - 2*indent); - TQColorGroup colorGroup; - colorGroup.setColor(TQColorGroup::Foreground, black); - colorGroup.setColor(TQColorGroup::Text, black); - colorGroup.setColor(TQColorGroup::Background, black); - colorGroup.setColor(TQColorGroup::Base, black); - txt.draw(&painter, x() + indent, y(), TQRect(x() + indent, y(), width() - indent, height() - indent), colorGroup); + TQColorGroup tqcolorGroup; + tqcolorGroup.setColor(TQColorGroup::Foreground, black); + tqcolorGroup.setColor(TQColorGroup::Text, black); + tqcolorGroup.setColor(TQColorGroup::Background, black); + tqcolorGroup.setColor(TQColorGroup::Base, black); + txt.draw(&painter, x() + indent, y(), TQRect(x() + indent, y(), width() - indent, height() - indent), tqcolorGroup); } ///////////////////////// -SignConfig::SignConfig(Sign *sign, TQWidget *parent) - : BridgeConfig(sign, parent) +SignConfig::SignConfig(Sign *sign, TQWidget *tqparent) + : BridgeConfig(sign, tqparent) { this->sign = sign; - m_vlayout->addStretch(); - m_vlayout->addWidget(new TQLabel(i18n("Sign HTML:"), this)); + m_vtqlayout->addStretch(); + m_vtqlayout->addWidget(new TQLabel(i18n("Sign HTML:"), this)); KLineEdit *name = new KLineEdit(sign->text(), this); - m_vlayout->addWidget(name); + m_vtqlayout->addWidget(name); connect(name, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(textChanged(const TQString &))); } @@ -658,25 +658,25 @@ void SignConfig::textChanged(const TQString &text) ///////////////////////// -EllipseConfig::EllipseConfig(Ellipse *ellipse, TQWidget *parent) - : Config(parent), slow1(0), fast1(0), slow2(0), fast2(0), slider1(0), slider2(0) +EllipseConfig::EllipseConfig(Ellipse *ellipse, TQWidget *tqparent) + : Config(tqparent), slow1(0), fast1(0), slow2(0), fast2(0), slider1(0), slider2(0) { this->ellipse = ellipse; - m_vlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); + m_vtqlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); TQCheckBox *check = new TQCheckBox(i18n("Enable show/hide"), this); - m_vlayout->addWidget(check); + m_vtqlayout->addWidget(check); connect(check, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(check1Changed(bool))); check->setChecked(ellipse->changeEnabled()); - TQHBoxLayout *hlayout = new TQHBoxLayout(m_vlayout, spacingHint()); + TQHBoxLayout *htqlayout = new TQHBoxLayout(m_vtqlayout, spacingHint()); slow1 = new TQLabel(i18n("Slow"), this); - hlayout->addWidget(slow1); + htqlayout->addWidget(slow1); slider1 = new TQSlider(1, 100, 5, 100 - ellipse->changeEvery(), Qt::Horizontal, this); - hlayout->addWidget(slider1); + htqlayout->addWidget(slider1); fast1 = new TQLabel(i18n("Fast"), this); - hlayout->addWidget(fast1); + htqlayout->addWidget(fast1); connect(slider1, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(value1Changed(int))); @@ -684,7 +684,7 @@ EllipseConfig::EllipseConfig(Ellipse *ellipse, TQWidget *parent) // TODO add slider2 and friends and make it possible for ellipses to grow and contract - m_vlayout->addStretch(); + m_vtqlayout->addStretch(); } void EllipseConfig::value1Changed(int news) @@ -733,7 +733,7 @@ Ellipse::Ellipse(TQCanvas *canvas) setChangeEnabled(false); setChangeEvery(50); count = 0; - setVisible(true); + tqsetVisible(true); point = new RectPoint(black, this, canvas); point->setSizeFactor(2.0); @@ -750,7 +750,7 @@ void Ellipse::setChangeEnabled(bool changeEnabled) setAnimated(m_changeEnabled); if (!m_changeEnabled) - setVisible(true); + tqsetVisible(true); } TQPtrList Ellipse::moveableItems() const @@ -775,7 +775,7 @@ void Ellipse::moveBy(double dx, double dy) void Ellipse::editModeChanged(bool changed) { - point->setVisible(changed); + point->tqsetVisible(changed); moveBy(0, 0); } @@ -788,7 +788,7 @@ void Ellipse::advance(int phase) if (count > (m_changeEvery + 10) * 1.8) count = 0; if (count == 0) - setVisible(!isVisible()); + tqsetVisible(!isVisible()); count++; } @@ -812,14 +812,14 @@ void Ellipse::save(KConfig *cfg) cfg->writeEntry("height", height()); } -Config *Ellipse::config(TQWidget *parent) +Config *Ellipse::config(TQWidget *tqparent) { - return new EllipseConfig(this, parent); + return new EllipseConfig(this, tqparent); } void Ellipse::aboutToSave() { - setVisible(true); + tqsetVisible(true); dontHide = true; } @@ -838,7 +838,7 @@ Puddle::Puddle(TQCanvas *canvas) TQBrush brush; TQPixmap pic; - if (!TQPixmapCache::find("puddle", pic)) + if (!TQPixmapCache::tqfind("puddle", pic)) { pic.load(locate("appdata", "pics/puddle.png")); TQPixmapCache::insert("puddle", pic); @@ -860,7 +860,7 @@ bool Puddle::collision(Ball *ball, long int /*id*/) if (ball->isVisible()) { TQCanvasRectangle i(TQRect(ball->x(), ball->y(), 1, 1), canvas()); - i.setVisible(true); + i.tqsetVisible(true); // is center of ball in? if (i.collidesWith(this)/* && ball->curVector().magnitude() < 4*/) @@ -868,7 +868,7 @@ bool Puddle::collision(Ball *ball, long int /*id*/) playSound("puddle"); ball->setAddStroke(ball->addStroke() + 1); ball->setPlaceOnGround(true); - ball->setVisible(false); + ball->tqsetVisible(false); ball->setState(Stopped); ball->setVelocity(0, 0); if (game && game->curBall() == ball) @@ -891,7 +891,7 @@ Sand::Sand(TQCanvas *canvas) TQBrush brush; TQPixmap pic; - if (!TQPixmapCache::find("sand", pic)) + if (!TQPixmapCache::tqfind("sand", pic)) { pic.load(locate("appdata", "pics/sand.png")); TQPixmapCache::insert("sand", pic); @@ -911,7 +911,7 @@ Sand::Sand(TQCanvas *canvas) bool Sand::collision(Ball *ball, long int /*id*/) { TQCanvasRectangle i(TQRect(ball->x(), ball->y(), 1, 1), canvas()); - i.setVisible(true); + i.tqsetVisible(true); // is center of ball in? if (i.collidesWith(this)/* && ball->curVector().magnitude() < 4*/) @@ -954,12 +954,12 @@ Putter::Putter(TQCanvas *canvas) void Putter::showInfo() { - guideLine->setVisible(isVisible()); + guideLine->tqsetVisible(isVisible()); } void Putter::hideInfo() { - guideLine->setVisible(m_showGuideLine? isVisible() : false); + guideLine->tqsetVisible(m_showGuideLine? isVisible() : false); } void Putter::moveBy(double dx, double dy) @@ -976,8 +976,8 @@ void Putter::setShowGuideLine(bool yes) void Putter::setVisible(bool yes) { - TQCanvasLine::setVisible(yes); - guideLine->setVisible(m_showGuideLine? yes : false); + TQCanvasLine::tqsetVisible(yes); + guideLine->tqsetVisible(m_showGuideLine? yes : false); } void Putter::setOrigin(int _x, int _y) @@ -990,7 +990,7 @@ void Putter::setOrigin(int _x, int _y) void Putter::setAngle(Ball *ball) { - angle = angleMap.contains(ball)? angleMap[ball] : 0; + angle = angleMap.tqcontains(ball)? angleMap[ball] : 0; finishMe(); } @@ -1002,11 +1002,11 @@ void Putter::go(Direction d, Amount amount) { case Forwards: len -= 1; - guideLine->setVisible(false); + guideLine->tqsetVisible(false); break; case Backwards: len += 1; - guideLine->setVisible(false); + guideLine->tqsetVisible(false); break; case D_Left: angle += addition; @@ -1085,7 +1085,7 @@ void Bumper::moveBy(double dx, double dy) void Bumper::editModeChanged(bool changed) { - inside->setVisible(!changed); + inside->tqsetVisible(!changed); } void Bumper::advance(int phase) @@ -1166,7 +1166,7 @@ HoleResult Hole::result(TQPoint p, double s, bool * /*wasCenter*/) return Result_Miss; TQCanvasRectangle i(TQRect(p, TQSize(1, 1)), canvas()); - i.setVisible(true); + i.tqsetVisible(true); // is center of ball in cup? if (i.collidesWith(this)) @@ -1182,7 +1182,7 @@ HoleResult Hole::result(TQPoint p, double s, bool * /*wasCenter*/) Cup::Cup(TQCanvas *canvas) : Hole(TQColor("#808080"), canvas) { - if (!TQPixmapCache::find("cup", pixmap)) + if (!TQPixmapCache::tqfind("cup", pixmap)) { pixmap.load(locate("appdata", "pics/cup.png")); TQPixmapCache::insert("cup", pixmap); @@ -1222,7 +1222,7 @@ BlackHole::BlackHole(TQCanvas *canvas) m_maxSpeed = 5.0; runs = 0; - const TQColor myColor((QRgb)(kapp->random() % 0x01000000)); + const TQColor myColor((TQRgb)(kapp->random() % 0x01000000)); outside = new TQCanvasEllipse(canvas); outside->setZ(z() - .001); @@ -1238,7 +1238,7 @@ BlackHole::BlackHole(TQCanvas *canvas) setSize(width(), width() / .8); const float factor = 1.3; outside->setSize(width() * factor, height() * factor); - outside->setVisible(true); + outside->tqsetVisible(true); moveBy(0, 0); @@ -1249,7 +1249,7 @@ void BlackHole::showInfo() { delete infoLine; infoLine = new TQCanvasLine(canvas()); - infoLine->setVisible(true); + infoLine->tqsetVisible(true); infoLine->setPen(TQPen(exitItem->pen().color(), 2)); infoLine->setZ(10000); infoLine->setPoints(x(), y(), exitItem->x(), exitItem->y()); @@ -1277,7 +1277,7 @@ void BlackHole::updateInfo() { if (infoLine) { - infoLine->setVisible(true); + infoLine->tqsetVisible(true); infoLine->setPoints(x(), y(), exitItem->x(), exitItem->y()); exitItem->showInfo(); } @@ -1338,7 +1338,7 @@ bool BlackHole::place(Ball *ball, bool /*wasCenter*/) ball->setVelocity(0, 0); ball->setState(Stopped); - ball->setVisible(false); + ball->tqsetVisible(false); ball->setForceStillGoing(true); double magnitude = Vector(TQPoint(x(), y()), TQPoint(exitItem->x(), exitItem->y())).magnitude(); @@ -1367,7 +1367,7 @@ void BlackHole::eject(Ball *ball, double speed) ball->setVector(v); ball->setForceStillGoing(false); - ball->setVisible(true); + ball->tqsetVisible(true); ball->setState(Rolling); runs++; @@ -1418,7 +1418,7 @@ void BlackHole::finishMe() } exitItem->setPoints(start.x(), start.y(), end.x(), end.y()); - exitItem->setVisible(true); + exitItem->tqsetVisible(true); } void BlackHole::save(KConfig *cfg) @@ -1439,7 +1439,7 @@ BlackHoleExit::BlackHoleExit(BlackHole *blackHole, TQCanvas *canvas) setZ(blackHole->z()); arrow->setZ(z() - .00001); updateArrowLength(); - arrow->setVisible(false); + arrow->tqsetVisible(false); } void BlackHoleExit::aboutToDie() @@ -1484,49 +1484,49 @@ void BlackHoleExit::editModeChanged(bool editing) void BlackHoleExit::showInfo() { - arrow->setVisible(true); + arrow->tqsetVisible(true); } void BlackHoleExit::hideInfo() { - arrow->setVisible(false); + arrow->tqsetVisible(false); } -Config *BlackHoleExit::config(TQWidget *parent) +Config *BlackHoleExit::config(TQWidget *tqparent) { - return blackHole->config(parent); + return blackHole->config(tqparent); } ///////////////////////// -BlackHoleConfig::BlackHoleConfig(BlackHole *blackHole, TQWidget *parent) - : Config(parent) +BlackHoleConfig::BlackHoleConfig(BlackHole *blackHole, TQWidget *tqparent) + : Config(tqparent) { this->blackHole = blackHole; - TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); - layout->addWidget(new TQLabel(i18n("Exiting ball angle:"), this)); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); + tqlayout->addWidget(new TQLabel(i18n("Exiting ball angle:"), this)); TQSpinBox *deg = new TQSpinBox(0, 359, 10, this); deg->setSuffix(TQString(" ") + i18n("degrees")); deg->setValue(blackHole->curExitDeg()); deg->setWrapping(true); - layout->addWidget(deg); + tqlayout->addWidget(deg); connect(deg, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(degChanged(int))); - layout->addStretch(); + tqlayout->addStretch(); - TQHBoxLayout *hlayout = new TQHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new TQLabel(i18n("Minimum exit speed:"), this)); + TQHBoxLayout *htqlayout = new TQHBoxLayout(tqlayout, spacingHint()); + htqlayout->addWidget(new TQLabel(i18n("Minimum exit speed:"), this)); KDoubleNumInput *min = new KDoubleNumInput(this); min->setRange(0, 8, 1, true); - hlayout->addWidget(min); + htqlayout->addWidget(min); connect(min, TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(minChanged(double))); min->setValue(blackHole->minSpeed()); - hlayout = new TQHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new TQLabel(i18n("Maximum:"), this)); + htqlayout = new TQHBoxLayout(tqlayout, spacingHint()); + htqlayout->addWidget(new TQLabel(i18n("Maximum:"), this)); KDoubleNumInput *max = new KDoubleNumInput(this); max->setRange(1, 10, 1, true); - hlayout->addWidget(max); + htqlayout->addWidget(max); connect(max, TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(maxChanged(double))); max->setValue(blackHole->maxSpeed()); } @@ -1639,7 +1639,7 @@ void WallPoint::updateVisible() void WallPoint::editModeChanged(bool changed) { editing = changed; - setVisible(true); + tqsetVisible(true); if (!editing) updateVisible(); } @@ -1741,8 +1741,8 @@ Wall::Wall(TQCanvas *canvas) startItem = new WallPoint(true, this, canvas); endItem = new WallPoint(false, this, canvas); - startItem->setVisible(true); - endItem->setVisible(true); + startItem->tqsetVisible(true); + endItem->tqsetVisible(true); setPen(TQPen(darkRed, 3)); setPoints(-15, 10, 15, -5); @@ -1777,10 +1777,10 @@ void Wall::setAlwaysShow(bool yes) void Wall::setVisible(bool yes) { - TQCanvasLine::setVisible(yes); + TQCanvasLine::tqsetVisible(yes); - startItem->setVisible(yes); - endItem->setVisible(yes); + startItem->tqsetVisible(yes); + endItem->tqsetVisible(yes); startItem->updateVisible(); endItem->updateVisible(); } @@ -1859,7 +1859,7 @@ TQPointArray Wall::areaPoints() const // it's all squished because I don't want my // line counts to count code I didn't write! - TQPointArray p(4); const int xi = int(x()); const int yi = int(y()); const TQPoint start = startPoint(); const TQPoint end = endPoint(); const int x1 = start.x(); const int x2 = end.x(); const int y1 = start.y(); const int y2 = end.y(); const int dx = QABS(x1-x2); const int dy = QABS(y1-y2); if ( dx > dy ) { p[0] = TQPoint(x1+xi,y1+yi-1); p[1] = TQPoint(x2+xi,y2+yi-1); p[2] = TQPoint(x2+xi,y2+yi+1); p[3] = TQPoint(x1+xi,y1+yi+1); } else { p[0] = TQPoint(x1+xi-1,y1+yi); p[1] = TQPoint(x2+xi-1,y2+yi); p[2] = TQPoint(x2+xi+1,y2+yi); p[3] = TQPoint(x1+xi+1,y1+yi); } return p; + TQPointArray p(4); const int xi = int(x()); const int yi = int(y()); const TQPoint start = startPoint(); const TQPoint end = endPoint(); const int x1 = start.x(); const int x2 = end.x(); const int y1 = start.y(); const int y2 = end.y(); const int dx = TQABS(x1-x2); const int dy = TQABS(y1-y2); if ( dx > dy ) { p[0] = TQPoint(x1+xi,y1+yi-1); p[1] = TQPoint(x2+xi,y2+yi-1); p[2] = TQPoint(x2+xi,y2+yi+1); p[3] = TQPoint(x1+xi,y1+yi+1); } else { p[0] = TQPoint(x1+xi-1,y1+yi); p[1] = TQPoint(x2+xi-1,y2+yi); p[2] = TQPoint(x2+xi+1,y2+yi); p[3] = TQPoint(x1+xi+1,y1+yi); } return p; } void Wall::editModeChanged(bool changed) @@ -1954,47 +1954,47 @@ void Wall::save(KConfig *cfg) ///////////////////////// -HoleConfig::HoleConfig(HoleInfo *holeInfo, TQWidget *parent) - : Config(parent) +HoleConfig::HoleConfig(HoleInfo *holeInfo, TQWidget *tqparent) + : Config(tqparent) { this->holeInfo = holeInfo; - TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); - TQHBoxLayout *hlayout = new TQHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new TQLabel(i18n("Course name: "), this)); + TQHBoxLayout *htqlayout = new TQHBoxLayout(tqlayout, spacingHint()); + htqlayout->addWidget(new TQLabel(i18n("Course name: "), this)); KLineEdit *nameEdit = new KLineEdit(holeInfo->untranslatedName(), this); - hlayout->addWidget(nameEdit); + htqlayout->addWidget(nameEdit); connect(nameEdit, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(nameChanged(const TQString &))); - hlayout = new TQHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new TQLabel(i18n("Course author: "), this)); + htqlayout = new TQHBoxLayout(tqlayout, spacingHint()); + htqlayout->addWidget(new TQLabel(i18n("Course author: "), this)); KLineEdit *authorEdit = new KLineEdit(holeInfo->author(), this); - hlayout->addWidget(authorEdit); + htqlayout->addWidget(authorEdit); connect(authorEdit, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(authorChanged(const TQString &))); - layout->addStretch(); + tqlayout->addStretch(); - hlayout = new TQHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new TQLabel(i18n("Par:"), this)); + htqlayout = new TQHBoxLayout(tqlayout, spacingHint()); + htqlayout->addWidget(new TQLabel(i18n("Par:"), this)); TQSpinBox *par = new TQSpinBox(1, 15, 1, this); par->setValue(holeInfo->par()); - hlayout->addWidget(par); + htqlayout->addWidget(par); connect(par, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(parChanged(int))); - hlayout->addStretch(); + htqlayout->addStretch(); - hlayout->addWidget(new TQLabel(i18n("Maximum:"), this)); + htqlayout->addWidget(new TQLabel(i18n("Maximum:"), this)); TQSpinBox *maxstrokes = new TQSpinBox(holeInfo->lowestMaxStrokes(), 30, 1, this); TQWhatsThis::add(maxstrokes, i18n("Maximum number of strokes player can take on this hole.")); TQToolTip::add(maxstrokes, i18n("Maximum number of strokes")); maxstrokes->setSpecialValueText(i18n("Unlimited")); maxstrokes->setValue(holeInfo->maxStrokes()); - hlayout->addWidget(maxstrokes); + htqlayout->addWidget(maxstrokes); connect(maxstrokes, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(maxStrokesChanged(int))); TQCheckBox *check = new TQCheckBox(i18n("Show border walls"), this); check->setChecked(holeInfo->borderWalls()); - layout->addWidget(check); + tqlayout->addWidget(check); connect(check, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(borderWallsChanged(bool))); } @@ -2122,7 +2122,7 @@ void StrokeCircle::draw(TQPainter &p) length = al; } - p.setBrush(TQBrush(black, Qt::NoBrush)); + p.setBrush(TQBrush(black, TQt::NoBrush)); p.setPen(TQPen(white, ithickness / 2)); p.drawEllipse(x() + ithickness / 2, y() + ithickness / 2, iwidth - ithickness, iheight - ithickness); p.setPen(TQPen(TQColor((int)(0xff * dvalue) / dmax, 0, 0xff - (int)(0xff * dvalue) / dmax), ithickness)); @@ -2139,8 +2139,8 @@ void StrokeCircle::draw(TQPainter &p) ///////////////////////////////////////// -KolfGame::KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWidget *parent, const char *name ) - : TQCanvasView(parent, name) +KolfGame::KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWidget *tqparent, const char *name ) + : TQCanvasView(tqparent, name) { // for mouse control setMouseTracking(true); @@ -2197,22 +2197,22 @@ KolfGame::KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWi margin = 10; - setFocusPolicy(TQWidget::StrongFocus); + setFocusPolicy(TQ_StrongFocus); setFixedSize(width + 2 * margin, height + 2 * margin); setMargins(margin, margin, margin, margin); - course = new TQCanvas(this); + course = new TQCanvas(TQT_TQOBJECT(this)); course->setBackgroundColor(white); course->resize(width, height); TQPixmap pic; - if (!TQPixmapCache::find("grass", pic)) + if (!TQPixmapCache::tqfind("grass", pic)) { pic.load(locate("appdata", "pics/grass.png")); TQPixmapCache::insert("grass", pic); } - course->setBackgroundPixmap(pic); + course->tqsetBackgroundPixmap(pic); setCanvas(course); move(0, 0); @@ -2225,7 +2225,7 @@ KolfGame::KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWi highlighter = new TQCanvasRectangle(course); highlighter->setPen(TQPen(yellow, 1)); highlighter->setBrush(TQBrush(NoBrush)); - highlighter->setVisible(false); + highlighter->tqsetVisible(false); highlighter->setZ(10000); // shows some info about hole @@ -2237,14 +2237,14 @@ KolfGame::KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWi infoText->move(15, width/2); infoText->setZ(10001); infoText->setFont(font); - infoText->setVisible(false); + infoText->tqsetVisible(false); // create the advanced putting indicator strokeCircle = new StrokeCircle(course); strokeCircle->move(width - 90, height - 90); strokeCircle->setSize(80, 80); strokeCircle->setThickness(8); - strokeCircle->setVisible(false); + strokeCircle->tqsetVisible(false); strokeCircle->setValue(0); strokeCircle->setMaxValue(360); @@ -2252,7 +2252,7 @@ KolfGame::KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWi whiteBall = new Ball(course); whiteBall->setGame(this); whiteBall->setColor(white); - whiteBall->setVisible(false); + whiteBall->tqsetVisible(false); whiteBall->setDoDetect(false); int highestLog = 0; @@ -2311,7 +2311,7 @@ void KolfGame::startFirstHole(int hole) { for (; scoreboardHoles < curHole; ++scoreboardHoles) { - cfg->setGroup(TQString("%1-hole@-50,-50|0").arg(scoreboardHoles + 1)); + cfg->setGroup(TQString("%1-hole@-50,-50|0").tqarg(scoreboardHoles + 1)); emit newHole(cfg->readNumEntry("par", 3)); } @@ -2382,7 +2382,7 @@ void KolfGame::addBorderWall(TQPoint start, TQPoint end) { Wall *wall = new Wall(course); wall->setPoints(start.x(), start.y(), end.x(), end.y()); - wall->setVisible(true); + wall->tqsetVisible(true); wall->setGame(this); wall->setZ(998.7); borderWalls.append(wall); @@ -2420,7 +2420,7 @@ void KolfGame::handleMousePressEvent(TQMouseEvent *e) list.pop_front(); moving = false; - highlighter->setVisible(false); + highlighter->tqsetVisible(false); selectedItem = 0; movingItem = 0; @@ -2430,7 +2430,7 @@ void KolfGame::handleMousePressEvent(TQMouseEvent *e) return; } // only items we keep track of - if ((!(items.containsRef(list.first()) || list.first() == whiteBall || extraMoveable.containsRef(list.first())))) + if ((!(items.tqcontainsRef(list.first()) || list.first() == whiteBall || extraMoveable.tqcontainsRef(list.first())))) { emit newSelectedItem(&holeInfo); return; @@ -2446,7 +2446,7 @@ void KolfGame::handleMousePressEvent(TQMouseEvent *e) switch (e->button()) { // select AND move now :) - case LeftButton: + case Qt::LeftButton: { selectedItem = list.first(); movingItem = selectedItem; @@ -2458,7 +2458,7 @@ void KolfGame::handleMousePressEvent(TQMouseEvent *e) setCursor(KCursor::sizeAllCursor()); emit newSelectedItem(citem); - highlighter->setVisible(true); + highlighter->tqsetVisible(true); TQRect rect = selectedItem->boundingRect(); highlighter->move(rect.x() + 1, rect.y() + 1); highlighter->setSize(rect.width(), rect.height()); @@ -2473,9 +2473,9 @@ void KolfGame::handleMousePressEvent(TQMouseEvent *e) { if (m_useMouse) { - if (!inPlay && e->button() == LeftButton) + if (!inPlay && e->button() == Qt::LeftButton) puttPress(); - else if (e->button() == RightButton) + else if (e->button() == Qt::RightButton) toggleShowInfo(); } } @@ -2553,7 +2553,7 @@ void KolfGame::handleMouseMoveEvent(TQMouseEvent *e) highlighter->moveBy(-(double)moveX, -(double)moveY); movingItem->moveBy(-(double)moveX, -(double)moveY); TQRect brect = movingItem->boundingRect(); - emit newStatusText(TQString("%1x%2").arg(brect.x()).arg(brect.y())); + emit newStatusText(TQString("%1x%2").tqarg(brect.x()).tqarg(brect.y())); storedMousePos = mouse; } @@ -2574,7 +2574,7 @@ void KolfGame::handleMouseReleaseEvent(TQMouseEvent *e) if (editing) { - emit newStatusText(TQString::null); + emit newStatusText(TQString()); moving = false; } @@ -2583,9 +2583,9 @@ void KolfGame::handleMouseReleaseEvent(TQMouseEvent *e) if (!editing && m_useMouse) { - if (!inPlay && e->button() == LeftButton) + if (!inPlay && e->button() == Qt::LeftButton) puttRelease(); - else if (e->button() == RightButton) + else if (e->button() == Qt::RightButton) toggleShowInfo(); } @@ -2608,7 +2608,7 @@ void KolfGame::keyPressEvent(TQKeyEvent *e) putting = false; stroking = false; finishStroking = false; - strokeCircle->setVisible(false); + strokeCircle->tqsetVisible(false); putterTimer->stop(); putter->setOrigin((*curPlayer).ball()->x(), (*curPlayer).ball()->y()); break; @@ -2701,7 +2701,7 @@ void KolfGame::puttPress() strokeCircle->move(px + pw / 2 + 10, py + 10); else strokeCircle->move(px + pw / 2 + 10, py - 10 - strokeCircle->height()); - strokeCircle->setVisible(true); + strokeCircle->tqsetVisible(true); } putterTimer->start(putterTimerMsec); } @@ -2741,7 +2741,7 @@ void KolfGame::keyReleaseEvent(TQKeyEvent *e) { lastDelId = citem->curId(); - highlighter->setVisible(false); + highlighter->tqsetVisible(false); items.removeRef(item); citem->hideInfo(); citem->aboutToDelete(); @@ -2785,7 +2785,7 @@ void KolfGame::timeout() // later undo the shot for (PlayerList::Iterator it = players->begin(); it != players->end(); ++it) { - if (!course->rect().contains(TQPoint((*it).ball()->x(), (*it).ball()->y()))) + if (!course->rect().tqcontains(TQPoint((*it).ball()->x(), (*it).ball()->y()))) { (*it).ball()->setState(Stopped); @@ -2907,7 +2907,7 @@ void KolfGame::putterTimeout() { // aborted putting = false; - strokeCircle->setVisible(false); + strokeCircle->tqsetVisible(false); } else if (strength > maxStrength || puttReverse) { @@ -2950,7 +2950,7 @@ void KolfGame::putterTimeout() putter->go(Forwards); else { - strokeCircle->setVisible(false); + strokeCircle->tqsetVisible(false); finishStroking = false; putterTimer->stop(); putting = false; @@ -3084,7 +3084,7 @@ void KolfGame::loadStateList() if ((*curPlayer).id() == info.id) ballMoved(); else - player.ball()->setVisible(!info.beginningOfHole); + player.ball()->tqsetVisible(!info.beginningOfHole); player.setScoreForHole(info.score, curHole); player.ball()->setState(info.state); emit scoreChanged(info.id, curHole, info.score); @@ -3136,7 +3136,7 @@ void KolfGame::shotDone() const TQString placeOutside = i18n("Drop Outside of Hazard"); const TQString rehit = i18n("Rehit From Last Location"); options << placeOutside << rehit; - const TQString choice = KComboBoxDialog::getItem(i18n("What would you like to do for your next shot?"), i18n("%1 is in a Hazard").arg((*it).name()), options, placeOutside, "hazardOptions"); + const TQString choice = KComboBoxDialog::getItem(i18n("What would you like to do for your next shot?"), i18n("%1 is in a Hazard").tqarg((*it).name()), options, placeOutside, "hazardOptions"); if (choice == placeOutside) { @@ -3186,7 +3186,7 @@ void KolfGame::shotDone() } } - ball->setVisible(true); + ball->tqsetVisible(true); ball->setState(Stopped); (*it).ball()->setDoDetect(true); @@ -3207,7 +3207,7 @@ void KolfGame::shotDone() if (curStrokes >= holeInfo.maxStrokes() && holeInfo.hasMaxStrokes()) { ball->setState(Holed); - ball->setVisible(false); + ball->tqsetVisible(false); // move to center in case he/she hit out ball->move(width / 2, height / 2); @@ -3236,7 +3236,7 @@ void KolfGame::shotDone() emit newPlayersTurn(&(*curPlayer)); - (*curPlayer).ball()->setVisible(true); + (*curPlayer).ball()->tqsetVisible(true); putter->setAngle((*curPlayer).ball()); putter->setOrigin((*curPlayer).ball()->x(), (*curPlayer).ball()->y()); @@ -3256,7 +3256,7 @@ void KolfGame::startBall(const Vector &vector) playSound("hit"); emit inPlayStart(); - putter->setVisible(false); + putter->tqsetVisible(false); (*curPlayer).ball()->setState(Rolling); (*curPlayer).ball()->setVector(vector); @@ -3303,14 +3303,14 @@ void KolfGame::sayWhosGoing() { if (players->count() >= 2) { - KMessageBox::information(this, i18n("%1 will start off.").arg((*curPlayer).name()), i18n("New Hole"), "newHole"); + KMessageBox::information(this, i18n("%1 will start off.").tqarg((*curPlayer).name()), i18n("New Hole"), "newHole"); } } void KolfGame::holeDone() { for (PlayerList::Iterator it = players->begin(); it != players->end(); ++it) - (*it).ball()->setVisible(false); + (*it).ball()->tqsetVisible(false); startNextHole(); sayWhosGoing(); } @@ -3407,7 +3407,7 @@ void KolfGame::startNextHole() if ((int)(*it).scores().count() < curHole) (*it).addHole(); (*it).ball()->setVelocity(0, 0); - (*it).ball()->setVisible(false); + (*it).ball()->tqsetVisible(false); } emit newPlayersTurn(&(*curPlayer)); @@ -3429,7 +3429,7 @@ void KolfGame::startNextHole() for (; scoreboardHoles < curHole; ++scoreboardHoles) { - cfg->setGroup(TQString("%1-hole@-50,-50|0").arg(scoreboardHoles + 1)); + cfg->setGroup(TQString("%1-hole@-50,-50|0").tqarg(scoreboardHoles + 1)); emit newHole(cfg->readNumEntry("par", 3)); } @@ -3437,7 +3437,7 @@ void KolfGame::startNextHole() updateShowInfo(); // this is from shotDone() - (*curPlayer).ball()->setVisible(true); + (*curPlayer).ball()->tqsetVisible(true); putter->setOrigin((*curPlayer).ball()->x(), (*curPlayer).ball()->y()); updateMouse(); @@ -3451,31 +3451,31 @@ void KolfGame::startNextHole() void KolfGame::showInfo() { - TQString text = i18n("Hole %1: par %2, maximum %3 strokes").arg(curHole).arg(holeInfo.par()).arg(holeInfo.maxStrokes()); + TQString text = i18n("Hole %1: par %2, maximum %3 strokes").tqarg(curHole).tqarg(holeInfo.par()).tqarg(holeInfo.maxStrokes()); infoText->move((width - TQFontMetrics(infoText->font()).width(text)) / 2, infoText->y()); infoText->setText(text); // I hate this text! Let's not show it - //infoText->setVisible(true); + //infoText->tqsetVisible(true); emit newStatusText(text); } void KolfGame::showInfoDlg(bool addDontShowAgain) { - KMessageBox::information(parentWidget(), - i18n("Course name: %1").arg(holeInfo.name()) + TQString("\n") - + i18n("Created by %1").arg(holeInfo.author()) + TQString("\n") - + i18n("%1 holes").arg(highestHole), + KMessageBox::information(tqparentWidget(), + i18n("Course name: %1").tqarg(holeInfo.name()) + TQString("\n") + + i18n("Created by %1").tqarg(holeInfo.author()) + TQString("\n") + + i18n("%1 holes").tqarg(highestHole), i18n("Course Information"), - addDontShowAgain? holeInfo.name() + TQString(" ") + holeInfo.author() : TQString::null); + addDontShowAgain? holeInfo.name() + TQString(" ") + holeInfo.author() : TQString()); } void KolfGame::hideInfo() { infoText->setText(""); - infoText->setVisible(false); + infoText->tqsetVisible(false); - emit newStatusText(TQString::null); + emit newStatusText(TQString()); } void KolfGame::openFile() @@ -3514,7 +3514,7 @@ void KolfGame::openFile() holeInfo.setUntranslatedName(cfg->readEntryUntranslated("Name", holeInfo.untranslatedName())); emit titleChanged(holeInfo.name()); - cfg->setGroup(TQString("%1-hole@-50,-50|0").arg(curHole)); + cfg->setGroup(TQString("%1-hole@-50,-50|0").tqarg(curHole)); curPar = cfg->readNumEntry("par", 3); holeInfo.setPar(curPar); holeInfo.borderWallsChanged(cfg->readBoolEntry("borderWalls", holeInfo.borderWalls())); @@ -3533,12 +3533,12 @@ void KolfGame::openFile() cfg->setGroup(*it); const int len = (*it).length(); - const int dashIndex = (*it).find("-"); + const int dashIndex = (*it).tqfind("-"); const int holeNum = (*it).left(dashIndex).toInt(); if (holeNum > _highestHole) _highestHole = holeNum; - const int atIndex = (*it).find("@"); + const int atIndex = (*it).tqfind("@"); const TQString name = (*it).mid(dashIndex + 1, atIndex - (dashIndex + 1)); if (holeNum != curHole) @@ -3552,8 +3552,8 @@ void KolfGame::openFile() numItems++; - const int commaIndex = (*it).find(","); - const int pipeIndex = (*it).find("|"); + const int commaIndex = (*it).tqfind(","); + const int pipeIndex = (*it).tqfind("|"); const int x = (*it).mid(atIndex + 1, commaIndex - (atIndex + 1)).toInt(); const int y = (*it).mid(commaIndex + 1, pipeIndex - (commaIndex + 1)).toInt(); @@ -3593,7 +3593,7 @@ void KolfGame::openFile() newItem->move(x, y); canvasItem->firstMove(x, y); - newItem->setVisible(true); + newItem->tqsetVisible(true); // make things actually show if (!hasFinalLoad) @@ -3610,13 +3610,13 @@ void KolfGame::openFile() break; } - if (!loaded && name != "hole" && missingPlugins.contains(name) <= 0) + if (!loaded && name != "hole" && missingPlugins.tqcontains(name) <= 0) missingPlugins.append(name); } if (!missingPlugins.empty()) { - KMessageBox::informationList(this, TQString("

<http://katzbrown.com/kolf/Plugins/>

") + i18n("This hole uses the following plugins, which you do not have installed:") + TQString("

"), missingPlugins, TQString::null, TQString("%1 warning").arg(holeInfo.untranslatedName() + TQString::number(curHole))); + KMessageBox::informationList(this, TQString("

<http://katzbrown.com/kolf/Plugins/>

") + i18n("This hole uses the following plugins, which you do not have installed:") + TQString("

"), missingPlugins, TQString(), TQString("%1 warning").tqarg(holeInfo.untranslatedName() + TQString::number(curHole))); } lastDelId = -1; @@ -3634,7 +3634,7 @@ void KolfGame::openFile() clearHole(); setModified(false); for (PlayerList::Iterator it = players->begin(); it != players->end(); ++it) - (*it).ball()->setVisible(false); + (*it).ball()->tqsetVisible(false); return; } @@ -3719,7 +3719,7 @@ void KolfGame::addNewObject(Object *newObj) { TQCanvasItem *newItem = newObj->newObject(course); items.append(newItem); - newItem->setVisible(true); + newItem->tqsetVisible(true); CanvasItem *canvasItem = dynamic_cast(newItem); if (!canvasItem) @@ -3826,11 +3826,11 @@ void KolfGame::addNewHole() // make sure even the current player isn't showing for (PlayerList::Iterator it = players->begin(); it != players->end(); ++it) - (*it).ball()->setVisible(false); + (*it).ball()->tqsetVisible(false); - whiteBall->setVisible(editing); - highlighter->setVisible(false); - putter->setVisible(!editing); + whiteBall->tqsetVisible(editing); + highlighter->tqsetVisible(false); + putter->tqsetVisible(!editing); inPlay = false; // add default objects @@ -3978,7 +3978,7 @@ void KolfGame::save() // wipe out all groups from this hole for (TQStringList::Iterator it = groups.begin(); it != groups.end(); ++it) { - int holeNum = (*it).left((*it).find("-")).toInt(); + int holeNum = (*it).left((*it).tqfind("-")).toInt(); if (holeNum == curHole) cfg->deleteGroup(*it); } @@ -3995,7 +3995,7 @@ void KolfGame::save() } // save where ball starts (whiteBall tells all) - cfg->setGroup(TQString("%1-ball@%2,%3").arg(curHole).arg((int)whiteBall->x()).arg((int)whiteBall->y())); + cfg->setGroup(TQString("%1-ball@%2,%3").tqarg(curHole).tqarg((int)whiteBall->x()).tqarg((int)whiteBall->y())); cfg->writeEntry("dummykey", true); cfg->setGroup("0-course@-50,-50"); @@ -4003,7 +4003,7 @@ void KolfGame::save() cfg->writeEntry("Name", holeInfo.untranslatedName()); // save hole info - cfg->setGroup(TQString("%1-hole@-50,-50|0").arg(curHole)); + cfg->setGroup(TQString("%1-hole@-50,-50|0").tqarg(curHole)); cfg->writeEntry("par", holeInfo.par()); cfg->writeEntry("maxstrokes", holeInfo.maxStrokes()); cfg->writeEntry("borderWalls", holeInfo.borderWalls()); @@ -4066,16 +4066,16 @@ void KolfGame::toggleEditMode() { // curplayer shouldn't be hidden no matter what if ((*it).ball()->beginningOfHole() && it != curPlayer) - (*it).ball()->setVisible(false); + (*it).ball()->tqsetVisible(false); else - (*it).ball()->setVisible(!editing); + (*it).ball()->tqsetVisible(!editing); } - whiteBall->setVisible(editing); - highlighter->setVisible(false); + whiteBall->tqsetVisible(editing); + highlighter->tqsetVisible(false); // shouldn't see putter whilst editing - putter->setVisible(!editing); + putter->tqsetVisible(!editing); if (editing) autoSaveTimer->start(autoSaveMsec); @@ -4103,7 +4103,7 @@ void KolfGame::playSound(TQString file, double vol) } } - file = soundDir + file + TQString::fromLatin1(".wav"); + file = soundDir + file + TQString::tqfromLatin1(".wav"); // not needed when all of the files are in the distribution //if (!TQFile::exists(file)) @@ -4160,7 +4160,7 @@ void KolfGame::print(KPrinter &pr) if (pr.option("kde-kolf-title") == "true") { - TQString text = i18n("%1 - Hole %2; by %3").arg(holeInfo.name()).arg(curHole).arg(holeInfo.author()); + TQString text = i18n("%1 - Hole %2; by %3").tqarg(holeInfo.name()).tqarg(curHole).tqarg(holeInfo.author()); TQFont font(kapp->font()); font.setPointSize(18); TQRect rect = TQFontMetrics(font).boundingRect(text); @@ -4183,7 +4183,7 @@ void KolfGame::setBorderWalls(bool showing) { Wall *wall = 0; for (wall = borderWalls.first(); wall; wall = borderWalls.next()) - wall->setVisible(showing); + wall->tqsetVisible(showing); } void KolfGame::setUseAdvancedPutting(bool yes) @@ -4219,7 +4219,7 @@ void KolfGame::courseInfo(CourseInfo &info, const TQString& filename) unsigned int par= 0; while (1) { - TQString group = TQString("%1-hole@-50,-50|0").arg(hole); + TQString group = TQString("%1-hole@-50,-50|0").tqarg(hole); if (!cfg.hasGroup(group)) { hole--; @@ -4283,7 +4283,7 @@ void KolfGame::saveScores(KConfig *config) { config->setGroup(TQString::number((*it).id())); config->writeEntry("Name", (*it).name()); - config->writeEntry("Color", (*it).ball()->color().name()); + config->writeEntry("Color", TQString((*it).ball()->color().name())); TQStringList scores; TQValueList intscores = (*it).scores(); diff --git a/kolf/game.h b/kolf/game.h index f3dfea35..3bcaaaf5 100644 --- a/kolf/game.h +++ b/kolf/game.h @@ -104,7 +104,7 @@ private: }; typedef TQValueList PlayerList; -class Arrow : public QCanvasLine +class Arrow : public TQCanvasLine { public: Arrow(TQCanvas *canvas); @@ -142,7 +142,7 @@ public: RectPoint(TQColor color, RectItem *, TQCanvas *canvas); void dontMove() { dontmove = true; } virtual void moveBy(double dx, double dy); - virtual Config *config(TQWidget *parent); + virtual Config *config(TQWidget *tqparent); virtual bool deleteable() const { return false; } virtual bool cornerResize() const { return true; } virtual CanvasItem *itemToDelete() { return dynamic_cast(rect); } @@ -181,7 +181,7 @@ public: virtual void save(KConfig *cfg); virtual void load(KConfig *cfg); - virtual Config *config(TQWidget *parent); + virtual Config *config(TQWidget *tqparent); protected: RectPoint *point; @@ -195,6 +195,7 @@ private: class EllipseConfig : public Config { Q_OBJECT + TQ_OBJECT public: EllipseConfig(Ellipse *ellipse, TQWidget *); @@ -206,7 +207,7 @@ private slots: void check2Changed(bool on); protected: - TQVBoxLayout *m_vlayout; + TQVBoxLayout *m_vtqlayout; private: TQLabel *slow1; @@ -317,9 +318,10 @@ class BlackHole; class BlackHoleConfig : public Config { Q_OBJECT + TQ_OBJECT public: - BlackHoleConfig(BlackHole *blackHole, TQWidget *parent); + BlackHoleConfig(BlackHole *blackHole, TQWidget *tqparent); private slots: void degChanged(int); @@ -344,15 +346,16 @@ public: virtual void hideInfo(); void updateArrowAngle(); void updateArrowLength(); - virtual Config *config(TQWidget *parent); + virtual Config *config(TQWidget *tqparent); BlackHole *blackHole; protected: Arrow *arrow; }; -class BlackHoleTimer : public QObject +class BlackHoleTimer : public TQObject { Q_OBJECT + TQ_OBJECT public: BlackHoleTimer(Ball *ball, double speed, int msec); @@ -372,6 +375,7 @@ protected: class BlackHole : public TQObject, public Hole { Q_OBJECT + TQ_OBJECT public: BlackHole(TQCanvas *canvas); @@ -382,7 +386,7 @@ public: virtual bool place(Ball *ball, bool wasCenter); virtual void save(KConfig *cfg); virtual void load(KConfig *cfg); - virtual Config *config(TQWidget *parent) { return new BlackHoleConfig(this, parent); } + virtual Config *config(TQWidget *tqparent) { return new BlackHoleConfig(this, tqparent); } virtual TQPtrList moveableItems() const; double minSpeed() const { return m_minSpeed; } double maxSpeed() const { return m_maxSpeed; } @@ -475,11 +479,11 @@ public: virtual bool collision(Ball *ball, long int id); virtual CanvasItem *itemToDelete() { return wall; } virtual void clean(); - virtual Config *config(TQWidget *parent) { return wall->config(parent); } + virtual Config *config(TQWidget *tqparent) { return wall->config(tqparent); } void dontMove() { dontmove = true; }; void updateVisible(); - Wall *parentWall() { return wall; } + Wall *tqparentWall() { return wall; } protected: Wall *wall; @@ -541,6 +545,7 @@ class Bridge; class BridgeConfig : public Config { Q_OBJECT + TQ_OBJECT public: BridgeConfig(Bridge *bridge, TQWidget *); @@ -552,7 +557,7 @@ protected slots: void rightWallChanged(bool); protected: - TQVBoxLayout *m_vlayout; + TQVBoxLayout *m_vtqlayout; TQCheckBox *top; TQCheckBox *bot; TQCheckBox *left; @@ -576,7 +581,7 @@ public: void doSave(KConfig *cfg); virtual void newSize(int width, int height); virtual void setGame(KolfGame *game); - virtual Config *config(TQWidget *parent) { return new BridgeConfig(this, parent); } + virtual Config *config(TQWidget *tqparent) { return new BridgeConfig(this, tqparent); } void setSize(int width, int height); virtual TQPtrList moveableItems() const; @@ -613,9 +618,10 @@ class Sign; class SignConfig : public BridgeConfig { Q_OBJECT + TQ_OBJECT public: - SignConfig(Sign *sign, TQWidget *parent); + SignConfig(Sign *sign, TQWidget *tqparent); private slots: void textChanged(const TQString &); @@ -631,7 +637,7 @@ public: TQString text() const { return m_text; } virtual void draw(TQPainter &painter); virtual bool vStrut() const { return false; } - virtual Config *config(TQWidget *parent) { return new SignConfig(this, parent); } + virtual Config *config(TQWidget *tqparent) { return new SignConfig(this, tqparent); } virtual void save(KConfig *cfg); virtual void load(KConfig *cfg); @@ -661,9 +667,10 @@ protected: class WindmillConfig : public BridgeConfig { Q_OBJECT + TQ_OBJECT public: - WindmillConfig(Windmill *windmill, TQWidget *parent); + WindmillConfig(Windmill *windmill, TQWidget *tqparent); private slots: void speedChanged(int news); @@ -681,7 +688,7 @@ public: virtual void save(KConfig *cfg); virtual void load(KConfig *cfg); virtual void setGame(KolfGame *game); - virtual Config *config(TQWidget *parent) { return new WindmillConfig(this, parent); } + virtual Config *config(TQWidget *tqparent) { return new WindmillConfig(this, tqparent); } void setSize(int width, int height); virtual void moveBy(double dx, double dy); void setSpeed(int news); @@ -708,6 +715,7 @@ class HoleInfo; class HoleConfig : public Config { Q_OBJECT + TQ_OBJECT public: HoleConfig(HoleInfo *holeInfo, TQWidget *); @@ -741,7 +749,7 @@ public: TQString name() const { return m_name; } TQString untranslatedName() const { return m_untranslatedName; } - virtual Config *config(TQWidget *parent) { return new HoleConfig(this, parent); } + virtual Config *config(TQWidget *tqparent) { return new HoleConfig(this, tqparent); } void borderWallsChanged(bool yes); bool borderWalls() const { return m_borderWalls; } @@ -755,7 +763,7 @@ private: int m_lowestMaxStrokes; }; -class StrokeCircle : public QCanvasItem +class StrokeCircle : public TQCanvasItem { public: StrokeCircle(TQCanvas *canvas); @@ -790,12 +798,13 @@ struct KDE_EXPORT CourseInfo unsigned int par; }; -class KDE_EXPORT KolfGame : public QCanvasView +class KDE_EXPORT KolfGame : public TQCanvasView { Q_OBJECT + TQ_OBJECT public: - KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWidget *parent=0, const char *name=0 ); + KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWidget *tqparent=0, const char *name=0 ); ~KolfGame(); void setObjects(ObjectList *obj) { this->obj = obj; } void setFilename(const TQString &filename); diff --git a/kolf/kcomboboxdialog.cpp b/kolf/kcomboboxdialog.cpp index 1e18e0b2..133edb01 100644 --- a/kolf/kcomboboxdialog.cpp +++ b/kolf/kcomboboxdialog.cpp @@ -34,8 +34,8 @@ #include "kcomboboxdialog.h" -KComboBoxDialog::KComboBoxDialog( const TQString &_text, const TQStringList &_items, const TQString& _value, bool showDontAskAgain, TQWidget *parent ) - : KDialogBase( Plain, TQString::null, Ok, Ok, parent, 0L, true, true ) +KComboBoxDialog::KComboBoxDialog( const TQString &_text, const TQStringList &_items, const TQString& _value, bool showDontAskAgain, TQWidget *tqparent ) + : KDialogBase( Plain, TQString(), Ok, Ok, tqparent, 0L, true, true ) { TQVBoxLayout *topLayout = new TQVBoxLayout( plainPage(), marginHint(), spacingHint() ); TQLabel *label = new TQLabel(_text, plainPage() ); @@ -76,12 +76,12 @@ bool KComboBoxDialog::dontAskAgainChecked() return false; } -TQString KComboBoxDialog::getItem( const TQString &_text, const TQStringList &_items, const TQString& _value, const TQString &dontAskAgainName, TQWidget *parent ) +TQString KComboBoxDialog::getItem( const TQString &_text, const TQStringList &_items, const TQString& _value, const TQString &dontAskAgainName, TQWidget *tqparent ) { - return getItem( _text, TQString::null, _items, _value, dontAskAgainName, parent ); + return getItem( _text, TQString(), _items, _value, dontAskAgainName, tqparent ); } -TQString KComboBoxDialog::getItem( const TQString &_text, const TQString &_caption, const TQStringList &_items, const TQString& _value, const TQString &dontAskAgainName, TQWidget *parent ) +TQString KComboBoxDialog::getItem( const TQString &_text, const TQString &_caption, const TQStringList &_items, const TQString& _value, const TQString &dontAskAgainName, TQWidget *tqparent ) { TQString prevAnswer; if ( !dontAskAgainName.isEmpty() ) @@ -90,11 +90,11 @@ TQString KComboBoxDialog::getItem( const TQString &_text, const TQString &_capti config->setGroup( "Notification Messages" ); prevAnswer = config->readEntry( dontAskAgainName ); if ( !prevAnswer.isEmpty() ) - if ( _items.contains( prevAnswer ) > 0 ) + if ( _items.tqcontains( prevAnswer ) > 0 ) return prevAnswer; } - KComboBoxDialog dlg( _text, _items, _value, !dontAskAgainName.isNull(), parent ); + KComboBoxDialog dlg( _text, _items, _value, !dontAskAgainName.isNull(), tqparent ); if ( !_caption.isNull() ) dlg.setCaption( _caption ); @@ -115,17 +115,17 @@ TQString KComboBoxDialog::getItem( const TQString &_text, const TQString &_capti return text; } -TQString KComboBoxDialog::getText(const TQString &_caption, const TQString &_text, const TQString &_value, bool *ok, TQWidget *parent, const TQString &configName, KConfig *config) +TQString KComboBoxDialog::getText(const TQString &_caption, const TQString &_text, const TQString &_value, bool *ok, TQWidget *tqparent, const TQString &configName, KConfig *config) { - KComboBoxDialog dlg(_text, TQStringList(), _value, false, parent); + KComboBoxDialog dlg(_text, TQStringList(), _value, false, tqparent); if ( !_caption.isNull() ) dlg.setCaption( _caption ); KHistoryCombo * const box = dlg.comboBox(); box->setEditable(true); - const TQString historyItem = TQString("%1History").arg(configName); - const TQString completionItem = TQString("%1Completion").arg(configName); + const TQString historyItem = TQString("%1History").tqarg(configName); + const TQString completionItem = TQString("%1Completion").tqarg(configName); if(!configName.isNull()) { diff --git a/kolf/kcomboboxdialog.h b/kolf/kcomboboxdialog.h index 28f3721f..91097f16 100644 --- a/kolf/kcomboboxdialog.h +++ b/kolf/kcomboboxdialog.h @@ -40,6 +40,7 @@ class KHistoryCombo; class KComboBoxDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: /** @@ -51,7 +52,7 @@ public: * @param _text Text of the label * @param _value Initial value of the combobox */ - KComboBoxDialog( const TQString &_text, const TQStringList& _items, const TQString& _value = TQString::null, bool showDontAskAgain = false, TQWidget *parent = 0 ); + KComboBoxDialog( const TQString &_text, const TQStringList& _items, const TQString& _value = TQString(), bool showDontAskAgain = false, TQWidget *tqparent = 0 ); virtual ~KComboBoxDialog(); /** @@ -70,9 +71,9 @@ public: * @param _text Text of the label * @param _items Items in the combobox * @param _value Initial value of the inputline - * @param dontAskAgainName Name for saving whether the user doesn't want to be asked again; use TQString::null to disable + * @param dontAskAgainName Name for saving whether the user doesn't want to be asked again; use TQString() to disable */ - static TQString getItem( const TQString &_text, const TQStringList &_items, const TQString& _value = TQString::null, const TQString &dontAskAgainName = TQString::null, TQWidget *parent = 0 ); + static TQString getItem( const TQString &_text, const TQStringList &_items, const TQString& _value = TQString(), const TQString &dontAskAgainName = TQString(), TQWidget *tqparent = 0 ); /** * Static convenience function to get input from the user. @@ -82,9 +83,9 @@ public: * @param _text Text of the label * @param _items Items in the combobox * @param _value Initial value of the inputline - * @param dontAskAgainName Name for saving whether the user doesn't want to be asked again; use TQString::null to disable + * @param dontAskAgainName Name for saving whether the user doesn't want to be asked again; use TQString() to disable */ - static TQString getItem( const TQString &_text, const TQString &_caption, const TQStringList &_items, const TQString& _value = TQString::null, const TQString &dontAskAgainName = TQString::null, TQWidget *parent = 0 ); + static TQString getItem( const TQString &_text, const TQString &_caption, const TQStringList &_items, const TQString& _value = TQString(), const TQString &dontAskAgainName = TQString(), TQWidget *tqparent = 0 ); /** * Static convenience method. @@ -95,14 +96,14 @@ public: * @param _text Text of the label * @param _value Initial value of the inputline * @param ok Variable to store whether the user hit OK - * @param parent Parent widget for the dialog + * @param tqparent Parent widget for the dialog * @param configName Name of the dialog for saving the completion and history * @parma config KConfig for saving the completion and history */ static TQString getText(const TQString &_caption, const TQString &_text, - const TQString &_value = TQString::null, - bool *ok = 0, TQWidget *parent = 0, - const TQString &configName = TQString::null, + const TQString &_value = TQString(), + bool *ok = 0, TQWidget *tqparent = 0, + const TQString &configName = TQString(), KConfig *config = KGlobal::config()); protected: diff --git a/kolf/kolf.cpp b/kolf/kolf.cpp index 696ddc72..5ad194a6 100644 --- a/kolf/kolf.cpp +++ b/kolf/kolf.cpp @@ -62,10 +62,10 @@ Kolf::Kolf() obj = new ObjectList; initPlugins(); - filename = TQString::null; + filename = TQString(); dummy = new TQWidget(this); setCentralWidget(dummy); - layout = new TQGridLayout(dummy, 3, 1); + tqlayout = new TQGridLayout(dummy, 3, 1); resize(420, 480); } @@ -79,75 +79,75 @@ Kolf::~Kolf() void Kolf::initGUI() { - newAction = KStdGameAction::gameNew(this, TQT_SLOT(newGame()), actionCollection()); + newAction = KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(newGame()), actionCollection()); newAction->setText(newAction->text() + TQString("...")); - endAction = KStdGameAction::end(this, TQT_SLOT(closeGame()), actionCollection()); - printAction = KStdGameAction::print(this, TQT_SLOT(print()), actionCollection()); + endAction = KStdGameAction::end(TQT_TQOBJECT(this), TQT_SLOT(closeGame()), actionCollection()); + printAction = KStdGameAction::print(TQT_TQOBJECT(this), TQT_SLOT(print()), actionCollection()); - (void) KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); - saveAction = KStdAction::save(this, TQT_SLOT(save()), actionCollection(), "game_save"); + (void) KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); + saveAction = KStdAction::save(TQT_TQOBJECT(this), TQT_SLOT(save()), actionCollection(), "game_save"); saveAction->setText(i18n("Save &Course")); - saveAsAction = KStdAction::saveAs(this, TQT_SLOT(saveAs()), actionCollection(), "game_save_as"); + saveAsAction = KStdAction::saveAs(TQT_TQOBJECT(this), TQT_SLOT(saveAs()), actionCollection(), "game_save_as"); saveAsAction->setText(i18n("Save &Course As...")); - saveGameAction = new KAction(i18n("&Save Game"), 0, this, TQT_SLOT(saveGame()), actionCollection(), "savegame"); - saveGameAsAction = new KAction(i18n("&Save Game As..."), 0, this, TQT_SLOT(saveGameAs()), actionCollection(), "savegameas"); + saveGameAction = new KAction(i18n("&Save Game"), 0, TQT_TQOBJECT(this), TQT_SLOT(saveGame()), actionCollection(), "savegame"); + saveGameAsAction = new KAction(i18n("&Save Game As..."), 0, TQT_TQOBJECT(this), TQT_SLOT(saveGameAs()), actionCollection(), "savegameas"); - loadGameAction = KStdGameAction::load(this, TQT_SLOT(loadGame()), actionCollection()); + loadGameAction = KStdGameAction::load(TQT_TQOBJECT(this), TQT_SLOT(loadGame()), actionCollection()); loadGameAction->setText(i18n("Load Saved Game...")); - highScoreAction = KStdGameAction::highscores(this, TQT_SLOT(showHighScores()), actionCollection()); + highScoreAction = KStdGameAction::highscores(TQT_TQOBJECT(this), TQT_SLOT(showHighScores()), actionCollection()); - editingAction = new KToggleAction(i18n("&Edit"), "pencil", CTRL+Key_E, this, TQT_SLOT(emptySlot()), actionCollection(), "editing"); - newHoleAction = new KAction(i18n("&New"), "filenew", CTRL+SHIFT+Key_N, this, TQT_SLOT(emptySlot()), actionCollection(), "newhole"); - clearHoleAction = new KAction(KStdGuiItem::clear().text(), "locationbar_erase", CTRL+Key_Delete, this, TQT_SLOT(emptySlot()), actionCollection(), "clearhole"); - resetHoleAction = new KAction(i18n("&Reset"), CTRL+Key_R, this, TQT_SLOT(emptySlot()), actionCollection(), "resethole"); - undoShotAction = KStdAction::undo(this, TQT_SLOT(emptySlot()), actionCollection(), "undoshot"); + editingAction = new KToggleAction(i18n("&Edit"), "pencil", CTRL+Key_E, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "editing"); + newHoleAction = new KAction(i18n("&New"), "filenew", CTRL+SHIFT+Key_N, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "newhole"); + clearHoleAction = new KAction(KStdGuiItem::clear().text(), "locationbar_erase", CTRL+Key_Delete, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "clearhole"); + resetHoleAction = new KAction(i18n("&Reset"), CTRL+Key_R, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "resethole"); + undoShotAction = KStdAction::undo(TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "undoshot"); undoShotAction->setText(i18n("&Undo Shot")); - //replayShotAction = new KAction(i18n("&Replay Shot"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "replay"); + //replayShotAction = new KAction(i18n("&Replay Shot"), 0, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "replay"); - holeAction = new KListAction(i18n("Switch to Hole"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "switchhole"); - nextAction = new KAction(i18n("&Next Hole"), "forward", KStdAccel::shortcut(KStdAccel::Forward), this, TQT_SLOT(emptySlot()), actionCollection(), "nexthole"); - prevAction = new KAction(i18n("&Previous Hole"), "back", KStdAccel::shortcut(KStdAccel::Back), this, TQT_SLOT(emptySlot()), actionCollection(), "prevhole"); - firstAction = new KAction(i18n("&First Hole"), "gohome", KStdAccel::shortcut(KStdAccel::Home), this, TQT_SLOT(emptySlot()), actionCollection(), "firsthole"); - lastAction = new KAction(i18n("&Last Hole"), CTRL+SHIFT+Key_End, this, TQT_SLOT(emptySlot()), actionCollection(), "lasthole"); - randAction = new KAction(i18n("&Random Hole"), "goto", 0, this, TQT_SLOT(emptySlot()), actionCollection(), "randhole"); + holeAction = new KListAction(i18n("Switch to Hole"), 0, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "switchhole"); + nextAction = new KAction(i18n("&Next Hole"), "forward", KStdAccel::shortcut(KStdAccel::Forward), TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "nexthole"); + prevAction = new KAction(i18n("&Previous Hole"), "back", KStdAccel::shortcut(KStdAccel::Back), TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "prevhole"); + firstAction = new KAction(i18n("&First Hole"), "gohome", KStdAccel::shortcut(KStdAccel::Home), TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "firsthole"); + lastAction = new KAction(i18n("&Last Hole"), CTRL+SHIFT+Key_End, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "lasthole"); + randAction = new KAction(i18n("&Random Hole"), "goto", 0, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "randhole"); - useMouseAction = new KToggleAction(i18n("Enable &Mouse for Moving Putter"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "usemouse"); + useMouseAction = new KToggleAction(i18n("Enable &Mouse for Moving Putter"), 0, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "usemouse"); useMouseAction->setCheckedState(i18n("Disable &Mouse for Moving Putter")); - connect(useMouseAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(useMouseChanged(bool))); + connect(useMouseAction, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(useMouseChanged(bool))); KConfig *config = kapp->config(); config->setGroup("Settings"); useMouseAction->setChecked(config->readBoolEntry("useMouse", true)); - useAdvancedPuttingAction = new KToggleAction(i18n("Enable &Advanced Putting"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "useadvancedputting"); + useAdvancedPuttingAction = new KToggleAction(i18n("Enable &Advanced Putting"), 0, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "useadvancedputting"); useAdvancedPuttingAction->setCheckedState(i18n("Disable &Advanced Putting")); - connect(useAdvancedPuttingAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(useAdvancedPuttingChanged(bool))); + connect(useAdvancedPuttingAction, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(useAdvancedPuttingChanged(bool))); useAdvancedPuttingAction->setChecked(config->readBoolEntry("useAdvancedPutting", false)); - showInfoAction = new KToggleAction(i18n("Show &Info"), "info", CTRL+Key_I, this, TQT_SLOT(emptySlot()), actionCollection(), "showinfo"); + showInfoAction = new KToggleAction(i18n("Show &Info"), "info", CTRL+Key_I, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "showinfo"); showInfoAction->setCheckedState(i18n("Hide &Info")); - connect(showInfoAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(showInfoChanged(bool))); + connect(showInfoAction, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(showInfoChanged(bool))); showInfoAction->setChecked(config->readBoolEntry("showInfo", false)); - showGuideLineAction = new KToggleAction(i18n("Show Putter &Guideline"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "showguideline"); + showGuideLineAction = new KToggleAction(i18n("Show Putter &Guideline"), 0, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "showguideline"); showGuideLineAction->setCheckedState(i18n("Hide Putter &Guideline")); - connect(showGuideLineAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(showGuideLineChanged(bool))); + connect(showGuideLineAction, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(showGuideLineChanged(bool))); showGuideLineAction->setChecked(config->readBoolEntry("showGuideLine", true)); - KToggleAction *act=new KToggleAction(i18n("Enable All Dialog Boxes"), 0, this, TQT_SLOT(enableAllMessages()), actionCollection(), "enableAll"); + KToggleAction *act=new KToggleAction(i18n("Enable All Dialog Boxes"), 0, TQT_TQOBJECT(this), TQT_SLOT(enableAllMessages()), actionCollection(), "enableAll"); act->setCheckedState(i18n("Disable All Dialog Boxes")); - soundAction = new KToggleAction(i18n("Play &Sounds"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "sound"); - connect(soundAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(soundChanged(bool))); + soundAction = new KToggleAction(i18n("Play &Sounds"), 0, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "sound"); + connect(soundAction, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(soundChanged(bool))); soundAction->setChecked(config->readBoolEntry("sound", true)); - (void) new KAction(i18n("&Reload Plugins"), 0, this, TQT_SLOT(initPlugins()), actionCollection(), "reloadplugins"); - (void) new KAction(i18n("Show &Plugins"), 0, this, TQT_SLOT(showPlugins()), actionCollection(), "showplugins"); + (void) new KAction(i18n("&Reload Plugins"), 0, TQT_TQOBJECT(this), TQT_SLOT(initPlugins()), actionCollection(), "reloadplugins"); + (void) new KAction(i18n("Show &Plugins"), 0, TQT_TQOBJECT(this), TQT_SLOT(showPlugins()), actionCollection(), "showplugins"); - aboutAction = new KAction(i18n("&About Course"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "aboutcourse"); - tutorialAction = new KAction(i18n("&Tutorial"), 0, this, TQT_SLOT(tutorial()), actionCollection(), "tutorial"); + aboutAction = new KAction(i18n("&About Course"), 0, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "aboutcourse"); + tutorialAction = new KAction(i18n("&Tutorial"), 0, TQT_TQOBJECT(this), TQT_SLOT(tutorial()), actionCollection(), "tutorial"); statusBar(); setupGUI(); @@ -176,7 +176,7 @@ void Kolf::startNewGame() players.clear(); delete scoreboard; scoreboard = new ScoreBoard(dummy, "Score Board"); - layout->addWidget(scoreboard, 1, 0); + tqlayout->addWidget(scoreboard, 1, 0); scoreboard->show(); if (loadedGame.isNull()) @@ -202,7 +202,7 @@ void Kolf::startNewGame() if (isTutorial) filename = KGlobal::dirs()->findResource("appdata", "tutorial.kolf"); else - filename = config.readEntry("Course", TQString::null); + filename = config.readEntry("Course", TQString()); if (filename.isNull()) return; @@ -226,19 +226,19 @@ void Kolf::startNewGame() connect(game, TQT_SIGNAL(newHole(int)), scoreboard, TQT_SLOT(newHole(int))); connect(game, TQT_SIGNAL(scoreChanged(int, int, int)), scoreboard, TQT_SLOT(setScore(int, int, int))); connect(game, TQT_SIGNAL(parChanged(int, int)), scoreboard, TQT_SLOT(parChanged(int, int))); - connect(game, TQT_SIGNAL(modifiedChanged(bool)), this, TQT_SLOT(updateModified(bool))); - connect(game, TQT_SIGNAL(newPlayersTurn(Player *)), this, TQT_SLOT(newPlayersTurn(Player *))); - connect(game, TQT_SIGNAL(holesDone()), this, TQT_SLOT(gameOver())); - connect(game, TQT_SIGNAL(checkEditing()), this, TQT_SLOT(checkEditing())); - connect(game, TQT_SIGNAL(editingStarted()), this, TQT_SLOT(editingStarted())); - connect(game, TQT_SIGNAL(editingEnded()), this, TQT_SLOT(editingEnded())); - connect(game, TQT_SIGNAL(inPlayStart()), this, TQT_SLOT(inPlayStart())); - connect(game, TQT_SIGNAL(inPlayEnd()), this, TQT_SLOT(inPlayEnd())); - connect(game, TQT_SIGNAL(maxStrokesReached(const TQString &)), this, TQT_SLOT(maxStrokesReached(const TQString &))); - connect(game, TQT_SIGNAL(largestHole(int)), this, TQT_SLOT(updateHoleMenu(int))); - connect(game, TQT_SIGNAL(titleChanged(const TQString &)), this, TQT_SLOT(titleChanged(const TQString &))); - connect(game, TQT_SIGNAL(newStatusText(const TQString &)), this, TQT_SLOT(newStatusText(const TQString &))); - connect(game, TQT_SIGNAL(currentHole(int)), this, TQT_SLOT(setCurrentHole(int))); + connect(game, TQT_SIGNAL(modifiedChanged(bool)), TQT_TQOBJECT(this), TQT_SLOT(updateModified(bool))); + connect(game, TQT_SIGNAL(newPlayersTurn(Player *)), TQT_TQOBJECT(this), TQT_SLOT(newPlayersTurn(Player *))); + connect(game, TQT_SIGNAL(holesDone()), TQT_TQOBJECT(this), TQT_SLOT(gameOver())); + connect(game, TQT_SIGNAL(checkEditing()), TQT_TQOBJECT(this), TQT_SLOT(checkEditing())); + connect(game, TQT_SIGNAL(editingStarted()), TQT_TQOBJECT(this), TQT_SLOT(editingStarted())); + connect(game, TQT_SIGNAL(editingEnded()), TQT_TQOBJECT(this), TQT_SLOT(editingEnded())); + connect(game, TQT_SIGNAL(inPlayStart()), TQT_TQOBJECT(this), TQT_SLOT(inPlayStart())); + connect(game, TQT_SIGNAL(inPlayEnd()), TQT_TQOBJECT(this), TQT_SLOT(inPlayEnd())); + connect(game, TQT_SIGNAL(maxStrokesReached(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(maxStrokesReached(const TQString &))); + connect(game, TQT_SIGNAL(largestHole(int)), TQT_TQOBJECT(this), TQT_SLOT(updateHoleMenu(int))); + connect(game, TQT_SIGNAL(titleChanged(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(titleChanged(const TQString &))); + connect(game, TQT_SIGNAL(newStatusText(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(newStatusText(const TQString &))); + connect(game, TQT_SIGNAL(currentHole(int)), TQT_TQOBJECT(this), TQT_SLOT(setCurrentHole(int))); connect(holeAction, TQT_SIGNAL(activated(const TQString &)), game, TQT_SLOT(switchHole(const TQString &))); connect(nextAction, TQT_SIGNAL(activated()), game, TQT_SLOT(nextHole())); connect(prevAction, TQT_SIGNAL(activated()), game, TQT_SLOT(prevHole())); @@ -264,7 +264,7 @@ void Kolf::startNewGame() game->setShowGuideLine(showGuideLineAction->isChecked()); game->setSound(soundAction->isChecked()); - layout->addWidget(game, 0, 0, AlignCenter); + tqlayout->addWidget(game, 0, 0, AlignCenter); game->show(); game->setFocus(); @@ -299,7 +299,7 @@ void Kolf::startNewGame() void Kolf::newGame() { isTutorial = false; - filename = TQString::null; + filename = TQString(); startNewGame(); } @@ -309,13 +309,13 @@ void Kolf::tutorial() if (newfilename.isNull()) return; - filename = TQString::null; + filename = TQString(); loadedGame = newfilename; isTutorial = true; startNewGame(); - loadedGame = TQString::null; + loadedGame = TQString(); } void Kolf::closeGame() @@ -327,12 +327,12 @@ void Kolf::closeGame() game->pause(); } - filename = TQString::null; + filename = TQString(); editingEnded(); delete game; game = 0; - loadedGame = TQString::null; + loadedGame = TQString(); editingAction->setChecked(false); setEditingEnabled(false); @@ -353,10 +353,10 @@ void Kolf::closeGame() loadGameAction->setEnabled(true); tutorialAction->setEnabled(true); - titleChanged(TQString::null); + titleChanged(TQString()); updateModified(false); - TQTimer::singleShot(100, this, TQT_SLOT(createSpacer())); + TQTimer::singleShot(100, TQT_TQOBJECT(this), TQT_SLOT(createSpacer())); } void Kolf::createSpacer() @@ -372,7 +372,7 @@ void Kolf::createSpacer() spacer = new KolfGame(obj, &spacerPlayers, KGlobal::dirs()->findResource("appdata", "intro"), dummy); spacer->setSound(false); spacer->startFirstHole(1); - layout->addWidget(spacer, 0, 0, AlignCenter); + tqlayout->addWidget(spacer, 0, 0, AlignCenter); spacer->hidePutter(); spacer->ignoreEvents(true); @@ -431,10 +431,10 @@ void Kolf::gameOver() if (names.count() > 1) { TQString winners = names.join(i18n(" and ")); - KMessageBox::information(this, i18n("%1 tied").arg(winners)); + KMessageBox::information(this, i18n("%1 tied").tqarg(winners)); } else - KMessageBox::information(this, i18n("%1 won!").arg(names.first())); + KMessageBox::information(this, i18n("%1 won!").tqarg(names.first())); } if (competition) @@ -459,11 +459,11 @@ void Kolf::gameOver() scoreDialog->addScore((*it).score, info, false, true); } - scoreDialog->setComment(i18n("High Scores for %1").arg(courseInfo.name)); + scoreDialog->setComment(i18n("High Scores for %1").tqarg(courseInfo.name)); scoreDialog->show(); } - TQTimer::singleShot(700, this, TQT_SLOT(closeGame())); + TQTimer::singleShot(700, TQT_TQOBJECT(this), TQT_SLOT(closeGame())); } void Kolf::showHighScores() @@ -475,7 +475,7 @@ void Kolf::showHighScores() game->courseInfo(courseInfo, game->curFilename()); scoreDialog->setConfigGroup(courseInfo.untranslatedName + TQString(" Highscores")); - scoreDialog->setComment(i18n("High Scores for %1").arg(courseInfo.name)); + scoreDialog->setComment(i18n("High Scores for %1").tqarg(courseInfo.name)); scoreDialog->show(); } @@ -537,7 +537,7 @@ void Kolf::saveGame() void Kolf::loadGame() { - loadedGame = KFileDialog::getOpenFileName(":savedkolf", TQString::fromLatin1("application/x-kolf"), this, i18n("Pick Kolf Saved Game")); + loadedGame = KFileDialog::getOpenFileName(":savedkolf", TQString::tqfromLatin1("application/x-kolf"), this, i18n("Pick Kolf Saved Game")); if (loadedGame.isNull()) return; @@ -564,7 +564,7 @@ void Kolf::openURL(KURL url) return; } - TQTimer::singleShot(10, this, TQT_SLOT(startNewGame())); + TQTimer::singleShot(10, TQT_TQOBJECT(this), TQT_SLOT(startNewGame())); } else closeGame(); @@ -572,7 +572,7 @@ void Kolf::openURL(KURL url) void Kolf::newPlayersTurn(Player *player) { - tempStatusBarText = i18n("%1's turn").arg(player->name()); + tempStatusBarText = i18n("%1's turn").tqarg(player->name()); if (showInfoAction->isChecked()) statusBar()->message(tempStatusBarText, 5 * 1000); @@ -596,12 +596,12 @@ void Kolf::editingStarted() editor = new Editor(obj, dummy, "Editor"); connect(editor, TQT_SIGNAL(addNewItem(Object *)), game, TQT_SLOT(addNewObject(Object *))); connect(editor, TQT_SIGNAL(changed()), game, TQT_SLOT(setModified())); - connect(editor, TQT_SIGNAL(addNewItem(Object *)), this, TQT_SLOT(setHoleFocus())); + connect(editor, TQT_SIGNAL(addNewItem(Object *)), TQT_TQOBJECT(this), TQT_SLOT(setHoleFocus())); connect(game, TQT_SIGNAL(newSelectedItem(CanvasItem *)), editor, TQT_SLOT(setItem(CanvasItem *))); scoreboard->hide(); - layout->addWidget(editor, 1, 0); + tqlayout->addWidget(editor, 1, 0); editor->show(); clearHoleAction->setEnabled(true); @@ -643,7 +643,7 @@ void Kolf::inPlayEnd() void Kolf::maxStrokesReached(const TQString &name) { - KMessageBox::sorry(this, i18n("%1's score has reached the maximum for this hole.").arg(name)); + KMessageBox::sorry(this, i18n("%1's score has reached the maximum for this hole.").tqarg(name)); } void Kolf::updateHoleMenu(int largest) @@ -697,7 +697,7 @@ void Kolf::print() KPrinter pr; pr.addDialogPage(new PrintDialogPage()); - if (pr.setup(this, i18n("Print %1 - Hole %2").arg(game->courseName()).arg(game->currentHole()))) + if (pr.setup(this, i18n("Print %1 - Hole %2").tqarg(game->courseName()).tqarg(game->currentHole()))) { pr.newPage(); if (game) @@ -785,14 +785,14 @@ void Kolf::initPlugins() void Kolf::showPlugins() { - TQString text = TQString("

%1

    ").arg(i18n("Currently Loaded Plugins")); + TQString text = TQString("

    %1

      ").tqarg(i18n("Currently Loaded Plugins")); Object *object = 0; for (object = plugins.first(); object; object = plugins.next()) { text.append("
    1. "); text.append(object->name()); text.append(" - "); - text.append(i18n("by %1").arg(object->author())); + text.append(i18n("by %1").tqarg(object->author())); text.append("
    2. "); } text.append("
    "); diff --git a/kolf/kolf.h b/kolf/kolf.h index b57b2774..62892ea7 100644 --- a/kolf/kolf.h +++ b/kolf/kolf.h @@ -27,6 +27,7 @@ class Editor; class KDE_EXPORT Kolf : public KMainWindow { Q_OBJECT + TQ_OBJECT public: Kolf(); @@ -87,7 +88,7 @@ private: TQString filename; PlayerList players; PlayerList spacerPlayers; - TQGridLayout *layout; + TQGridLayout *tqlayout; ScoreBoard *scoreboard; KToggleAction *editingAction; KAction *newHoleAction; diff --git a/kolf/kvolumecontrol.cpp b/kolf/kvolumecontrol.cpp index e2aaa464..b2028b77 100644 --- a/kolf/kvolumecontrol.cpp +++ b/kolf/kvolumecontrol.cpp @@ -5,14 +5,14 @@ #include "kvolumecontrol.h" -KVolumeControl::KVolumeControl(Arts::SoundServerV2 server, KPlayObject *parent) - : TQObject(parent) +KVolumeControl::KVolumeControl(Arts::SoundServerV2 server, KPlayObject *tqparent) + : TQObject(tqparent) { init(server); } -KVolumeControl::KVolumeControl(double vol, Arts::SoundServerV2 server, KPlayObject *parent) - : TQObject(parent) +KVolumeControl::KVolumeControl(double vol, Arts::SoundServerV2 server, KPlayObject *tqparent) + : TQObject(tqparent) { init(server); setVolume(vol); @@ -42,8 +42,8 @@ void KVolumeControl::init(Arts::SoundServerV2 server) } volumeControl.start(); - Arts::connect((static_cast(parent()))->object(), "left", volumeControl, "inleft"); - Arts::connect((static_cast(parent()))->object(), "right", volumeControl, "inright"); + Arts::connect((static_cast(tqparent()))->object(), "left", volumeControl, "inleft"); + Arts::connect((static_cast(tqparent()))->object(), "right", volumeControl, "inright"); Arts::connect(volumeControl, manager); } diff --git a/kolf/kvolumecontrol.h b/kolf/kvolumecontrol.h index ab7632f4..190b3beb 100644 --- a/kolf/kvolumecontrol.h +++ b/kolf/kvolumecontrol.h @@ -6,13 +6,14 @@ #include #include -class KVolumeControl : public QObject +class KVolumeControl : public TQObject { Q_OBJECT + TQ_OBJECT public: - KVolumeControl(Arts::SoundServerV2 server, KPlayObject *parent); - KVolumeControl(double vol, Arts::SoundServerV2 server, KPlayObject *parent); + KVolumeControl(Arts::SoundServerV2 server, KPlayObject *tqparent); + KVolumeControl(double vol, Arts::SoundServerV2 server, KPlayObject *tqparent); ~KVolumeControl(); void setVolume(double); diff --git a/kolf/main.cpp b/kolf/main.cpp index e9e8498a..079178ee 100644 --- a/kolf/main.cpp +++ b/kolf/main.cpp @@ -57,16 +57,16 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) KolfGame::courseInfo(info, filename); cout << info.name.latin1() - << " - " << i18n("By %1").arg(info.author).latin1() - << " - " << i18n("%1 holes").arg(info.holes).latin1() - << " - " << i18n("par %1").arg(info.par).latin1() + << " - " << i18n("By %1").tqarg(info.author).latin1() + << " - " << i18n("%1 holes").tqarg(info.holes).latin1() + << " - " << i18n("par %1").tqarg(info.par).latin1() << endl; return 0; } else { - KCmdLineArgs::usage(i18n("Course %1 does not exist.").arg(filename.latin1())); + KCmdLineArgs::usage(i18n("Course %1 does not exist.").tqarg(filename.latin1())); } } diff --git a/kolf/newgame.cpp b/kolf/newgame.cpp index 22c6b785..2fd048c1 100644 --- a/kolf/newgame.cpp +++ b/kolf/newgame.cpp @@ -35,8 +35,8 @@ #include "newgame.h" #include "game.h" -NewGameDialog::NewGameDialog(bool enableCourses, TQWidget *parent, const char *_name) - : KDialogBase(KDialogBase::TreeList, i18n("New Game"), Ok | Cancel, Ok, parent, _name) +NewGameDialog::NewGameDialog(bool enableCourses, TQWidget *tqparent, const char *_name) + : KDialogBase(KDialogBase::TreeList, i18n("New Game"), Ok | Cancel, Ok, tqparent, _name) { this->enableCourses = enableCourses; @@ -56,14 +56,14 @@ NewGameDialog::NewGameDialog(bool enableCourses, TQWidget *parent, const char *_ scroller = new TQScrollView(playerPage); bigLayout->addWidget(scroller); - layout = new TQVBox(scroller->viewport()); - if (!TQPixmapCache::find("grass", grass)) + tqlayout = new TQVBox(scroller->viewport()); + if (!TQPixmapCache::tqfind("grass", grass)) { grass.load(locate("appdata", "pics/grass.png")); TQPixmapCache::insert("grass", grass); } scroller->viewport()->setBackgroundPixmap(grass); - scroller->addChild(layout); + scroller->addChild(tqlayout); TQMap entries = config->entryMap("New Game Dialog"); unsigned int i = 0; @@ -95,7 +95,7 @@ NewGameDialog::NewGameDialog(bool enableCourses, TQWidget *parent, const char *_ connect(coursesLink, TQT_SIGNAL(leftClickedURL(const TQString &)), kapp, TQT_SLOT(invokeBrowser(const TQString &))); coursePageLayout->addWidget(coursesLink); - TQHBoxLayout *hlayout = new TQHBoxLayout(coursePageLayout, spacingHint()); + TQHBoxLayout *htqlayout = new TQHBoxLayout(coursePageLayout, spacingHint()); // following use this group config->setGroup("New Game Dialog Mode"); @@ -123,18 +123,18 @@ NewGameDialog::NewGameDialog(bool enableCourses, TQWidget *parent, const char *_ } const TQString newName(i18n("Create New")); - info[TQString::null] = CourseInfo(newName, newName, i18n("You"), 0, 0); - names.append(TQString::null); + info[TQString()] = CourseInfo(newName, newName, i18n("You"), 0, 0); + names.append(TQString()); nameList.append(newName); courseList = new KListBox(coursePage); - hlayout->addWidget(courseList); + htqlayout->addWidget(courseList); courseList->insertStringList(nameList); courseList->setCurrentItem(curItem); connect(courseList, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(courseSelected(int))); connect(courseList, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(selectionChanged())); - TQVBoxLayout *detailLayout = new TQVBoxLayout(hlayout, spacingHint()); + TQVBoxLayout *detailLayout = new TQVBoxLayout(htqlayout, spacingHint()); name = new TQLabel(coursePage); detailLayout->addWidget(name); author = new TQLabel(coursePage); @@ -170,15 +170,15 @@ NewGameDialog::NewGameDialog(bool enableCourses, TQWidget *parent, const char *_ // options page optionsPage = addPage(i18n("Options"), i18n("Game Options")); - TQVBoxLayout *vlayout = new TQVBoxLayout(optionsPage, marginHint(), spacingHint()); + TQVBoxLayout *vtqlayout = new TQVBoxLayout(optionsPage, marginHint(), spacingHint()); mode = new TQCheckBox(i18n("&Strict mode"), optionsPage); - vlayout->addWidget(mode); + vtqlayout->addWidget(mode); mode->setChecked(config->readBoolEntry("competition", false)); TQLabel *desc = new TQLabel(i18n("In strict mode, undo, editing, and switching holes is not allowed. This is generally for competition. Only in strict mode are highscores kept."), optionsPage); desc->setTextFormat(RichText); - vlayout->addWidget(desc); + vtqlayout->addWidget(desc); } void NewGameDialog::slotOk() @@ -199,7 +199,7 @@ void NewGameDialog::slotOk() PlayerEditor *curEditor = 0; int i = 0; for (curEditor = editors.first(); curEditor; curEditor = editors.next(), ++i) - config->writeEntry(TQString::number(i) + curEditor->name(), curEditor->color().name()); + config->writeEntry(TQString::number(i) + curEditor->name(), TQString(curEditor->color().name())); config->sync(); @@ -212,11 +212,11 @@ void NewGameDialog::courseSelected(int index) CourseInfo &curinfo = info[currentCourse]; - name->setText(TQString("%1").arg(curinfo.name)); + name->setText(TQString("%1").tqarg(curinfo.name)); - author->setText(i18n("By %1").arg(curinfo.author)); - par->setText(i18n("Par %1").arg(curinfo.par)); - holes->setText(i18n("%1 Holes").arg(curinfo.holes)); + author->setText(i18n("By %1").tqarg(curinfo.author)); + par->setText(i18n("Par %1").tqarg(curinfo.par)); + holes->setText(i18n("%1 Holes").tqarg(curinfo.holes)); } void NewGameDialog::showHighscores() @@ -224,7 +224,7 @@ void NewGameDialog::showHighscores() KScoreDialog *scoreDialog = new KScoreDialog(KScoreDialog::Name | KScoreDialog::Custom1 | KScoreDialog::Score, this); scoreDialog->addField(KScoreDialog::Custom1, i18n("Par"), "Par"); scoreDialog->setConfigGroup(info[currentCourse].untranslatedName + TQString(" Highscores")); - scoreDialog->setComment(i18n("High Scores for %1").arg(info[currentCourse].name)); + scoreDialog->setComment(i18n("High Scores for %1").tqarg(info[currentCourse].name)); scoreDialog->show(); } @@ -235,7 +235,7 @@ void NewGameDialog::removeCourse() return; TQString file = *names.at(curItem); - if (externCourses.contains(file) < 1) + if (externCourses.tqcontains(file) < 1) return; names.remove(file); @@ -248,18 +248,18 @@ void NewGameDialog::removeCourse() void NewGameDialog::selectionChanged() { const int curItem = courseList->currentItem(); - remove->setEnabled(!(curItem < 0 || externCourses.contains(*names.at(curItem)) < 1)); + remove->setEnabled(!(curItem < 0 || externCourses.tqcontains(*names.at(curItem)) < 1)); } void NewGameDialog::addCourse() { - TQStringList files = KFileDialog::getOpenFileNames(":kourses", TQString::fromLatin1("application/x-kourse"), this, i18n("Pick Kolf Course")); + TQStringList files = KFileDialog::getOpenFileNames(":kourses", TQString::tqfromLatin1("application/x-kourse"), this, i18n("Pick Kolf Course")); bool hasDuplicates = false; for (TQStringList::Iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) { - if (names.contains(*fileIt) > 0) + if (names.tqcontains(*fileIt) > 0) { hasDuplicates = true; continue; @@ -287,7 +287,7 @@ void NewGameDialog::addPlayer() if (editors.count() >= startColors.count()) return; - editors.append(new PlayerEditor(i18n("Player %1").arg(editors.count() + 1), *startColors.at(editors.count()), layout)); + editors.append(new PlayerEditor(i18n("Player %1").tqarg(editors.count() + 1), *startColors.at(editors.count()), tqlayout)); editors.last()->show(); connect(editors.last(), TQT_SIGNAL(deleteEditor(PlayerEditor *)), this, TQT_SLOT(deleteEditor(PlayerEditor *))); @@ -311,12 +311,12 @@ void NewGameDialog::enableButtons() ///////////////////////// -PlayerEditor::PlayerEditor(TQString startName, TQColor startColor, TQWidget *parent, const char *_name) - : TQWidget(parent, _name) +PlayerEditor::PlayerEditor(TQString startName, TQColor startColor, TQWidget *tqparent, const char *_name) + : TQWidget(tqparent, _name) { - TQHBoxLayout *layout = new TQHBoxLayout(this, KDialogBase::spacingHint()); + TQHBoxLayout *tqlayout = new TQHBoxLayout(this, KDialogBase::spacingHint()); - if (!TQPixmapCache::find("grass", grass)) + if (!TQPixmapCache::tqfind("grass", grass)) { grass.load(locate("appdata", "pics/grass.png")); TQPixmapCache::insert("grass", grass); @@ -324,17 +324,17 @@ PlayerEditor::PlayerEditor(TQString startName, TQColor startColor, TQWidget *par setBackgroundPixmap(grass); editor = new KLineEdit(this); - layout->addWidget(editor); + tqlayout->addWidget(editor); editor->setFrame(false); editor->setText(startName); - layout->addStretch(); - layout->addWidget(colorButton = new KColorButton(startColor, this)); + tqlayout->addStretch(); + tqlayout->addWidget(colorButton = new KColorButton(startColor, this)); colorButton->setAutoMask(true); colorButton->setBackgroundPixmap(grass); KPushButton *remove = new KPushButton(i18n("Remove"), this); remove->setAutoMask(true); - layout->addWidget(remove); + tqlayout->addWidget(remove); remove->setBackgroundPixmap(grass); connect(remove, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeMe())); } diff --git a/kolf/newgame.h b/kolf/newgame.h index c4e228a4..ce5b8060 100644 --- a/kolf/newgame.h +++ b/kolf/newgame.h @@ -24,12 +24,13 @@ class TQPainter; class KListBox; class TQEvent; -class PlayerEditor : public QWidget +class PlayerEditor : public TQWidget { Q_OBJECT + TQ_OBJECT public: - PlayerEditor(TQString name = TQString::null, TQColor = red, TQWidget *parent = 0, const char *_name = 0); + PlayerEditor(TQString name = TQString(), TQColor = red, TQWidget *tqparent = 0, const char *_name = 0); TQColor color() { return colorButton->color(); } TQString name() { return editor->text(); } void setColor(TQColor col) { colorButton->setColor(col); } @@ -50,9 +51,10 @@ private: class NewGameDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - NewGameDialog(bool enableCourses, TQWidget *parent, const char *_name = 0); + NewGameDialog(bool enableCourses, TQWidget *tqparent, const char *_name = 0); TQPtrList *players() { return &editors; } bool competition() { return mode->isChecked(); } TQString course() { return currentCourse; } @@ -72,7 +74,7 @@ private slots: void showHighscores(); private: - TQVBox *layout; + TQVBox *tqlayout; KPushButton *addButton; TQFrame *playerPage; TQScrollView *scroller; diff --git a/kolf/object.h b/kolf/object.h index 1ef52c55..74464bb6 100644 --- a/kolf/object.h +++ b/kolf/object.h @@ -7,12 +7,13 @@ #include #include -class Object : public QObject +class Object : public TQObject { Q_OBJECT + TQ_OBJECT public: - Object(TQObject *parent = 0, const char *name = 0) : TQObject(parent, name) { m_addOnNewHole = false; } + Object(TQObject *tqparent = 0, const char *name = 0) : TQObject(tqparent, name) { m_addOnNewHole = false; } virtual TQCanvasItem *newObject(TQCanvas * /*canvas*/) { return 0; } TQString name() { return m_name; } TQString _name() { return m__name; } diff --git a/kolf/objects/poolball/poolball.cpp b/kolf/objects/poolball/poolball.cpp index c2fe0718..18d3ca5b 100644 --- a/kolf/objects/poolball/poolball.cpp +++ b/kolf/objects/poolball/poolball.cpp @@ -54,20 +54,20 @@ void PoolBall::draw(TQPainter &p) Ball::draw(p); } -PoolBallConfig::PoolBallConfig(PoolBall *poolBall, TQWidget *parent) - : Config(parent), m_poolBall(poolBall) +PoolBallConfig::PoolBallConfig(PoolBall *poolBall, TQWidget *tqparent) + : Config(tqparent), m_poolBall(poolBall) { - TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); - layout->addStretch(); + tqlayout->addStretch(); TQLabel *num = new TQLabel(i18n("Number:"), this); - layout->addWidget(num); + tqlayout->addWidget(num); KIntNumInput *slider = new KIntNumInput(m_poolBall->number(), this); slider->setRange(1, 15); - layout->addWidget(slider); + tqlayout->addWidget(slider); - layout->addStretch(); + tqlayout->addStretch(); connect(slider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(numberChanged(int))); } @@ -78,9 +78,9 @@ void PoolBallConfig::numberChanged(int newNumber) changed(); } -Config *PoolBall::config(TQWidget *parent) +Config *PoolBall::config(TQWidget *tqparent) { - return new PoolBallConfig(this, parent); + return new PoolBallConfig(this, tqparent); } #include "poolball.moc" diff --git a/kolf/objects/poolball/poolball.h b/kolf/objects/poolball/poolball.h index 82b1dd68..312e1996 100644 --- a/kolf/objects/poolball/poolball.h +++ b/kolf/objects/poolball/poolball.h @@ -15,7 +15,7 @@ class StateDB; class KConfig; -class PoolBallFactory : KLibFactory { Q_OBJECT public: TQObject *createObject(TQObject *, const char *, const char *, const TQStringList & = TQStringList()); }; +class PoolBallFactory : KLibFactory { TQ_OBJECT public: TQObject *createObject(TQObject *, const char *, const char *, const TQStringList & = TQStringList()); }; class PoolBall : public Ball { @@ -24,7 +24,7 @@ public: virtual bool deleteable() const { return true; } - virtual Config *config(TQWidget *parent); + virtual Config *config(TQWidget *tqparent); virtual void saveState(StateDB *); virtual void save(KConfig *cfg); virtual void loadState(StateDB *); @@ -42,9 +42,10 @@ private: class PoolBallConfig : public Config { Q_OBJECT + TQ_OBJECT public: - PoolBallConfig(PoolBall *poolBall, TQWidget *parent); + PoolBallConfig(PoolBall *poolBall, TQWidget *tqparent); private slots: void numberChanged(int); diff --git a/kolf/objects/test/test.cpp b/kolf/objects/test/test.cpp index d417f552..38a40f22 100644 --- a/kolf/objects/test/test.cpp +++ b/kolf/objects/test/test.cpp @@ -14,7 +14,7 @@ #include "test.h" K_EXPORT_COMPONENT_FACTORY(libkolftest, TestFactory) -TQObject *TestFactory::createObject (TQObject * /*parent*/, const char * /*name*/, const char * /*classname*/, const TQStringList & /*args*/) +TQObject *TestFactory::createObject (TQObject * /*tqparent*/, const char * /*name*/, const char * /*classname*/, const TQStringList & /*args*/) { return new TestObj; } Test::Test(TQCanvas *canvas) @@ -39,9 +39,9 @@ void Test::advance(int phase) if (count % m_switchEvery == 0) { // random color - const TQColor myColor((QRgb)(kapp->random() % 0x01000000)); + const TQColor myColor((TQRgb)(kapp->random() % 0x01000000)); - // set the brush, so our shape is drawn + // set the brush, so our tqshape is drawn // with the random color setBrush(TQBrush(myColor)); @@ -65,24 +65,24 @@ void Test::load(KConfig *cfg) setSwitchEvery(cfg->readNumEntry("switchEvery", 50)); } -TestConfig::TestConfig(Test *test, TQWidget *parent) - : Config(parent), m_test(test) +TestConfig::TestConfig(Test *test, TQWidget *tqparent) + : Config(tqparent), m_test(test) { - TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); - layout->addStretch(); + tqlayout->addStretch(); - layout->addWidget(new TQLabel(i18n("Flash speed"), this)); + tqlayout->addWidget(new TQLabel(i18n("Flash speed"), this)); - TQHBoxLayout *hlayout = new TQHBoxLayout(layout, spacingHint()); + TQHBoxLayout *htqlayout = new TQHBoxLayout(tqlayout, spacingHint()); TQLabel *slow = new TQLabel(i18n("Slow"), this); - hlayout->addWidget(slow); + htqlayout->addWidget(slow); TQSlider *slider = new TQSlider(1, 100, 5, 101 - m_test->switchEvery(), Qt::Horizontal, this); - hlayout->addWidget(slider); + htqlayout->addWidget(slider); TQLabel *fast = new TQLabel(i18n("Fast"), this); - hlayout->addWidget(fast); + htqlayout->addWidget(fast); - layout->addStretch(); + tqlayout->addStretch(); connect(slider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(switchEveryChanged(int))); } @@ -96,9 +96,9 @@ void TestConfig::switchEveryChanged(int news) changed(); } -Config *Test::config(TQWidget *parent) +Config *Test::config(TQWidget *tqparent) { - return new TestConfig(this, parent); + return new TestConfig(this, tqparent); } #include "test.moc" diff --git a/kolf/objects/test/test.h b/kolf/objects/test/test.h index 06e9f30a..690a7e84 100644 --- a/kolf/objects/test/test.h +++ b/kolf/objects/test/test.h @@ -11,14 +11,14 @@ class KConfig; -class TestFactory : KLibFactory { Q_OBJECT public: TQObject *createObject(TQObject *, const char *, const char *, const TQStringList & = TQStringList()); }; +class TestFactory : KLibFactory { TQ_OBJECT public: TQObject *createObject(TQObject *, const char *, const char *, const TQStringList & = TQStringList()); }; class Test : public TQCanvasEllipse, public CanvasItem { public: Test(TQCanvas *canvas); - virtual Config *config(TQWidget *parent); + virtual Config *config(TQWidget *tqparent); virtual void save(KConfig *cfg); virtual void load(KConfig *cfg); @@ -35,9 +35,10 @@ private: class TestConfig : public Config { Q_OBJECT + TQ_OBJECT public: - TestConfig(Test *test, TQWidget *parent); + TestConfig(Test *test, TQWidget *tqparent); private slots: void switchEveryChanged(int news); diff --git a/kolf/printdialogpage.cpp b/kolf/printdialogpage.cpp index e8733c81..dfec9c96 100644 --- a/kolf/printdialogpage.cpp +++ b/kolf/printdialogpage.cpp @@ -8,16 +8,16 @@ #include "printdialogpage.h" -PrintDialogPage::PrintDialogPage(TQWidget *parent, const char *name) - : KPrintDialogPage( parent, name ) +PrintDialogPage::PrintDialogPage(TQWidget *tqparent, const char *name) + : KPrintDialogPage( tqparent, name ) { setTitle(i18n("Kolf Options")); - TQVBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); titleCheck = new TQCheckBox(i18n("Draw title text"), this); titleCheck->setChecked(true); - layout->addWidget(titleCheck); + tqlayout->addWidget(titleCheck); } void PrintDialogPage::getOptions(TQMap &opts, bool /*incldef*/) diff --git a/kolf/printdialogpage.h b/kolf/printdialogpage.h index 76b7c43a..4869ea53 100644 --- a/kolf/printdialogpage.h +++ b/kolf/printdialogpage.h @@ -11,9 +11,10 @@ class TQWidget; class PrintDialogPage : public KPrintDialogPage { Q_OBJECT + TQ_OBJECT public: - PrintDialogPage(TQWidget *parent = 0, const char *name = 0); + PrintDialogPage(TQWidget *tqparent = 0, const char *name = 0); //reimplement virtual functions void getOptions(TQMap &opts, bool incldef = false); diff --git a/kolf/scoreboard.cpp b/kolf/scoreboard.cpp index 61ff9926..cdd5759b 100644 --- a/kolf/scoreboard.cpp +++ b/kolf/scoreboard.cpp @@ -9,15 +9,15 @@ #include "scoreboard.h" -ScoreBoard::ScoreBoard(TQWidget *parent, const char *name) - : TQTable(1, 1, parent, name) +ScoreBoard::ScoreBoard(TQWidget *tqparent, const char *name) + : TQTable(1, 1, tqparent, name) { vh = verticalHeader(); hh = horizontalHeader(); vh->setLabel(numRows() - 1, i18n("Par")); hh->setLabel(numCols() - 1, i18n("Total")); - setFocusPolicy(TQWidget::NoFocus); + setFocusPolicy(TQ_NoFocus); setRowReadOnly(0, true); setRowReadOnly(1, true); } diff --git a/kolf/scoreboard.h b/kolf/scoreboard.h index b9caf652..f15a323a 100644 --- a/kolf/scoreboard.h +++ b/kolf/scoreboard.h @@ -6,12 +6,13 @@ class TQWidget; class TQHeader; -class ScoreBoard : public QTable +class ScoreBoard : public TQTable { Q_OBJECT + TQ_OBJECT public: - ScoreBoard(TQWidget *parent = 0, const char *name = 0); + ScoreBoard(TQWidget *tqparent = 0, const char *name = 0); int total(int id, TQString &name); public slots: diff --git a/kolf/slope.cpp b/kolf/slope.cpp index a6a1abf1..dd40cc49 100644 --- a/kolf/slope.cpp +++ b/kolf/slope.cpp @@ -34,7 +34,7 @@ Slope::Slope(TQRect rect, TQCanvas *canvas) setZ(-50); - if (!TQPixmapCache::find("grass", grass)) + if (!TQPixmapCache::tqfind("grass", grass)) { grass.load(locate("appdata", "pics/grass.png")); TQPixmapCache::insert("grass", grass); @@ -71,7 +71,7 @@ void Slope::showInfo() arrow->setZ(z() + .01); arrow->setVisible(true); } - text->setVisible(true); + text->tqsetVisible(true); } void Slope::hideInfo() @@ -80,7 +80,7 @@ void Slope::hideInfo() Arrow *arrow = 0; for (arrow = arrows.first(); arrow; arrow = arrows.next()) arrow->setVisible(false); - text->setVisible(false); + text->tqsetVisible(false); } void Slope::aboutToDie() @@ -179,7 +179,7 @@ void Slope::moveArrow() void Slope::editModeChanged(bool changed) { - point->setVisible(changed); + point->tqsetVisible(changed); moveBy(0, 0); } @@ -501,13 +501,13 @@ void Slope::updatePixmap() // shift all the points for (unsigned int i = 0; i < r.count(); ++i) { - TQPoint &p = r[i]; + QPoint &p = r[i]; p.setX(p.x() - x()); p.setY(p.y() - y()); } bpainter.drawPolygon(r); - // mask is drawn + // tqmask is drawn pixmap.setMask(bitmap); } @@ -517,11 +517,11 @@ void Slope::updatePixmap() ///////////////////////// -SlopeConfig::SlopeConfig(Slope *slope, TQWidget *parent) - : Config(parent) +SlopeConfig::SlopeConfig(Slope *slope, TQWidget *tqparent) + : Config(tqparent) { this->slope = slope; - TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); KComboBox *gradient = new KComboBox(this); TQStringList items; TQString curText; @@ -533,28 +533,28 @@ SlopeConfig::SlopeConfig(Slope *slope, TQWidget *parent) } gradient->insertStringList(items); gradient->setCurrentText(curText); - layout->addWidget(gradient); + tqlayout->addWidget(gradient); connect(gradient, TQT_SIGNAL(activated(const TQString &)), this, TQT_SLOT(setGradient(const TQString &))); - layout->addStretch(); + tqlayout->addStretch(); TQCheckBox *reversed = new TQCheckBox(i18n("Reverse direction"), this); reversed->setChecked(slope->isReversed()); - layout->addWidget(reversed); + tqlayout->addWidget(reversed); connect(reversed, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setReversed(bool))); - TQHBoxLayout *hlayout = new TQHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new TQLabel(i18n("Grade:"), this)); + TQHBoxLayout *htqlayout = new TQHBoxLayout(tqlayout, spacingHint()); + htqlayout->addWidget(new TQLabel(i18n("Grade:"), this)); KDoubleNumInput *grade = new KDoubleNumInput(this); grade->setRange(0, 8, 1, true); grade->setValue(slope->curGrade()); - hlayout->addWidget(grade); + htqlayout->addWidget(grade); connect(grade, TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(gradeChanged(double))); TQCheckBox *stuck = new TQCheckBox(i18n("Unmovable"), this); TQWhatsThis::add(stuck, i18n("Whether or not this slope can be moved by other objects, like floaters.")); stuck->setChecked(slope->isStuckOnGround()); - layout->addWidget(stuck); + tqlayout->addWidget(stuck); connect(stuck, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setStuckOnGround(bool))); } diff --git a/kolf/slope.h b/kolf/slope.h index 1bca5e5e..c829ad36 100644 --- a/kolf/slope.h +++ b/kolf/slope.h @@ -9,9 +9,10 @@ class Slope; class SlopeConfig : public Config { Q_OBJECT + TQ_OBJECT public: - SlopeConfig(Slope *slope, TQWidget *parent); + SlopeConfig(Slope *slope, TQWidget *tqparent); private slots: void setGradient(const TQString &text); @@ -35,7 +36,7 @@ public: virtual void editModeChanged(bool changed); virtual bool canBeMovedByOthers() const { return !stuckOnGround; } virtual TQPtrList moveableItems() const; - virtual Config *config(TQWidget *parent) { return new SlopeConfig(this, parent); } + virtual Config *config(TQWidget *tqparent) { return new SlopeConfig(this, tqparent); } void setSize(int, int); virtual void newSize(int width, int height); diff --git a/kolf/tutorial.kolf b/kolf/tutorial.kolf index cfc5f5af..eaddc8aa 100644 --- a/kolf/tutorial.kolf +++ b/kolf/tutorial.kolf @@ -188,7 +188,7 @@ Comment[pl]=Aby wycelować kij, wciÅ›nij klawisz z lewÄ… lub prawÄ… strzaÅ‚kÄ… ( Comment[pt]=Para apontar o taco, carregue nas teclas Esquerda (rodar no sentido contrário aos ponteiros do relógio) e Direita (rodar nos ponteiros do relógio) ou use o rato. Comment[pt_BR]=Para direcionar a mira, pressione a seta para Esquerda (rotação no sentido anti-horário) e Direita (sentido horário) ou use o mouse. Comment[ru]=Чтобы прицелитьÑÑ, нажмите Ñтрелку влево (поворот против чаÑовой Ñтрелки) или вправо (по чаÑовой) или иÑпользуйте мышь. -Comment[sk]=Smer urÄíte pomocou Å¡ipky vľavo (otoÄenie proti smeru hodinových ruÄiÄiek) a vpravo (otoÄenie po smere) alebo použite myÅ¡. +Comment[sk]=Smer urÄíte potqmocou Å¡ipky vľavo (otoÄenie proti smeru hodinových ruÄiÄiek) a vpravo (otoÄenie po smere) alebo použite myÅ¡. Comment[sl]=Da namerite palico, pritisnite puÅ¡Äici levo (zasuk v nasprotni smeri urinega kazalca) ali desno (zasuk v smeri urinega kazalca) ali uporabite miÅ¡ko. Comment[sr]=Да биÑте нациљали путер притиÑните леву Ñтрелицу (окреће Ñупротно Ñмеру казаљке на чаÑовнику) или деÑну (у Ñмеру казаљке на чаÑовнику), или кориÑтите миша. Comment[sr@Latn]=Da biste naciljali puter pritisnite levu strelicu (okreće suprotno smeru kazaljke na Äasovniku) ili desnu (u smeru kazaljke na Äasovniku), ili koristite miÅ¡a. diff --git a/konquest/fleetdlg.cc b/konquest/fleetdlg.cc index e933e895..e2194089 100644 --- a/konquest/fleetdlg.cc +++ b/konquest/fleetdlg.cc @@ -8,7 +8,7 @@ #include "fleetdlg.h" -FleetDlgListViewItem::FleetDlgListViewItem(TQListView *parent, TQString s1, TQString s2, TQString s3, TQString s4, TQString s5) : TQListViewItem(parent, s1, s2, s3, s4, s5) +FleetDlgListViewItem::FleetDlgListViewItem(TQListView *tqparent, TQString s1, TQString s2, TQString s3, TQString s4, TQString s5) : TQListViewItem(tqparent, s1, s2, s3, s4, s5) { } @@ -35,8 +35,8 @@ int FleetDlgListViewItem::compare(TQListViewItem *i, int col, bool) const } -FleetDlg::FleetDlg( TQWidget *parent, AttackFleetList *fleets ) - : TQDialog(parent, "FleetDlg", true ), fleetList(fleets) +FleetDlg::FleetDlg( TQWidget *tqparent, AttackFleetList *fleets ) + : TQDialog(tqparent, "FleetDlg", true ), fleetList(fleets) { setCaption( kapp->makeStdCaption(i18n("Fleet Overview")) ); @@ -46,21 +46,21 @@ FleetDlg::FleetDlg( TQWidget *parent, AttackFleetList *fleets ) fleetTable->addColumn(i18n("Ships")); fleetTable->addColumn(i18n("Kill Percentage")); fleetTable->addColumn(i18n("Arrival Turn")); - fleetTable->setMinimumSize( fleetTable->sizeHint() ); + fleetTable->setMinimumSize( fleetTable->tqsizeHint() ); KPushButton *okButton = new KPushButton( KStdGuiItem::ok(), this ); - okButton->setMinimumSize( okButton->sizeHint() ); + okButton->setMinimumSize( okButton->tqsizeHint() ); okButton->setDefault(true); - TQVBoxLayout *layout1 = new TQVBoxLayout( this ); - TQHBoxLayout *layout2 = new TQHBoxLayout; + TQVBoxLayout *tqlayout1 = new TQVBoxLayout( this ); + TQHBoxLayout *tqlayout2 = new TQHBoxLayout; - layout1->addWidget( fleetTable, 1 ); - layout1->addLayout( layout2 ); + tqlayout1->addWidget( fleetTable, 1 ); + tqlayout1->addLayout( tqlayout2 ); - layout2->addStretch( 2 ); - layout2->addWidget( okButton ); - layout2->addStretch( 2 ); + tqlayout2->addStretch( 2 ); + tqlayout2->addWidget( okButton ); + tqlayout2->addStretch( 2 ); connect( okButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept()) ); @@ -79,10 +79,10 @@ FleetDlg::init() while( (curFleet = nextFleet())) { fleetNumber++; new FleetDlgListViewItem(fleetTable, - TQString("%1").arg(fleetNumber), + TQString("%1").tqarg(fleetNumber), curFleet->destination->getName(), - TQString("%1").arg(curFleet->getShipCount()), - TQString("%1").arg(KGlobal::locale()->formatNumber(curFleet->killPercentage, 3)), - TQString("%1").arg((int)ceil(curFleet->arrivalTurn))); + TQString("%1").tqarg(curFleet->getShipCount()), + TQString("%1").tqarg(KGlobal::locale()->formatNumber(curFleet->killPercentage, 3)), + TQString("%1").tqarg((int)ceil(curFleet->arrivalTurn))); } } diff --git a/konquest/fleetdlg.h b/konquest/fleetdlg.h index 7937f69e..a823cf0c 100644 --- a/konquest/fleetdlg.h +++ b/konquest/fleetdlg.h @@ -7,17 +7,17 @@ #include "gamecore.h" -class FleetDlgListViewItem : public QListViewItem +class FleetDlgListViewItem : public TQListViewItem { public: - FleetDlgListViewItem(TQListView *parent, TQString s1, TQString s2, TQString s3, TQString s4, TQString s5); + FleetDlgListViewItem(TQListView *tqparent, TQString s1, TQString s2, TQString s3, TQString s4, TQString s5); int compare(TQListViewItem *i, int col, bool) const; }; class FleetDlg : public TQDialog { public: - FleetDlg( TQWidget *parent, AttackFleetList *fleets ); + FleetDlg( TQWidget *tqparent, AttackFleetList *fleets ); private: void init(); diff --git a/konquest/gameboard.cc b/konquest/gameboard.cc index 17b40272..96433e02 100644 --- a/konquest/gameboard.cc +++ b/konquest/gameboard.cc @@ -33,8 +33,8 @@ /********************************************************************* Game Board *********************************************************************/ -GameBoard::GameBoard( TQWidget *parent ) - : TQWidget( parent ), gameInProgress( false ), gameState( NONE ) +GameBoard::GameBoard( TQWidget *tqparent ) + : TQWidget( tqparent ), gameInProgress( false ), gameState( NONE ) { TQColorGroup cg( white, black, green.light(), green.dark(), green, green.dark(75), green.dark() ); TQPalette palette( cg, cg, cg ); @@ -53,17 +53,17 @@ GameBoard::GameBoard( TQWidget *parent ) msgWidget->setTextFormat(LogText); msgWidget->setMinimumHeight(100); msgWidget->setHScrollBarMode(TQScrollView::AlwaysOff); - msgWidget->setPaper(TQBrush(Qt::black)); + msgWidget->setPaper(TQBrush(TQt::black)); planetInfo = new PlanetInfo( this, palette ); gameMessage = new TQLabel( this ); gameMessage->setPalette( palette ); turnCounter = new TQLabel( this ); turnCounter->setPalette( palette ); turnCounter->setText( "Turn" ); - turnCounter->setMaximumHeight( turnCounter->sizeHint().height() ); + turnCounter->setMaximumHeight( turnCounter->tqsizeHint().height() ); endTurn = new TQPushButton( i18n("End Turn"), this ); - endTurn->setFixedSize( endTurn->sizeHint() ); + endTurn->setFixedSize( endTurn->tqsizeHint() ); endTurn->setPalette( palette ); shipCountEdit = new TQLineEdit( this ); @@ -82,39 +82,39 @@ GameBoard::GameBoard( TQWidget *parent ) setMinimumSize( 600, 600 ); setMouseTracking( true ); - setFocusPolicy( StrongFocus ); + setFocusPolicy( TQ_StrongFocus ); setFocus(); //******************************************************************** // Layout the main window //******************************************************************** - TQHBoxLayout *layout1 = new TQHBoxLayout( this ); - TQVBoxLayout *layout2 = new TQVBoxLayout; - TQHBoxLayout *layout3 = new TQHBoxLayout; - TQVBoxLayout *layout4 = new TQVBoxLayout; + TQHBoxLayout *tqlayout1 = new TQHBoxLayout( this ); + TQVBoxLayout *tqlayout2 = new TQVBoxLayout; + TQHBoxLayout *tqlayout3 = new TQHBoxLayout; + TQVBoxLayout *tqlayout4 = new TQVBoxLayout; - layout1->addLayout( layout2 ); - layout2->addLayout( layout3 ); + tqlayout1->addLayout( tqlayout2 ); + tqlayout2->addLayout( tqlayout3 ); - layout3->addSpacing( 5 ); - layout3->addWidget( gameMessage, 10 ); - layout3->addWidget( shipCountEdit, 1 ); - layout3->addWidget( endTurn, 1 ); + tqlayout3->addSpacing( 5 ); + tqlayout3->addWidget( gameMessage, 10 ); + tqlayout3->addWidget( shipCountEdit, 1 ); + tqlayout3->addWidget( endTurn, 1 ); - layout2->addSpacing( 5 ); - layout2->addWidget( mapWidget, 0, AlignTop ); - layout2->addWidget( msgWidget ); - layout2->addStretch( 1 ); + tqlayout2->addSpacing( 5 ); + tqlayout2->addWidget( mapWidget, 0, AlignTop ); + tqlayout2->addWidget( msgWidget ); + tqlayout2->addStretch( 1 ); - layout1->addSpacing( 5 ); - layout1->addLayout( layout4, 10 ); + tqlayout1->addSpacing( 5 ); + tqlayout1->addLayout( tqlayout4, 10 ); - layout4->addWidget( planetInfo, 1 ); - layout4->addSpacing( 10 ); - layout4->addWidget( turnCounter, 1 ); - layout4->addStretch( 1 ); + tqlayout4->addWidget( planetInfo, 1 ); + tqlayout4->addSpacing( 10 ); + tqlayout4->addWidget( turnCounter, 1 ); + tqlayout4->addStretch( 1 ); - layout1->addStretch( 1 ); + tqlayout1->addStretch( 1 ); //********************************************************************** // Set up signal/slot connections @@ -137,7 +137,7 @@ GameBoard::~GameBoard() } #if 0 -TQSize GameBoard::sizeHint() const +TQSize GameBoard::tqsizeHint() const { return TQSize( 600, 550 ); } @@ -187,7 +187,7 @@ GameBoard::keyPressEvent( TQKeyEvent *e ) } -QString +TQString GameBoard::playerString(Player *player) { if (!player) @@ -315,10 +315,10 @@ GameBoard::turn() TQString msg; msg = i18n("The distance from Planet %1 to Planet %2 is %3 light years.\n" "A ship leaving this turn will arrive on turn %4") - .arg(sourcePlanet->getName()) - .arg(destPlanet->getName()) - .arg(KGlobal::locale()->formatNumber( dist, 2 )) - .arg(KGlobal::locale()->formatNumber( turnNumber + (int)dist, 0 )); + .tqarg(sourcePlanet->getName()) + .tqarg(destPlanet->getName()) + .tqarg(KGlobal::locale()->formatNumber( dist, 2 )) + .tqarg(KGlobal::locale()->formatNumber( turnNumber + (int)dist, 0 )); KMessageBox::information( this, msg, i18n("Distance")); gameState = NONE; @@ -431,7 +431,7 @@ GameBoard::turn() } TQString turnStr; - turnStr = i18n("Turn #: %1 of %2").arg(turnNumber).arg(lastTurn); + turnStr = i18n("Turn #: %1 of %2").tqarg(turnNumber).tqarg(lastTurn); turnCounter->setText( turnStr ); @@ -470,15 +470,15 @@ GameBoard::nextTurn() Player *winner = findWinner(); if (winner) { - mapWidget->repaint(true); + mapWidget->tqrepaint(true); KMessageBox::information(this, - i18n("The mighty %1 has conquered the galaxy!").arg(winner->getName()), + i18n("The mighty %1 has conquered the galaxy!").tqarg(winner->getName()), i18n("Game Over")); } if( (turnNumber == lastTurn) && !winner ) { - mapWidget->repaint(true); + mapWidget->tqrepaint(true); GameEndDlg *dlg = new GameEndDlg( this ); if( dlg->exec() == KDialogBase::Yes ) { @@ -492,7 +492,7 @@ GameBoard::nextTurn() { // Game over, man! Game over. - mapWidget->repaint(true); + mapWidget->tqrepaint(true); gameOver(); }; @@ -565,8 +565,8 @@ GameBoard::gameMsg(const TQString &msg, Player *player, Planet *planet, Player * { if (!player->isAiPlayer()) isHumanInvolved = true; - colorMsg = colorMsg.arg(playerString(player)); - plainMsg = plainMsg.arg(player->getName()); + colorMsg = colorMsg.tqarg(playerString(player)); + plainMsg = plainMsg.tqarg(player->getName()); } if (planet) @@ -577,15 +577,15 @@ GameBoard::gameMsg(const TQString &msg, Player *player, Planet *planet, Player * isHumanInvolved = true; TQString color = planetPlayer->getColor().name(); - colorMsg = colorMsg.arg(TQString("%2").arg(color, planet->getName())); - plainMsg = plainMsg.arg(planet->getName()); + colorMsg = colorMsg.tqarg(TQString("%2").tqarg(color, planet->getName())); + plainMsg = plainMsg.tqarg(planet->getName()); } - msgWidget->append(("Turn %1: ").arg(turnNumber)+colorMsg+""); + msgWidget->append(("Turn %1: ").tqarg(turnNumber)+colorMsg+""); msgWidget->scrollToBottom(); if (isHumanInvolved) { - mapWidget->repaint(true); + mapWidget->tqrepaint(true); KMessageBox::information(this, plainMsg); } } @@ -660,7 +660,7 @@ GameBoard::doFleetArrival( AttackFleet *arrivingFleet ) TQString msg; msg = i18n("Reinforcements (%1 ships) have arrived for planet %2.") - .arg(arrivingFleet->getShipCount()); + .tqarg(arrivingFleet->getShipCount()); gameMsg(msg, 0, arrivingFleet->destination); } } else { @@ -717,7 +717,7 @@ GameBoard::doFleetArrival( AttackFleet *arrivingFleet ) } } - mapWidget->repaint(true); + mapWidget->tqrepaint(true); } //************************************************************************ diff --git a/konquest/gameboard.h b/konquest/gameboard.h index ed165b21..7826d00f 100644 --- a/konquest/gameboard.h +++ b/konquest/gameboard.h @@ -21,17 +21,18 @@ enum GameState { NONE, SOURCE_PLANET, DEST_PLANET, SHIP_COUNT, RULER_SOURCE, RUL //************************************************************************ // GameBoard Widget //************************************************************************ -class GameBoard : public QWidget +class GameBoard : public TQWidget { Q_OBJECT + TQ_OBJECT public: - GameBoard( TQWidget *parent ); + GameBoard( TQWidget *tqparent ); virtual ~GameBoard(); bool isGameInProgress(void) const { return gameInProgress; } -// virtual TQSize sizeHint() const; +// virtual TQSize tqsizeHint() const; protected slots: void startNewGame(); diff --git a/konquest/gamecore.cc b/konquest/gamecore.cc index 3706cf68..df8ba86e 100644 --- a/konquest/gamecore.cc +++ b/konquest/gamecore.cc @@ -94,7 +94,7 @@ Map::populateMap( PlayerList &players, Player *neutral, Freeze(); int index = 0; - TQString names( "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*(),.<>;:[]{}/?-+\\|" ); + TQString names( "ABCDEFGHIJKLMNOPTQRSTUVWXYZ1234567890!@#$%^&*(),.<>;:[]{}/?-+\\|" ); // Create a planet for each player Player *plr; @@ -242,16 +242,16 @@ const int Map::getColumns() const //--------------------------------------------------------------------------- Sector::Sector() -: TQObject(0,0), planet( NULL ), parentMap(NULL ), x(0), y(0) +: TQObject(0,0), planet( NULL ), tqparentMap(NULL ), x(0), y(0) {} Sector::Sector( Map *newParentMap, int xPos, int yPos ) -: TQObject(0,0), planet(NULL), parentMap( newParentMap ), x(xPos), y(yPos) +: TQObject(0,0), planet(NULL), tqparentMap( newParentMap ), x(xPos), y(yPos) { } Sector::Sector( const Sector & other ) -: TQObject(0,0), planet(other.planet), parentMap(other.parentMap), x(other.x), y(other.y) +: TQObject(0,0), planet(other.planet), tqparentMap(other.tqparentMap), x(other.x), y(other.y) { } @@ -294,7 +294,7 @@ Sector::operator=( const Sector &other ) x = other.x; y = other.y; planet = other.planet; - parentMap = other.parentMap; + tqparentMap = other.tqparentMap; return *this; } @@ -302,7 +302,7 @@ Sector::operator=( const Sector &other ) void Sector::select() { - parentMap->setSelectedSector( x, y ); + tqparentMap->setSelectedSector( x, y ); emit selected(); } @@ -322,29 +322,29 @@ int Sector::getColumn() Planet::Planet( TQString planetName, Sector &newParentSector, Player *initialOwner, int newProd, double newKillP, double newMorale ) - : TQObject(0,0), name(planetName), owner(initialOwner), parentSector(newParentSector), + : TQObject(0,0), name(planetName), owner(initialOwner), tqparentSector(newParentSector), homeFleet( this, newProd ), killPercentage(newKillP), morale( newMorale ), productionRate(newProd) { - parentSector.setPlanet( this ); + tqparentSector.setPlanet( this ); } Planet::~Planet() {} Planet * -Planet::createPlayerPlanet( Sector &parentSector, Player *initialOwner, TQString planetName ) +Planet::createPlayerPlanet( Sector &tqparentSector, Player *initialOwner, TQString planetName ) { CoreLogic clogic; double morale = clogic.generateMorale(); - return new Planet( planetName, parentSector, initialOwner, + return new Planet( planetName, tqparentSector, initialOwner, 10, 0.400, morale ); } Planet * -Planet::createNeutralPlanet( Sector &parentSector, Player *initialOwner, TQString planetName ) +Planet::createNeutralPlanet( Sector &tqparentSector, Player *initialOwner, TQString planetName ) { CoreLogic clogic; double morale = clogic.generateMorale(); @@ -353,7 +353,7 @@ Planet::createNeutralPlanet( Sector &parentSector, Player *initialOwner, TQStrin int productionRate = (int)clogic.generatePlanetProduction(); - return new Planet( planetName, parentSector, + return new Planet( planetName, tqparentSector, initialOwner, productionRate, killP, morale ); } @@ -398,7 +398,7 @@ Planet::setProduction( int newProduction ) void Planet::select() { - parentSector.select(); + tqparentSector.select(); emit selected(); } @@ -423,7 +423,7 @@ Planet::getName() const Sector & Planet::getSector() const { - return parentSector; + return tqparentSector; } void @@ -479,10 +479,10 @@ Player::getName() return name; } -QString +TQString Player::getColoredName() { - return TQString("%2").arg(color.name(), name); + return TQString("%2").tqarg(color.name(), name); } Player *Player::createPlayer( TQString newName, TQColor color, int playerNum, bool isAi ) @@ -492,7 +492,7 @@ Player *Player::createPlayer( TQString newName, TQColor color, int playerNum, bo Player *Player::createNeutralPlayer() { - return new Player( TQString::null, gray, NEUTRAL_PLAYER_NUMBER, false ); + return new Player( TQString(), gray, NEUTRAL_PLAYER_NUMBER, false ); } TQColor &Player::getColor() diff --git a/konquest/gamecore.h b/konquest/gamecore.h index 03683a08..80dab502 100644 --- a/konquest/gamecore.h +++ b/konquest/gamecore.h @@ -56,7 +56,7 @@ private: // \--- class DefenseFleet //********************************************************** -class Fleet : public QObject +class Fleet : public TQObject { public: @@ -107,7 +107,7 @@ public: // class Player //************************************************************** -class Player : public QObject +class Player : public TQObject { public: @@ -171,9 +171,10 @@ public: // class Planet //************************************************************** -class Planet : public QObject +class Planet : public TQObject { Q_OBJECT + TQ_OBJECT private: @@ -184,9 +185,9 @@ private: public: virtual ~Planet(); - static Planet *createPlayerPlanet( Sector &parentSector, + static Planet *createPlayerPlanet( Sector &tqparentSector, Player *initialOwner, TQString planetName ); - static Planet *createNeutralPlanet( Sector &parentSector, + static Planet *createNeutralPlanet( Sector &tqparentSector, Player *initialOwner, TQString planetName ); Sector &getSector() const; @@ -213,7 +214,7 @@ signals: private: TQString name; Player *owner; - Sector &parentSector; + Sector &tqparentSector; DefenseFleet homeFleet; double killPercentage; @@ -225,15 +226,16 @@ private: // class Sector //*************************************************************** -class Sector : public QObject +class Sector : public TQObject { Q_OBJECT + TQ_OBJECT public: // constructors Sector(); - Sector( Map *parentMap, int xpos, int ypos ); + Sector( Map *tqparentMap, int xpos, int ypos ); Sector( const Sector & ); // assignment operator (makes initialization easy) @@ -259,7 +261,7 @@ protected slots: protected: Planet *planet; // a sector has 0 or 1 planets - Map *parentMap; + Map *tqparentMap; int x, y; }; @@ -268,9 +270,10 @@ protected: // class Map //***************************************************************** -class Map : public QObject +class Map : public TQObject { Q_OBJECT + TQ_OBJECT public: Map(); diff --git a/konquest/gameenddlg.cc b/konquest/gameenddlg.cc index 2295acd9..2c31869e 100644 --- a/konquest/gameenddlg.cc +++ b/konquest/gameenddlg.cc @@ -11,23 +11,23 @@ #include "gameenddlg.h" #include "gameenddlg.moc" -GameEndDlg::GameEndDlg( TQWidget *parent ) +GameEndDlg::GameEndDlg( TQWidget *tqparent ) : KDialogBase( i18n("Out of Turns"), KDialogBase::Yes|KDialogBase::No, KDialogBase::Yes, KDialogBase::No, - parent, "end_game_dialog", true, true ) + tqparent, "end_game_dialog", true, true ) { TQVBox *page = makeVBoxMainWidget(); // Create controls TQLabel *label1 = new TQLabel( i18n("This is the last turn.\nDo you wish to add extra turns?")+"\n\n", page ); - label1->setAlignment( AlignCenter ); + label1->tqsetAlignment( AlignCenter ); turnCountLbl = new TQLabel( page ); turnCount = new TQSlider( 1, 40, 1, 5, Qt::Horizontal, page ); - KGuiItem addTurns(i18n("&Add Turns"), TQString::null, TQString::null, + KGuiItem addTurns(i18n("&Add Turns"), TQString(), TQString(), i18n("Add the specified number of turns to the game and continue playing.")); - KGuiItem gameOver(i18n("&Game Over"), TQString::null, TQString::null, + KGuiItem gameOver(i18n("&Game Over"), TQString(), TQString(), i18n("Terminate the current game.")); setButtonGuiItem(KDialogBase::Yes, addTurns); @@ -71,6 +71,6 @@ GameEndDlg::extraTurns() void GameEndDlg::turnCountChange( int newTurnCount ) { - TQString newLbl = i18n("Extra turns: %1").arg( newTurnCount ); + TQString newLbl = i18n("Extra turns: %1").tqarg( newTurnCount ); turnCountLbl->setText( newLbl); } diff --git a/konquest/gameenddlg.h b/konquest/gameenddlg.h index 4ffab262..4836a795 100644 --- a/konquest/gameenddlg.h +++ b/konquest/gameenddlg.h @@ -9,9 +9,10 @@ class TQPushButton; class GameEndDlg : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - GameEndDlg( TQWidget *parent ); + GameEndDlg( TQWidget *tqparent ); virtual ~GameEndDlg(); int extraTurns(); diff --git a/konquest/int_validator.cc b/konquest/int_validator.cc index 12f707c6..06315b18 100644 --- a/konquest/int_validator.cc +++ b/konquest/int_validator.cc @@ -3,8 +3,8 @@ #include "int_validator.h" #include "int_validator.moc" -IntValidator::IntValidator( TQWidget *parent, const char *name ) : - TQValidator( parent, name ) +IntValidator::IntValidator( TQWidget *tqparent, const char *name ) : + TQValidator( TQT_TQOBJECT(tqparent), name ) { #ifdef INT_MIN v_bottom = INT_MIN; @@ -14,8 +14,8 @@ IntValidator::IntValidator( TQWidget *parent, const char *name ) : v_top = INT_MIN; } -IntValidator::IntValidator( int bottom, int top, TQWidget *parent, const char *name ) : -TQValidator( parent, name ) +IntValidator::IntValidator( int bottom, int top, TQWidget *tqparent, const char *name ) : +TQValidator( TQT_TQOBJECT(tqparent), name ) { v_bottom = bottom; v_top = top; diff --git a/konquest/int_validator.h b/konquest/int_validator.h index 6cb67bcb..4f995158 100644 --- a/konquest/int_validator.h +++ b/konquest/int_validator.h @@ -4,13 +4,14 @@ #include -class IntValidator : public QValidator +class IntValidator : public TQValidator { Q_OBJECT + TQ_OBJECT public: - IntValidator( TQWidget *parent, const char *name = 0 ); - IntValidator( int bottom, int top, TQWidget *parent, const char *name = 0 ); + IntValidator( TQWidget *tqparent, const char *name = 0 ); + IntValidator( int bottom, int top, TQWidget *tqparent, const char *name = 0 ); virtual ~IntValidator(); diff --git a/konquest/mainwin.cc b/konquest/mainwin.cc index 866cd936..a5306172 100644 --- a/konquest/mainwin.cc +++ b/konquest/mainwin.cc @@ -37,18 +37,18 @@ MainWindow::~MainWindow() void MainWindow::setupKAction() { - KStdGameAction::gameNew( gameBoard, TQT_SLOT( startNewGame() ), actionCollection() ); - KStdGameAction::quit( this, TQT_SLOT( close() ), actionCollection() ); - endAction = KStdGameAction::end( gameBoard, TQT_SLOT( shutdownGame() ), actionCollection() ); + KStdGameAction::gameNew( TQT_TQOBJECT(gameBoard), TQT_SLOT( startNewGame() ), actionCollection() ); + KStdGameAction::quit( TQT_TQOBJECT(this), TQT_SLOT( close() ), actionCollection() ); + endAction = KStdGameAction::end( TQT_TQOBJECT(gameBoard), TQT_SLOT( shutdownGame() ), actionCollection() ); endAction->setEnabled(false); //AB: there is no icon for disabled - KToolBar::insertButton shows the //different state - KAction not :-( - measureAction = new KAction( i18n("&Measure Distance"), "ruler", 0, gameBoard, TQT_SLOT( measureDistance() ), actionCollection(), "game_measure" ); + measureAction = new KAction( i18n("&Measure Distance"), "ruler", 0, TQT_TQOBJECT(gameBoard), TQT_SLOT( measureDistance() ), actionCollection(), "game_measure" ); measureAction->setEnabled(false); - standingAction = new KAction( i18n("&Show Standings"), "help", 0, gameBoard, TQT_SLOT( showScores() ), actionCollection(), "game_scores" ); + standingAction = new KAction( i18n("&Show Standings"), "help", 0, TQT_TQOBJECT(gameBoard), TQT_SLOT( showScores() ), actionCollection(), "game_scores" ); standingAction->setEnabled(false); - fleetAction = new KAction( i18n("&Fleet Overview"), "launch", 0, gameBoard, TQT_SLOT( showFleets() ), actionCollection(), "game_fleets" ); + fleetAction = new KAction( i18n("&Fleet Overview"), "launch", 0, TQT_TQOBJECT(gameBoard), TQT_SLOT( showFleets() ), actionCollection(), "game_fleets" ); fleetAction->setEnabled(false); toolBar()->setBarPos( KToolBar::Left ); toolBar()->setMovingEnabled( false ); @@ -60,7 +60,7 @@ MainWindow::setupGameBoard() gameBoard = new GameBoard( this ); setCentralWidget(gameBoard); - connect( gameBoard, TQT_SIGNAL( newGameState( GameState )), this, TQT_SLOT( gameStateChange( GameState ) ) ); + connect( gameBoard, TQT_SIGNAL( newGameState( GameState )), TQT_TQOBJECT(this), TQT_SLOT( gameStateChange( GameState ) ) ); } diff --git a/konquest/mainwin.h b/konquest/mainwin.h index 2954039c..50779e41 100644 --- a/konquest/mainwin.h +++ b/konquest/mainwin.h @@ -11,6 +11,7 @@ class PlanetStatusTable; class MainWindow : public KMainWindow { Q_OBJECT + TQ_OBJECT public: MainWindow(); diff --git a/konquest/map_widget.cc b/konquest/map_widget.cc index a8aa33de..e6d8512c 100644 --- a/konquest/map_widget.cc +++ b/konquest/map_widget.cc @@ -9,8 +9,8 @@ #include #include "map_widget.moc" -ConquestMap::ConquestMap( Map *newMap, TQWidget *parent ) - : TQGridView( parent ), +ConquestMap::ConquestMap( Map *newMap, TQWidget *tqparent ) + : TQGridView( tqparent ), SECTOR_HEIGHT( 28 ), SECTOR_WIDTH( 28 ), BOARD_HEIGHT( newMap->getRows() * SECTOR_HEIGHT ), BOARD_WIDTH( newMap->getColumns() * SECTOR_WIDTH ), @@ -149,7 +149,7 @@ ConquestMap::squareBlink() void ConquestMap::mapUpdate() { - viewport()->repaint(false); + viewport()->tqrepaint(false); } diff --git a/konquest/map_widget.h b/konquest/map_widget.h index ed8d98f3..e408b2dd 100644 --- a/konquest/map_widget.h +++ b/konquest/map_widget.h @@ -13,13 +13,14 @@ #include "gamecore.h" #include "images.h" -class ConquestMap : public QGridView +class ConquestMap : public TQGridView { Q_OBJECT + TQ_OBJECT // Constructors public: - ConquestMap( Map *newMap, TQWidget *parent = 0 ); + ConquestMap( Map *newMap, TQWidget *tqparent = 0 ); virtual ~ConquestMap(); // Interface diff --git a/konquest/minimap.cc b/konquest/minimap.cc index a287ab79..c08e7282 100644 --- a/konquest/minimap.cc +++ b/konquest/minimap.cc @@ -7,8 +7,8 @@ #include "minimap.h" #include "minimap.moc" -MiniMap::MiniMap( TQWidget *parent, const char *name ) - : TQGridView( parent, name ), +MiniMap::MiniMap( TQWidget *tqparent, const char *name ) + : TQGridView( tqparent, name ), SECTOR_HEIGHT( 12 ), SECTOR_WIDTH( 12 ), BOARD_HEIGHT( 10 * SECTOR_HEIGHT ), BOARD_WIDTH( 10 * SECTOR_WIDTH ), diff --git a/konquest/minimap.h b/konquest/minimap.h index 886e247c..33d90ef2 100644 --- a/konquest/minimap.h +++ b/konquest/minimap.h @@ -11,13 +11,14 @@ #include "images.h" -class MiniMap : public QGridView +class MiniMap : public TQGridView { Q_OBJECT + TQ_OBJECT // Constructors public: - MiniMap( TQWidget *parent = 0, const char* name = 0 ); + MiniMap( TQWidget *tqparent = 0, const char* name = 0 ); virtual ~MiniMap(); void setMap( Map *newMap ); diff --git a/konquest/newGameDlg_ui.ui b/konquest/newGameDlg_ui.ui index 2768e5f8..61188418 100644 --- a/konquest/newGameDlg_ui.ui +++ b/konquest/newGameDlg_ui.ui @@ -1,10 +1,10 @@ NewGameDlgUI - + NewGameDlgUI - + 0 0 @@ -16,23 +16,23 @@ unnamed - + - layout9 + tqlayout9 unnamed - + - layout4 + tqlayout4 unnamed - + labelPlayers @@ -43,7 +43,7 @@ sliderPlayers - + sliderPlayers @@ -57,7 +57,7 @@ Horizontal - + labelPlayerList @@ -68,7 +68,7 @@ listPlayers - + Name @@ -95,15 +95,15 @@ listPlayers - + - layout3 + tqlayout3 unnamed - + labelNewPlayer @@ -114,7 +114,7 @@ newPlayer - + newPlayer @@ -129,9 +129,9 @@ - + - layout2 + tqlayout2 @@ -147,14 +147,14 @@ Expanding - + 0 20 - + addPlayer @@ -172,7 +172,7 @@ Expanding - + 0 20 @@ -193,22 +193,22 @@ Fixed - + 20 20 - + - layout8 + tqlayout8 unnamed - + labelPlanets @@ -219,7 +219,7 @@ sliderPlanets - + sliderPlanets @@ -236,7 +236,7 @@ Horizontal - + labelMap @@ -244,9 +244,9 @@ Preview map: - + - layout7 + tqlayout7 @@ -262,7 +262,7 @@ Expanding - + 0 20 @@ -284,7 +284,7 @@ Expanding - + 0 20 @@ -303,16 +303,16 @@ Expanding - + 20 16 - + - layout5 + tqlayout5 @@ -328,14 +328,14 @@ Expanding - + 31 20 - + rejectMap @@ -353,7 +353,7 @@ Expanding - + 51 20 @@ -380,7 +380,7 @@ Horizontal - + labelTurns @@ -391,7 +391,7 @@ sliderTurns - + sliderTurns @@ -433,7 +433,7 @@ 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000003b149444154789cad945f4c5b551cc73fe7dc4b7b4bcba0762d45c43114323599ee6192609c51d883892ce083f1718b3ebb185f8dc91e972cf39d2d2a2f1af664b6f1e0fe3863a0718969700eb0c52142da0242a1bd6d696f7bcff101585203ceb8fd9ece39f99dcff9fe7edf939f88c562ec465f5f9fe609442c161362173c3e3eae7b7a7ac8e7f36432196cdbfe4f907c3e4f2291201e8fe338cec3737357e9e8e828aded1e229d650e1f2d51754b082110124c13a4dc5ea341eb9dc284c0558a853f3ce8cb0677ef500fde7d39d2596679e326597b8e9abb85d7a770ab16ab6983ec5a05b487a70e36f0f4e10afe408d6a558310980108478dba4a1e8233990c5d474b64ed39aa3a8fe5f3317fbf81dbd70bccfeb205947632fd74f6589c1c6ea2f70d03a58ba0c1f2c9bdc1b66de3b8256a6e11cbe7e3ee1d181b590124fe2693aeee08d223c82c3a2c24b7b874bec8f26288774f7bd054504aef0dde6e99c0eb83f9fb266323cb80a27fb0958141836044605a2ee5523393371cc646fee2da37195aa35d0c0c5b4859ac03d7e91712dcaac5adab3650a3ff9d08ef7dd8404bb48869e5d958b5b87dadc4c9a1464e9f0d0326df7ebd86bd2e310cb1bf62d384d59441f2d70a070e1c60e09489929b988681bdd9cc97170bcc4c65595f71f8e0e3301337fc24a7732467831875a47f289652b0be5e4151e6d07316c1b0c0340d8ab92023e76d66a6b2840e36d2fb7a13fee632475e6edc367ea98a90fb98b7dd6310ca0328a44761582e1bab41befabcc0ec940d28bc5e93b68e064cab84e1d9beaeb48934eac1f53b01c1b000fca496aa54b61a99fcde61662a4b4b4b23d1680be9d426173e4df3602a48ea411989a4fd590f52a8fd156b05ed9d350e3defe3cfdf4b4c7ce770ea7d3fb9f520afbe1620daeee5c26735d20b9b9cfb6811a754a439e4e5c5639a4caa1e5caf586bfc0197b78702005cb9b4cae4cd3267ce8638fe964bd72b393e39d74928d242617303a756a37f284447770dcdbffc6384a05a85de1306e9a52057c7527c7131c3c42d3f475eb2303c82d4fc3276d6811db37efeb148723082d9b08f79f97c1e5729109a9a28307cc622d2d6cdf52b2b24efe548dedb00142009862cfa879ee1a71f6cec928353511472fbf4389148b0b0e0c108081412458dfe21c9f11351e67e7358595468246d1d1e5e38a6e9e851bc39d84ab502a669331dafec0d8ec7e3e8cb06e1a881d727d1ae40180a434a8c9db129a54126ad48a7358c2b4c5352c8c374bcccdab2bb37d8719cba79fab8211f9df218e0582c261e95f8bfc04f1a1e8bc5c4dfe0a19017a725d8c60000000049454e44ae426082 - + minimap.h diff --git a/konquest/newgamedlg.cc b/konquest/newgamedlg.cc index 232e6415..fffe17d4 100644 --- a/konquest/newgamedlg.cc +++ b/konquest/newgamedlg.cc @@ -25,9 +25,9 @@ New Game Dialog Members ************************************************************************/ -NewGameDlg::NewGameDlg( TQWidget *parent, Map *pmap, PlayerList *players, +NewGameDlg::NewGameDlg( TQWidget *tqparent, Map *pmap, PlayerList *players, Player *neutralPlayer, PlanetList *planets ) - : KDialogBase( parent, "new_game_dialog", true, i18n("Start New Game"), + : KDialogBase( tqparent, "new_game_dialog", true, i18n("Start New Game"), KDialogBase::Ok|KDialogBase::Default|KDialogBase::Cancel, KDialogBase::NoDefault, true ), plrList(players), plnetList(planets), neutral(neutralPlayer), map(pmap) @@ -96,7 +96,7 @@ NewGameDlg::init() for( TQListViewItem *item = w->listPlayers->firstChild(); item; item = item->nextSibling(), plrNum++ ) { - TQString key = TQString("Player_%1").arg(plrNum); + TQString key = TQString("Player_%1").tqarg(plrNum); TQString playerName = config->readEntry(key); if (playerName.isEmpty()) @@ -151,7 +151,7 @@ NewGameDlg::slotAddPlayer() item->setText(1, i18n("Human Player")); item->setText(0, playerName); - w->newPlayer->setText(TQString::null); + w->newPlayer->setText(TQString()); updateMiniMap(); updateLabels(); @@ -184,7 +184,7 @@ NewGameDlg::setPlayerCount(int playerCount) while(w->listPlayers->childCount() < playerCount) { - TQString playerName = i18n("Generated AI player name", "Comp%1").arg(i+1); + TQString playerName = i18n("Generated AI player name", "Comp%1").tqarg(i+1); TQPixmap pm(16,16); TQColor color(PlayerColors[i]); pm.fill(color); @@ -229,9 +229,9 @@ NewGameDlg::turns() void NewGameDlg::updateLabels() { - w->labelPlayers->setText(i18n("Number of &players: %1").arg(w->sliderPlayers->value())); - w->labelPlanets->setText(i18n("Number of neutral p&lanets: %1").arg(w->sliderPlanets->value())); - w->labelTurns->setText(i18n("Number of &turns: %1").arg(w->sliderTurns->value())); + w->labelPlayers->setText(i18n("Number of &players: %1").tqarg(w->sliderPlayers->value())); + w->labelPlanets->setText(i18n("Number of neutral p&lanets: %1").tqarg(w->sliderPlanets->value())); + w->labelTurns->setText(i18n("Number of &turns: %1").tqarg(w->sliderTurns->value())); } void @@ -269,7 +269,7 @@ NewGameDlg::save() for( TQListViewItem *item = w->listPlayers->firstChild(); item; item = item->nextSibling() ) { - TQString key = TQString("Player_%1").arg(plrNum); + TQString key = TQString("Player_%1").tqarg(plrNum); TQString playerName = item->text(0); bool ai = (item->text(2) == "A"); if (ai) diff --git a/konquest/newgamedlg.h b/konquest/newgamedlg.h index 6a8c81d4..b3c93b2c 100644 --- a/konquest/newgamedlg.h +++ b/konquest/newgamedlg.h @@ -15,9 +15,10 @@ class NewGameDlgUI; class NewGameDlg : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - NewGameDlg( TQWidget *parent, Map *map, PlayerList *playerList, + NewGameDlg( TQWidget *tqparent, Map *map, PlayerList *playerList, Player *neutralPlayer, PlanetList *planetList ); int turns( void ); diff --git a/konquest/planet_info.cc b/konquest/planet_info.cc index 1d178493..a9f03034 100644 --- a/konquest/planet_info.cc +++ b/konquest/planet_info.cc @@ -9,8 +9,8 @@ #include #include "planet_info.moc" -PlanetInfo::PlanetInfo( TQWidget *parent, TQPalette palette ) - : TQFrame( parent ) +PlanetInfo::PlanetInfo( TQWidget *tqparent, TQPalette palette ) + : TQFrame( tqparent ) { setPalette( palette ); @@ -27,19 +27,19 @@ PlanetInfo::PlanetInfo( TQWidget *parent, TQPalette palette ) clearDisplay(); - TQVBoxLayout *layout1 = new TQVBoxLayout( this ); + TQVBoxLayout *tqlayout1 = new TQVBoxLayout( this ); - layout1->addWidget( name ); - layout1->addWidget( owner ); - layout1->addWidget( ships ); - layout1->addWidget( production ); - layout1->addWidget( kill_percent ); - layout1->addStretch(1); + tqlayout1->addWidget( name ); + tqlayout1->addWidget( owner ); + tqlayout1->addWidget( ships ); + tqlayout1->addWidget( production ); + tqlayout1->addWidget( kill_percent ); + tqlayout1->addStretch(1); setMouseTracking( true ); - setMinimumSize( sizeHint() ); - setMaximumHeight( sizeHint().height() ); + setMinimumSize( tqsizeHint() ); + setMaximumHeight( tqsizeHint().height() ); } PlanetInfo::~PlanetInfo() @@ -47,15 +47,15 @@ PlanetInfo::~PlanetInfo() emptyPlanetInfoList(); } -TQSize PlanetInfo::sizeHint() const +TQSize PlanetInfo::tqsizeHint() const { int height; - height = name->sizeHint().height() + - owner->sizeHint().height() + - ships->sizeHint().height() + - production->sizeHint().height()+ - kill_percent->sizeHint().height(); + height = name->tqsizeHint().height() + + owner->tqsizeHint().height() + + ships->tqsizeHint().height() + + production->tqsizeHint().height()+ + kill_percent->tqsizeHint().height(); return TQSize( 100, height ); } @@ -126,7 +126,7 @@ void PlanetInfo::showPlanet( Planet *planet ) TQString temp; - temp = "" + i18n("Planet name: %1").arg(planet->getName()); + temp = "" + i18n("Planet name: %1").tqarg(planet->getName()); name->setText( temp ); return; } @@ -141,19 +141,19 @@ void PlanetInfo::showPlanet( Planet *planet ) TQString temp; - temp = "" + i18n("Planet name: %1").arg(p->planet->getName()); + temp = "" + i18n("Planet name: %1").tqarg(p->planet->getName()); name->setText( temp ); - temp = "" + i18n("Owner: %1").arg(p->planet->getPlayer()->getColoredName()); + temp = "" + i18n("Owner: %1").tqarg(p->planet->getPlayer()->getColoredName()); owner->setText( temp ); - temp = "" + i18n("Ships: %1").arg( KGlobal::locale()->formatNumber(p->ships, 0) ); + temp = "" + i18n("Ships: %1").tqarg( KGlobal::locale()->formatNumber(p->ships, 0) ); ships->setText( temp ); - temp = "" + i18n("Production: %1").arg( KGlobal::locale()->formatNumber(p->production, 0) ); + temp = "" + i18n("Production: %1").tqarg( KGlobal::locale()->formatNumber(p->production, 0) ); production->setText( temp ); - temp = "" + i18n("Kill percent: %1").arg( KGlobal::locale()->formatNumber(p->killRate, 3) ); + temp = "" + i18n("Kill percent: %1").tqarg( KGlobal::locale()->formatNumber(p->killRate, 3) ); kill_percent->setText( temp ); } } diff --git a/konquest/planet_info.h b/konquest/planet_info.h index e31882a9..c4386cee 100644 --- a/konquest/planet_info.h +++ b/konquest/planet_info.h @@ -20,17 +20,18 @@ struct planet_info_buffer { typedef TQPtrList PlanetInfoList; typedef TQPtrListIterator PlanetInfoListIterator; -class PlanetInfo : public QFrame +class PlanetInfo : public TQFrame { Q_OBJECT + TQ_OBJECT public: - PlanetInfo( TQWidget *parent, TQPalette palette ); + PlanetInfo( TQWidget *tqparent, TQPalette palette ); virtual ~PlanetInfo(); void setPlanetList( PlanetList &newPlanets ); void rescanPlanets(); - TQSize sizeHint() const; + TQSize tqsizeHint() const; public slots: void showPlanet( Planet * ); diff --git a/konquest/scoredlg.cc b/konquest/scoredlg.cc index fee4a404..3400032e 100644 --- a/konquest/scoredlg.cc +++ b/konquest/scoredlg.cc @@ -6,7 +6,7 @@ #include "scoredlg.h" -ScoreDlgListViewItem::ScoreDlgListViewItem(TQListView *parent, TQString s1, TQString s2, TQString s3, TQString s4, TQString s5, TQString s6) : TQListViewItem(parent, s1, s2, s3, s4, s5, s6) +ScoreDlgListViewItem::ScoreDlgListViewItem(TQListView *tqparent, TQString s1, TQString s2, TQString s3, TQString s4, TQString s5, TQString s6) : TQListViewItem(tqparent, s1, s2, s3, s4, s5, s6) { } @@ -27,8 +27,8 @@ int ScoreDlgListViewItem::compare(TQListViewItem *i, int col, bool) const } -ScoreDlg::ScoreDlg( TQWidget *parent, const TQString& title, PlayerList *players ) - : TQDialog(parent, "ScoreDlg", true ), plrList(players) +ScoreDlg::ScoreDlg( TQWidget *tqparent, const TQString& title, PlayerList *players ) + : TQDialog(tqparent, "ScoreDlg", true ), plrList(players) { setCaption( kapp->makeStdCaption(title) ); @@ -39,21 +39,21 @@ ScoreDlg::ScoreDlg( TQWidget *parent, const TQString& title, PlayerList *players scoreTable->addColumn(i18n("Fleets Launched")); scoreTable->addColumn(i18n("Fleets Destroyed")); scoreTable->addColumn(i18n("Ships Destroyed")); - scoreTable->setMinimumSize( scoreTable->sizeHint() ); + scoreTable->setMinimumSize( scoreTable->tqsizeHint() ); KPushButton *okButton = new KPushButton( KStdGuiItem::ok(), this ); - okButton->setMinimumSize( okButton->sizeHint() ); + okButton->setMinimumSize( okButton->tqsizeHint() ); okButton->setDefault(true); - TQVBoxLayout *layout1 = new TQVBoxLayout( this ); - TQHBoxLayout *layout2 = new TQHBoxLayout; + TQVBoxLayout *tqlayout1 = new TQVBoxLayout( this ); + TQHBoxLayout *tqlayout2 = new TQHBoxLayout; - layout1->addWidget( scoreTable, 1 ); - layout1->addLayout( layout2 ); + tqlayout1->addWidget( scoreTable, 1 ); + tqlayout1->addLayout( tqlayout2 ); - layout2->addStretch( 2 ); - layout2->addWidget( okButton ); - layout2->addStretch( 2 ); + tqlayout2->addStretch( 2 ); + tqlayout2->addWidget( okButton ); + tqlayout2->addStretch( 2 ); connect( okButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept()) ); @@ -71,10 +71,10 @@ ScoreDlg::init() for( ;(curPlayer = itr()); ) new ScoreDlgListViewItem(scoreTable, curPlayer->getName(), - TQString("%1").arg(curPlayer->getShipsBuilt()), - TQString("%1").arg(curPlayer->getPlanetsConquered()), - TQString("%1").arg(curPlayer->getFleetsLaunched()), - TQString("%1").arg(curPlayer->getEnemyFleetsDestroyed()), - TQString("%1").arg(curPlayer->getEnemyShipsDestroyed())); + TQString("%1").tqarg(curPlayer->getShipsBuilt()), + TQString("%1").tqarg(curPlayer->getPlanetsConquered()), + TQString("%1").tqarg(curPlayer->getFleetsLaunched()), + TQString("%1").tqarg(curPlayer->getEnemyFleetsDestroyed()), + TQString("%1").tqarg(curPlayer->getEnemyShipsDestroyed())); } diff --git a/konquest/scoredlg.h b/konquest/scoredlg.h index 55eaa926..88b7911d 100644 --- a/konquest/scoredlg.h +++ b/konquest/scoredlg.h @@ -7,18 +7,18 @@ #include "gamecore.h" -class ScoreDlgListViewItem : public QListViewItem +class ScoreDlgListViewItem : public TQListViewItem { public: - ScoreDlgListViewItem(TQListView *parent, TQString s1, TQString s2, TQString s3, TQString s4, TQString s5, TQString s6); + ScoreDlgListViewItem(TQListView *tqparent, TQString s1, TQString s2, TQString s3, TQString s4, TQString s5, TQString s6); int compare(TQListViewItem *i, int col, bool) const; }; -class ScoreDlg : public QDialog +class ScoreDlg : public TQDialog { public: - ScoreDlg( TQWidget *parent, const TQString& title, PlayerList *players ); + ScoreDlg( TQWidget *tqparent, const TQString& title, PlayerList *players ); private: void init(); diff --git a/kpat/CHANGES b/kpat/CHANGES index 2480f12e..d6016123 100644 --- a/kpat/CHANGES +++ b/kpat/CHANGES @@ -132,7 +132,7 @@ since kpat-0.2 since kpat-0.1 - - changed shading colorGroup (Paul) + - changed shading tqcolorGroup (Paul) - fixed drawing of suit symbols (Paul) - renamed "very easy" to "cheating" :) (Paul) - fixed spurious core dump(Paul) diff --git a/kpat/card.cpp b/kpat/card.cpp index a6529bd1..30f5d81d 100644 --- a/kpat/card.cpp +++ b/kpat/card.cpp @@ -45,7 +45,7 @@ Card::Card( Rank r, Suit s, TQCanvas* _parent ) { // Set the name of the card // FIXME: i18n() - m_name = TQString("%1 %2").arg(suit_names[s-1]).arg(rank_names[r-1]).utf8(); + m_name = TQString("%1 %2").tqarg(suit_names[s-1]).tqarg(rank_names[r-1]).utf8(); // Default for the card is face up, standard size. m_faceup = true; @@ -186,7 +186,7 @@ bool Card::realFace() const /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** -** This file is part of Qt Palmtop Environment. +** This file is part of TQt Palmtop Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software diff --git a/kpat/card.h b/kpat/card.h index 8ec96bb9..88b4fec3 100644 --- a/kpat/card.h +++ b/kpat/card.h @@ -47,13 +47,14 @@ typedef TQValueList CardList; // class Card: public TQObject, public TQCanvasRectangle { Q_OBJECT + TQ_OBJECT public: enum Suit { Clubs = 1, Diamonds, Hearts, Spades }; enum Rank { None = 0, Ace = 1, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten, Jack, Queen, King }; - Card( Rank r, Suit s, TQCanvas *parent=0); + Card( Rank r, Suit s, TQCanvas *tqparent=0); virtual ~Card(); // Properties of the card. diff --git a/kpat/cardmaps.cpp b/kpat/cardmaps.cpp index 563f4bfe..a7461daa 100644 --- a/kpat/cardmaps.cpp +++ b/kpat/cardmaps.cpp @@ -95,7 +95,7 @@ bool cardMap::setCardDir( const TQString &dir) card_width = image.width(); card_height = image.height(); - const int diff_x_between_cards = QMAX(card_width / 9, 1); + const int diff_x_between_cards = TQMAX(card_width / 9, 1); TQString wait_message = i18n("please wait, loading cards..."); TQString greeting = i18n("KPatience - a Solitaire game"); @@ -103,23 +103,23 @@ bool cardMap::setCardDir( const TQString &dir) if( animate ) { t1 = TQTime::currentTime(); - w = new TQWidget( 0, "", Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_Tool ); + w = new TQWidget( 0, "", TQt::WStyle_Customize | TQt::WStyle_NoBorder | TQt::WStyle_Tool ); TQRect dg = KGlobalSettings::splashScreenDesktopGeometry(); - w->setBackgroundColor( Qt::darkGreen ); + w->setBackgroundColor( TQt::darkGreen ); w->setGeometry( dg.left() + ( dg.width() - greeting_width ) / 2, dg.top() + ( dg.height() - 180 ) / 2, greeting_width, 180); w->show(); - qApp->processEvents(); + tqApp->processEvents(); p.begin( w ); - p.drawText(0, 150, greeting_width, 20, Qt::AlignCenter, + p.drawText(0, 150, greeting_width, 20, TQt::AlignCenter, wait_message ); p.setFont(TQFont("Times", 24)); - p.drawText(0, 0, greeting_width, 40, Qt::AlignCenter, + p.drawText(0, 0, greeting_width, 40, TQt::AlignCenter, greeting); p.setPen(TQPen(TQColor(0, 0, 0), 4)); - p.setBrush(Qt::NoBrush); + p.setBrush(TQt::NoBrush); p.drawRect(0, 0, greeting_width, 180); p.flush(); } diff --git a/kpat/clock.cpp b/kpat/clock.cpp index 7fcb94b4..dec72cc0 100644 --- a/kpat/clock.cpp +++ b/kpat/clock.cpp @@ -4,8 +4,8 @@ #include #include "cardmaps.h" -Clock::Clock( KMainWindow* parent, const char *name ) - : Dealer( parent, name ) +Clock::Clock( KMainWindow* tqparent, const char *name ) + : Dealer( tqparent, name ) { const int dist_x = cardMap::CARDX() * 11 / 10 + 1; const int dist_y = cardMap::CARDY() * 11 / 10 + 1; @@ -85,7 +85,7 @@ static class LocalDealerInfo11 : public DealerInfo { public: LocalDealerInfo11() : DealerInfo(I18N_NOOP("G&randfather's Clock"), 11) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Clock(parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Clock(tqparent); } } gfi11; #include "clock.moc" diff --git a/kpat/clock.h b/kpat/clock.h index 42521862..8aaead34 100644 --- a/kpat/clock.h +++ b/kpat/clock.h @@ -5,9 +5,10 @@ class Clock : public Dealer { Q_OBJECT + TQ_OBJECT public: - Clock( KMainWindow* parent=0, const char* name=0); + Clock( KMainWindow* tqparent=0, const char* name=0); virtual bool checkAdd ( int checkIndex, const Pile *c1, const CardList& c2) const; virtual bool startAutoDrop() { return false; } diff --git a/kpat/computation.cpp b/kpat/computation.cpp index 22f104aa..0da5f226 100644 --- a/kpat/computation.cpp +++ b/kpat/computation.cpp @@ -27,8 +27,8 @@ #include #include "cardmaps.h" -Computation::Computation( KMainWindow *parent, const char *name ) - :Dealer( parent, name) +Computation::Computation( KMainWindow *tqparent, const char *name ) + :Dealer( tqparent, name) { deck = Deck::new_deck(this); deck->hide(); @@ -114,7 +114,7 @@ static class LocalDealerInfo6 : public DealerInfo { public: LocalDealerInfo6() : DealerInfo(I18N_NOOP("&Calculation"), 6) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Computation(parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Computation(tqparent); } } ldi6; #include "computation.moc" diff --git a/kpat/computation.h b/kpat/computation.h index 3b9b3fbc..ea988f2d 100644 --- a/kpat/computation.h +++ b/kpat/computation.h @@ -30,9 +30,10 @@ class Computation : public Dealer { Q_OBJECT + TQ_OBJECT public: - Computation( KMainWindow *parent = 0, const char *name=0 ); + Computation( KMainWindow *tqparent = 0, const char *name=0 ); virtual void restart(); diff --git a/kpat/dealer.cpp b/kpat/dealer.cpp index 365e7411..d53b7d3a 100644 --- a/kpat/dealer.cpp +++ b/kpat/dealer.cpp @@ -99,7 +99,7 @@ const Dealer *Dealer::instance() void Dealer::setBackgroundPixmap(const TQPixmap &background, const TQColor &midcolor) { _midcolor = midcolor; - canvas()->setBackgroundPixmap(background); + canvas()->tqsetBackgroundPixmap(background); for (PileList::Iterator it = piles.begin(); it != piles.end(); ++it) { (*it)->resetCache(); (*it)->initSizes(); @@ -114,30 +114,30 @@ void Dealer::setupActions() { if (actions() & Dealer::Hint) { - ahint = new KAction( i18n("&Hint"), TQString::fromLatin1("wizard"), Key_H, this, + ahint = new KAction( i18n("&Hint"), TQString::tqfromLatin1("wizard"), Key_H, TQT_TQOBJECT(this), TQT_SLOT(hint()), - parent()->actionCollection(), "game_hint"); + tqparent()->actionCollection(), "game_hint"); actionlist.append(ahint); } else ahint = 0; if (actions() & Dealer::Demo) { - ademo = new KToggleAction( i18n("&Demo"), TQString::fromLatin1("1rightarrow"), CTRL+Key_D, this, + ademo = new KToggleAction( i18n("&Demo"), TQString::tqfromLatin1("1rightarrow"), CTRL+Key_D, TQT_TQOBJECT(this), TQT_SLOT(toggleDemo()), - parent()->actionCollection(), "game_demo"); + tqparent()->actionCollection(), "game_demo"); actionlist.append(ademo); } else ademo = 0; if (actions() & Dealer::Redeal) { - aredeal = new KAction (i18n("&Redeal"), TQString::fromLatin1("queue"), 0, this, + aredeal = new KAction (i18n("&Redeal"), TQString::tqfromLatin1("queue"), 0, TQT_TQOBJECT(this), TQT_SLOT(redeal()), - parent()->actionCollection(), "game_redeal"); + tqparent()->actionCollection(), "game_redeal"); actionlist.append(aredeal); } else aredeal = 0; - parent()->guiFactory()->plugActionList( parent(), TQString::fromLatin1("game_actions"), actionlist); + tqparent()->guiFactory()->plugActionList( tqparent(), TQString::tqfromLatin1("game_actions"), actionlist); } Dealer::~Dealer() @@ -145,7 +145,7 @@ Dealer::~Dealer() if (!_won) countLoss(); clearHints(); - parent()->guiFactory()->unplugActionList( parent(), TQString::fromLatin1("game_actions")); + tqparent()->guiFactory()->unplugActionList( tqparent(), TQString::tqfromLatin1("game_actions")); while (!piles.isEmpty()) delete piles.first(); // removes itself @@ -154,9 +154,9 @@ Dealer::~Dealer() s_instance = 0; } -KMainWindow *Dealer::parent() const +KMainWindow *Dealer::tqparent() const { - return dynamic_cast(TQCanvasView::parent()); + return dynamic_cast(TQCanvasView::tqparent()); } @@ -249,7 +249,7 @@ void Dealer::newHint(MoveHint *mh) bool Dealer::isMoving(Card *c) const { - return movingCards.find(c) != movingCards.end(); + return movingCards.tqfind(c) != movingCards.end(); } void Dealer::contentsMouseMoveEvent(TQMouseEvent* e) @@ -277,13 +277,13 @@ void Dealer::contentsMouseMoveEvent(TQMouseEvent* e) continue; if (c->source() == movingCards.first()->source()) continue; - if (sources.findIndex(c->source()) != -1) + if (sources.tqfindIndex(c->source()) != -1) continue; sources.append(c->source()); } else { if ((*it)->rtti() == Pile::RTTI) { Pile *p = static_cast(*it); - if (p->isEmpty() && !sources.contains(p)) + if (p->isEmpty() && !sources.tqcontains(p)) sources.append(p); } else { kdDebug(11111) << "unknown object " << *it << " " << (*it)->rtti() << endl; @@ -314,7 +314,7 @@ void Dealer::contentsMouseMoveEvent(TQMouseEvent* e) void Dealer::mark(Card *c) { c->setSelected(true); - if (!marked.contains(c)) + if (!marked.tqcontains(c)) marked.append(c); } @@ -342,7 +342,7 @@ void Dealer::contentsMousePressEvent(TQMouseEvent* e) if (!list.count()) return; - if (e->button() == LeftButton) { + if (e->button() == Qt::LeftButton) { if (list.first()->rtti() == Card::RTTI) { Card *c = dynamic_cast(list.first()); assert(c); @@ -355,7 +355,7 @@ void Dealer::contentsMousePressEvent(TQMouseEvent* e) return; } - if (e->button() == RightButton) { + if (e->button() == Qt::RightButton) { if (list.first()->rtti() == Card::RTTI) { Card *preview = dynamic_cast(list.first()); assert(preview); @@ -535,8 +535,8 @@ void Dealer::resizeEvent(TQResizeEvent *e) { int x = width(); int y = height(); - int hs = horizontalScrollBar()->sizeHint().height(); - int vs = verticalScrollBar()->sizeHint().width(); + int hs = horizontalScrollBar()->tqsizeHint().height(); + int vs = verticalScrollBar()->tqsizeHint().width(); int mx = minsize.width(); int my = minsize.height(); @@ -735,7 +735,7 @@ State *Dealer::getState() s.it = c; s.source = c->source(); if (!s.source) { - kdDebug(11111) << c->name() << " has no parent\n"; + kdDebug(11111) << c->name() << " has no tqparent\n"; assert(false); } s.source_index = c->source()->indexOf(c); @@ -778,7 +778,7 @@ void Dealer::setState(State *st) CardState s = *it; bool target = c->takenDown(); // abused s.source->add(c, s.source_index); - c->setVisible(s.source->isVisible()); + c->tqsetVisible(s.source->isVisible()); c->setAnimated(false); c->setX(s.x); c->setY(s.y); @@ -827,13 +827,13 @@ void Dealer::takeState() ademo->setEnabled( false ); if ( aredeal ) aredeal->setEnabled( false ); - TQTimer::singleShot(400, this, TQT_SIGNAL(gameLost())); + TQTimer::singleShot(400, TQT_TQOBJECT(this), TQT_SIGNAL(gameLost())); toldAboutLostGame = true; return; } } if (!demoActive() && !waiting()) - TQTimer::singleShot(TIME_BETWEEN_MOVES, this, TQT_SLOT(startAutoDrop())); + TQTimer::singleShot(TIME_BETWEEN_MOVES, TQT_TQOBJECT(this), TQT_SLOT(startAutoDrop())); emit undoPossible(undoList.count() > 1 && !waiting()); } @@ -962,7 +962,7 @@ void Dealer::openGame(TQDomDocument &doc) (*it2)->setX(card.attribute("x").toInt()); (*it2)->setY(card.attribute("y").toInt()); (*it2)->setZ(card.attribute("z").toInt()); - (*it2)->setVisible(p->isVisible()); + (*it2)->tqsetVisible(p->isVisible()); cards.remove(it2); break; } @@ -1034,7 +1034,7 @@ void Dealer::setWaiting(bool w) void Dealer::setAutoDropEnabled(bool a) { _autodrop = a; - TQTimer::singleShot(TIME_BETWEEN_MOVES, this, TQT_SLOT(startAutoDrop())); + TQTimer::singleShot(TIME_BETWEEN_MOVES, TQT_TQOBJECT(this), TQT_SLOT(startAutoDrop())); } bool Dealer::startAutoDrop() @@ -1046,7 +1046,7 @@ bool Dealer::startAutoDrop() for (TQCanvasItemList::ConstIterator it = list.begin(); it != list.end(); ++it) if ((*it)->animated()) { - TQTimer::singleShot(TIME_BETWEEN_MOVES, this, TQT_SLOT(startAutoDrop())); + TQTimer::singleShot(TIME_BETWEEN_MOVES, TQT_TQOBJECT(this), TQT_SLOT(startAutoDrop())); return true; } @@ -1160,14 +1160,14 @@ void Dealer::won() { // wrap in own scope to make KConfigGroupSave work KConfig *config = kapp->config(); KConfigGroupSaver kcs(config, scores_group); - unsigned int n = config->readUnsignedNumEntry(TQString("won%1").arg(_id),0) + 1; - config->writeEntry(TQString("won%1").arg(_id),n); - n = config->readUnsignedNumEntry(TQString("winstreak%1").arg(_id),0) + 1; - config->writeEntry(TQString("winstreak%1").arg(_id),n); - unsigned int m = config->readUnsignedNumEntry(TQString("maxwinstreak%1").arg(_id),0); + unsigned int n = config->readUnsignedNumEntry(TQString("won%1").tqarg(_id),0) + 1; + config->writeEntry(TQString("won%1").tqarg(_id),n); + n = config->readUnsignedNumEntry(TQString("winstreak%1").tqarg(_id),0) + 1; + config->writeEntry(TQString("winstreak%1").tqarg(_id),n); + unsigned int m = config->readUnsignedNumEntry(TQString("maxwinstreak%1").tqarg(_id),0); if (n>m) - config->writeEntry(TQString("maxwinstreak%1").arg(_id),n); - config->writeEntry(TQString("loosestreak%1").arg(_id),0); + config->writeEntry(TQString("maxwinstreak%1").tqarg(_id),n); + config->writeEntry(TQString("loosestreak%1").tqarg(_id),0); } // sort cards by increasing z @@ -1348,7 +1348,7 @@ void Dealer::drawPile(KPixmap &pixmap, Pile *pile, bool selected) TQRect bounding(int(pile->x()), int(pile->y()), cardMap::CARDX(), cardMap::CARDY()); pixmap.resize(bounding.width(), bounding.height()); - pixmap.fill(Qt::white); + pixmap.fill(TQt::white); if (!bg.isNull()) { for (int x=bounding.x()/bg.width(); @@ -1371,8 +1371,8 @@ void Dealer::drawPile(KPixmap &pixmap, Pile *pile, bool selected) sy = -dy; dy = 0; } - bitBlt(&pixmap, dx, dy, &bg, - sx, sy, w, h, Qt::CopyROP, true); + bitBlt(TQT_TQPAINTDEVICE(&pixmap), dx, dy, TQT_TQPAINTDEVICE(&bg), + sx, sy, w, h, TQt::CopyROP, true); } } } @@ -1381,7 +1381,7 @@ void Dealer::drawPile(KPixmap &pixmap, Pile *pile, bool selected) float s = -0.4; float n = -0.3; - int mid = QMAX( QMAX(midColor().red(), midColor().green()), midColor().blue()); + int mid = TQMAX( TQMAX(midColor().red(), midColor().green()), midColor().blue()); // if it's too dark - light instead of dark if (mid < 120) { @@ -1415,9 +1415,9 @@ void Dealer::wheelEvent( TQWheelEvent *e ) e->globalPos(), e->delta(), e->state()); viewportWheelEvent(&ce); if ( !ce.isAccepted() ) { - if ( e->orientation() == Horizontal && hScrollBarMode () == AlwaysOn ) + if ( e->orientation() ==Qt::Horizontal && hScrollBarMode () == AlwaysOn ) TQApplication::sendEvent( horizontalScrollBar(), e); - else if (e->orientation() == Vertical && vScrollBarMode () == AlwaysOn ) + else if (e->orientation() ==Qt::Vertical && vScrollBarMode () == AlwaysOn ) TQApplication::sendEvent( verticalScrollBar(), e); } else { e->accept(); @@ -1430,9 +1430,9 @@ void Dealer::countGame() kdDebug(11111) << "counting game as played." << endl; KConfig *config = kapp->config(); KConfigGroupSaver kcs(config, scores_group); - unsigned int Total = config->readUnsignedNumEntry(TQString("total%1").arg(_id),0); + unsigned int Total = config->readUnsignedNumEntry(TQString("total%1").tqarg(_id),0); ++Total; - config->writeEntry(TQString("total%1").arg(_id),Total); + config->writeEntry(TQString("total%1").tqarg(_id),Total); _gameRecorded = true; } } @@ -1443,12 +1443,12 @@ void Dealer::countLoss() // update score KConfig *config = kapp->config(); KConfigGroupSaver kcs(config, scores_group); - unsigned int n = config->readUnsignedNumEntry(TQString("loosestreak%1").arg(_id),0) + 1; - config->writeEntry(TQString("loosestreak%1").arg(_id),n); - unsigned int m = config->readUnsignedNumEntry(TQString("maxloosestreak%1").arg(_id),0); + unsigned int n = config->readUnsignedNumEntry(TQString("loosestreak%1").tqarg(_id),0) + 1; + config->writeEntry(TQString("loosestreak%1").tqarg(_id),n); + unsigned int m = config->readUnsignedNumEntry(TQString("maxloosestreak%1").tqarg(_id),0); if (n>m) - config->writeEntry(TQString("maxloosestreak%1").arg(_id),n); - config->writeEntry(TQString("winstreak%1").arg(_id),0); + config->writeEntry(TQString("maxloosestreak%1").tqarg(_id),n); + config->writeEntry(TQString("winstreak%1").tqarg(_id),0); } } diff --git a/kpat/dealer.h b/kpat/dealer.h index 42c07e9c..63b5bde9 100644 --- a/kpat/dealer.h +++ b/kpat/dealer.h @@ -35,7 +35,7 @@ public: } const char *name; uint gameindex; - virtual Dealer *createGame(KMainWindow *parent) = 0; + virtual Dealer *createGame(KMainWindow *tqparent) = 0; }; class CardState; @@ -54,13 +54,14 @@ struct State Dealer -- abstract base class of all varieties of patience ***************************************************************/ -class Dealer: public QCanvasView +class Dealer: public TQCanvasView { Q_OBJECT + TQ_OBJECT public: - Dealer( KMainWindow* parent = 0, const char* name = 0 ); + Dealer( KMainWindow* tqparent = 0, const char* name = 0 ); virtual ~Dealer(); static const Dealer *instance(); @@ -170,7 +171,7 @@ protected: // it's not const because it changes the random seed virtual MoveHint *chooseHint(); - KMainWindow *parent() const; + KMainWindow *tqparent() const; bool waiting() const { return _waiting != 0; } void setWaiting(bool w); @@ -182,7 +183,7 @@ protected: void setState(State *); // reimplement this to add game-specific information in the state structure - virtual TQString getGameState() const { return TQString::null; } + virtual TQString getGameState() const { return TQString(); } // reimplement this to use the game-specific information from the state structure virtual void setGameState( const TQString & ) {} @@ -210,7 +211,7 @@ protected: KRandomSequence randseq; TQColor _midcolor; - Q_UINT32 _id; + TQ_UINT32 _id; bool takeTargets; bool _won; int _waiting; diff --git a/kpat/deck.cpp b/kpat/deck.cpp index c2b6e0e5..860a88b7 100644 --- a/kpat/deck.cpp +++ b/kpat/deck.cpp @@ -10,8 +10,8 @@ const int NumberOfCards = 52; Deck *Deck::my_deck = 0; -Deck::Deck( Dealer* parent, int m, int s ) - : Pile( 0, parent ), mult( m ) +Deck::Deck( Dealer* tqparent, int m, int s ) + : Pile( 0, tqparent ), mult( m ) { _deck = new Card * [mult*NumberOfCards]; Q_CHECK_PTR (_deck); @@ -44,9 +44,9 @@ Deck::~Deck() // ---------------------------------------------------------------- -Deck *Deck::new_deck( Dealer *parent, int m, int s ) +Deck *Deck::new_deck( Dealer *tqparent, int m, int s ) { - my_deck = new Deck(parent, m, s); + my_deck = new Deck(tqparent, m, s); return my_deck; } diff --git a/kpat/deck.h b/kpat/deck.h index f5239fe0..eb13268c 100644 --- a/kpat/deck.h +++ b/kpat/deck.h @@ -13,11 +13,11 @@ class Deck: public Pile { private: - Deck( Dealer* parent = 0, int m = 1, int s = 4 ); + Deck( Dealer* tqparent = 0, int m = 1, int s = 4 ); virtual ~Deck(); public: - static Deck *new_deck( Dealer *parent = 0, int m = 1, int s = 4 ); + static Deck *new_deck( Dealer *tqparent = 0, int m = 1, int s = 4 ); static Deck *deck() { return my_deck; } static const long n; diff --git a/kpat/fortyeight.cpp b/kpat/fortyeight.cpp index 1747b647..e3e72385 100644 --- a/kpat/fortyeight.cpp +++ b/kpat/fortyeight.cpp @@ -5,8 +5,8 @@ #include #include "cardmaps.h" -HorLeftPile::HorLeftPile( int _index, Dealer* parent) - : Pile(_index, parent) +HorLeftPile::HorLeftPile( int _index, Dealer* tqparent) + : Pile(_index, tqparent) { // TODO: create a pile that moves the cards together when filling space setHSpread( cardMap::CARDX() / 11 + 1 ); @@ -27,8 +27,8 @@ void HorLeftPile::initSizes() } -Fortyeight::Fortyeight( KMainWindow* parent, const char* name) - : Dealer(parent,name) +Fortyeight::Fortyeight( KMainWindow* tqparent, const char* name) + : Dealer(tqparent,name) { deck = Deck::new_deck(this, 2); @@ -194,7 +194,7 @@ static class LocalDealerInfo8 : public DealerInfo { public: LocalDealerInfo8() : DealerInfo(I18N_NOOP("Forty && &Eight"), 8) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Fortyeight(parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Fortyeight(tqparent); } } ldi9; //-------------------------------------------------------------------------// diff --git a/kpat/fortyeight.h b/kpat/fortyeight.h index 80303c0e..4489ffb1 100644 --- a/kpat/fortyeight.h +++ b/kpat/fortyeight.h @@ -6,9 +6,10 @@ class HorLeftPile : public Pile { Q_OBJECT + TQ_OBJECT public: - HorLeftPile( int _index, Dealer* parent = 0); + HorLeftPile( int _index, Dealer* tqparent = 0); virtual TQSize cardOffset( bool _spread, bool _facedown, const Card *before) const; virtual void initSizes(); }; @@ -16,9 +17,10 @@ public: class Fortyeight : public Dealer { Q_OBJECT + TQ_OBJECT public: - Fortyeight( KMainWindow* parent=0, const char* name=0); + Fortyeight( KMainWindow* tqparent=0, const char* name=0); virtual bool isGameLost() const; public slots: diff --git a/kpat/freecell-solver/USAGE b/kpat/freecell-solver/USAGE index f78295b2..583624ca 100644 --- a/kpat/freecell-solver/USAGE +++ b/kpat/freecell-solver/USAGE @@ -67,7 +67,7 @@ program with some effort on the programmer's part. This option will display the moves in standard notation in which every move consists of two characters and there are ten moves in a line. Naturally, -this option will only become apparent if the display moves is specified. +this option will only become aptqparent if the display moves is specified. (it does not implicitly specify it, though). For more information regarding standard notation refer to the following @@ -89,7 +89,7 @@ are needed to move from one to another. The standard notation option applies to it to. --pi --display-parent-iter +-pi --display-tqparent-iter This option (assuming the -s and -i options are specified) will also display the iteration index of the state from which the current state @@ -217,34 +217,34 @@ Freecell Tests: '2' - put freecell cards on top of stacks. '3' - put non-top stack cards in the foundations. '4' - move stack cards to different stacks. -'5' - move stack cards to a parent card on the same stack. +'5' - move stack cards to a tqparent card on the same stack. '6' - move sequences of cards onto free stacks. '7' - put freecell cards on empty stacks. -'8' - move cards to a different parent. +'8' - move cards to a different tqparent. '9' - empty an entire stack into the freecells. Atomic Freecell Tests: 'A' - move a stack card to an empty stack. -'B' - move a stack card to a parent on a different stack. +'B' - move a stack card to a tqparent on a different stack. 'C' - move a stack card to a freecell. -'D' - move a freecell card to a parent. +'D' - move a freecell card to a tqparent. 'E' - move a freecell card to an empty stack. Simple Simon Tests: 'a' - move a full sequence to the foundations. -'b' - move a sequence to a true parent of his. -'c' - move a whole stack sequence to a false parent (in order to clear +'b' - move a sequence to a true tqparent of his. +'c' - move a whole stack sequence to a false tqparent (in order to clear the stack) -'d' - move a sequence to a true parent that has some cards above it. -'e' - move a sequence with some cards above it to a true parent. -'f' - move a sequence with a junk sequence above it to a true parent that +'d' - move a sequence to a true tqparent that has some cards above it. +'e' - move a sequence with some cards above it to a true tqparent. +'f' - move a sequence with a junk sequence above it to a true tqparent that has some cards above it. -'g' - move a whole stack sequence to a false parent which has some +'g' - move a whole stack sequence to a false tqparent which has some cards above it. -'h' - move a sequence to a parent on the same stack. +'h' - move a sequence to a tqparent on the same stack. Manipulating the tests order can be very helpful to the quick solution of a given board. If you found that a certain board cannot be solved in @@ -259,7 +259,7 @@ Also note that Freecell tests are not suitable for solving Simple Simon games and Simple Simon tests are not suitable for solving anything except Simple Simon. -Tests can be grouped together into random groups using parenthesis +Tests can be grouped together into random groups using tqparenthesis (e.g: "(0123)") or square brackets ("[012][3456789]"). Such grouping is only relevant to the Random DFS scan (see below). @@ -332,7 +332,7 @@ used in all the normal scans. --reparent-states This option specifies that states that were encountered whose depth in the -states graph can be improved should be reparented to the new parent. This +states graph can be improved should be reparented to the new tqparent. This option can possibly make solutions shorter. @@ -502,7 +502,7 @@ If you are working on a UNIX or a similar system then you can set some run-time options in "fc-solve" by sending it some signal combinations. -If you send the signal USR1, without sending any other signals before +If you send the signal USR1, without sending any other Q_SIGNALS before that, then "fc-solve" will output the present number of iterations. This method is a good way to monitor an instance that takes a long time to solve. @@ -512,7 +512,7 @@ will print the iteration number and depth on every state that it checks. It is the equivalent of specifying (or unspecifying) the option -i/--iter-output. -If you send it two USR2 signals and then USR1, then "fc-solve" +If you send it two USR2 Q_SIGNALS and then USR1, then "fc-solve" will also print the board of every state. Again, this will only be done assuming the iteration output is turned on. diff --git a/kpat/freecell-solver/caas.c b/kpat/freecell-solver/caas.c index 82492f34..3654ab59 100644 --- a/kpat/freecell-solver/caas.c +++ b/kpat/freecell-solver/caas.c @@ -63,7 +63,7 @@ if (hash_value_int < 0) \ { \ /* \ - * This is a bit mask that nullifies the sign bit of the \ + * This is a bit tqmask that nullifies the sign bit of the \ * number so it will always be positive \ * */ \ hash_value_int &= (~(1<<((sizeof(hash_value_int)<<3)-1))); \ @@ -92,7 +92,7 @@ if (hash_value_int < 0) \ { \ /* \ - * This is a bit mask that nullifies the sign bit of the \ + * This is a bit tqmask that nullifies the sign bit of the \ * number so it will always be positive \ * */ \ hash_value_int &= (~(1<<((sizeof(hash_value_int)<<3)-1))); \ @@ -333,7 +333,7 @@ static GCC_INLINE void freecell_solver_cache_stacks( if (hash_value_int < 0) { /* - * This is a bit mask that nullifies the sign bit of the + * This is a bit tqmask that nullifies the sign bit of the * number so it will always be positive * */ hash_value_int &= (~(1<<((sizeof(hash_value_int)<<3)-1))); @@ -372,7 +372,7 @@ static GCC_INLINE void freecell_solver_cache_stacks( ); #if 0 ) /* In order to settle gvim and other editors that - are keen on parenthesis matching */ + are keen on tqparenthesis matching */ #endif replace_with_cached(cached_stack != NULL); @@ -437,7 +437,7 @@ void freecell_solver_cache_talon( if (hash_value_int < 0) { /* - * This is a bit mask that nullifies the sign bit of the + * This is a bit tqmask that nullifies the sign bit of the * number so it will always be positive * */ hash_value_int &= (~(1<<((sizeof(hash_value_int)<<3)-1))); @@ -529,9 +529,9 @@ GCC_INLINE int freecell_solver_check_and_add_state( if (check) { /* The new state was not found in the cache, and it was already inserted */ - if (new_state->parent) + if (new_state->tqparent) { - new_state->parent->num_active_children++; + new_state->tqparent->num_active_tqchildren++; } instance->num_states_in_collection++; diff --git a/kpat/freecell-solver/fcs.h b/kpat/freecell-solver/fcs.h index 43300310..6bca557f 100644 --- a/kpat/freecell-solver/fcs.h +++ b/kpat/freecell-solver/fcs.h @@ -170,7 +170,7 @@ typedef struct freecell_solver_instance * The debug_iter_output variables provide a programmer programmable way * to debug the algorithm while it is running. This works well for DFS * and Soft-DFS scans but at present support for A* and BFS is not - * too good, as its hard to tell which state came from which parent state. + * too good, as its hard to tell which state came from which tqparent state. * * debug_iter_output is a flag that indicates whether to use this feature * at all. @@ -190,7 +190,7 @@ typedef struct freecell_solver_instance int depth, void * instance, fcs_state_with_locations_t * state, - int parent_iter_num + int tqparent_iter_num ); void * debug_iter_output_context; @@ -582,7 +582,7 @@ struct freecell_solver_soft_thread_struct /* * The priority queue of the A* scan */ - PQUEUE * a_star_pqueue; + PTQUEUE * a_star_pqueue; double a_star_initial_cards_under_sequences; /* @@ -683,7 +683,7 @@ typedef struct freecell_solver_soft_thread_struct freecell_solver_soft_thread_t; #define FCS_A_STAR_WEIGHT_CARDS_OUT 0 #define FCS_A_STAR_WEIGHT_MAX_SEQUENCE_MOVE 1 #define FCS_A_STAR_WEIGHT_CARDS_UNDER_SEQUENCES 2 -#define FCS_A_STAR_WEIGHT_SEQS_OVER_RENEGADE_CARDS 3 +#define FCS_A_STAR_WEIGHT_SETQS_OVER_RENEGADE_CARDS 3 #define FCS_A_STAR_WEIGHT_DEPTH 4 freecell_solver_instance_t * freecell_solver_alloc_instance(void); diff --git a/kpat/freecell-solver/fcs_hash.c b/kpat/freecell-solver/fcs_hash.c index fde7a03f..2ae2d60b 100644 --- a/kpat/freecell-solver/fcs_hash.c +++ b/kpat/freecell-solver/fcs_hash.c @@ -53,7 +53,7 @@ SFO_hash_t * freecell_solver_hash_init( hash = (SFO_hash_t *)malloc(sizeof(SFO_hash_t)); hash->size = size; - hash->size_bitmask = size-1; + hash->size_bittqmask = size-1; hash->num_elems = 0; @@ -87,7 +87,7 @@ void * freecell_solver_hash_insert( SFO_hash_symlink_item_t * item, * last_item; /* Get the index of the appropriate chain in the hash table */ - place = hash_value & (hash->size_bitmask); + place = hash_value & (hash->size_bittqmask); list = &(hash->entries[place]); /* If first_item is non-existent */ @@ -220,7 +220,7 @@ static void SFO_hash_rehash( SFO_hash_t * hash ) { - int old_size, new_size, new_size_bitmask; + int old_size, new_size, new_size_bittqmask; int i; #if 0 SFO_hash_t * new_hash; @@ -242,7 +242,7 @@ static void SFO_hash_rehash( old_size = hash->size; new_size = old_size << 1; - new_size_bitmask = new_size - 1; + new_size_bittqmask = new_size - 1; new_entries = calloc(new_size, sizeof(SFO_hash_symlink_t)); @@ -254,7 +254,7 @@ static void SFO_hash_rehash( while(item != NULL) { /* The place in the new hash table */ - place = item->hash_value & new_size_bitmask; + place = item->hash_value & new_size_bittqmask; /* Store the next item in the linked list in a safe place, so we can retrieve it after the assignment */ @@ -280,7 +280,7 @@ static void SFO_hash_rehash( #endif hash->entries = new_entries; hash->size = new_size; - hash->size_bitmask = new_size_bitmask; + hash->size_bittqmask = new_size_bittqmask; } #else diff --git a/kpat/freecell-solver/fcs_hash.h b/kpat/freecell-solver/fcs_hash.h index fbe6c78c..77d746f0 100644 --- a/kpat/freecell-solver/fcs_hash.h +++ b/kpat/freecell-solver/fcs_hash.h @@ -53,8 +53,8 @@ struct SFO_hash_struct /* The size of the hash table */ int size; - /* A bit mask that extract the lowest bits out of the hash value */ - int size_bitmask; + /* A bit tqmask that extract the lowest bits out of the hash value */ + int size_bittqmask; /* The number of elements stored inside the hash */ int num_elems; /* A context to pass to the comparison function */ diff --git a/kpat/freecell-solver/fcs_user.h b/kpat/freecell-solver/fcs_user.h index 8ddbf6f2..0d9fe815 100644 --- a/kpat/freecell-solver/fcs_user.h +++ b/kpat/freecell-solver/fcs_user.h @@ -165,7 +165,7 @@ typedef void (*freecell_solver_user_iter_handler_t) int iter_num, int depth, void * ptr_state, - int parent_iter_num, + int tqparent_iter_num, void * context ); diff --git a/kpat/freecell-solver/freecell.c b/kpat/freecell-solver/freecell.c index 159772ff..fca09078 100644 --- a/kpat/freecell-solver/freecell.c +++ b/kpat/freecell-solver/freecell.c @@ -243,7 +243,7 @@ int freecell_solver_sfs_move_freecell_cards_on_top_of_stacks( { src_card = fcs_freecell_card(state, fc); - /* If the freecell is not empty and dest_card is its parent + /* If the freecell is not empty and dest_card is its tqparent * */ if ( (fcs_card_card_num(src_card) != 0) && fcs_is_parent_card(src_card,dest_card) ) @@ -533,7 +533,7 @@ int freecell_solver_sfs_move_stack_cards_to_a_parent_on_the_same_stack( sequences_are_built_by = instance->sequences_are_built_by; /* - * Now let's try to move a stack card to a parent card which is found + * Now let's try to move a stack card to a tqparent card which is found * on the same stack. * */ for (stack=0;stacka_star_pqueue = malloc(sizeof(PQUEUE)); + soft_thread->a_star_pqueue = malloc(sizeof(PTQUEUE)); freecell_solver_PQueueInitialise( soft_thread->a_star_pqueue, 1024 @@ -795,8 +795,8 @@ static void trace_solution( s1 = instance->final_state; - /* Retrace the step from the current state to its parents */ - while (s1->parent != NULL) + /* Retrace the step from the current state to its tqparents */ + while (s1->tqparent != NULL) { /* Mark the state as part of the non-optimized solution */ s1->visited |= FCS_VISITED_IN_SOLUTION_PATH; @@ -811,8 +811,8 @@ static void trace_solution( } /* Duplicate the state to a freshly malloced memory */ - /* Move to the parent state */ - s1 = s1->parent; + /* Move to the tqparent state */ + s1 = s1->tqparent; } /* There's one more state than there are move stacks */ s1->visited |= FCS_VISITED_IN_SOLUTION_PATH; @@ -915,7 +915,7 @@ int freecell_solver_solve_instance( state_copy_ptr->depth = 0; state_copy_ptr->moves_to_parent = NULL; state_copy_ptr->visited = 0; - state_copy_ptr->parent = NULL; + state_copy_ptr->tqparent = NULL; memset(&(state_copy_ptr->scan_visited), '\0', sizeof(state_copy_ptr->scan_visited)); instance->state_copy_ptr = state_copy_ptr; diff --git a/kpat/freecell-solver/lib.c b/kpat/freecell-solver/lib.c index 1839614b..e887fe00 100644 --- a/kpat/freecell-solver/lib.c +++ b/kpat/freecell-solver/lib.c @@ -892,7 +892,7 @@ static void freecell_solver_user_iter_handler_wrapper( int depth, void * lp_instance, fcs_state_with_locations_t * ptr_state_with_locations, - int parent_iter_num + int tqparent_iter_num ) { fcs_user_t * user; @@ -904,7 +904,7 @@ static void freecell_solver_user_iter_handler_wrapper( iter_num, depth, (void *)ptr_state_with_locations, - parent_iter_num, + tqparent_iter_num, user->iter_handler_context ); diff --git a/kpat/freecell-solver/lookup2.c b/kpat/freecell-solver/lookup2.c index 6ab9ae7e..c5886304 100644 --- a/kpat/freecell-solver/lookup2.c +++ b/kpat/freecell-solver/lookup2.c @@ -19,7 +19,7 @@ Note: #define hashsize(n) ((ub4)1<<(n)) -#define hashmask(n) (hashsize(n)-1) +#define hashtqmask(n) (hashsize(n)-1) /* -------------------------------------------------------------------- diff --git a/kpat/freecell-solver/main.c b/kpat/freecell-solver/main.c index d16468c4..f4949741 100644 --- a/kpat/freecell-solver/main.c +++ b/kpat/freecell-solver/main.c @@ -43,7 +43,7 @@ static void my_iter_handler( int iter_num, int depth, void * ptr_state, - int parent_iter_num, + int tqparent_iter_num, void * lp_context ) { @@ -57,7 +57,7 @@ static void my_iter_handler( ); if (context->display_parent_iter_num) { - fprintf(stdout, "Parent Iteration: %i\n", parent_iter_num); + fprintf(stdout, "Parent Iteration: %i\n", tqparent_iter_num); } fprintf(stdout, "\n"); @@ -169,8 +169,8 @@ help_screen_t help_screens[] = { "-snx --standard-notation-extended\n" " Display the moves in extended standard notation while specifying the\n" " number of cards moved if applicable\n" -"-pi --display-parent-iter \n" -" Display the index of the parent iteration of each state in the\n" +"-pi --display-tqparent-iter \n" +" Display the index of the tqparent iteration of each state in the\n" " run-time dump.\n" "\n" "--freecells-num [Freecells\' Number]\n" @@ -227,35 +227,35 @@ help_screen_t help_screens[] = { " '2' - put freecell cards on top of stacks.\n" " '3' - put non-top stack cards in the foundations.\n" " '4' - move stack cards to different stacks.\n" -" '5' - move stack cards to a parent card on the same stack.\n" +" '5' - move stack cards to a tqparent card on the same stack.\n" " '6' - move sequences of cards onto free stacks.\n" " '7' - put freecell cards on empty stacks.\n" -" '8' - move cards to a different parent.\n" +" '8' - move cards to a different tqparent.\n" " '9' - empty an entire stack into the freecells.\n" "\n" " Atomic Freecell Tests:\n" "\n" " 'A' - move a stack card to an empty stack.\n" -" 'B' - move a stack card to a parent on a different stack.\n" +" 'B' - move a stack card to a tqparent on a different stack.\n" " 'C' - move a stack card to a freecell.\n" -" 'D' - move a freecel card to a parent.\n" +" 'D' - move a freecel card to a tqparent.\n" " 'E' - move a freecel card to an empty stack.\n" "\n" " Simple Simon Tests:\n" "\n" " 'a' - move a full sequence to the foundations.\n" -" 'b' - move a sequence to a true parent of his.\n" -" 'c' - move a whole stack sequence to a false parent (in order to\n" +" 'b' - move a sequence to a true tqparent of his.\n" +" 'c' - move a whole stack sequence to a false tqparent (in order to\n" " clear the stack)\n" -" 'd' - move a sequence to a true parent that has some cards above it.\n" -" 'e' - move a sequence with some cards above it to a true parent.\n" -" 'f' - move a sequence with a junk sequence above it to a true parent\n" +" 'd' - move a sequence to a true tqparent that has some cards above it.\n" +" 'e' - move a sequence with some cards above it to a true tqparent.\n" +" 'f' - move a sequence with a junk sequence above it to a true tqparent\n" " that has some cards above it.\n" -" 'g' - move a whole stack sequence to a false parent which has some\n" +" 'g' - move a whole stack sequence to a false tqparent which has some\n" " cards above it.\n" -" 'h' - move a sequence to a parent on the same stack.\n" +" 'h' - move a sequence to a tqparent on the same stack.\n" "\n" -" Tests are grouped with parenthesis or square brackets. Each group\n" +" Tests are grouped with tqparenthesis or square brackets. Each group\n" " will be randomized as a whole by the random-dfs scan.\n" "\n" "\n" @@ -313,7 +313,7 @@ help_screen_t help_screens[] = { "\n" "\n" "--reparent-states\n" -" Reparent states that have a larger depth than that of the state\n" +" Retqparent states that have a larger depth than that of the state\n" " from which they were reached a posteriori.\n" "--calc-real-depth\n" " If --reparent-states is enabled, then explictly calculate the real\n" @@ -498,7 +498,7 @@ static int cmd_line_callback( dc->display_moves = 1; dc->display_states = 1; } - else if ((!strcmp(argv[arg], "-pi")) || (!strcmp(argv[arg], "--display-parent-iter"))) + else if ((!strcmp(argv[arg], "-pi")) || (!strcmp(argv[arg], "--display-tqparent-iter"))) { dc->display_parent_iter_num = 1; } @@ -588,7 +588,7 @@ static char * known_parameters[] = { "-sn", "--standard-notation", "-snx", "--standard-notation-extended", "-sam", "--display-states-and-moves", - "-pi", "--display-parent-iter", + "-pi", "--display-tqparent-iter", "--reset", NULL }; @@ -658,12 +658,12 @@ int main(int argc, char * argv[]) if ((arg == argc) || (!strcmp(argv[arg], "-"))) { file = stdin; - if (!getenv("FREECELL_SOLVER_QUIET")) + if (!getenv("FREECELL_SOLVER_TQUIET")) { fprintf(stderr, "%s", "Reading the board from the standard input.\n" "Type \"fc-solve --help\" for more usage information.\n" - "To cancel this message set the FREECELL_SOLVER_QUIET environment variable.\n" + "To cancel this message set the FREECELL_SOLVER_TQUIET environment variable.\n" ); } } diff --git a/kpat/freecell-solver/pqueue.c b/kpat/freecell-solver/pqueue.c index 086cce96..7cacf8ff 100644 --- a/kpat/freecell-solver/pqueue.c +++ b/kpat/freecell-solver/pqueue.c @@ -33,7 +33,7 @@ the list is sorted ascending or descending... */ void freecell_solver_PQueueInitialise( - PQUEUE *pq, + PTQUEUE *pq, int32 MaxElements ) { @@ -53,7 +53,7 @@ void freecell_solver_PQueueInitialise( returns TRUE if successful, FALSE if fails. (You fail by filling the pqueue.) PGetRating is a function which returns the rating of the item you're adding for sorting purposes */ -int freecell_solver_PQueuePush( PQUEUE *pq, void *item, pq_rating_t r) +int freecell_solver_PQueuePush( PTQUEUE *pq, void *item, pq_rating_t r) { uint32 i; pq_element_t * Elements = pq->Elements; @@ -73,7 +73,7 @@ int freecell_solver_PQueuePush( PQUEUE *pq, void *item, pq_rating_t r) i = (++CurrentSize); - /* while the parent of the space we're putting the new node into is worse than + /* while the tqparent of the space we're putting the new node into is worse than our new node, swap the space with the worse node. We keep doing that until we get to a worse node or until we get to the top @@ -82,17 +82,17 @@ int freecell_solver_PQueuePush( PQUEUE *pq, void *item, pq_rating_t r) { - while( ( i==PQ_FIRST_ENTRY ? - (PQUEUE_MaxRating) /* return biggest possible rating if first element */ + while( ( i==PTQ_FIRST_ENTRY ? + (PTQUEUE_MaxRating) /* return biggest possible rating if first element */ : - (PGetRating(Elements[ PQ_PARENT_INDEX(i) ]) ) + (PGetRating(Elements[ PTQ_PARENT_INDEX(i) ]) ) ) < r ) { - Elements[ i ] = Elements[ PQ_PARENT_INDEX(i) ]; + Elements[ i ] = Elements[ PTQ_PARENT_INDEX(i) ]; - i = PQ_PARENT_INDEX(i); + i = PTQ_PARENT_INDEX(i); } } @@ -110,14 +110,14 @@ int freecell_solver_PQueuePush( PQUEUE *pq, void *item, pq_rating_t r) #define PQueueIsEmpty(pq) ((pq)->CurrentSize == 0) /* free up memory for pqueue */ -void freecell_solver_PQueueFree( PQUEUE *pq ) +void freecell_solver_PQueueFree( PTQUEUE *pq ) { free( pq->Elements ); } /* remove the first node from the pqueue and provide a pointer to it */ -void *freecell_solver_PQueuePop( PQUEUE *pq) +void *freecell_solver_PQueuePop( PTQUEUE *pq) { int32 i; int32 child; @@ -132,7 +132,7 @@ void *freecell_solver_PQueuePop( PQUEUE *pq) return NULL; } - pMaxElement = Elements[PQ_FIRST_ENTRY]; + pMaxElement = Elements[PTQ_FIRST_ENTRY]; /* get pointer to last element in tree */ pLastElement = Elements[ CurrentSize-- ]; @@ -143,9 +143,9 @@ void *freecell_solver_PQueuePop( PQUEUE *pq) /* UNTESTED */ - for( i=PQ_FIRST_ENTRY; (child = PQ_LEFT_CHILD_INDEX(i)) <= CurrentSize; i=child ) + for( i=PTQ_FIRST_ENTRY; (child = PTQ_LEFT_CHILD_INDEX(i)) <= CurrentSize; i=child ) { - /* set child to the smaller of the two children... */ + /* set child to the smaller of the two tqchildren... */ if( (child != CurrentSize) && (PGetRating(Elements[child + 1]) > PGetRating(Elements[child])) ) diff --git a/kpat/freecell-solver/pqueue.h b/kpat/freecell-solver/pqueue.h index cf5f5372..d4cfd7a3 100644 --- a/kpat/freecell-solver/pqueue.h +++ b/kpat/freecell-solver/pqueue.h @@ -11,8 +11,8 @@ http://www.geocities.com/jheyesjones/astar.html */ -#ifndef FC_SOLVE__PQUEUE_H -#define FC_SOLVE__PQUEUE_H +#ifndef FC_SOLVE__PTQUEUE_H +#define FC_SOLVE__PTQUEUE_H #ifdef __cplusplus extern "C" { @@ -22,7 +22,7 @@ extern "C" { #include "jhjtypes.h" -#define PQUEUE_MaxRating INT_MAX +#define PTQUEUE_MaxRating INT_MAX typedef int32 pq_rating_t; @@ -32,35 +32,35 @@ typedef struct struct_pq_element_t pq_rating_t rating; } pq_element_t; -typedef struct _PQUEUE +typedef struct _PTQUEUE { int32 MaxSize; int32 CurrentSize; pq_element_t * Elements; /* pointer to void pointers */ pq_rating_t MaxRating; /* biggest element possible */ -} PQUEUE; +} PTQUEUE; /* given an index to any element in a binary tree stored in a linear array with the root at 1 and a "sentinel" value at 0 these macros are useful in making the code clearer */ -/* the parent is always given by index/2 */ -#define PQ_PARENT_INDEX(i) ((i)>>1) -#define PQ_FIRST_ENTRY (1) +/* the tqparent is always given by index/2 */ +#define PTQ_PARENT_INDEX(i) ((i)>>1) +#define PTQ_FIRST_ENTRY (1) -/* left and right children are index * 2 and (index * 2) +1 respectively */ -#define PQ_LEFT_CHILD_INDEX(i) ((i)<<1) -#define PQ_RIGHT_CHILD_INDEX(i) (((i)<<1)+1) +/* left and right tqchildren are index * 2 and (index * 2) +1 respectively */ +#define PTQ_LEFT_CHILD_INDEX(i) ((i)<<1) +#define PTQ_RIGHT_CHILD_INDEX(i) (((i)<<1)+1) void freecell_solver_PQueueInitialise( - PQUEUE *pq, + PTQUEUE *pq, int32 MaxElements ); -void freecell_solver_PQueueFree( PQUEUE *pq ); +void freecell_solver_PQueueFree( PTQUEUE *pq ); -int freecell_solver_PQueuePush( PQUEUE *pq, void *item, pq_rating_t); +int freecell_solver_PQueuePush( PTQUEUE *pq, void *item, pq_rating_t); -void *freecell_solver_PQueuePop( PQUEUE *pq); +void *freecell_solver_PQueuePop( PTQUEUE *pq); #define PGetRating(elem) ((elem).rating) @@ -68,4 +68,4 @@ void *freecell_solver_PQueuePop( PQUEUE *pq); } #endif -#endif /* #ifdef FC_SOLVE__PQUEUE_H */ +#endif /* #ifdef FC_SOLVE__PTQUEUE_H */ diff --git a/kpat/freecell-solver/preset.c b/kpat/freecell-solver/preset.c index 16a02f1d..9286fd83 100644 --- a/kpat/freecell-solver/preset.c +++ b/kpat/freecell-solver/preset.c @@ -457,7 +457,7 @@ int freecell_solver_apply_tests_order( } if (! is_group) { - *error_string = strdup("There's a renegade right parenthesis or bracket."); + *error_string = strdup("There's a renegade right tqparenthesis or bracket."); return 3; } is_group = 0; diff --git a/kpat/freecell-solver/scans.c b/kpat/freecell-solver/scans.c index 5c579739..31a5dd18 100644 --- a/kpat/freecell-solver/scans.c +++ b/kpat/freecell-solver/scans.c @@ -406,7 +406,7 @@ int freecell_solver_soft_dfs_or_random_dfs_do_solve_or_resume( freecell_solver_increase_dfs_max_depth(soft_thread); /* Initialize the initial state to indicate it is the first */ - ptr_state_with_locations_orig->parent = NULL; + ptr_state_with_locations_orig->tqparent = NULL; ptr_state_with_locations_orig->moves_to_parent = NULL; ptr_state_with_locations_orig->depth = 0; @@ -692,7 +692,7 @@ int freecell_solver_soft_dfs_or_random_dfs_do_solve_or_resume( ptr_recurse_into_state_with_locations->visited_iter = instance->num_times; #if 0 - ptr_recurse_into_state_with_locations->parent = ptr_state_with_locations; + ptr_recurse_into_state_with_locations->tqparent = ptr_state_with_locations; #endif /* @@ -727,7 +727,7 @@ int freecell_solver_soft_dfs_or_random_dfs_do_solve_or_resume( #undef myreturn #define FCS_A_STAR_CARDS_UNDER_SEQUENCES_EXPONENT 1.3 -#define FCS_A_STAR_SEQS_OVER_RENEGADE_CARDS_EXPONENT 1.3 +#define FCS_A_STAR_SETQS_OVER_RENEGADE_CARDS_EXPONENT 1.3 #define state (ptr_state_with_locations->s) @@ -827,7 +827,7 @@ static pq_rating_t freecell_solver_a_star_rate_state( seqs_over_renegade_cards += ((unlimited_sequence_move) ? 1 : - pow(cards_num-c-1, FCS_A_STAR_SEQS_OVER_RENEGADE_CARDS_EXPONENT) + pow(cards_num-c-1, FCS_A_STAR_SETQS_OVER_RENEGADE_CARDS_EXPONENT) ); } } @@ -836,8 +836,8 @@ static pq_rating_t freecell_solver_a_star_rate_state( / soft_thread->a_star_initial_cards_under_sequences) * a_star_weights[FCS_A_STAR_WEIGHT_CARDS_UNDER_SEQUENCES]; ret += (seqs_over_renegade_cards / - pow(decks_num*52, FCS_A_STAR_SEQS_OVER_RENEGADE_CARDS_EXPONENT) ) - * a_star_weights[FCS_A_STAR_WEIGHT_SEQS_OVER_RENEGADE_CARDS]; + pow(decks_num*52, FCS_A_STAR_SETQS_OVER_RENEGADE_CARDS_EXPONENT) ) + * a_star_weights[FCS_A_STAR_WEIGHT_SETQS_OVER_RENEGADE_CARDS]; num_cards_in_founds = 0; for(a=0;a<(decks_num<<2);a++) @@ -945,7 +945,7 @@ int freecell_solver_a_star_or_bfs_do_solve_or_resume( ); int scans_synergy = instance->scans_synergy; fcs_states_linked_list_item_t * bfs_queue = soft_thread->bfs_queue; - PQUEUE * a_star_pqueue = soft_thread->a_star_pqueue; + PTQUEUE * a_star_pqueue = soft_thread->a_star_pqueue; fcs_states_linked_list_item_t * bfs_queue_last_item = soft_thread->bfs_queue_last_item; derived.num_states = 0; @@ -958,7 +958,7 @@ int freecell_solver_a_star_or_bfs_do_solve_or_resume( if (!resume) { /* Initialize the first element to indicate it is the first */ - ptr_state_with_locations_orig->parent = NULL; + ptr_state_with_locations_orig->tqparent = NULL; ptr_state_with_locations_orig->moves_to_parent = NULL; ptr_state_with_locations_orig->depth = 0; } @@ -1027,9 +1027,9 @@ int freecell_solver_a_star_or_bfs_do_solve_or_resume( ptr_state_with_locations->depth, (void*)instance, ptr_state_with_locations, - ((ptr_state_with_locations->parent == NULL) ? + ((ptr_state_with_locations->tqparent == NULL) ? 0 : - ptr_state_with_locations->parent->visited_iter + ptr_state_with_locations->tqparent->visited_iter ) ); } diff --git a/kpat/freecell-solver/simpsim.c b/kpat/freecell-solver/simpsim.c index f603ba39..a51b0c50 100644 --- a/kpat/freecell-solver/simpsim.c +++ b/kpat/freecell-solver/simpsim.c @@ -19,16 +19,16 @@ #endif -#define fcs_is_ss_false_parent(parent, child) \ - (fcs_card_card_num(parent) == fcs_card_card_num(child)+1) +#define fcs_is_ss_false_parent(tqparent, child) \ + (fcs_card_card_num(tqparent) == fcs_card_card_num(child)+1) -#define fcs_suit_is_ss_true_parent(parent_suit, child_suit) \ - ((parent_suit) == (child_suit)) +#define fcs_suit_is_ss_true_parent(tqparent_suit, child_suit) \ + ((tqparent_suit) == (child_suit)) -#define fcs_is_ss_true_parent(parent, child) \ +#define fcs_is_ss_true_parent(tqparent, child) \ ( \ - fcs_is_ss_false_parent(parent,child) && \ - (fcs_suit_is_ss_true_parent(fcs_card_suit(parent),fcs_card_suit(child))) \ + fcs_is_ss_false_parent(tqparent,child) && \ + (fcs_suit_is_ss_true_parent(fcs_card_suit(tqparent),fcs_card_suit(child))) \ ) /* @@ -185,7 +185,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_true_parent( if (cards_num > 0) { /* Loop on the cards in the stack and try to look for a true - * parent on top one of the stacks */ + * tqparent on top one of the stacks */ card = fcs_stack_card(state,stack,cards_num-1); card_num = fcs_card_card_num(card); suit = fcs_card_suit(card); @@ -208,7 +208,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_true_parent( (fcs_card_card_num(dest_card) == (card_num+1)) ) { - /* This is a suitable parent - let's check if we + /* This is a suitable tqparent - let's check if we * have enough empty stacks to make the move feasible */ if (calc_max_sequence_move(0, num_freestacks) >= num_true_seqs) { @@ -334,7 +334,7 @@ int freecell_solver_sfs_simple_simon_move_whole_stack_sequence_to_false_parent( (fcs_is_ss_false_parent(dest_card, card)) ) { - /* This is a suitable parent - let's check if we + /* This is a suitable tqparent - let's check if we * have enough empty stacks to make the move feasible */ if (calc_max_sequence_move(0, num_freestacks) >= num_true_seqs) { @@ -387,7 +387,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_true_parent_with_some_card * dest_cards_num - the number of cards in "ds" * dc - the index of the current card in "ds". * num_separate_false_seqs - this variable tells how many distinct false - * sequences exist above the true parent + * sequences exist above the true tqparent * above_num_true_seqs[] - the number of true sequences in each false * sequence * seq_points[] - the separation points of the false sequences (i.e: where @@ -451,7 +451,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_true_parent_with_some_card (fcs_card_card_num(dest_card) == (card_num+1)) ) { - /* This is a suitable parent - let's check if there's a sequence above it. */ + /* This is a suitable tqparent - let's check if there's a sequence above it. */ /* * above_c - the height of the card that is to be checked. @@ -504,7 +504,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_true_parent_with_some_card int clear_junk_dest_stack = -1; - /* Let's try to find a suitable parent on top one of the stacks */ + /* Let's try to find a suitable tqparent on top one of the stacks */ for(clear_junk_dest_stack=0; clear_junk_dest_stack < state_stacks_num; clear_junk_dest_stack++ @@ -573,7 +573,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_true_parent_with_some_card /* * We can do it - so let's move everything. * Notice that we only put the child in a different stack - * then the parent and let it move to the parent in the + * then the tqparent and let it move to the tqparent in the * next iteration of the program * */ @@ -743,7 +743,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_with_some_cards_above_to_true (fcs_card_card_num(dest_card) == (card_num+1)) ) { - /* This is a suitable parent - let's check if we + /* This is a suitable tqparent - let's check if we * have enough empty stacks to make the move feasible */ for(a=0;a= num_true_seqs) { @@ -1450,7 +1450,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_parent_on_the_same_stack( int check; int stack, cards_num, pc, cc; - fcs_card_t parent_card, child_card; + fcs_card_t tqparent_card, child_card; int a; int after_junk_num_freestacks; int false_seq_index; @@ -1468,13 +1468,13 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_parent_on_the_same_stack( cards_num = fcs_stack_len(state, stack); if (cards_num > 2) { - /* Search for a parent card */ + /* Search for a tqparent card */ for(pc=0; pc < cards_num-1 ; pc++) { - parent_card = fcs_stack_card(state, stack, pc); + tqparent_card = fcs_stack_card(state, stack, pc); if ( fcs_is_ss_true_parent( - parent_card, + tqparent_card, fcs_stack_card(state, stack, pc+1) ) ) @@ -1487,12 +1487,12 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_parent_on_the_same_stack( { child_card = fcs_stack_card(state, stack, cc); if (fcs_is_ss_true_parent( - parent_card, + tqparent_card, child_card ) ) { - /* We have a matching parent and child cards */ + /* We have a matching tqparent and child cards */ #if 0 printf("Stack %i, Parent %i, Child %i\n", stack, pc, cc); fflush(stdout); @@ -1559,7 +1559,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_parent_on_the_same_stack( above_num_true_seqs[num_separate_false_seqs] = child_num_true_seqs; seq_points[num_separate_false_seqs++] = cc; - /* Add the cards between the parent and the child to the seq_points */ + /* Add the cards between the tqparent and the child to the seq_points */ above_card = fcs_stack_card(state, stack, cc-1); above_num_true_seqs[num_separate_false_seqs] = 1; @@ -1599,7 +1599,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_parent_on_the_same_stack( int clear_junk_dest_stack = -1; - /* Let's try to find a suitable parent on top one of the stacks */ + /* Let's try to find a suitable tqparent on top one of the stacks */ for(clear_junk_dest_stack=0; clear_junk_dest_stack < state_stacks_num; clear_junk_dest_stack++ diff --git a/kpat/freecell-solver/state.h b/kpat/freecell-solver/state.h index e52b717c..7b312b42 100644 --- a/kpat/freecell-solver/state.h +++ b/kpat/freecell-solver/state.h @@ -72,12 +72,12 @@ struct fcs_struct_state_with_locations_t fcs_state_t s; int stack_locs[MAX_NUM_STACKS]; int fc_locs[MAX_NUM_FREECELLS]; - struct fcs_struct_state_with_locations_t * parent; + struct fcs_struct_state_with_locations_t * tqparent; fcs_move_stack_t * moves_to_parent; int depth; int visited; int visited_iter; - int num_active_children; + int num_active_tqchildren; int scan_visited[MAX_NUM_SCANS_BUCKETS]; }; @@ -232,12 +232,12 @@ struct fcs_struct_state_with_locations_t fcs_state_t s; char stack_locs[MAX_NUM_STACKS]; char fc_locs[MAX_NUM_FREECELLS]; - struct fcs_struct_state_with_locations_t * parent; + struct fcs_struct_state_with_locations_t * tqparent; fcs_move_stack_t * moves_to_parent; int depth; int visited; int visited_iter; - int num_active_children; + int num_active_tqchildren; int scan_visited[MAX_NUM_SCANS_BUCKETS]; }; @@ -484,7 +484,7 @@ struct fcs_struct_state_with_locations_t fcs_state_t s; fcs_locs_t stack_locs[MAX_NUM_STACKS]; fcs_locs_t fc_locs[MAX_NUM_FREECELLS]; - struct fcs_struct_state_with_locations_t * parent; + struct fcs_struct_state_with_locations_t * tqparent; fcs_move_stack_t * moves_to_parent; int depth; /* @@ -508,11 +508,11 @@ struct fcs_struct_state_with_locations_t * */ int visited_iter; /* - * This is the number of direct children of this state which were not + * This is the number of direct tqchildren of this state which were not * yet declared as dead ends. Once this counter reaches zero, this * state too is declared as a dead end. * */ - int num_active_children; + int num_active_tqchildren; /* * This is a vector of flags - one for each scan. Each indicates whether * its scan has already visited this state diff --git a/kpat/freecell-solver/test_arr.h b/kpat/freecell-solver/test_arr.h index cfc5cd12..821ccd98 100644 --- a/kpat/freecell-solver/test_arr.h +++ b/kpat/freecell-solver/test_arr.h @@ -26,19 +26,19 @@ typedef int (*freecell_solver_solve_for_state_test_t)( extern freecell_solver_solve_for_state_test_t freecell_solver_sfs_tests[FCS_TESTS_NUM]; /* - * This macro determines if child can be placed above parent. + * This macro determines if child can be placed above tqparent. * * The variable sequences_are_built_by has to be initialized to * the sequences_are_built_by member of the instance. * * */ -#define fcs_is_parent_card(child, parent) \ - ((fcs_card_card_num(child)+1 == fcs_card_card_num(parent)) && \ +#define fcs_is_parent_card(child, tqparent) \ + ((fcs_card_card_num(child)+1 == fcs_card_card_num(tqparent)) && \ ((sequences_are_built_by == FCS_SEQ_BUILT_BY_RANK) ? \ 1 : \ ((sequences_are_built_by == FCS_SEQ_BUILT_BY_SUIT) ? \ - (fcs_card_suit(child) == fcs_card_suit(parent)) : \ - ((fcs_card_suit(child) & 0x1) != (fcs_card_suit(parent)&0x1)) \ + (fcs_card_suit(child) == fcs_card_suit(tqparent)) : \ + ((fcs_card_suit(child) & 0x1) != (fcs_card_suit(tqparent)&0x1)) \ )) \ ) @@ -58,7 +58,7 @@ extern freecell_solver_solve_for_state_test_t freecell_solver_sfs_tests[FCS_TEST /* Count the number of states until the original state. */ \ while(ptr_state != NULL) \ { \ - ptr_state = ptr_state->parent; \ + ptr_state = ptr_state->tqparent; \ this_real_depth++; \ } \ this_real_depth--; \ @@ -68,14 +68,14 @@ extern freecell_solver_solve_for_state_test_t freecell_solver_sfs_tests[FCS_TEST { \ ptr_state->depth = this_real_depth; \ this_real_depth--; \ - ptr_state = ptr_state->parent; \ + ptr_state = ptr_state->tqparent; \ } \ } \ } \ /* * This macro marks a state as a dead end, and afterwards propogates - * this information to its parent and ancestor states. + * this information to its tqparent and ancestor states. * */ #define mark_as_dead_end(ptr_state_input) \ { \ @@ -84,23 +84,23 @@ extern freecell_solver_solve_for_state_test_t freecell_solver_sfs_tests[FCS_TEST fcs_state_with_locations_t * ptr_state = (ptr_state_input); \ /* Mark as a dead end */ \ ptr_state->visited |= FCS_VISITED_DEAD_END; \ - ptr_state = ptr_state->parent; \ + ptr_state = ptr_state->tqparent; \ if (ptr_state != NULL) \ { \ /* Decrease the refcount of the state */ \ - ptr_state->num_active_children--; \ - while((ptr_state->num_active_children == 0) && (ptr_state->visited & FCS_VISITED_ALL_TESTS_DONE)) \ + ptr_state->num_active_tqchildren--; \ + while((ptr_state->num_active_tqchildren == 0) && (ptr_state->visited & FCS_VISITED_ALL_TESTS_DONE)) \ { \ /* Mark as dead end */ \ ptr_state->visited |= FCS_VISITED_DEAD_END; \ - /* Go to its parent state */ \ - ptr_state = ptr_state->parent; \ + /* Go to its tqparent state */ \ + ptr_state = ptr_state->tqparent; \ if (ptr_state == NULL) \ { \ break; \ } \ /* Decrease the refcount */ \ - ptr_state->num_active_children--; \ + ptr_state->num_active_tqchildren--; \ } \ } \ } \ diff --git a/kpat/freecell-solver/tests.h b/kpat/freecell-solver/tests.h index ce0b35b5..fbf78262 100644 --- a/kpat/freecell-solver/tests.h +++ b/kpat/freecell-solver/tests.h @@ -58,7 +58,7 @@ extern "C" { /* Some A* and BFS parameters that need to be initialized in \ * the derived state. \ * */ \ - ptr_new_state_with_locations->parent = ptr_state_with_locations; \ + ptr_new_state_with_locations->tqparent = ptr_state_with_locations; \ ptr_new_state_with_locations->moves_to_parent = moves; \ /* Make sure depth is consistent with the game graph. \ * I.e: the depth of every newly discovered state is derived from \ @@ -66,8 +66,8 @@ extern "C" { ptr_new_state_with_locations->depth = ptr_state_with_locations->depth + 1; \ /* Mark this state as a state that was not yet visited */ \ ptr_new_state_with_locations->visited = 0; \ - /* It's a newly created state which does not have children yet. */ \ - ptr_new_state_with_locations->num_active_children = 0; \ + /* It's a newly created state which does not have tqchildren yet. */ \ + ptr_new_state_with_locations->num_active_tqchildren = 0; \ memset(ptr_new_state_with_locations->scan_visited, '\0', \ sizeof(ptr_new_state_with_locations->scan_visited) \ ); \ @@ -103,11 +103,11 @@ fcs_move_stack_push(moves, temp_move); \ { \ fcs_state_ia_release(hard_thread); \ calculate_real_depth(existing_state); \ - /* Re-parent the existing state to this one. \ + /* Re-tqparent the existing state to this one. \ * \ * What it means is that if the depth of the state if it \ * can be reached from this one is lower than what it \ - * already have, then re-assign its parent to this state. \ + * already have, then re-assign its tqparent to this state. \ * */ \ if (reparent && \ (existing_state->depth > ptr_state_with_locations->depth+1)) \ @@ -119,15 +119,15 @@ fcs_move_stack_push(moves, temp_move); \ ); \ if (!(existing_state->visited & FCS_VISITED_DEAD_END)) \ { \ - if ((--existing_state->parent->num_active_children) == 0) \ + if ((--existing_state->tqparent->num_active_tqchildren) == 0) \ { \ mark_as_dead_end( \ - existing_state->parent \ + existing_state->tqparent \ ); \ } \ - ptr_state_with_locations->num_active_children++; \ + ptr_state_with_locations->num_active_tqchildren++; \ } \ - existing_state->parent = ptr_state_with_locations; \ + existing_state->tqparent = ptr_state_with_locations; \ existing_state->depth = ptr_state_with_locations->depth + 1; \ } \ fcs_derived_states_list_add_state( \ diff --git a/kpat/freecell.cpp b/kpat/freecell.cpp index ff8a5b1a..9e67633a 100644 --- a/kpat/freecell.cpp +++ b/kpat/freecell.cpp @@ -49,8 +49,8 @@ void FreecellPile::moveCards(CardList &c, Pile *to) //-------------------------------------------------------------------------// FreecellBase::FreecellBase( int decks, int stores, int freecells, int fill, bool unlimit, - KMainWindow* parent, const char* name) - : Dealer(parent,name), + KMainWindow* tqparent, const char* name) + : Dealer(tqparent,name), solver_instance(0), es_filling(fill), solver_ret(FCS_STATE_NOT_BEGAN_YET), unlimited_move(unlimit) { @@ -113,7 +113,7 @@ TQString suitToString(Card::Suit s) { case Card::Spades: return "S"; } - return TQString::null; + return TQString(); } TQString rankToString(Card::Rank r) @@ -280,8 +280,8 @@ void FreecellBase::resumeSolution() return; emit gameInfo(i18n("%1 tries - depth %2") - .arg(freecell_solver_user_get_num_times(solver_instance)) - .arg(freecell_solver_user_get_current_depth(solver_instance))); + .tqarg(freecell_solver_user_get_num_times(solver_instance)) + .tqarg(freecell_solver_user_get_current_depth(solver_instance))); if (solver_ret == FCS_STATE_WAS_SOLVED) { @@ -296,7 +296,7 @@ void FreecellBase::resumeSolution() int moves = freecell_solver_user_get_num_times(solver_instance); freeSolution(); emit gameInfo(i18n("unsolved after %1 moves") - .arg(moves)); + .tqarg(moves)); stopDemo(); return; } @@ -379,7 +379,7 @@ TQString FreecellBase::solverFormat() const tmp += suitToString(target[i]->top()->suit()) + "-" + rankToString(target[i]->top()->rank()) + " "; } if (!tmp.isEmpty()) - output += TQString::fromLatin1("Foundations: %1\n").arg(tmp); + output += TQString::tqfromLatin1("Foundations: %1\n").tqarg(tmp); tmp.truncate(0); for (uint i = 0; i < freecell.count(); i++) { @@ -389,7 +389,7 @@ TQString FreecellBase::solverFormat() const tmp += rankToString(freecell[i]->top()->rank()) + suitToString(freecell[i]->top()->suit()) + " "; } if (!tmp.isEmpty()) - output += TQString::fromLatin1("Freecells: %1\n").arg(tmp); + output += TQString::tqfromLatin1("Freecells: %1\n").tqarg(tmp); for (uint i = 0; i < store.count(); i++) { @@ -544,7 +544,7 @@ MoveHint *FreecellBase::chooseHint() { if (solver_instance && freecell_solver_user_get_moves_left(solver_instance)) { - emit gameInfo(i18n("%1 moves before finish").arg(freecell_solver_user_get_moves_left(solver_instance))); + emit gameInfo(i18n("%1 moves before finish").tqarg(freecell_solver_user_get_moves_left(solver_instance))); fcs_move_t move; if (!freecell_solver_user_get_next_move(solver_instance, &move)) { @@ -665,7 +665,7 @@ void FreecellBase::movePileToPile(CardList &c, Pile *to, PileList fss, PileList if ((count > (fcs.count() + 1)) && (count <= 2 * (fcs.count() + 1))) moveaway = count - (fcs.count() + 1); } - uint moving = QMIN(count, QMIN(c.count() - start, fcs.count() + 1)); + uint moving = TQMIN(count, TQMIN(c.count() - start, fcs.count() + 1)); assert(moving); for (uint i = 0; i < moving - 1; i++) { @@ -813,12 +813,12 @@ bool FreecellBase::checkRemove(int checkIndex, const Pile *p, const Card *c) con class Freecell : public FreecellBase { public: - Freecell( KMainWindow* parent=0, const char* name=0); + Freecell( KMainWindow* tqparent=0, const char* name=0); virtual void deal(); }; -Freecell::Freecell( KMainWindow* parent, const char* name) - : FreecellBase(1, 8, 4, FCS_ES_FILLED_BY_ANY_CARD, false, parent, name) +Freecell::Freecell( KMainWindow* tqparent, const char* name) + : FreecellBase(1, 8, 4, FCS_ES_FILLED_BY_ANY_CARD, false, tqparent, name) { for (int i = 0; i < 8; i++) store[i]->move(8 + ( cardMap::CARDX() * 11 / 10 + 1 ) * i, 8 + cardMap::CARDY() * 11 / 10); @@ -846,7 +846,7 @@ static class LocalDealerInfo3 : public DealerInfo { public: LocalDealerInfo3() : DealerInfo(I18N_NOOP("&Freecell"), 3) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Freecell(parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Freecell(tqparent); } } ldi8; //-------------------------------------------------------------------------// diff --git a/kpat/freecell.h b/kpat/freecell.h index b2b94dad..5d354eda 100644 --- a/kpat/freecell.h +++ b/kpat/freecell.h @@ -27,17 +27,18 @@ class FreecellPile : public Pile { public: - FreecellPile(int _index, Dealer* parent = 0) : Pile(_index, parent) {} + FreecellPile(int _index, Dealer* tqparent = 0) : Pile(_index, tqparent) {} virtual void moveCards(CardList &c, Pile *to); }; class FreecellBase : public Dealer { Q_OBJECT + TQ_OBJECT public: FreecellBase( int decks, int stores, int freecells, int es_filling, bool unlimited_move, - KMainWindow* parent=0, const char* name=0); + KMainWindow* tqparent=0, const char* name=0); void moveCards(CardList &c, FreecellPile *from, Pile *to); TQString solverFormat() const; virtual ~FreecellBase(); diff --git a/kpat/gamestats.ui b/kpat/gamestats.ui index 2d1e5443..76654317 100644 --- a/kpat/gamestats.ui +++ b/kpat/gamestats.ui @@ -1,10 +1,10 @@ GameStats - + GameStats - + 0 0 @@ -22,15 +22,15 @@ unnamed - + - layout3 + tqlayout3 unnamed - + textLabel1 @@ -46,7 +46,7 @@ Game: - + GameType @@ -61,34 +61,34 @@ - + - layout5 + tqlayout5 unnamed - + - layout2 + tqlayout2 unnamed - + Won %1 - + AlignVCenter|AlignRight - + WonPerc @@ -96,7 +96,7 @@ (%1%) - + textLabel7 @@ -104,7 +104,7 @@ Longest winning streak: - + textLabel2 @@ -112,18 +112,18 @@ Games played: - + LooseStreak %1 - + AlignVCenter|AlignRight - + textLabel8 @@ -131,18 +131,18 @@ Longest losing streak: - + WinStreak %1 - + AlignVCenter|AlignRight - + textLabel3 @@ -150,14 +150,14 @@ Games won: - + Played %1 - + AlignVCenter|AlignRight @@ -173,7 +173,7 @@ Expanding - + 250 20 @@ -192,14 +192,14 @@ Expanding - + 20 71 - + Layout1 @@ -223,14 +223,14 @@ Expanding - + 20 20 - + buttonOk @@ -265,8 +265,8 @@ setGameType(int) - + setGameType(int) - - + + diff --git a/kpat/gamestatsimpl.cpp b/kpat/gamestatsimpl.cpp index 11b95fee..59e37b79 100644 --- a/kpat/gamestatsimpl.cpp +++ b/kpat/gamestatsimpl.cpp @@ -24,7 +24,7 @@ GameStatsImpl::GameStatsImpl(TQWidget* aParent, const char* aname) if (list.count() <= i) list.append("unknown"); list[index] = i18n((*it)->name); - list[index].replace('&',""); + list[index].tqreplace('&',""); } GameType->insertStringList(list); showGameType(0); @@ -42,16 +42,16 @@ void GameStatsImpl::setGameType(int id) languageChange(); KConfig *config = kapp->config(); KConfigGroupSaver kcs(config, scores_group); - unsigned int t = config->readUnsignedNumEntry(TQString("total%1").arg(id),0); - Played->setText(Played->text().arg(t)); - unsigned int w = config->readUnsignedNumEntry(TQString("won%1").arg(id),0); - Won->setText(Won->text().arg(w)); + unsigned int t = config->readUnsignedNumEntry(TQString("total%1").tqarg(id),0); + Played->setText(Played->text().tqarg(t)); + unsigned int w = config->readUnsignedNumEntry(TQString("won%1").tqarg(id),0); + Won->setText(Won->text().tqarg(w)); if (t) - WonPerc->setText(WonPerc->text().arg(w*100/t)); + WonPerc->setText(WonPerc->text().tqarg(w*100/t)); else - WonPerc->setText(WonPerc->text().arg(0)); + WonPerc->setText(WonPerc->text().tqarg(0)); WinStreak->setText( - WinStreak->text().arg(config->readUnsignedNumEntry(TQString("maxwinstreak%1").arg(id),0))); + WinStreak->text().tqarg(config->readUnsignedNumEntry(TQString("maxwinstreak%1").tqarg(id),0))); LooseStreak->setText( - LooseStreak->text().arg(config->readUnsignedNumEntry(TQString("maxloosestreak%1").arg(id),0))); + LooseStreak->text().tqarg(config->readUnsignedNumEntry(TQString("maxloosestreak%1").tqarg(id),0))); } diff --git a/kpat/golf.cpp b/kpat/golf.cpp index 053525da..b06caf68 100644 --- a/kpat/golf.cpp +++ b/kpat/golf.cpp @@ -4,8 +4,8 @@ #include #include "cardmaps.h" -HorRightPile::HorRightPile( int _index, Dealer* parent) - : Pile(_index, parent) +HorRightPile::HorRightPile( int _index, Dealer* tqparent) + : Pile(_index, tqparent) { } @@ -19,8 +19,8 @@ TQSize HorRightPile::cardOffset( bool _spread, bool, const Card *) const //-------------------------------------------------------------------------// -Golf::Golf( KMainWindow* parent, const char* _name) - : Dealer( parent, _name ) +Golf::Golf( KMainWindow* tqparent, const char* _name) + : Dealer( tqparent, _name ) { const int dist_x = cardMap::CARDX() * 11 / 10 + 1; const int pile_dist = 10 + 3 * cardMap::CARDY(); @@ -158,7 +158,7 @@ static class LocalDealerInfo13 : public DealerInfo { public: LocalDealerInfo13() : DealerInfo(I18N_NOOP("Go&lf"), 12) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Golf(parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Golf(tqparent); } } ldi13; //-------------------------------------------------------------------------// diff --git a/kpat/golf.h b/kpat/golf.h index 7729e8f4..275cd8b5 100644 --- a/kpat/golf.h +++ b/kpat/golf.h @@ -6,18 +6,20 @@ class HorRightPile : public Pile { Q_OBJECT + TQ_OBJECT public: - HorRightPile( int _index, Dealer* parent = 0); + HorRightPile( int _index, Dealer* tqparent = 0); virtual TQSize cardOffset( bool _spread, bool _facedown, const Card *before) const; }; class Golf : public Dealer { Q_OBJECT + TQ_OBJECT public: - Golf( KMainWindow* parent=0, const char* name=0); + Golf( KMainWindow* tqparent=0, const char* name=0); void deal(); virtual void restart(); virtual bool isGameLost() const; diff --git a/kpat/grandf.cpp b/kpat/grandf.cpp index c15c6103..5ada2ea6 100644 --- a/kpat/grandf.cpp +++ b/kpat/grandf.cpp @@ -25,8 +25,8 @@ #include #include "cardmaps.h" -Grandf::Grandf( KMainWindow* parent, const char *name ) - : Dealer( parent, name ) +Grandf::Grandf( KMainWindow* tqparent, const char *name ) + : Dealer( tqparent, name ) { deck = Deck::new_deck(this); deck->hide(); @@ -221,7 +221,7 @@ static class LocalDealerInfo1 : public DealerInfo { public: LocalDealerInfo1() : DealerInfo(I18N_NOOP("&Grandfather"), 1) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Grandf(parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Grandf(tqparent); } } gfdi; #include "grandf.moc" diff --git a/kpat/grandf.h b/kpat/grandf.h index 4c07abc1..24e64c5c 100644 --- a/kpat/grandf.h +++ b/kpat/grandf.h @@ -36,9 +36,10 @@ class KMainWindow; class Grandf : public Dealer { Q_OBJECT + TQ_OBJECT public: - Grandf( KMainWindow* parent=0, const char* name=0); + Grandf( KMainWindow* tqparent=0, const char* name=0); public slots: void redeal(); diff --git a/kpat/gypsy.cpp b/kpat/gypsy.cpp index 5432336a..9c37b6b6 100644 --- a/kpat/gypsy.cpp +++ b/kpat/gypsy.cpp @@ -3,8 +3,8 @@ #include "deck.h" #include "cardmaps.h" -Gypsy::Gypsy( KMainWindow* parent, const char *name ) - : Dealer( parent, name ) +Gypsy::Gypsy( KMainWindow* tqparent, const char *name ) + : Dealer( tqparent, name ) { const int dist_x = cardMap::CARDX() * 11 / 10 + 1; const int dist_y = cardMap::CARDY() * 11 / 10 + 1; @@ -111,7 +111,7 @@ static class LocalDealerInfo7 : public DealerInfo { public: LocalDealerInfo7() : DealerInfo(I18N_NOOP("Gy&psy"), 7) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Gypsy(parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Gypsy(tqparent); } } gyfdi; #include "gypsy.moc" diff --git a/kpat/gypsy.h b/kpat/gypsy.h index ea28b04e..5ead4175 100644 --- a/kpat/gypsy.h +++ b/kpat/gypsy.h @@ -11,9 +11,10 @@ class KMainWindow; class Gypsy : public Dealer { Q_OBJECT + TQ_OBJECT public: - Gypsy( KMainWindow* parent=0, const char* name=0); + Gypsy( KMainWindow* tqparent=0, const char* name=0); virtual bool isGameLost() const; public slots: diff --git a/kpat/idiot.cpp b/kpat/idiot.cpp index 3ac49ef5..e86e8059 100644 --- a/kpat/idiot.cpp +++ b/kpat/idiot.cpp @@ -25,8 +25,8 @@ #include "cardmaps.h" -Idiot::Idiot( KMainWindow* parent, const char* _name) - : Dealer( parent, _name ) +Idiot::Idiot( KMainWindow* tqparent, const char* _name) + : Dealer( tqparent, _name ) { // Create the deck to the left. m_deck = Deck::new_deck( this ); @@ -227,7 +227,7 @@ static class LocalDealerInfo2 : public DealerInfo { public: LocalDealerInfo2() : DealerInfo(I18N_NOOP("&Aces Up"), 2) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Idiot(parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Idiot(tqparent); } } ldi4; diff --git a/kpat/idiot.h b/kpat/idiot.h index 101957c0..147e2fec 100644 --- a/kpat/idiot.h +++ b/kpat/idiot.h @@ -29,10 +29,11 @@ class Idiot: public Dealer { Q_OBJECT + TQ_OBJECT public: - Idiot( KMainWindow* parent = 0, const char* name = 0 ); + Idiot( KMainWindow* tqparent = 0, const char* name = 0 ); virtual bool isGameWon() const; diff --git a/kpat/kings.cpp b/kpat/kings.cpp index 7654a88f..22faf307 100644 --- a/kpat/kings.cpp +++ b/kpat/kings.cpp @@ -6,8 +6,8 @@ #include "freecell-solver/fcs_enums.h" #include "cardmaps.h" -Kings::Kings( KMainWindow* parent, const char *name ) - : FreecellBase( 2, 8, 8, FCS_ES_FILLED_BY_KINGS_ONLY, true, parent, name ) +Kings::Kings( KMainWindow* tqparent, const char *name ) + : FreecellBase( 2, 8, 8, FCS_ES_FILLED_BY_KINGS_ONLY, true, tqparent, name ) { const int dist_x = cardMap::CARDX() * 11 / 10 + 1; @@ -125,7 +125,7 @@ static class LocalDealerInfo12 : public DealerInfo { public: LocalDealerInfo12() : DealerInfo(I18N_NOOP("&The Kings"), 12) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Kings(parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Kings(tqparent); } } gfdi12; #endif diff --git a/kpat/kings.h b/kpat/kings.h index e3a60475..dc49e8c3 100644 --- a/kpat/kings.h +++ b/kpat/kings.h @@ -9,9 +9,10 @@ class KMainWindow; class Kings : public FreecellBase { Q_OBJECT + TQ_OBJECT public: - Kings( KMainWindow* parent=0, const char* name=0); + Kings( KMainWindow* tqparent=0, const char* name=0); virtual bool isGameLost() const; public slots: diff --git a/kpat/klondike.cpp b/kpat/klondike.cpp index dcf4c1f8..1e0d0b79 100644 --- a/kpat/klondike.cpp +++ b/kpat/klondike.cpp @@ -32,8 +32,8 @@ class KlondikePile : public Pile { public: - KlondikePile( int _index, Dealer* parent) - : Pile(_index, parent) {} + KlondikePile( int _index, Dealer* tqparent) + : Pile(_index, tqparent) {} void clearSpread() { cardlist.clear(); } @@ -42,7 +42,7 @@ public: } virtual TQSize cardOffset( bool _spread, bool, const Card *c) const { kdDebug(11111) << "cardOffset " << _spread << " " << (c? c->name() : "(null)") << endl; - if (cardlist.contains(const_cast(c))) + if (cardlist.tqcontains(const_cast(c))) return TQSize(+dspread(), 0); return TQSize(0, 0); } @@ -50,8 +50,8 @@ private: CardList cardlist; }; -Klondike::Klondike( bool easy, KMainWindow* parent, const char* _name ) - : Dealer( parent, _name ) +Klondike::Klondike( bool easy, KMainWindow* tqparent, const char* _name ) + : Dealer( tqparent, _name ) { // The units of the follwoing constants are pixels const int margin = 10; // between card piles and board edge @@ -481,14 +481,14 @@ static class LocalDealerInfo0 : public DealerInfo { public: LocalDealerInfo0() : DealerInfo(I18N_NOOP("&Klondike"), 0) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Klondike(true, parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Klondike(true, tqparent); } } ldi0; static class LocalDealerInfo14 : public DealerInfo { public: LocalDealerInfo14() : DealerInfo(I18N_NOOP("Klondike (&draw 3)"), 13) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Klondike(false, parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Klondike(false, tqparent); } } ldi14; diff --git a/kpat/klondike.h b/kpat/klondike.h index b1b7e673..ad4fcdcd 100644 --- a/kpat/klondike.h +++ b/kpat/klondike.h @@ -33,9 +33,10 @@ class KlondikePile; class Klondike : public Dealer { Q_OBJECT + TQ_OBJECT public: - Klondike( bool easy, KMainWindow* parent=0, const char* name=0); + Klondike( bool easy, KMainWindow* tqparent=0, const char* name=0); public: virtual void restart(); diff --git a/kpat/mod3.cpp b/kpat/mod3.cpp index 45a8d026..9f92643f 100644 --- a/kpat/mod3.cpp +++ b/kpat/mod3.cpp @@ -26,8 +26,8 @@ //-------------------------------------------------------------------------// -Mod3::Mod3( KMainWindow* parent, const char* _name) - : Dealer( parent, _name ) +Mod3::Mod3( KMainWindow* tqparent, const char* _name) + : Dealer( tqparent, _name ) { const int dist_x = cardMap::CARDX() * 11 / 10 + 1; const int dist_y = cardMap::CARDY() * 11 / 10 + 1; @@ -301,7 +301,7 @@ static class LocalDealerInfo5 : public DealerInfo { public: LocalDealerInfo5() : DealerInfo(I18N_NOOP("M&od3"), 5) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Mod3(parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Mod3(tqparent); } } ldi5; //-------------------------------------------------------------------------// diff --git a/kpat/mod3.h b/kpat/mod3.h index 17ff6aa2..cb6047ce 100644 --- a/kpat/mod3.h +++ b/kpat/mod3.h @@ -28,9 +28,10 @@ class Mod3 : public Dealer { Q_OBJECT + TQ_OBJECT public: - Mod3( KMainWindow* parent=0, const char* name=0); + Mod3( KMainWindow* tqparent=0, const char* name=0); void deal(); diff --git a/kpat/napoleon.cpp b/kpat/napoleon.cpp index 7f7c7f95..1429fbdb 100644 --- a/kpat/napoleon.cpp +++ b/kpat/napoleon.cpp @@ -22,8 +22,8 @@ #include "deck.h" #include "cardmaps.h" -Napoleon::Napoleon( KMainWindow* parent, const char* _name ) - : Dealer( parent, _name ) +Napoleon::Napoleon( KMainWindow* tqparent, const char* _name ) + : Dealer( tqparent, _name ) { deck = Deck::new_deck( this ); connect(deck, TQT_SIGNAL(clicked(Card *)), TQT_SLOT(deal1(Card*))); @@ -198,7 +198,7 @@ static class LocalDealerInfo4 : public DealerInfo { public: LocalDealerInfo4() : DealerInfo(I18N_NOOP("&Napoleon's Tomb"), 4) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Napoleon(parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Napoleon(tqparent); } } ldi3; #include "napoleon.moc" diff --git a/kpat/napoleon.h b/kpat/napoleon.h index a89f68b9..d097d6ac 100644 --- a/kpat/napoleon.h +++ b/kpat/napoleon.h @@ -26,8 +26,9 @@ class Napoleon : public Dealer { Q_OBJECT + TQ_OBJECT public: - Napoleon (KMainWindow* parent=0, const char* name=0); + Napoleon (KMainWindow* tqparent=0, const char* name=0); virtual void restart(); virtual void getHints(); diff --git a/kpat/pile.cpp b/kpat/pile.cpp index 50a15bab..8d34325e 100644 --- a/kpat/pile.cpp +++ b/kpat/pile.cpp @@ -32,13 +32,13 @@ Pile::Pile( int _index, Dealer* _dealer) // Make the patience aware of this pile. dealer()->addPile(this); - TQCanvasRectangle::setVisible(true); // default + TQCanvasRectangle::tqsetVisible(true); // default _checkIndex = -1; m_addFlags = 0; m_removeFlags = 0; - setBrush(Qt::black); - setPen(TQPen(Qt::black)); + setBrush(TQt::black); + setPen(TQPen(TQt::black)); setZ(0); initSizes(); @@ -193,12 +193,12 @@ bool Pile::legalRemove(const Card *c) const void Pile::setVisible(bool vis) { - TQCanvasRectangle::setVisible(vis); + TQCanvasRectangle::tqsetVisible(vis); dealer()->enlargeCanvas(this); for (CardList::Iterator it = m_cards.begin(); it != m_cards.end(); ++it) { - (*it)->setVisible(vis); + (*it)->tqsetVisible(vis); dealer()->enlargeCanvas(*it); } } @@ -218,7 +218,7 @@ void Pile::moveBy(double dx, double dy) int Pile::indexOf(const Card *c) const { assert(c->source() == this); - return m_cards.findIndex(const_cast(c)); // the list is of non-const cards + return m_cards.tqfindIndex(const_cast(c)); // the list is of non-const cards } Card *Pile::at(int index) const @@ -338,7 +338,7 @@ void Pile::add( Card* _card, bool _facedown, bool _spread ) void Pile::remove(Card *c) { - assert(m_cards.contains(c)); + assert(m_cards.tqcontains(c)); m_cards.remove(c); } diff --git a/kpat/pile.h b/kpat/pile.h index 7dd14f3c..3580eefe 100644 --- a/kpat/pile.h +++ b/kpat/pile.h @@ -15,9 +15,10 @@ class Dealer; * */ -class Pile : public TQObject, public QCanvasRectangle +class Pile : public TQObject, public TQCanvasRectangle { Q_OBJECT + TQ_OBJECT public: @@ -40,7 +41,7 @@ public: static const int autoTurnTop; static const int wholeColumn; - Pile( int _index, Dealer* parent = 0); + Pile( int _index, Dealer* tqparent = 0); virtual ~Pile(); Dealer *dealer() const { return m_dealer; } diff --git a/kpat/pwidget.cpp b/kpat/pwidget.cpp index eb12a1c8..e8353dee 100644 --- a/kpat/pwidget.cpp +++ b/kpat/pwidget.cpp @@ -59,28 +59,28 @@ pWidget::pWidget() { current_pwidget = this; // KCrash::setEmergencySaveFunction(::saveGame); - KStdAction::quit(kapp, TQT_SLOT(quit()), actionCollection(), "game_exit"); + KStdAction::quit(TQT_TQOBJECT(kapp), TQT_SLOT(quit()), actionCollection(), "game_exit"); - undo = KStdAction::undo(this, TQT_SLOT(undoMove()), + undo = KStdAction::undo(TQT_TQOBJECT(this), TQT_SLOT(undoMove()), actionCollection(), "undo_move"); undo->setEnabled(false); - (void)KStdAction::openNew(this, TQT_SLOT(newGame()), + (void)KStdAction::openNew(TQT_TQOBJECT(this), TQT_SLOT(newGame()), actionCollection(), "new_game"); - (void)KStdAction::open(this, TQT_SLOT(openGame()), + (void)KStdAction::open(TQT_TQOBJECT(this), TQT_SLOT(openGame()), actionCollection(), "open"); - recent = KStdAction::openRecent(this, TQT_SLOT(openGame(const KURL&)), + recent = KStdAction::openRecent(TQT_TQOBJECT(this), TQT_SLOT(openGame(const KURL&)), actionCollection(), "open_recent"); recent->loadEntries(KGlobal::config()); - (void)KStdAction::saveAs(this, TQT_SLOT(saveGame()), + (void)KStdAction::saveAs(TQT_TQOBJECT(this), TQT_SLOT(saveGame()), actionCollection(), "save"); - (void)new KAction(i18n("&Choose Game..."), 0, this, TQT_SLOT(chooseGame()), + (void)new KAction(i18n("&Choose Game..."), 0, TQT_TQOBJECT(this), TQT_SLOT(chooseGame()), actionCollection(), "choose_game"); - (void)new KAction(i18n("Restart &Game"), TQString::fromLatin1("reload"), 0, - this, TQT_SLOT(restart()), + (void)new KAction(i18n("Restart &Game"), TQString::tqfromLatin1("reload"), 0, + TQT_TQOBJECT(this), TQT_SLOT(restart()), actionCollection(), "restart_game"); - (void)KStdAction::help(this, TQT_SLOT(helpGame()), actionCollection(), "help_game"); + (void)KStdAction::help(TQT_TQOBJECT(this), TQT_SLOT(helpGame()), actionCollection(), "help_game"); - games = new KSelectAction(i18n("&Game Type"), 0, this, + games = new KSelectAction(i18n("&Game Type"), 0, TQT_TQOBJECT(this), TQT_SLOT(newGameType()), actionCollection(), "game_type"); TQStringList list; @@ -104,17 +104,17 @@ pWidget::pWidget() KGlobal::dirs()->addResourceType("wallpaper", KStandardDirs::kde_default("data") + "kpat/backgrounds/"); KGlobal::dirs()->addResourceType("wallpaper", KStandardDirs::kde_default("data") + "ksnake/backgrounds/"); - wallpapers = new KSelectAction(i18n("&Change Background"), 0, this, + wallpapers = new KSelectAction(i18n("&Change Background"), 0, TQT_TQOBJECT(this), TQT_SLOT(changeWallpaper()), actionCollection(), "wallpaper"); list.clear(); wallpaperlist.clear(); - TQStringList wallpaperlist2 = KGlobal::dirs()->findAllResources("wallpaper", TQString::null, + TQStringList wallpaperlist2 = KGlobal::dirs()->findAllResources("wallpaper", TQString(), false, true, list); TQStringList list2; for (TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { TQString file = *it; - int rindex = file.findRev('.'); + int rindex = file.tqfindRev('.'); if (rindex != -1) { TQString ext = file.mid(rindex + 1).lower(); if (ext == "jpeg" || ext == "png" || ext == "jpg") { @@ -125,23 +125,23 @@ pWidget::pWidget() } wallpapers->setItems(list2); - wallpapers->setCurrentItem(list2.findIndex("No-Ones-Laughing-3")); + wallpapers->setCurrentItem(list2.tqfindIndex("No-Ones-Laughing-3")); changeWallpaper(); (void)new cardMap(midcolor); - backs = new KAction(i18n("&Switch Cards..."), 0, this, + backs = new KAction(i18n("&Switch Cards..."), 0, TQT_TQOBJECT(this), TQT_SLOT(changeBackside()), actionCollection(), "backside"); - stats = new KAction(i18n("&Statistics"), 0, this, TQT_SLOT(showStats()), + stats = new KAction(i18n("&Statistics"), 0, TQT_TQOBJECT(this), TQT_SLOT(showStats()), actionCollection(),"game_stats"); animation = new KToggleAction(i18n( "&Animation on Startup" ), - 0, this, TQT_SLOT(animationChanged()), + 0, TQT_TQOBJECT(this), TQT_SLOT(animationChanged()), actionCollection(), "animation"); dropaction = new KToggleAction(i18n("&Enable Autodrop"), - 0, this, TQT_SLOT(enableAutoDrop()), + 0, TQT_TQOBJECT(this), TQT_SLOT(enableAutoDrop()), actionCollection(), "enable_autodrop"); dropaction->setCheckedState(i18n("Disable Autodrop")); @@ -167,7 +167,7 @@ pWidget::pWidget() statusBar()->insertItem( "", 1, 0, true ); - createGUI(TQString::null, false); + createGUI(TQString(), false); KAcceleratorManager::manage(menuBar()); newGameType(); @@ -239,7 +239,7 @@ void pWidget::changeWallpaper() return; background = TQPixmap(bgpath); if (background.isNull()) { - KMessageBox::sorry(this, i18n("Couldn't load wallpaper
    %1
    ").arg(bgpath)); + KMessageBox::sorry(this, i18n("Couldn't load wallpaper
    %1
    ").tqarg(bgpath)); return; } @@ -251,10 +251,10 @@ void pWidget::changeWallpaper() long b = 0; for (int i = 0; i < bg.numColors(); ++i) { - QRgb rgb = bg.color(i); - r += qRed(rgb); - g += qGreen(rgb); - b += qBlue(rgb); + TQRgb rgb = bg.color(i); + r += tqRed(rgb); + g += tqGreen(rgb); + b += tqBlue(rgb); } r /= bg.numColors(); b /= bg.numColors(); @@ -344,8 +344,8 @@ void pWidget::newGameType() if ((*it)->gameindex == id) { dill = (*it)->createGame(this); TQString name = (*it)->name; - name = name.replace(TQRegExp("[&']"), ""); - name = name.replace(TQRegExp("[ ]"), "_").lower(); + name = name.tqreplace(TQRegExp("[&']"), ""); + name = name.tqreplace(TQRegExp("[ ]"), "_").lower(); dill->setAnchorName("game_" + name); connect(dill, TQT_SIGNAL(saveGame()), TQT_SLOT(saveGame())); connect(dill, TQT_SIGNAL(gameInfo(const TQString&)), @@ -455,7 +455,7 @@ void pWidget::gameWon(bool withhelp) #if TEST_SOLVER == 0 KMessageBox::information(this, congrats, i18n("Congratulations!")); #endif - TQTimer::singleShot(0, this, TQT_SLOT(newGame())); + TQTimer::singleShot(0, TQT_TQOBJECT(this), TQT_SLOT(newGame())); #if TEST_SOLVER == 1 dill->demo(); #endif @@ -468,11 +468,11 @@ void pWidget::gameLost() // The following code is taken out of kmessagebox.cpp in kdeui. // Is there a better way? KConfig *config = 0; - TQString grpNotifMsgs = TQString::fromLatin1("Notification Messages"); + TQString grpNotifMsgs = TQString::tqfromLatin1("Notification Messages"); config = KGlobal::config(); KConfigGroupSaver saver(config, - TQString::fromLatin1("Notification Messages")); + TQString::tqfromLatin1("Notification Messages")); TQString dontAsk = config->readEntry(dontAskAgainName).lower(); // If we are ordered never to ask again and to continue the game, @@ -482,7 +482,7 @@ void pWidget::gameLost() // If it says yes, we ask anyway. Just starting a new game would // be incredibly annoying. if (dontAsk == "yes") - dontAskAgainName = TQString::null; + dontAskAgainName = TQString(); if (KMessageBox::questionYesNo(this, i18n("You could not win this game, " "but there is always a second try.\nStart a new game?"), @@ -491,7 +491,7 @@ void pWidget::gameLost() KStdGuiItem::cont(), dontAskAgainName) == KMessageBox::Yes) { - TQTimer::singleShot(0, this, TQT_SLOT(newGame())); + TQTimer::singleShot(0, TQT_TQOBJECT(this), TQT_SLOT(newGame())); } } @@ -511,7 +511,7 @@ void pWidget::openGame(const KURL &url) } uint id = doc.documentElement().attribute("id").toUInt(); - if (id != (Q_UINT32)games->currentItem()) { + if (id != (TQ_UINT32)games->currentItem()) { games->setCurrentItem(id); newGameType(); if (!dill) { diff --git a/kpat/pwidget.h b/kpat/pwidget.h index ab2b4972..1ff0367c 100644 --- a/kpat/pwidget.h +++ b/kpat/pwidget.h @@ -35,6 +35,7 @@ class TQLabel; class pWidget: public KMainWindow { Q_OBJECT + TQ_OBJECT public: pWidget(); diff --git a/kpat/simon.cpp b/kpat/simon.cpp index 287ecd00..fd3c3604 100644 --- a/kpat/simon.cpp +++ b/kpat/simon.cpp @@ -5,8 +5,8 @@ #include #include "cardmaps.h" -Simon::Simon( KMainWindow* parent, const char *name ) - : Dealer( parent, name ) +Simon::Simon( KMainWindow* tqparent, const char *name ) + : Dealer( tqparent, name ) { deck = Deck::new_deck(this); deck->move(10, 10); @@ -150,7 +150,7 @@ static class LocalDealerInfo9 : public DealerInfo { public: LocalDealerInfo9() : DealerInfo(I18N_NOOP("&Simple Simon"), 9) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Simon(parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Simon(tqparent); } } gfi9; #include "simon.moc" diff --git a/kpat/simon.h b/kpat/simon.h index 91a50a1b..b20bfde8 100644 --- a/kpat/simon.h +++ b/kpat/simon.h @@ -5,9 +5,10 @@ class Simon : public Dealer { Q_OBJECT + TQ_OBJECT public: - Simon( KMainWindow* parent=0, const char* name=0); + Simon( KMainWindow* tqparent=0, const char* name=0); public slots: void deal(); diff --git a/kpat/spider.cpp b/kpat/spider.cpp index c8e6abc5..5c367c04 100644 --- a/kpat/spider.cpp +++ b/kpat/spider.cpp @@ -48,8 +48,8 @@ void SpiderPile::moveCards(CardList &c, Pile *to) //-------------------------------------------------------------------------// -Spider::Spider(int suits, KMainWindow* parent, const char* _name) - : Dealer(parent, _name) +Spider::Spider(int suits, KMainWindow* tqparent, const char* _name) + : Dealer(tqparent, _name) { const int dist_x = cardMap::CARDX() * 11 / 10 + 1; const int dist_y = cardMap::CARDY() * 11 / 10 + 1; @@ -459,21 +459,21 @@ static class LocalDealerInfo15 : public DealerInfo { public: LocalDealerInfo15() : DealerInfo(I18N_NOOP("S&pider (Easy)"), 14) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Spider(1, parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Spider(1, tqparent); } } ldi15; static class LocalDealerInfo16 : public DealerInfo { public: LocalDealerInfo16() : DealerInfo(I18N_NOOP("Spider (&Medium)"), 15) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Spider(2, parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Spider(2, tqparent); } } ldi16; static class LocalDealerInfo17 : public DealerInfo { public: LocalDealerInfo17() : DealerInfo(I18N_NOOP("Spider (&Hard)"), 16) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Spider(4, parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Spider(4, tqparent); } } ldi17; //-------------------------------------------------------------------------// diff --git a/kpat/spider.h b/kpat/spider.h index 055502ff..81bf84b2 100644 --- a/kpat/spider.h +++ b/kpat/spider.h @@ -26,7 +26,7 @@ class SpiderPile : public Pile { public: - SpiderPile(int _index, Dealer* parent = 0) : Pile(_index, parent) {} + SpiderPile(int _index, Dealer* tqparent = 0) : Pile(_index, tqparent) {} virtual void moveCards(CardList &c, Pile *to); CardList getRun(); }; @@ -34,9 +34,10 @@ public: class Spider : public Dealer { Q_OBJECT + TQ_OBJECT public: - Spider(int suits, KMainWindow *parent=0, const char *name=0); + Spider(int suits, KMainWindow *tqparent=0, const char *name=0); void deal(); void dealRow(); void checkPileDeck(Pile *to); diff --git a/kpat/yukon.cpp b/kpat/yukon.cpp index 859b3746..1d3a6157 100644 --- a/kpat/yukon.cpp +++ b/kpat/yukon.cpp @@ -5,8 +5,8 @@ #include #include "cardmaps.h" -Yukon::Yukon( KMainWindow* parent, const char *name ) - : Dealer( parent, name ) +Yukon::Yukon( KMainWindow* tqparent, const char *name ) + : Dealer( tqparent, name ) { const int dist_x = cardMap::CARDX() * 11 / 10 + 1; const int dist_y = cardMap::CARDY() * 11 / 10 + 1; @@ -124,7 +124,7 @@ static class LocalDealerInfo10 : public DealerInfo { public: LocalDealerInfo10() : DealerInfo(I18N_NOOP("&Yukon"), 10) {} - virtual Dealer *createGame(KMainWindow *parent) { return new Yukon(parent); } + virtual Dealer *createGame(KMainWindow *tqparent) { return new Yukon(tqparent); } } gfi10; #include "yukon.moc" diff --git a/kpat/yukon.h b/kpat/yukon.h index 9b407ac3..c9b4e5c9 100644 --- a/kpat/yukon.h +++ b/kpat/yukon.h @@ -5,9 +5,10 @@ class Yukon : public Dealer { Q_OBJECT + TQ_OBJECT public: - Yukon( KMainWindow* parent=0, const char* name=0); + Yukon( KMainWindow* tqparent=0, const char* name=0); virtual bool isGameLost() const; public slots: diff --git a/kpoker/betbox.cpp b/kpoker/betbox.cpp index 91fcab8b..304c4543 100644 --- a/kpoker/betbox.cpp +++ b/kpoker/betbox.cpp @@ -24,8 +24,8 @@ #include "betbox.h" -BetBox::BetBox(TQWidget* parent, const char* name) - : TQGroupBox(parent, name) +BetBox::BetBox(TQWidget* tqparent, const char* name) + : TQGroupBox(tqparent, name) { TQVBoxLayout* topLayout = new TQVBoxLayout(this, 1, 1); TQGridLayout* g = new TQGridLayout(topLayout, 2, 2, 1); @@ -46,10 +46,10 @@ BetBox::BetBox(TQWidget* parent, const char* name) foldButton = new TQPushButton(this); l->addWidget(foldButton, 0); - bet5Up->setText(TQString("+%1").arg(KGlobal::locale()->formatMoney(5))); - bet10Up->setText(TQString("+%1").arg(KGlobal::locale()->formatMoney(10))); - bet5Down->setText(TQString("-%1").arg(KGlobal::locale()->formatMoney(5))); - bet10Down->setText(TQString("-%1").arg(KGlobal::locale()->formatMoney(10))); + bet5Up->setText(TQString("+%1").tqarg(KGlobal::locale()->formatMoney(5))); + bet10Up->setText(TQString("+%1").tqarg(KGlobal::locale()->formatMoney(10))); + bet5Down->setText(TQString("-%1").tqarg(KGlobal::locale()->formatMoney(5))); + bet10Down->setText(TQString("-%1").tqarg(KGlobal::locale()->formatMoney(10))); adjustBet->setText(i18n("Adjust Bet")); foldButton->setText(i18n("Fold")); diff --git a/kpoker/betbox.h b/kpoker/betbox.h index 69fd741d..e3c52ce9 100644 --- a/kpoker/betbox.h +++ b/kpoker/betbox.h @@ -30,12 +30,13 @@ class TQPushButton; * the adjustBet and out buttons depend on the computers bet * @short This is a box with several buttons used to bet / raise **/ -class BetBox : public QGroupBox +class BetBox : public TQGroupBox { Q_OBJECT + TQ_OBJECT public: - BetBox(TQWidget* parent = 0, const char* name = 0); + BetBox(TQWidget* tqparent = 0, const char* name = 0); ~BetBox(); diff --git a/kpoker/defines.h b/kpoker/defines.h index 3da071f6..d4b827de 100644 --- a/kpoker/defines.h +++ b/kpoker/defines.h @@ -21,7 +21,7 @@ // ---------------------------------------------------------------- -// Graphical layout +// Graphical tqlayout #define cardHeight 96 diff --git a/kpoker/kpaint.cpp b/kpoker/kpaint.cpp index 5ba74f40..15ce5935 100644 --- a/kpoker/kpaint.cpp +++ b/kpoker/kpaint.cpp @@ -38,14 +38,14 @@ TQPixmap *CardImages::m_cardPixmaps; TQPixmap *CardImages::m_deck; -CardImages::CardImages(TQWidget* parent, const char* name) - : TQWidget(parent, name) +CardImages::CardImages(TQWidget* tqparent, const char* name) + : TQWidget(tqparent, name) { - m_cardPixmaps = new QPixmap[numCards]; + m_cardPixmaps = new TQPixmap[numCards]; m_deck = new TQPixmap; // Hide the window. - // FIXME: Why is this a QWidget? + // FIXME: Why is this a TQWidget? hide(); // loadCards(); } @@ -109,8 +109,8 @@ CardImages::loadDeck(TQString path) extern CardImages *cardImages; -CardWidget::CardWidget( TQWidget *parent, const char *name ) - : TQPushButton( parent, name ) +CardWidget::CardWidget( TQWidget *tqparent, const char *name ) + : TQPushButton( tqparent, name ) { m_held = false; @@ -168,13 +168,13 @@ void CardWidget::paintCard(int cardType) } -void CardWidget::repaintDeck() +void CardWidget::tqrepaintDeck() { setPixmap(*m_pm); setFixedSize(cardImages->getWidth(), cardImages->getHeight()); - ((TQWidget*) parent())->layout()->invalidate(); - ((TQWidget*) parent())->setFixedSize( ((TQWidget*) parent())->sizeHint()); + ((TQWidget*) tqparent())->tqlayout()->tqinvalidate(); + ((TQWidget*) tqparent())->setFixedSize( ((TQWidget*) tqparent())->tqsizeHint()); } diff --git a/kpoker/kpaint.h b/kpoker/kpaint.h index 2300e8b1..8c480fd5 100644 --- a/kpoker/kpaint.h +++ b/kpoker/kpaint.h @@ -33,12 +33,13 @@ class TQLabel; * @short A help class for loading the pictures **/ -class CardImages : public QWidget +class CardImages : public TQWidget { Q_OBJECT + TQ_OBJECT public: - CardImages( TQWidget *parent = 0, const char *name = 0 ); + CardImages( TQWidget *tqparent = 0, const char *name = 0 ); ~CardImages(); // FIXME: Use CardValue instead of int when the cards are in their @@ -63,12 +64,13 @@ class CardImages : public QWidget * * @short The cards **/ -class CardWidget : public QPushButton +class CardWidget : public TQPushButton { Q_OBJECT + TQ_OBJECT public: - CardWidget( TQWidget *parent=0, const char *name=0 ); + CardWidget( TQWidget *tqparent=0, const char *name=0 ); /** * Paints the deck if cardType = 0 or the card specified in cardType @@ -93,7 +95,7 @@ class CardWidget : public QPushButton bool toggleHeld(); /* returns the new value of held*/ - void repaintDeck(); + void tqrepaintDeck(); signals: /** diff --git a/kpoker/kpoker.cpp b/kpoker/kpoker.cpp index 0a293118..0c826c14 100644 --- a/kpoker/kpoker.cpp +++ b/kpoker/kpoker.cpp @@ -88,7 +88,7 @@ PokerGame::dealCards(PokerPlayer *player, bool skip[]) void PokerGame::activatePlayer(PokerPlayer *player) { - if (!m_activePlayers.contains(player)) { + if (!m_activePlayers.tqcontains(player)) { m_activePlayers.append(player); m_removedPlayers.remove(player); } @@ -98,7 +98,7 @@ PokerGame::activatePlayer(PokerPlayer *player) void PokerGame::inactivatePlayer(PokerPlayer *player) { - if (m_activePlayers.contains(player)) { + if (m_activePlayers.tqcontains(player)) { m_activePlayers.remove(player); m_removedPlayers.append(player); } @@ -159,8 +159,8 @@ CardImages *cardImages; // Class kpok -kpok::kpok(TQWidget *parent, const char *name) - : TQWidget(parent, name), +kpok::kpok(TQWidget *tqparent, const char *name) + : TQWidget(tqparent, name), m_game(&m_random) { TQString version; @@ -178,7 +178,7 @@ kpok::kpok(TQWidget *parent, const char *name) // ...and the rest to computer players. for (int unsigned i = 1; i < m_numPlayers; i++) - m_players[i].setName(TQString("Computer %1").arg(i-1)); + m_players[i].setName(TQString("Computer %1").tqarg(i-1)); lastHandText = ""; @@ -269,13 +269,13 @@ void kpok::initWindow() mWonWidget = new TQWidget(this); inputLayout->addWidget(mWonWidget, 2); mWonWidget->setMinimumHeight(50); //FIXME hardcoded value for the wave - mWonWidget->setMinimumWidth(tmp.width(i18n("You won %1").arg(KGlobal::locale()->formatMoney(100))) + 20); // workaround for width problem in wave + mWonWidget->setMinimumWidth(tmp.width(i18n("You won %1").tqarg(KGlobal::locale()->formatMoney(100))) + 20); // workaround for width problem in wave TQHBoxLayout* wonLayout = new TQHBoxLayout(mWonWidget); wonLayout->setAutoAdd(true); wonLabel = new TQLabel(mWonWidget); wonLabel->setFont(wonFont); - wonLabel->setAlignment(AlignCenter); + wonLabel->tqsetAlignment(AlignCenter); wonLabel->hide(); inputLayout->addStretch(1); @@ -554,7 +554,7 @@ void kpok::bet() // Check if player 1 is out -> for players > 2 - // TODO: maybe if (!m_activePlayers.contains(humanPlayer)) + // TODO: maybe if (!m_activePlayers.tqcontains(humanPlayer)) // {exchangeCards(); bet(); displayerWinner_computer();return;} @@ -674,7 +674,7 @@ void kpok::initPoker(unsigned int numPlayers) m_game.clearPot(); drawAllDecks(); for (unsigned int i = 0; i < m_numPlayers; i++) { - playerBox[i]->repaintCard(); + playerBox[i]->tqrepaintCard(); } paintCash(); playerBox[0]->setHeldEnabled(false); @@ -686,7 +686,7 @@ void kpok::paintCash() for (unsigned int i = 0; i < m_numPlayers; i++) { playerBox[i]->showCash(); } - potLabel->setText(i18n("Pot: %1").arg(KGlobal::locale()->formatMoney(m_game.getPot()))); + potLabel->setText(i18n("Pot: %1").tqarg(KGlobal::locale()->formatMoney(m_game.getPot()))); } @@ -805,9 +805,9 @@ void kpok::displayWinner_Computer(PokerPlayer* winner, bool othersPassed) // Generate a string with winner info and show it. TQString label; if (winner->getHuman()) - label = i18n("You won %1").arg(KGlobal::locale()->formatMoney(m_game.getPot())); + label = i18n("You won %1").tqarg(KGlobal::locale()->formatMoney(m_game.getPot())); else - label = i18n("%1 won %2").arg(winner->getName()).arg(KGlobal::locale()->formatMoney(m_game.getPot())); + label = i18n("%1 won %2").tqarg(winner->getName()).tqarg(KGlobal::locale()->formatMoney(m_game.getPot())); wonLabel->setText(label); // Start the waving motion of the text. @@ -1028,7 +1028,7 @@ void kpok::stopWave() { waveTimer->stop(); fCount = -1; /* clear image */ - repaint ( FALSE ); + tqrepaint ( FALSE ); waveActive = false; } @@ -1042,7 +1042,7 @@ void kpok::stopDrawing() void kpok::waveTimerEvent() { fCount = (fCount + 1) & 15; - repaint( FALSE ); + tqrepaint( FALSE ); } @@ -1072,7 +1072,7 @@ void kpok::displayWin(const TQString& hand, int cashWon) if (cashWon) { playSound("win.wav"); - buf = i18n("You won %1!").arg(KGlobal::locale()->formatMoney(cashWon)); + buf = i18n("You won %1!").tqarg(KGlobal::locale()->formatMoney(cashWon)); } else { playSound("lose.wav"); buf = i18n("Game Over"); // locale @@ -1093,7 +1093,7 @@ void kpok::displayWin(const TQString& hand, int cashWon) void kpok::paintEvent( TQPaintEvent *) { /* NOTE: This was shamelessy stolen from the "hello world" example - * coming with Qt Thanks to the Qt-Guys for doing such a cool + * coming with TQt Thanks to the TQt-Guys for doing such a cool * example 8-) */ @@ -1307,9 +1307,9 @@ void kpok::saveGame(KConfig* conf) conf->writeEntry("lastHandText", lastHandText); for (int i = 0; i < players; i++) { - conf->writeEntry(TQString("Name_%1").arg(i), m_players[i].getName()); - conf->writeEntry(TQString("Human_%1").arg(i), m_players[i].getHuman()); - conf->writeEntry(TQString("Cash_%1").arg(i), m_players[i].getCash()); + conf->writeEntry(TQString("Name_%1").tqarg(i), m_players[i].getName()); + conf->writeEntry(TQString("Human_%1").tqarg(i), m_players[i].getHuman()); + conf->writeEntry(TQString("Cash_%1").tqarg(i), m_players[i].getCash()); } m_game.clearDirty(); @@ -1407,14 +1407,14 @@ bool kpok::loadGame(KConfig* conf) if (numPlayers > 0) { for (int i = 0; i < numPlayers; i++) { - TQString buf = conf->readEntry(TQString("Name_%1").arg(i), + TQString buf = conf->readEntry(TQString("Name_%1").tqarg(i), "Player"); m_players[i].setName(buf); - bool human = conf->readBoolEntry(TQString("Human_%1").arg(i), + bool human = conf->readBoolEntry(TQString("Human_%1").tqarg(i), false); if (human) m_players[i].setHuman(); // i == 0 - int cash = conf->readNumEntry(TQString("Cash_%1").arg(i), + int cash = conf->readNumEntry(TQString("Cash_%1").tqarg(i), START_MONEY); m_players[i].setCash(cash); m_game.setDirty(); @@ -1469,7 +1469,7 @@ void kpok::slotCardDeck() cardImages->loadCards(cardPath); for (int i = 0; i < m_game.getNumActivePlayers(); i++) { - playerBox[i]->repaintCard(); + playerBox[i]->tqrepaintCard(); } // Save selected stuff in the configuration. diff --git a/kpoker/kpoker.h b/kpoker/kpoker.h index bb33773d..379ac26c 100644 --- a/kpoker/kpoker.h +++ b/kpoker/kpoker.h @@ -116,7 +116,7 @@ public: PokerPlayer * getActivePlayer(unsigned int nr) { return m_activePlayers.at(nr); } void activatePlayer(PokerPlayer *player); void inactivatePlayer(PokerPlayer *player); - bool isActivePlayer(PokerPlayer *player) const { return m_activePlayers.contains(player); } + bool isActivePlayer(PokerPlayer *player) const { return m_activePlayers.tqcontains(player); } // Misc // FIXME: clearDirty should only be called by a save method @@ -167,12 +167,13 @@ public: // Poker Game View -class kpok : public QWidget +class kpok : public TQWidget { Q_OBJECT + TQ_OBJECT public: - kpok(TQWidget * parent = 0, const char *name = 0); + kpok(TQWidget * tqparent = 0, const char *name = 0); virtual ~kpok(); TQString getName (int playerNr); @@ -324,7 +325,7 @@ class kpok : public QWidget int drawDelay; - // Graphical layout. + // Graphical tqlayout. TQVBoxLayout *topLayout; TQHBoxLayout *inputLayout; TQLabel *potLabel; diff --git a/kpoker/newgamedlg.cpp b/kpoker/newgamedlg.cpp index 80a9a501..7237567a 100644 --- a/kpoker/newgamedlg.cpp +++ b/kpoker/newgamedlg.cpp @@ -34,9 +34,9 @@ #include "newgamedlg.h" -NewGameDlg::NewGameDlg(TQWidget* parent) +NewGameDlg::NewGameDlg(TQWidget* tqparent) : KDialogBase(Plain, i18n("New Game"), - Ok|Cancel, Ok, parent, 0, true, true) + Ok|Cancel, Ok, tqparent, 0, true, true) { TQVBoxLayout *topLayout = new TQVBoxLayout(plainPage(), spacingHint()); TQHBoxLayout *l = new TQHBoxLayout(topLayout); @@ -75,7 +75,7 @@ NewGameDlg::NewGameDlg(TQWidget* parent) l = new TQHBoxLayout(topLayout); l->addWidget(new TQLabel(i18n("Players' starting money:"), plainPage())); - moneyOfPlayers = new TQLineEdit(TQString("%1").arg(money), plainPage()); + moneyOfPlayers = new TQLineEdit(TQString("%1").tqarg(money), plainPage()); moneyOfPlayers->setValidator( new KIntValidator( 0,999999,moneyOfPlayers ) ); l->addWidget(moneyOfPlayers); @@ -127,7 +127,7 @@ void NewGameDlg::setPlayerNames(int no, TQString playerName) player1Name->setText(kapp->config()->readEntry("Name_0", i18n("You"))); computerNames->clear(); for (int i = 1; i < MAX_PLAYERS; i++) { - computerNames->insertItem(kapp->config()->readEntry(TQString("Name_%1").arg(i), i18n("Computer %1").arg(i))); + computerNames->insertItem(kapp->config()->readEntry(TQString("Name_%1").tqarg(i), i18n("Computer %1").tqarg(i))); } } else if (no == 0) { player1Name->setText(playerName); diff --git a/kpoker/newgamedlg.h b/kpoker/newgamedlg.h index d62f9612..09b9460d 100644 --- a/kpoker/newgamedlg.h +++ b/kpoker/newgamedlg.h @@ -39,9 +39,10 @@ class TQComboBox; class NewGameDlg : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - NewGameDlg(TQWidget* parent = 0); + NewGameDlg(TQWidget* tqparent = 0); ~NewGameDlg(); /** diff --git a/kpoker/optionsdlg.cpp b/kpoker/optionsdlg.cpp index 5fdfbfcf..85c00b2c 100644 --- a/kpoker/optionsdlg.cpp +++ b/kpoker/optionsdlg.cpp @@ -28,9 +28,9 @@ #include "defines.h" -OptionsDlg::OptionsDlg(TQWidget* parent, const char* name, int _players) +OptionsDlg::OptionsDlg(TQWidget* tqparent, const char* name, int _players) : KDialogBase(Plain, i18n("Options")/*?*/, Ok|Cancel, Ok, - parent, name, true, true) + tqparent, name, true, true) { TQVBoxLayout* topLayout = new TQVBoxLayout(plainPage(), spacingHint()); maxBet = 0; diff --git a/kpoker/optionsdlg.h b/kpoker/optionsdlg.h index d559de15..8aa6b8ff 100644 --- a/kpoker/optionsdlg.h +++ b/kpoker/optionsdlg.h @@ -39,9 +39,10 @@ class KIntNumInput; class OptionsDlg : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - OptionsDlg(TQWidget* parent = 0, const char* name = 0, int _players = 1); + OptionsDlg(TQWidget* tqparent = 0, const char* name = 0, int _players = 1); ~OptionsDlg(); void init(int _drawDelay, int _maxBetOrCashPerRound, int minBet = -1); diff --git a/kpoker/playerbox.cpp b/kpoker/playerbox.cpp index 66ffd5a7..53123fbc 100644 --- a/kpoker/playerbox.cpp +++ b/kpoker/playerbox.cpp @@ -30,8 +30,8 @@ #include "kpaint.h" -PlayerBox::PlayerBox(bool playerOne, TQWidget* parent, const char* name) - : TQGroupBox(parent, name) +PlayerBox::PlayerBox(bool playerOne, TQWidget* tqparent, const char* name) + : TQGroupBox(tqparent, name) { TQHBoxLayout* l = new TQHBoxLayout(this, PLAYERBOX_BORDERS, PLAYERBOX_HDISTANCEOFWIDGETS); @@ -52,7 +52,7 @@ PlayerBox::PlayerBox(bool playerOne, TQWidget* parent, const char* name) vl->addWidget(cardBox, 0); cardBox->setFrameStyle(Box | Sunken); m_cardWidgets[i] = new CardWidget(cardBox); - cardBox->setFixedSize(cardBox->sizeHint()); + cardBox->setFixedSize(cardBox->tqsizeHint()); // Only add the "held" labels if this is the first player (the human one). if (playerOne) { @@ -60,7 +60,7 @@ PlayerBox::PlayerBox(bool playerOne, TQWidget* parent, const char* name) m_heldLabels[i] = new TQLabel(b); m_heldLabels[i]->setText(i18n("Held")); b->setFrameStyle(Box | Sunken); - b->setFixedSize(b->sizeHint()); + b->setFixedSize(b->tqsizeHint()); m_cardWidgets[i]->heldLabel = m_heldLabels[i]; TQHBoxLayout* heldLayout = new TQHBoxLayout(0); @@ -91,7 +91,7 @@ PlayerBox::PlayerBox(bool playerOne, TQWidget* parent, const char* name) } TQToolTip::add(m_cashLabel, - i18n("Money of %1").arg("Player"));//change via showName() + i18n("Money of %1").tqarg("Player"));//change via showName() // Assume that we have a multiplayer game. m_singlePlayer = false; @@ -122,7 +122,7 @@ void PlayerBox::showCash() { // Show the amount of cash the player has. m_cashLabel->setText(i18n("Cash: %1") - .arg(KGlobal::locale()->formatMoney(m_player->getCash()))); + .tqarg(KGlobal::locale()->formatMoney(m_player->getCash()))); // Show how much we have bet during this round. if (m_player->out()) @@ -130,10 +130,10 @@ void PlayerBox::showCash() else { if (m_singlePlayer) m_betLabel->setText(i18n("Cash per round: %1") - .arg(KGlobal::locale()->formatMoney(m_cashPerRound))); + .tqarg(KGlobal::locale()->formatMoney(m_cashPerRound))); else m_betLabel->setText(i18n("Bet: %1") - .arg(KGlobal::locale()-> formatMoney(m_player->getCurrentBet()))); + .tqarg(KGlobal::locale()-> formatMoney(m_player->getCurrentBet()))); } } @@ -145,7 +145,7 @@ void PlayerBox::showName() { setTitle(m_player->getName()); TQToolTip::remove(m_cashLabel); - TQToolTip::add(m_cashLabel, i18n("Money of %1").arg(m_player->getName())); + TQToolTip::add(m_cashLabel, i18n("Money of %1").tqarg(m_player->getName())); } @@ -252,10 +252,10 @@ void PlayerBox::cardClicked(int no) } -void PlayerBox::repaintCard() +void PlayerBox::tqrepaintCard() { for (int i = 0; i < PokerHandSize; i++) - m_cardWidgets[i]->repaintDeck(); + m_cardWidgets[i]->tqrepaintDeck(); } diff --git a/kpoker/playerbox.h b/kpoker/playerbox.h index 5c401993..aeb5d3c8 100644 --- a/kpoker/playerbox.h +++ b/kpoker/playerbox.h @@ -29,12 +29,13 @@ class PokerPlayer; class CardWidget; -class PlayerBox : public QGroupBox +class PlayerBox : public TQGroupBox { Q_OBJECT + TQ_OBJECT public: - PlayerBox(bool playerOne, TQWidget* parent = 0, const char* name = 0); + PlayerBox(bool playerOne, TQWidget* tqparent = 0, const char* name = 0); ~PlayerBox(); void cardClicked(int no); @@ -117,7 +118,7 @@ class PlayerBox : public QGroupBox **/ void blinkOff(); - void repaintCard(); + void tqrepaintCard(); protected: diff --git a/kpoker/poker.h b/kpoker/poker.h index ff388950..d139ea2b 100644 --- a/kpoker/poker.h +++ b/kpoker/poker.h @@ -43,7 +43,7 @@ typedef enum { C_NINE, D_NINE, S_NINE, H_NINE, C_TEN, D_TEN, S_TEN, H_TEN, C_JACK, D_JACK, S_JACK, H_JACK, - C_QUEEN, D_QUEEN, S_QUEEN, H_QUEEN, + C_TQUEEN, D_TQUEEN, S_TQUEEN, H_TQUEEN, C_KING, D_KING, S_KING, H_KING, C_ACE, D_ACE, S_ACE, H_ACE, ROOF // to get a roof on the value. @@ -73,7 +73,7 @@ typedef enum { NINE, TEN, JACK, - QUEEN, + TQUEEN, KING, ACE // The most valuable rank } CardRank; diff --git a/kpoker/top.cpp b/kpoker/top.cpp index a58d5666..a1659954 100644 --- a/kpoker/top.cpp +++ b/kpoker/top.cpp @@ -61,7 +61,7 @@ PokerWindow::PokerWindow() statusBar()->addWidget(LHLabel, 0, true); m_kpok->updateLHLabel(); - //FIXME: LHLabel is shown twize until the bar is repainted! + //FIXME: LHLabel is shown twize until the bar is tqrepainted! initKAction(); readOptions(); @@ -79,46 +79,46 @@ PokerWindow::~PokerWindow() void PokerWindow::initKAction() { //Game - KStdGameAction::gameNew(m_kpok, TQT_SLOT(newGame()), actionCollection()); - KStdGameAction::save(m_kpok, TQT_SLOT(saveGame()), actionCollection()); - KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); + KStdGameAction::gameNew(TQT_TQOBJECT(m_kpok), TQT_SLOT(newGame()), actionCollection()); + KStdGameAction::save(TQT_TQOBJECT(m_kpok), TQT_SLOT(saveGame()), actionCollection()); + KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); //Settings showMenubarAction = - KStdAction::showMenubar(this, TQT_SLOT(toggleMenubar()), actionCollection()); + KStdAction::showMenubar(TQT_TQOBJECT(this), TQT_SLOT(toggleMenubar()), actionCollection()); - soundAction = new KToggleAction(i18n("Soun&d"), 0, m_kpok, + soundAction = new KToggleAction(i18n("Soun&d"), 0, TQT_TQOBJECT(m_kpok), TQT_SLOT(toggleSound()), actionCollection(), "options_sound"); if (m_kpok->getSound()) m_kpok->toggleSound(); - blinkingAction = new KToggleAction(i18n("&Blinking Cards"), 0, m_kpok, + blinkingAction = new KToggleAction(i18n("&Blinking Cards"), 0, TQT_TQOBJECT(m_kpok), TQT_SLOT(toggleBlinking()), actionCollection(), "options_blinking"); if (m_kpok->getBlinking()) m_kpok->toggleBlinking(); adjustAction = new KToggleAction(i18n("&Adjust Bet is Default"), 0, - m_kpok, TQT_SLOT(toggleAdjust()), actionCollection(), "options_adjust"); + TQT_TQOBJECT(m_kpok), TQT_SLOT(toggleAdjust()), actionCollection(), "options_adjust"); if (m_kpok->getAdjust()) m_kpok->toggleAdjust(); showStatusbarAction = - KStdAction::showStatusbar(this, TQT_SLOT(toggleStatusbar()), actionCollection()); + KStdAction::showStatusbar(TQT_TQOBJECT(this), TQT_SLOT(toggleStatusbar()), actionCollection()); - KStdAction::saveOptions(this, TQT_SLOT(saveOptions()), actionCollection()); - KStdGameAction::carddecks(m_kpok, TQT_SLOT(slotCardDeck()), actionCollection()); - KStdAction::preferences(m_kpok, TQT_SLOT(slotPreferences()), actionCollection()); + KStdAction::saveOptions(TQT_TQOBJECT(this), TQT_SLOT(saveOptions()), actionCollection()); + KStdGameAction::carddecks(TQT_TQOBJECT(m_kpok), TQT_SLOT(slotCardDeck()), actionCollection()); + KStdAction::preferences(TQT_TQOBJECT(m_kpok), TQT_SLOT(slotPreferences()), actionCollection()); // Keyboard shortcuts. - (void)new KAction(i18n("Draw"), KShortcut(Qt::Key_Return), m_kpok, + (void)new KAction(i18n("Draw"), KShortcut(TQt::Key_Return), TQT_TQOBJECT(m_kpok), TQT_SLOT(drawClick()), actionCollection(), "draw"); - (void)new KAction(i18n("Exchange Card 1"), KShortcut(Qt::Key_1), m_kpok, + (void)new KAction(i18n("Exchange Card 1"), KShortcut(TQt::Key_1), TQT_TQOBJECT(m_kpok), TQT_SLOT(exchangeCard1()), actionCollection(), "exchange_card_1"); - (void)new KAction(i18n("Exchange Card 2"), KShortcut(Qt::Key_2), m_kpok, + (void)new KAction(i18n("Exchange Card 2"), KShortcut(TQt::Key_2), TQT_TQOBJECT(m_kpok), TQT_SLOT(exchangeCard2()), actionCollection(), "exchange_card_2"); - (void)new KAction(i18n("Exchange Card 3"), KShortcut(Qt::Key_3), m_kpok, + (void)new KAction(i18n("Exchange Card 3"), KShortcut(TQt::Key_3), TQT_TQOBJECT(m_kpok), TQT_SLOT(exchangeCard3()), actionCollection(), "exchange_card_3"); - (void)new KAction(i18n("Exchange Card 4"), KShortcut(Qt::Key_4), m_kpok, + (void)new KAction(i18n("Exchange Card 4"), KShortcut(TQt::Key_4), TQT_TQOBJECT(m_kpok), TQT_SLOT(exchangeCard4()), actionCollection(), "exchange_card_4"); - (void)new KAction(i18n("Exchange Card 5"), KShortcut(Qt::Key_5), m_kpok, + (void)new KAction(i18n("Exchange Card 5"), KShortcut(TQt::Key_5), TQT_TQOBJECT(m_kpok), TQT_SLOT(exchangeCard5()), actionCollection(), "exchange_card_5"); setupGUI( KMainWindow::Save | StatusBar | Keys | Create); @@ -177,7 +177,7 @@ bool PokerWindow::queryClose() return true; // Only ask if the game is changed in some way. - switch(KMessageBox::warningYesNoCancel(this, i18n("Do you want to save this game?"), TQString::null, KStdGuiItem::save(), KStdGuiItem::dontSave())) { + switch(KMessageBox::warningYesNoCancel(this, i18n("Do you want to save this game?"), TQString(), KStdGuiItem::save(), KStdGuiItem::dontSave())) { case KMessageBox::Yes : m_kpok->saveGame(); return true; @@ -250,7 +250,7 @@ bool PokerWindow::eventFilter(TQObject*, TQEvent* e) { if (e->type() == TQEvent::MouseButtonPress) { - if (((TQMouseEvent*)e)->button() == RightButton) { + if (((TQMouseEvent*)e)->button() == Qt::RightButton) { TQPopupMenu* popup = (TQPopupMenu*) factory()->container("popup", this); if (popup) popup->popup(TQCursor::pos()); diff --git a/kpoker/top.h b/kpoker/top.h index ec0d9681..843528cb 100644 --- a/kpoker/top.h +++ b/kpoker/top.h @@ -30,6 +30,7 @@ class kpok; class PokerWindow : public KMainWindow { Q_OBJECT + TQ_OBJECT public: PokerWindow(); diff --git a/kreversi/DESIGN b/kreversi/DESIGN index d2a13202..08c329fd 100644 --- a/kreversi/DESIGN +++ b/kreversi/DESIGN @@ -71,9 +71,9 @@ Engine QReversiGame The "document" for KReversi. - Handles a game being played and sends signals to all its views + Handles a game being played and sends Q_SIGNALS to all its views when something changes. Basically, the only difference between - this class and the more basic ReversiGame is that it sends signals + this class and the more basic ReversiGame is that it sends Q_SIGNALS to the views. Inherits: ReversiGame The actual game being played diff --git a/kreversi/Engine.cpp b/kreversi/Engine.cpp index c675b5b2..ce86b6bd 100644 --- a/kreversi/Engine.cpp +++ b/kreversi/Engine.cpp @@ -290,7 +290,7 @@ Engine::Engine() : SuperEngine(1) // keep GUI alive void Engine::yield() { - qApp->processEvents(); + tqApp->processEvents(); } diff --git a/kreversi/Move.cpp b/kreversi/Move.cpp index 3916925e..14a03577 100644 --- a/kreversi/Move.cpp +++ b/kreversi/Move.cpp @@ -66,7 +66,7 @@ TQString SimpleMove::asString() const if (m_x == -1) return TQString("pass"); else - return TQString("%1%2").arg(" ABCDEFGH"[m_x]).arg(" 12345678"[m_y]); + return TQString("%1%2").tqarg(" ABCDEFGH"[m_x]).tqarg(" 12345678"[m_y]); } @@ -114,5 +114,5 @@ bool Move::wasTurned(uint x, uint y) const { // findIndex returns the first index where the item is found, or -1 // if not found. - return (m_turnedPieces.findIndex(10 * x + y) != -1); + return (m_turnedPieces.tqfindIndex(10 * x + y) != -1); } diff --git a/kreversi/board.cpp b/kreversi/board.cpp index e0324ebd..b3f75663 100644 --- a/kreversi/board.cpp +++ b/kreversi/board.cpp @@ -36,7 +36,6 @@ ******************************************************************* */ - #include #include @@ -72,8 +71,8 @@ const uint CHIP_SIZE = 36; // class KReversiBoardView -QReversiBoardView::QReversiBoardView(TQWidget *parent, QReversiGame *krgame) - : TQWidget(parent, "board"), +TQReversiBoardView::TQReversiBoardView(TQWidget *tqparent, TQReversiGame *krgame) + : TQWidget(tqparent, "board"), chiptype(Unloaded) { m_krgame = krgame; @@ -87,7 +86,7 @@ QReversiBoardView::QReversiBoardView(TQWidget *parent, QReversiGame *krgame) } -QReversiBoardView::~QReversiBoardView() +TQReversiBoardView::~TQReversiBoardView() { } @@ -98,14 +97,14 @@ QReversiBoardView::~QReversiBoardView() // Start it all up. // -void QReversiBoardView::start() +void TQReversiBoardView::start() { updateBoard(true); adjustSize(); } -void QReversiBoardView::loadChips(ChipType type) +void TQReversiBoardView::loadChips(ChipType type) { TQString name("pics/"); name += (type==Colored ? "chips.png" : "chips_mono.png"); @@ -124,7 +123,7 @@ void QReversiBoardView::loadChips(ChipType type) // no animations are displayed. // -void QReversiBoardView::setAnimationSpeed(uint speed) +void TQReversiBoardView::setAnimationSpeed(uint speed) { if (speed <= 10) anim_speed = speed; @@ -134,10 +133,10 @@ void QReversiBoardView::setAnimationSpeed(uint speed) // Handle mouse clicks. // -void QReversiBoardView::mousePressEvent(TQMouseEvent *e) +void TQReversiBoardView::mousePressEvent(TQMouseEvent *e) { // Only handle left button. No context menu. - if ( e->button() != LeftButton ) { + if ( e->button() != Qt::LeftButton ) { e->ignore(); return; } @@ -156,7 +155,7 @@ void QReversiBoardView::mousePressEvent(TQMouseEvent *e) } -void QReversiBoardView::showHint(Move move) +void TQReversiBoardView::showHint(Move move) { // Only show a hint if there is a move to show. if (move.x() == -1) @@ -186,7 +185,7 @@ void QReversiBoardView::showHint(Move move) // keep GUI alive while waiting for (int dummy = 0; dummy < 5; dummy++) { usleep(HINT_BLINKRATE / 5); - qApp->processEvents(); + tqApp->processEvents(); } } m_hintShowing = false; @@ -202,26 +201,26 @@ void QReversiBoardView::showHint(Move move) // end, if it is running. // -void QReversiBoardView::quitHint() +void TQReversiBoardView::quitHint() { m_hintShowing = false; } -void QReversiBoardView::setShowLegalMoves(bool show) +void TQReversiBoardView::setShowLegalMoves(bool show) { m_legalMovesShowing = show; updateBoard(true); } -void QReversiBoardView::setShowMarks(bool show) +void TQReversiBoardView::setShowMarks(bool show) { m_marksShowing = show; updateBoard(true); } -void QReversiBoardView::setShowLastMove(bool show) +void TQReversiBoardView::setShowLastMove(bool show) { m_showLastMove = show; updateBoard(true); @@ -237,7 +236,7 @@ void QReversiBoardView::setShowLastMove(bool show) // NOTE: This code is quite a hack. Should make it better. // -void QReversiBoardView::animateChanged(Move move) +void TQReversiBoardView::animateChanged(Move move) { if (anim_speed == 0) return; @@ -253,13 +252,13 @@ void QReversiBoardView::animateChanged(Move move) } -bool QReversiBoardView::isField(int row, int col) const +bool TQReversiBoardView::isField(int row, int col) const { return ((0 <= row) && (row < 8) && (0 <= col) && (col < 8)); } -void QReversiBoardView::animateChangedRow(int row, int col, int dy, int dx) +void TQReversiBoardView::animateChangedRow(int row, int col, int dy, int dx) { row = row + dy; col = col + dx; @@ -276,7 +275,7 @@ void QReversiBoardView::animateChangedRow(int row, int col, int dy, int dx) } -void QReversiBoardView::rotateChip(uint row, uint col) +void TQReversiBoardView::rotateChip(uint row, uint col) { // Check which direction the chip has to be rotated. If the new // chip is white, the chip was black first, so lets begin at index @@ -302,16 +301,16 @@ void QReversiBoardView::rotateChip(uint row, uint col) // m_krgame->squareModified(col, row)). // -void QReversiBoardView::updateBoard (bool force) +void TQReversiBoardView::updateBoard (bool force) { TQPainter p(this); p.setPen(black); // If we are showing legal moves, we have to erase the old ones // before we can show the new ones. The easiest way to do that is - // to repaint everything. + // to tqrepaint everything. // - // FIXME: A better way, perhaps, is to do the repainting in + // FIXME: A better way, perhaps, is to do the tqrepainting in // drawPiece (which should be renamed drawSquare). if (m_legalMovesShowing) force = true; @@ -403,7 +402,7 @@ void QReversiBoardView::updateBoard (bool force) // Show legal moves on the board. -void QReversiBoardView::showLegalMoves() +void TQReversiBoardView::showLegalMoves() { TQPainter p(this); p.setPen(black); @@ -419,7 +418,7 @@ void QReversiBoardView::showLegalMoves() } -void QReversiBoardView::drawSmallCircle(int x, int y, TQPainter &p) +void TQReversiBoardView::drawSmallCircle(int x, int y, TQPainter &p) { int offset = m_marksShowing ? OFFSET() : 0; int ellipseSize = zoomedSize() / 3; @@ -433,7 +432,7 @@ void QReversiBoardView::drawSmallCircle(int x, int y, TQPainter &p) -TQPixmap QReversiBoardView::chipPixmap(Color color, uint size) const +TQPixmap TQReversiBoardView::chipPixmap(Color color, uint size) const { return chipPixmap(CHIP_OFFSET[color], size); } @@ -442,7 +441,7 @@ TQPixmap QReversiBoardView::chipPixmap(Color color, uint size) const // Get a pixmap for the chip 'i' at size 'size'. // -TQPixmap QReversiBoardView::chipPixmap(uint i, uint size) const +TQPixmap TQReversiBoardView::chipPixmap(uint i, uint size) const { // Get the part of the 'allchips' pixmap that contains exactly that // chip that we want to use. @@ -458,20 +457,20 @@ TQPixmap QReversiBoardView::chipPixmap(uint i, uint size) const } -uint QReversiBoardView::zoomedSize() const +uint TQReversiBoardView::zoomedSize() const { - return qRound(float(CHIP_SIZE) * Prefs::zoom() / 100); + return tqRound(float(CHIP_SIZE) * Prefs::zoom() / 100); } -void QReversiBoardView::drawPiece(uint row, uint col, Color color) +void TQReversiBoardView::drawPiece(uint row, uint col, Color color) { int i = (color == Nobody ? -1 : int(CHIP_OFFSET[color])); drawOnePiece(row, col, i); } -void QReversiBoardView::drawOnePiece(uint row, uint col, int i) +void TQReversiBoardView::drawOnePiece(uint row, uint col, int i) { int px = col * zoomedSize() + 1; int py = row * zoomedSize() + 1; @@ -499,17 +498,17 @@ void QReversiBoardView::drawOnePiece(uint row, uint col, int i) } -// We got a repaint event. We make it easy for us and redraw the +// We got a tqrepaint event. We make it easy for us and redraw the // entire board. // -void QReversiBoardView::paintEvent(TQPaintEvent *) +void TQReversiBoardView::paintEvent(TQPaintEvent *) { updateBoard(true); } -void QReversiBoardView::adjustSize() +void TQReversiBoardView::adjustSize() { int w = 8 * zoomedSize(); @@ -520,7 +519,7 @@ void QReversiBoardView::adjustSize() } -void QReversiBoardView::setPixmap(TQPixmap &pm) +void TQReversiBoardView::setPixmap(TQPixmap &pm) { if ( pm.width() == 0 ) return; @@ -531,7 +530,7 @@ void QReversiBoardView::setPixmap(TQPixmap &pm) } -void QReversiBoardView::setColor(const TQColor &c) +void TQReversiBoardView::setColor(const TQColor &c) { bgColor = c; bg = TQPixmap(); @@ -543,7 +542,7 @@ void QReversiBoardView::setColor(const TQColor &c) // Load all settings that have to do with the board view, such as // piece colors, background, animation speed, an so on. -void QReversiBoardView::loadSettings() +void TQReversiBoardView::loadSettings() { // Colors of the pieces (red/blue or black/white) if ( Prefs::grayscale() ) { diff --git a/kreversi/board.h b/kreversi/board.h index f5efc739..59c9463c 100644 --- a/kreversi/board.h +++ b/kreversi/board.h @@ -49,18 +49,19 @@ class KConfig; -class QReversiGame; +class TQReversiGame; // The class Board is the visible Reversi Board widget. // -class QReversiBoardView : public TQWidget { +class TQReversiBoardView : public TQWidget { Q_OBJECT + TQ_OBJECT public: - QReversiBoardView(TQWidget *parent, QReversiGame *game); - ~QReversiBoardView(); + TQReversiBoardView(TQWidget *tqparent, TQReversiGame *game); + ~TQReversiBoardView(); // starts all: emits some signal, so it can't be called from // constructor @@ -124,7 +125,7 @@ private: private: - QReversiGame *m_krgame; // Pointer to the game object (not owner). + TQReversiGame *m_krgame; // Pointer to the game object (not owner). // The background of the board - a color and a pixmap. TQColor bgColor; diff --git a/kreversi/highscores.cpp b/kreversi/highscores.cpp index 1da40d26..2c089975 100644 --- a/kreversi/highscores.cpp +++ b/kreversi/highscores.cpp @@ -61,7 +61,7 @@ TQString ExtManager::gameTypeLabel(uint gameType, LabelType type) const case WW: break; } - return TQString::null; + return TQString(); } @@ -79,7 +79,7 @@ void ExtManager::convertLegacy(uint gameType) for (uint i = 1; i <= 10; i++) { TQString key = "Pos" + TQString::number(i); - TQString name = cg.config()->readEntry(key + "Name", TQString::null); + TQString name = cg.config()->readEntry(key + "Name", TQString()); if ( name.isEmpty() ) name = i18n("anonymous"); @@ -88,7 +88,7 @@ void ExtManager::convertLegacy(uint gameType) if ( score==0 ) continue; - TQString sdate = cg.config()->readEntry(key + "Date", TQString::null); + TQString sdate = cg.config()->readEntry(key + "Date", TQString()); TQDateTime date = TQDateTime::fromString(sdate); Score s(Won); diff --git a/kreversi/kreversi.cpp b/kreversi/kreversi.cpp index d01c2f6e..0305dda9 100644 --- a/kreversi/kreversi.cpp +++ b/kreversi/kreversi.cpp @@ -88,7 +88,7 @@ KReversi::KReversi() KNotifyClient::startDaemon(); // The game. - m_game = new QReversiGame(); + m_game = new TQReversiGame(); m_cheating = false; m_gameOver = false; m_humanColor = Black; @@ -104,7 +104,7 @@ KReversi::KReversi() top = new TQGridLayout(w, 2, 2); // The reversi game view. - m_gameView = new QReversiGameView(w, m_game); + m_gameView = new TQReversiGameView(w, m_game); top->addMultiCellWidget(m_gameView, 0, 1, 0, 0); // Populate the GUI. @@ -116,15 +116,15 @@ KReversi::KReversi() // The only part of the view that is left in this class is the // indicator of whose turn it is in the status bar. The rest is // in the game view. - connect(m_game, TQT_SIGNAL(sig_newGame()), this, TQT_SLOT(showTurn())); + connect(m_game, TQT_SIGNAL(sig_newGame()), TQT_TQOBJECT(this), TQT_SLOT(showTurn())); connect(m_game, TQT_SIGNAL(sig_move(uint, Move&)), - this, TQT_SLOT(handleMove(uint, Move&))); // Calls showTurn(). - connect(m_game, TQT_SIGNAL(sig_update()), this, TQT_SLOT(showTurn())); - connect(m_game, TQT_SIGNAL(sig_gameOver()), this, TQT_SLOT(slotGameOver())); + TQT_TQOBJECT(this), TQT_SLOT(handleMove(uint, Move&))); // Calls showTurn(). + connect(m_game, TQT_SIGNAL(sig_update()), TQT_TQOBJECT(this), TQT_SLOT(showTurn())); + connect(m_game, TQT_SIGNAL(sig_gameOver()), TQT_TQOBJECT(this), TQT_SLOT(slotGameOver())); // Signal that is sent when the user clicks on the board. connect(m_gameView, TQT_SIGNAL(signalSquareClicked(int, int)), - this, TQT_SLOT(slotSquareClicked(int, int))); + TQT_TQOBJECT(this), TQT_SLOT(slotSquareClicked(int, int))); loadSettings(); @@ -150,38 +150,38 @@ KReversi::~KReversi() void KReversi::createKActions() { // Standard Game Actions. - KStdGameAction::gameNew(this, TQT_SLOT(slotNewGame()), actionCollection(), + KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(slotNewGame()), actionCollection(), "game_new"); - KStdGameAction::load(this, TQT_SLOT(slotOpenGame()), actionCollection()); - KStdGameAction::save(this, TQT_SLOT(slotSave()), actionCollection()); - KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); - KStdGameAction::hint(this, TQT_SLOT(slotHint()), actionCollection(), + KStdGameAction::load(TQT_TQOBJECT(this), TQT_SLOT(slotOpenGame()), actionCollection()); + KStdGameAction::save(TQT_TQOBJECT(this), TQT_SLOT(slotSave()), actionCollection()); + KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); + KStdGameAction::hint(TQT_TQOBJECT(this), TQT_SLOT(slotHint()), actionCollection(), "game_hint"); - KStdGameAction::undo(this, TQT_SLOT(slotUndo()), actionCollection(), + KStdGameAction::undo(TQT_TQOBJECT(this), TQT_SLOT(slotUndo()), actionCollection(), "game_undo"); // Non-standard Game Actions: Stop, Continue, Switch sides - stopAction = new KAction(i18n("&Stop Thinking"), "game_stop", Qt::Key_Escape, - this, TQT_SLOT(slotInterrupt()), actionCollection(), + stopAction = new KAction(i18n("&Stop Thinking"), "game_stop", TQt::Key_Escape, + TQT_TQOBJECT(this), TQT_SLOT(slotInterrupt()), actionCollection(), "game_stop"); continueAction = new KAction(i18n("&Continue Thinking"), "reload", 0, - this, TQT_SLOT(slotContinue()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(slotContinue()), actionCollection(), "game_continue"); new KAction(i18n("S&witch Sides"), 0, 0, - this, TQT_SLOT(slotSwitchSides()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(slotSwitchSides()), actionCollection(), "game_switch_sides"); // Some more standard game actions: Highscores, Settings. - KStdGameAction::highscores(this, TQT_SLOT(showHighScoreDialog()), actionCollection()); - KStdAction::preferences(this, TQT_SLOT(slotEditSettings()), actionCollection()); + KStdGameAction::highscores(TQT_TQOBJECT(this), TQT_SLOT(showHighScoreDialog()), actionCollection()); + KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(slotEditSettings()), actionCollection()); // Actions for the view(s). showLastMoveAction = new KToggleAction(i18n("Show Last Move"), "lastmoves", 0, - this, TQT_SLOT(slotShowLastMove()), + TQT_TQOBJECT(this), TQT_SLOT(slotShowLastMove()), actionCollection(), "show_last_move"); showLegalMovesAction = new KToggleAction(i18n("Show Legal Moves"), "legalmoves", 0, - this, TQT_SLOT(slotShowLegalMoves()), + TQT_TQOBJECT(this), TQT_SLOT(slotShowLegalMoves()), actionCollection(), "show_legal_moves"); } @@ -200,7 +200,7 @@ void KReversi::setStrength(uint strength) // FIXME: 7 should be MAXSTRENGTH or something similar. Q_ASSERT( 1 <= strength && strength <= 7 ); - strength = QMAX(QMIN(strength, 7), 1); + strength = TQMAX(TQMIN(strength, 7), 1); m_engine->setStrength(strength); if (m_lowestStrength < strength) m_lowestStrength = strength; @@ -329,9 +329,9 @@ void KReversi::slotUndo() } if (m_game->toMove() == computerColor()) { - // Must repaint so that the new move is not shown before the old + // Must tqrepaint so that the new move is not shown before the old // one is removed on the screen. - m_gameView->repaint(); + m_gameView->tqrepaint(); computerMakeMove(); } else @@ -392,7 +392,7 @@ void KReversi::slotSwitchSides() if (m_game->moveNumber() != 0) { int res = KMessageBox::warningContinueCancel(this, i18n("If you switch side, your score will not be added to the highscores."), - TQString::null, TQString::null, "switch_side_warning"); + TQString(), TQString(), "switch_side_warning"); if ( res==KMessageBox::Cancel ) return; @@ -609,21 +609,21 @@ void KReversi::showGameOver(Color color) if ( color == Nobody ) { KNotifyClient::event(winId(), "draw", i18n("Draw!")); TQString s = i18n("Game is drawn!\n\nYou : %1\nComputer: %2") - .arg(human).arg(computer); + .tqarg(human).tqarg(computer); KMessageBox::information(this, s, i18n("Game Ended")); score.setType(KExtHighscore::Draw); } else if ( humanColor() == color ) { KNotifyClient::event(winId(), "won", i18n("Game won!")); TQString s = i18n("Congratulations, you have won!\n\nYou : %1\nComputer: %2") - .arg(human).arg(computer); + .tqarg(human).tqarg(computer); KMessageBox::information(this, s, i18n("Game Ended")); score.setType(KExtHighscore::Won); } else { KNotifyClient::event(winId(), "lost", i18n("Game lost!")); TQString s = i18n("You have lost the game!\n\nYou : %1\nComputer: %2") - .arg(human).arg(computer); + .tqarg(human).tqarg(computer); KMessageBox::information(this, s, i18n("Game Ended")); score.setType(KExtHighscore::Lost); } @@ -755,7 +755,7 @@ void KReversi::slotEditSettings() Settings *general = new Settings(0, "General"); dialog->addPage(general, i18n("General"), "package_settings"); - connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(loadSettings())); + connect(dialog, TQT_SIGNAL(settingsChanged()), TQT_TQOBJECT(this), TQT_SLOT(loadSettings())); dialog->show(); } diff --git a/kreversi/kreversi.h b/kreversi/kreversi.h index f8ea3bb6..1be7069d 100644 --- a/kreversi/kreversi.h +++ b/kreversi/kreversi.h @@ -59,6 +59,7 @@ class KAction; class KReversi : public KZoomMainWindow { Q_OBJECT + TQ_OBJECT public: @@ -157,7 +158,7 @@ private: KToggleAction *showLegalMovesAction; // The game itself and game properties - QReversiGame *m_game; // The main document - the game + TQReversiGame *m_game; // The main document - the game Color m_humanColor; // The Color of the human player. bool m_gameOver; // True if the game is over @@ -170,7 +171,7 @@ private: Engine *m_engine; // The AI that creates the computers moves. // Widgets - QReversiGameView *m_gameView; // The board widget. + TQReversiGameView *m_gameView; // The board widget. }; diff --git a/kreversi/kzoommainwindow.cpp b/kreversi/kzoommainwindow.cpp index 56f46742..dc2820fe 100644 --- a/kreversi/kzoommainwindow.cpp +++ b/kreversi/kzoommainwindow.cpp @@ -34,11 +34,11 @@ KZoomMainWindow::KZoomMainWindow(uint min, uint max, uint step, installEventFilter(this); m_zoomInAction = - KStdAction::zoomIn(this, TQT_SLOT(zoomIn()), actionCollection()); + KStdAction::zoomIn(TQT_TQOBJECT(this), TQT_SLOT(zoomIn()), actionCollection()); m_zoomOutAction = - KStdAction::zoomOut(this, TQT_SLOT(zoomOut()), actionCollection()); + KStdAction::zoomOut(TQT_TQOBJECT(this), TQT_SLOT(zoomOut()), actionCollection()); m_menu = - KStdAction::showMenubar(this, TQT_SLOT(toggleMenubar()), actionCollection()); + KStdAction::showMenubar(TQT_TQOBJECT(this), TQT_SLOT(toggleMenubar()), actionCollection()); } @@ -65,7 +65,7 @@ void KZoomMainWindow::addWidget(TQWidget *widget) { widget->adjustSize(); - TQWidget *tlw = widget->topLevelWidget(); + TQWidget *tlw = widget->tqtopLevelWidget(); KZoomMainWindow *zm = static_cast(tlw->qt_cast("KZoomMainWindow")); @@ -84,7 +84,7 @@ void KZoomMainWindow::widgetDestroyed() bool KZoomMainWindow::eventFilter(TQObject *o, TQEvent *e) { if ( e->type()==TQEvent::LayoutHint ) - setFixedSize(minimumSize()); // because K/QMainWindow + setFixedSize(tqminimumSize()); // because K/TQMainWindow // does not manage fixed central widget // with hidden menubar... return KMainWindow::eventFilter(o, e); diff --git a/kreversi/kzoommainwindow.h b/kreversi/kzoommainwindow.h index 73acd539..a27b61a4 100644 --- a/kreversi/kzoommainwindow.h +++ b/kreversi/kzoommainwindow.h @@ -47,6 +47,7 @@ class KToggleAction; class KZoomMainWindow : public KMainWindow { Q_OBJECT + TQ_OBJECT public: /** Constructor. */ KZoomMainWindow(uint minZoom, uint maxZoom, uint zoomStep, @@ -54,7 +55,7 @@ public: /** Add a widget to be managed i.e. the adjustSize() method of the * widget is called whenever the zoom is changed. - * This function assumes that the topLevelWidget() is the KZoomMainWindow. + * This function assumes that the tqtopLevelWidget() is the KZoomMainWindow. */ static void addWidget(TQWidget *widget); diff --git a/kreversi/qreversigame.cpp b/kreversi/qreversigame.cpp index 3e940ca2..d126789a 100644 --- a/kreversi/qreversigame.cpp +++ b/kreversi/qreversigame.cpp @@ -41,21 +41,21 @@ // ================================================================ -// class QReversiGame +// class TQReversiGame -QReversiGame::QReversiGame(TQObject *parent) - : TQObject(parent), Game() +TQReversiGame::TQReversiGame(TQObject *tqparent) + : TQObject(tqparent), Game() { } -QReversiGame::~QReversiGame() +TQReversiGame::~TQReversiGame() { } -void QReversiGame::newGame() +void TQReversiGame::newGame() { Game::newGame(); @@ -63,7 +63,7 @@ void QReversiGame::newGame() } -bool QReversiGame::doMove(Move move) +bool TQReversiGame::doMove(Move move) { bool retval = Game::doMove(move); if (!retval) @@ -78,7 +78,7 @@ bool QReversiGame::doMove(Move move) } -bool QReversiGame::undoMove() +bool TQReversiGame::undoMove() { bool retval = Game::undoMove(); diff --git a/kreversi/qreversigame.h b/kreversi/qreversigame.h index b4dcb19b..875d2c07 100644 --- a/kreversi/qreversigame.h +++ b/kreversi/qreversigame.h @@ -36,8 +36,8 @@ ******************************************************************* */ -#ifndef __QREVERSIGAME__H__ -#define __QREVERSIGAME__H__ +#ifndef __TQREVERSIGAME__H__ +#define __TQREVERSIGAME__H__ #include #include @@ -52,7 +52,7 @@ class KConfig; // The main document class in the reversi program. The thing that -// makes this a QReversiGame instead of just a ReversiGame is that it +// makes this a TQReversiGame instead of just a ReversiGame is that it // emits signals that can be used to update a view. // // Signals: @@ -62,12 +62,13 @@ class KConfig; // gameOver() // -class QReversiGame : public TQObject, public Game { +class TQReversiGame : public TQObject, public Game { Q_OBJECT + TQ_OBJECT public: - QReversiGame(TQObject *parent = 0); - ~QReversiGame(); + TQReversiGame(TQObject *tqparent = 0); + ~TQReversiGame(); // Methods dealing with the game void newGame(); diff --git a/kreversi/qreversigameview.cpp b/kreversi/qreversigameview.cpp index e9104398..e6a17cbf 100644 --- a/kreversi/qreversigameview.cpp +++ b/kreversi/qreversigameview.cpp @@ -71,8 +71,8 @@ // class StatusWidget -StatusWidget::StatusWidget(const TQString &text, TQWidget *parent) - : TQWidget(parent, "status_widget") +StatusWidget::StatusWidget(const TQString &text, TQWidget *tqparent) + : TQWidget(tqparent, "status_widget") { TQHBoxLayout *hbox = new TQHBoxLayout(this, 0, KDialog::spacingHint()); TQLabel *label; @@ -119,11 +119,11 @@ void StatusWidget::setScore(uint s) // ================================================================ -// class QReversiGameView +// class TQReversiGameView -QReversiGameView::QReversiGameView(TQWidget *parent, QReversiGame *game) - : TQWidget(parent, "gameview") +TQReversiGameView::TQReversiGameView(TQWidget *tqparent, TQReversiGame *game) + : TQWidget(tqparent, "gameview") { // Store a pointer to the game. m_game = game; @@ -147,39 +147,39 @@ QReversiGameView::QReversiGameView(TQWidget *parent, QReversiGame *game) } -QReversiGameView::~QReversiGameView() +TQReversiGameView::~TQReversiGameView() { } // Create the entire view. Only called once from the constructor. -void QReversiGameView::createView() +void TQReversiGameView::createView() { - TQGridLayout *layout = new TQGridLayout(this, 4, 2); + TQGridLayout *tqlayout = new TQGridLayout(this, 4, 2); // The board - m_boardView = new QReversiBoardView(this, m_game); + m_boardView = new TQReversiBoardView(this, m_game); m_boardView->loadSettings(); // Load the pixmaps used in the status widgets. - layout->addMultiCellWidget(m_boardView, 0, 3, 0, 0); + tqlayout->addMultiCellWidget(m_boardView, 0, 3, 0, 0); // The status widgets - m_blackStatus = new StatusWidget(TQString::null, this); - m_blackStatus->setPixmap(m_boardView->chipPixmap(Black, 20)); - layout->addWidget(m_blackStatus, 0, 1); - m_whiteStatus = new StatusWidget(TQString::null, this); - m_whiteStatus->setPixmap(m_boardView->chipPixmap(White, 20)); - layout->addWidget(m_whiteStatus, 1, 1); + m_blacktqStatus = new StatusWidget(TQString(), this); + m_blacktqStatus->setPixmap(m_boardView->chipPixmap(Black, 20)); + tqlayout->addWidget(m_blacktqStatus, 0, 1); + m_whitetqStatus = new StatusWidget(TQString(), this); + m_whitetqStatus->setPixmap(m_boardView->chipPixmap(White, 20)); + tqlayout->addWidget(m_whitetqStatus, 1, 1); // The "Moves" label TQLabel *movesLabel = new TQLabel( i18n("Moves"), this); - movesLabel->setAlignment(AlignCenter); - layout->addWidget(movesLabel, 2, 1); + movesLabel->tqsetAlignment(AlignCenter); + tqlayout->addWidget(movesLabel, 2, 1); // The list of moves. m_movesView = new TQListBox(this, "moves"); m_movesView->setMinimumWidth(150); - layout->addWidget(m_movesView, 3, 1); + tqlayout->addWidget(m_movesView, 3, 1); } @@ -189,17 +189,17 @@ void QReversiGameView::createView() // Recieves the sig_newGame signal from the game. -void QReversiGameView::newGame() +void TQReversiGameView::newGame() { m_boardView->updateBoard(true); m_movesView->clear(); - updateStatus(); + updatetqStatus(); } // Recieves the sig_move signal from the game. -void QReversiGameView::moveMade(uint moveNum, Move &move) +void TQReversiGameView::moveMade(uint moveNum, Move &move) { //FIXME: Error checks. TQString colorsWB[] = { @@ -213,10 +213,10 @@ void QReversiGameView::moveMade(uint moveNum, Move &move) // Insert the new move in the listbox and mark it as the current one. m_movesView->insertItem(TQString("%1. %2 %3") - .arg(moveNum) - .arg(Prefs::grayscale() ? colorsWB[move.color()] + .tqarg(moveNum) + .tqarg(Prefs::grayscale() ? colorsWB[move.color()] : colorsRB[move.color()]) - .arg(move.asString())); + .tqarg(move.asString())); m_movesView->setCurrentItem(moveNum - 1); m_movesView->ensureCurrentVisible(); @@ -225,33 +225,33 @@ void QReversiGameView::moveMade(uint moveNum, Move &move) m_boardView->updateBoard(); // Update the score. - updateStatus(); + updatetqStatus(); } // Recieves the sig_update signal from the game, and can be called // whenever a total update of the view is required. -void QReversiGameView::updateView() +void TQReversiGameView::updateView() { m_boardView->updateBoard(true); updateMovelist(); - updateStatus(); + updatetqStatus(); } // Only updates the status widgets (score). -void QReversiGameView::updateStatus() +void TQReversiGameView::updatetqStatus() { - m_blackStatus->setScore(m_game->score(Black)); - m_whiteStatus->setScore(m_game->score(White)); + m_blacktqStatus->setScore(m_game->score(Black)); + m_whitetqStatus->setScore(m_game->score(White)); } // Only updates the status board. -void QReversiGameView::updateBoard(bool force) +void TQReversiGameView::updateBoard(bool force) { m_boardView->updateBoard(force); } @@ -260,7 +260,7 @@ void QReversiGameView::updateBoard(bool force) // Only updates the movelist. This method regenerates the list from // scratch. -void QReversiGameView::updateMovelist() +void TQReversiGameView::updateMovelist() { // FIXME: NYI } @@ -270,7 +270,7 @@ void QReversiGameView::updateMovelist() // access to the internal board view. // -void QReversiGameView::squareClicked(int row, int col) +void TQReversiGameView::squareClicked(int row, int col) { emit signalSquareClicked(row, col); } @@ -280,17 +280,17 @@ void QReversiGameView::squareClicked(int row, int col) // Other public methods. -void QReversiGameView::setHumanColor(Color color) +void TQReversiGameView::setHumanColor(Color color) { m_humanColor = color; if (color == Black) { - m_blackStatus->setText(i18n("You")); - m_whiteStatus->setText(""); + m_blacktqStatus->setText(i18n("You")); + m_whitetqStatus->setText(""); } else { - m_blackStatus->setText(""); - m_whiteStatus->setText(i18n("You")); + m_blacktqStatus->setText(""); + m_whitetqStatus->setText(i18n("You")); } } diff --git a/kreversi/qreversigameview.h b/kreversi/qreversigameview.h index 97cc1738..628c4637 100644 --- a/kreversi/qreversigameview.h +++ b/kreversi/qreversigameview.h @@ -36,8 +36,8 @@ ******************************************************************* */ -#ifndef __QREVERSIGAMEVIEW__H__ -#define __QREVERSIGAMEVIEW__H__ +#ifndef __TQREVERSIGAMEVIEW__H__ +#define __TQREVERSIGAMEVIEW__H__ #include @@ -52,15 +52,16 @@ class KConfig; class TQLabel; -class QReversiGame; +class TQReversiGame; -class StatusWidget : public QWidget +class StatusWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - StatusWidget(const TQString &text, TQWidget *parent); + StatusWidget(const TQString &text, TQWidget *tqparent); void setText(const TQString &string); void setPixmap(const TQPixmap &pixmap); @@ -75,13 +76,14 @@ private: // The main game view -class QReversiGameView : public TQWidget { +class TQReversiGameView : public TQWidget { Q_OBJECT + TQ_OBJECT public: - QReversiGameView(TQWidget *parent, QReversiGame *game); - ~QReversiGameView(); + TQReversiGameView(TQWidget *tqparent, TQReversiGame *game); + ~TQReversiGameView(); // Proxy methods for the board view void showHint(Move move) { m_boardView->showHint(move); } @@ -102,7 +104,7 @@ public: void insertMove(TQString moveString) { m_movesView->insertItem(moveString); } void removeMove(int moveNum) { m_movesView->removeItem(moveNum); - updateStatus(); + updatetqStatus(); } void setCurrentMove(int moveNum) { m_movesView->setCurrentItem(moveNum); @@ -127,7 +129,7 @@ public slots: void moveMade(uint moveNum, Move &move); void updateView(); // Update the entire view. - void updateStatus(); // Update the status widgets (score) + void updatetqStatus(); // Update the status widgets (score) void updateBoard(bool force = FALSE); // Update the board. void updateMovelist(); // Update the move list. @@ -144,15 +146,15 @@ private: private: // Pointer to the game we are displaying - QReversiGame *m_game; // Pointer to the game object (not owner). + TQReversiGame *m_game; // Pointer to the game object (not owner). Color m_humanColor; // Widgets in the view. - QReversiBoardView *m_boardView; + TQReversiBoardView *m_boardView; TQListBox *m_movesView; - StatusWidget *m_blackStatus; - StatusWidget *m_whiteStatus; + StatusWidget *m_blacktqStatus; + StatusWidget *m_whitetqStatus; }; diff --git a/kreversi/settings.ui b/kreversi/settings.ui index b7c59ff5..f9dc2031 100644 --- a/kreversi/settings.ui +++ b/kreversi/settings.ui @@ -1,10 +1,10 @@ Settings - + Settings - + 0 0 @@ -25,7 +25,7 @@ 0 - + frame3 @@ -52,14 +52,14 @@ Expanding - + 20 20 - + kcfg_Grayscale @@ -67,7 +67,7 @@ &Grayscale chips - + kcfg_CompetitiveGameChoice @@ -78,7 +78,7 @@ unnamed - + CasualGameChoice @@ -92,7 +92,7 @@ true - + CompetitiveGameChoice @@ -105,7 +105,7 @@ - + skillGroup @@ -116,7 +116,7 @@ unnamed - + kcfg_skill @@ -136,42 +136,42 @@ NoMarks - + Beginner Beginner - + AlignVCenter|AlignLeft - + Expert Expert - + AlignVCenter|AlignRight - + Average Average - + AlignCenter - + groupBox2 @@ -182,29 +182,29 @@ unnamed - + textLabel1 Slow - + AlignVCenter|AlignLeft - + textLabel3 Fast - + AlignVCenter|AlignRight - + kcfg_AnimationSpeed @@ -229,7 +229,7 @@ - + kcfg_Animation @@ -240,7 +240,7 @@ true - + kcfg_BackgroundImageChoice @@ -251,7 +251,7 @@ unnamed - + BackgroundColorChoice @@ -264,7 +264,7 @@ kcfg_BackgroundImage - + BackgroundImageChoice @@ -319,7 +319,7 @@ setEnabled(bool) - + kurlrequester.h klineedit.h diff --git a/ksame/KSameWidget.cpp b/ksame/KSameWidget.cpp index a0e0142e..28329b06 100644 --- a/ksame/KSameWidget.cpp +++ b/ksame/KSameWidget.cpp @@ -46,20 +46,20 @@ static int default_colors=3; #define Board KScoreDialog::Custom1 -KSameWidget::KSameWidget(TQWidget *parent, const char* name, WFlags fl) : - KMainWindow(parent,name,fl) +KSameWidget::KSameWidget(TQWidget *tqparent, const char* name, WFlags fl) : + KMainWindow(tqparent,name,fl) { - KStdGameAction::gameNew(this, TQT_SLOT(m_new()), actionCollection(), "game_new"); - restart = new KAction(i18n("&Restart This Board"), CTRL+Key_R, this, + KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(m_new()), actionCollection(), "game_new"); + restart = new KAction(i18n("&Restart This Board"), CTRL+Key_R, TQT_TQOBJECT(this), TQT_SLOT(m_restart()), actionCollection(), "game_restart"); - KStdGameAction::highscores(this, TQT_SLOT(m_showhs()), actionCollection(), "game_highscores"); - KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection(), "game_quit"); - undo = KStdGameAction::undo(this, TQT_SLOT(m_undo()), actionCollection(), "edit_undo"); + KStdGameAction::highscores(TQT_TQOBJECT(this), TQT_SLOT(m_showhs()), actionCollection(), "game_highscores"); + KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection(), "game_quit"); + undo = KStdGameAction::undo(TQT_TQOBJECT(this), TQT_SLOT(m_undo()), actionCollection(), "edit_undo"); random = new KToggleAction(i18n("&Random Board"), 0, 0, 0, actionCollection(), "random_board"); - showNumberRemaining = new KToggleAction(i18n("&Show Number Remaining"), 0, this, TQT_SLOT(showNumberRemainingToggled()), actionCollection(), "showNumberRemaining"); + showNumberRemaining = new KToggleAction(i18n("&Show Number Remaining"), 0, TQT_TQOBJECT(this), TQT_SLOT(showNumberRemainingToggled()), actionCollection(), "showNumberRemaining"); - KStdAction::configureNotifications(this, TQT_SLOT(configureNotifications()), + KStdAction::configureNotifications(TQT_TQOBJECT(this), TQT_SLOT(configureNotifications()), actionCollection()); status=statusBar(); @@ -70,14 +70,14 @@ KSameWidget::KSameWidget(TQWidget *parent, const char* name, WFlags fl) : stone = new StoneWidget(this,15,10); - connect( stone, TQT_SIGNAL(s_gameover()), this, TQT_SLOT(gameover())); - connect( stone, TQT_SIGNAL(s_colors(int)), this, TQT_SLOT(setColors(int))); - connect( stone, TQT_SIGNAL(s_board(int)), this, TQT_SLOT(setBoard(int))); - connect( stone, TQT_SIGNAL(s_marked(int)), this, TQT_SLOT(setMarked(int))); - connect( stone, TQT_SIGNAL(s_score(int)), this, TQT_SLOT(setScore(int))); - connect( stone, TQT_SIGNAL(s_remove(int,int)), this, TQT_SLOT(stonesRemoved(int,int))); + connect( stone, TQT_SIGNAL(s_gameover()), TQT_TQOBJECT(this), TQT_SLOT(gameover())); + connect( stone, TQT_SIGNAL(s_colors(int)), TQT_TQOBJECT(this), TQT_SLOT(setColors(int))); + connect( stone, TQT_SIGNAL(s_board(int)), TQT_TQOBJECT(this), TQT_SLOT(setBoard(int))); + connect( stone, TQT_SIGNAL(s_marked(int)), TQT_TQOBJECT(this), TQT_SLOT(setMarked(int))); + connect( stone, TQT_SIGNAL(s_score(int)), TQT_TQOBJECT(this), TQT_SLOT(setScore(int))); + connect( stone, TQT_SIGNAL(s_remove(int,int)), TQT_TQOBJECT(this), TQT_SLOT(stonesRemoved(int,int))); - connect(stone, TQT_SIGNAL(s_sizechanged()), this, TQT_SLOT(sizeChanged())); + connect(stone, TQT_SIGNAL(s_sizechanged()), TQT_TQOBJECT(this), TQT_SLOT(sizeChanged())); sizeChanged(); setCentralWidget(stone); @@ -113,7 +113,7 @@ void KSameWidget::saveProperties(KConfig *conf) { } void KSameWidget::sizeChanged() { - stone->setFixedSize(stone->sizeHint()); + stone->setFixedSize(stone->tqsizeHint()); } void KSameWidget::showNumberRemainingToggled() @@ -121,11 +121,11 @@ void KSameWidget::showNumberRemainingToggled() if(showNumberRemaining->isChecked()){ TQStringList list; for(int i=1;i<=stone->colors();i++) - list.append(TQString("%1").arg(stone->count(i))); - TQString count = TQString(" (%1)").arg(list.join(",")); - status->changeItem(i18n("%1 Colors%2").arg(stone->colors()).arg(count),1); + list.append(TQString("%1").tqarg(stone->count(i))); + TQString count = TQString(" (%1)").tqarg(list.join(",")); + status->changeItem(i18n("%1 Colors%2").tqarg(stone->colors()).tqarg(count),1); } - else status->changeItem(i18n("%1 Colors").arg(stone->colors()),1); + else status->changeItem(i18n("%1 Colors").tqarg(stone->colors()),1); KConfig *cfg = kapp->config(); cfg->writeEntry("showRemaining", showNumberRemaining->isChecked()); @@ -162,7 +162,7 @@ void KSameWidget::m_new() { bno.setRange(0, 1000000, 1); bno.setLabel(i18n("Select a board:")); bno.setFocus(); - bno.setFixedSize(bno.sizeHint()); + bno.setFixedSize(bno.tqsizeHint()); bno.setValue(stone->board()); if (dlg.exec()) newGame(bno.value(),default_colors); @@ -188,15 +188,15 @@ void KSameWidget::m_showhs() { } void KSameWidget::setColors(int colors) { - status->changeItem(i18n("%1 Colors").arg(colors),1); + status->changeItem(i18n("%1 Colors").tqarg(colors),1); } void KSameWidget::setBoard(int board) { - status->changeItem(i18n("Board: %1").arg(board, 6), 2); + status->changeItem(i18n("Board: %1").tqarg(board, 6), 2); } void KSameWidget::setMarked(int m) { - status->changeItem(i18n("Marked: %1").arg(m, 6),3); + status->changeItem(i18n("Marked: %1").tqarg(m, 6),3); m_markedStones=m; } @@ -209,11 +209,11 @@ void KSameWidget::setScore(int score) { if(showNumberRemaining->isChecked()){ TQStringList list; for(int i=1;i<=stone->colors();i++) - list.append(TQString("%1").arg(stone->count(i))); - TQString count = TQString(" (%1)").arg(list.join(",")); - status->changeItem(i18n("%1 Colors%2").arg(stone->colors()).arg(count),1); + list.append(TQString("%1").tqarg(stone->count(i))); + TQString count = TQString(" (%1)").tqarg(list.join(",")); + status->changeItem(i18n("%1 Colors%2").tqarg(stone->colors()).tqarg(count),1); } - status->changeItem(i18n("Score: %1").arg(score, 6),4); + status->changeItem(i18n("Score: %1").tqarg(score, 6),4); undo->setEnabled(stone->undoPossible()); restart->setEnabled(!stone->isOriginalBoard()); } @@ -222,11 +222,11 @@ void KSameWidget::gameover() { if (stone->hasBonus()) { KNotifyClient::event(winId(), "game won", i18n("You even removed the last stone, great job! " - "This gave you a score of %1 in total.").arg(stone->score())); + "This gave you a score of %1 in total.").tqarg(stone->score())); } else { KNotifyClient::event(winId(), "game over", i18n("There are no more removeable stones. " - "You got a score of %1 in total.").arg(stone->score())); + "You got a score of %1 in total.").tqarg(stone->score())); } stone->unmark(); KScoreDialog d(KScoreDialog::Name | KScoreDialog::Score, this); diff --git a/ksame/KSameWidget.h b/ksame/KSameWidget.h index 46154094..0d7f833b 100644 --- a/ksame/KSameWidget.h +++ b/ksame/KSameWidget.h @@ -29,9 +29,10 @@ class StoneWidget; class KSameWidget: public KMainWindow { Q_OBJECT + TQ_OBJECT public: - KSameWidget(TQWidget *parent=0, const char* name=0, WFlags fl=0); + KSameWidget(TQWidget *tqparent=0, const char* name=0, WFlags fl=0); private slots: /* File Menu */ diff --git a/ksame/StoneWidget.cpp b/ksame/StoneWidget.cpp index 81fafca9..3109c33e 100644 --- a/ksame/StoneWidget.cpp +++ b/ksame/StoneWidget.cpp @@ -46,8 +46,8 @@ struct StoneSlice { }; -StoneWidget::StoneWidget( TQWidget *parent, int x, int y ) - : TQWidget(parent,"StoneWidget"), stonefield(x,y) +StoneWidget::StoneWidget( TQWidget *tqparent, int x, int y ) + : TQWidget(tqparent,"StoneWidget"), stonefield(x,y) { setBackgroundPixmap(TQPixmap(locate("wallpaper", "Time-For-Lunch-2.jpg"))); TQPixmap stonemap(locate("appdata", "stones.png")); @@ -65,20 +65,20 @@ StoneWidget::StoneWidget( TQWidget *parent, int x, int y ) stone_height=stonemap.height()/maxcolors; map = new StoneSlice*[maxcolors]; - TQBitmap mask; + TQBitmap tqmask; for (int c = 0; c < maxcolors; c++) { map[c] = new StoneSlice[maxslices]; for (int s = 0; s < maxslices; s++) { map[c][s].stone.resize(stone_width, stone_height); assert(!map[c][s].stone.isNull()); - bitBlt(&map[c][s].stone, 0, 0, - &stonemap, stone_width * s, + bitBlt(TQT_TQPAINTDEVICE(&map[c][s].stone), 0, 0, + TQT_TQPAINTDEVICE(&stonemap), stone_width * s, c*stone_height, stone_width,stone_height,CopyROP,false); TQImage im = map[c][s].stone.convertToImage(); - mask = im.createHeuristicMask(); - map[c][s].stone.setMask(mask); + tqmask.convertFromImage(im.createHeuristicMask()); + map[c][s].stone.setMask(tqmask); } } @@ -102,7 +102,7 @@ StoneWidget::~StoneWidget() { delete [] map; setMouseTracking(false); - killTimers(); + TQT_TQOBJECT(this)->killTimers(); } unsigned int @@ -125,7 +125,7 @@ StoneWidget::marked() { return stonefield.getMarked(); } -QSize +TQSize StoneWidget::size() { return TQSize(sizex,sizey); } @@ -135,8 +135,8 @@ StoneWidget::colors() { return stonefield.getColors(); } -QSize -StoneWidget::sizeHint () const { +TQSize +StoneWidget::tqsizeHint () const { return TQSize(field_width,field_height); } @@ -276,8 +276,8 @@ StoneWidget::paintEvent( TQPaintEvent *e ) { if (stone->color) { int tslice = stone->marked?slice:0; - bitBlt(this,cx,cy, - &map[stone->color-1][tslice].stone, + bitBlt(TQT_TQPAINTDEVICE(this),cx,cy, + TQT_TQPAINTDEVICE(&map[stone->color-1][tslice].stone), 0, 0, stone_width,stone_height,CopyROP,FALSE); diff --git a/ksame/StoneWidget.h b/ksame/StoneWidget.h index b6840055..01e64ebe 100644 --- a/ksame/StoneWidget.h +++ b/ksame/StoneWidget.h @@ -29,6 +29,7 @@ struct StoneSlice; class StoneWidget : public TQWidget { Q_OBJECT + TQ_OBJECT int modified; // int marked; // # of marked stones @@ -46,7 +47,7 @@ class StoneWidget : public TQWidget { StoneSlice **map; public: - StoneWidget( TQWidget *parent=0, int x=10,int y=10); + StoneWidget( TQWidget *tqparent=0, int x=10,int y=10); ~StoneWidget(); unsigned int board(); @@ -54,7 +55,7 @@ public: int marked(); TQSize size(); int colors(); - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; bool undoPossible() const; diff --git a/kshisen/app.cpp b/kshisen/app.cpp index ab6e3b85..8717d767 100644 --- a/kshisen/app.cpp +++ b/kshisen/app.cpp @@ -62,10 +62,10 @@ #include "prefs.h" #include "settings.h" -App::App(TQWidget *parent, const char *name) : KMainWindow(parent, name), +App::App(TQWidget *tqparent, const char *name) : KMainWindow(tqparent, name), cheat(false) { - highscoreTable = new KHighscore(this); + highscoreTable = new KHighscore(TQT_TQOBJECT(this)); // TODO? // Would it make sense long term to have a kconfig update rather then @@ -89,13 +89,13 @@ App::App(TQWidget *parent, const char *name) : KMainWindow(parent, name), setupGUI(); - connect(board, TQT_SIGNAL(changed()), this, TQT_SLOT(enableItems())); + connect(board, TQT_SIGNAL(changed()), TQT_TQOBJECT(this), TQT_SLOT(enableItems())); TQTimer *t = new TQTimer(this); t->start(1000); - connect(t, TQT_SIGNAL(timeout()), this, TQT_SLOT(updateScore())); - connect(board, TQT_SIGNAL(endOfGame()), this, TQT_SLOT(slotEndOfGame())); - connect(board, TQT_SIGNAL(resized()), this, TQT_SLOT(boardResized())); + connect(t, TQT_SIGNAL(timeout()), TQT_TQOBJECT(this), TQT_SLOT(updateScore())); + connect(board, TQT_SIGNAL(endOfGame()), TQT_TQOBJECT(this), TQT_SLOT(slotEndOfGame())); + connect(board, TQT_SIGNAL(resized()), TQT_TQOBJECT(this), TQT_SLOT(boardResized())); kapp->processEvents(); @@ -106,16 +106,16 @@ App::App(TQWidget *parent, const char *name) : KMainWindow(parent, name), void App::initKAction() { // Game - KStdGameAction::gameNew(this, TQT_SLOT(newGame()), actionCollection()); - KStdGameAction::restart(this, TQT_SLOT(restartGame()), actionCollection()); - KStdGameAction::pause(this, TQT_SLOT(pause()), actionCollection()); - KStdGameAction::highscores(this, TQT_SLOT(hallOfFame()), actionCollection()); - KStdGameAction::quit(this, TQT_SLOT(quitGame()), actionCollection()); + KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(newGame()), actionCollection()); + KStdGameAction::restart(TQT_TQOBJECT(this), TQT_SLOT(restartGame()), actionCollection()); + KStdGameAction::pause(TQT_TQOBJECT(this), TQT_SLOT(pause()), actionCollection()); + KStdGameAction::highscores(TQT_TQOBJECT(this), TQT_SLOT(hallOfFame()), actionCollection()); + KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(quitGame()), actionCollection()); // Move - KStdGameAction::undo(this, TQT_SLOT(undo()), actionCollection()); - KStdGameAction::redo(this, TQT_SLOT(redo()), actionCollection()); - KStdGameAction::hint(this, TQT_SLOT(hint()), actionCollection()); + KStdGameAction::undo(TQT_TQOBJECT(this), TQT_SLOT(undo()), actionCollection()); + KStdGameAction::redo(TQT_TQOBJECT(this), TQT_SLOT(redo()), actionCollection()); + KStdGameAction::hint(TQT_TQOBJECT(this), TQT_SLOT(hint()), actionCollection()); //new KAction(i18n("Is Game Solvable?"), 0, this, // TQT_SLOT(isSolvable()), actionCollection(), "move_solvable"); @@ -124,7 +124,7 @@ void App::initKAction() #endif // Settings - KStdAction::preferences(this, TQT_SLOT(showSettings()), actionCollection()); + KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(showSettings()), actionCollection()); } void App::hallOfFame() @@ -299,9 +299,9 @@ void App::slotEndOfGame() else { TQString s = i18n("Congratulations! You made it in %1:%2:%3") - .arg(TQString().sprintf("%02d", board->getTimeForGame()/3600)) - .arg(TQString().sprintf("%02d", (board->getTimeForGame() / 60) % 60)) - .arg(TQString().sprintf("%02d", board->getTimeForGame() % 60)); + .tqarg(TQString().sprintf("%02d", board->getTimeForGame()/3600)) + .tqarg(TQString().sprintf("%02d", (board->getTimeForGame() / 60) % 60)) + .tqarg(TQString().sprintf("%02d", board->getTimeForGame() % 60)); KMessageBox::information(this, s, i18n("End of Game")); } @@ -315,18 +315,18 @@ void App::updateScore() { int t = board->getTimeForGame(); TQString s = i18n(" Your time: %1:%2:%3 %4") - .arg(TQString().sprintf("%02d", t / 3600 )) - .arg(TQString().sprintf("%02d", (t / 60) % 60 )) - .arg(TQString().sprintf("%02d", t % 60 )) - .arg(board->isPaused()?i18n("(Paused) "):TQString::null); + .tqarg(TQString().sprintf("%02d", t / 3600 )) + .tqarg(TQString().sprintf("%02d", (t / 60) % 60 )) + .tqarg(TQString().sprintf("%02d", t % 60 )) + .tqarg(board->isPaused()?i18n("(Paused) "):TQString()); statusBar()->changeItem(s, SBI_TIME); // Number of tiles int tl = (board->x_tiles() * board->y_tiles()); s = i18n(" Removed: %1/%2 ") - .arg(TQString().sprintf("%d", tl - board->tilesLeft())) - .arg(TQString().sprintf("%d", tl )); + .tqarg(TQString().sprintf("%d", tl - board->tilesLeft())) + .tqarg(TQString().sprintf("%d", tl )); statusBar()->changeItem(s, SBI_TILES); } @@ -356,26 +356,26 @@ TQString App::getPlayerName() TQDialog *dlg = new TQDialog(this, "Hall of Fame", true); TQLabel *l1 = new TQLabel(i18n("You've made it into the \"Hall Of Fame\". Type in\nyour name so mankind will always remember\nyour cool rating."), dlg); - l1->setFixedSize(l1->sizeHint()); + l1->setFixedSize(l1->tqsizeHint()); TQLabel *l2 = new TQLabel(i18n("Your name:"), dlg); - l2->setFixedSize(l2->sizeHint()); + l2->setFixedSize(l2->tqsizeHint()); TQLineEdit *e = new TQLineEdit(dlg); e->setText("XXXXXXXXXXXXXXXX"); - e->setMinimumWidth(e->sizeHint().width()); - e->setFixedHeight(e->sizeHint().height()); + e->setMinimumWidth(e->tqsizeHint().width()); + e->setFixedHeight(e->tqsizeHint().height()); e->setText( lastPlayerName ); e->setFocus(); TQPushButton *b = new KPushButton(KStdGuiItem::ok(), dlg); b->setDefault(true); - b->setFixedSize(b->sizeHint()); + b->setFixedSize(b->tqsizeHint()); connect(b, TQT_SIGNAL(released()), dlg, TQT_SLOT(accept())); connect(e, TQT_SIGNAL(returnPressed()), dlg, TQT_SLOT(accept())); - // create layout + // create tqlayout TQVBoxLayout *tl = new TQVBoxLayout(dlg, 10); TQHBoxLayout *tl1 = new TQHBoxLayout(); tl->addWidget(l1); @@ -603,12 +603,12 @@ void App::showHighscore(int focusitem) f.setPointSize(24); f.setBold(true); l->setFont(f); - l->setFixedSize(l->sizeHint()); + l->setFixedSize(l->tqsizeHint()); l->setFixedWidth(l->width() + 32); - l->setAlignment(AlignCenter); + l->tqsetAlignment(AlignCenter); tl->addWidget(l); - // insert highscores in a gridlayout + // insert highscores in a gridtqlayout TQGridLayout *table = new TQGridLayout(12, 5, 5); tl->addLayout(table, 1); @@ -621,23 +621,23 @@ void App::showHighscore(int focusitem) f.setBold(true); l = new TQLabel(i18n("Rank"), dlg); l->setFont(f); - l->setMinimumSize(l->sizeHint()); + l->setMinimumSize(l->tqsizeHint()); table->addWidget(l, 0, 0); l = new TQLabel(i18n("Name"), dlg); l->setFont(f); - l->setMinimumSize(l->sizeHint()); + l->setMinimumSize(l->tqsizeHint()); table->addWidget(l, 0, 1); l = new TQLabel(i18n("Time"), dlg); l->setFont(f); - l->setMinimumSize(l->sizeHint()); + l->setMinimumSize(l->tqsizeHint()); table->addWidget(l, 0, 2); l = new TQLabel(i18n("Size"), dlg); l->setFont(f); - l->setMinimumSize(l->sizeHint()); + l->setMinimumSize(l->tqsizeHint()); table->addWidget(l, 0, 3); l = new TQLabel(i18n("Score"), dlg); l->setFont(f); - l->setMinimumSize(l->sizeHint().width()*3, l->sizeHint().height()); + l->setMinimumSize(l->tqsizeHint().width()*3, l->tqsizeHint().height()); table->addWidget(l, 0, 4); TQString s; @@ -685,8 +685,8 @@ void App::showHighscore(int focusitem) if(i < highscore.size()) { s = TQString("%1 %2") - .arg(getScore(hs)) - .arg(hs.gravity ? i18n("(gravity)") : TQString("")); + .tqarg(getScore(hs)) + .tqarg(hs.gravity ? i18n("(gravity)") : TQString("")); } else { @@ -694,7 +694,7 @@ void App::showHighscore(int focusitem) } e[i][4] = new TQLabel(s, dlg); - e[i][4]->setAlignment(AlignRight); + e[i][4]->tqsetAlignment(AlignRight); } f = font(); @@ -704,12 +704,12 @@ void App::showHighscore(int focusitem) { for(j = 0; j < 5; j++) { - e[i][j]->setMinimumHeight(e[i][j]->sizeHint().height()); + e[i][j]->setMinimumHeight(e[i][j]->tqsizeHint().height()); if(j == 1) - e[i][j]->setMinimumWidth(std::max(e[i][j]->sizeHint().width(), 100)); + e[i][j]->setMinimumWidth(std::max(e[i][j]->tqsizeHint().width(), 100)); else - e[i][j]->setMinimumWidth(std::max(e[i][j]->sizeHint().width(), 60)); + e[i][j]->setMinimumWidth(std::max(e[i][j]->tqsizeHint().width(), 60)); if((int)i == focusitem) e[i][j]->setFont(f); @@ -720,14 +720,14 @@ void App::showHighscore(int focusitem) TQPushButton *b = new KPushButton(KStdGuiItem::close(), dlg); - b->setFixedSize(b->sizeHint()); + b->setFixedSize(b->tqsizeHint()); // connect the "Close"-button to done connect(b, TQT_SIGNAL(clicked()), dlg, TQT_SLOT(accept())); b->setDefault(true); b->setFocus(); - // make layout + // make tqlayout tl->addSpacing(10); tl->addWidget(b); tl->activate(); @@ -752,7 +752,7 @@ void App::showSettings(){ KConfigDialog *dialog = new KConfigDialog(this, "settings", Prefs::self(), KDialogBase::Swallow); Settings *general = new Settings(0, "General"); dialog->addPage(general, i18n("General"), "package_settings"); - connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(loadSettings())); + connect(dialog, TQT_SIGNAL(settingsChanged()), TQT_TQOBJECT(this), TQT_SLOT(loadSettings())); connect(dialog, TQT_SIGNAL(settingsChanged()), board, TQT_SLOT(loadSettings())); dialog->show(); } diff --git a/kshisen/app.h b/kshisen/app.h index 7e670138..917f9d1a 100644 --- a/kshisen/app.h +++ b/kshisen/app.h @@ -62,9 +62,10 @@ const unsigned HIGHSCORE_MAX = 10; class App : public KMainWindow { Q_OBJECT + TQ_OBJECT public: - App(TQWidget *parent = 0, const char *name=0); + App(TQWidget *tqparent = 0, const char *name=0); private slots: void loadSettings(); diff --git a/kshisen/board.cpp b/kshisen/board.cpp index ee0d70a7..d568b825 100644 --- a/kshisen/board.cpp +++ b/kshisen/board.cpp @@ -57,8 +57,8 @@ static int size_x[5] = {14, 18, 24, 26, 30}; static int size_y[5] = { 6, 8, 12, 14, 16}; static int DELAY[5] = {1000, 750, 500, 250, 125}; -Board::Board(TQWidget *parent, const char *name) : - TQWidget(parent, name, WResizeNoErase), field(0), +Board::Board(TQWidget *tqparent, const char *name) : + TQWidget(tqparent, name, WResizeNoErase), field(0), _x_tiles(0), _y_tiles(0), _delay(125), paused(false), gravity_flag(true), _solvable_flag(true), @@ -179,7 +179,7 @@ void Board::mousePressEvent(TQMouseEvent *e) } // Mark tile - if(e->button() == LeftButton) + if(e->button() == Qt::LeftButton) { clearHighlight(); @@ -188,7 +188,7 @@ void Board::mousePressEvent(TQMouseEvent *e) } // Assist by highlighting all tiles of same type - if(e->button() == RightButton) + if(e->button() == Qt::RightButton) { int clicked_tile = getField(pos_x, pos_y); @@ -261,8 +261,8 @@ void Board::setSize(int x, int y) // set the minimum size of the scalable window const double MINIMUM_SCALE = 0.2; - int w = qRound(tiles.unscaledTileWidth() * MINIMUM_SCALE) * x_tiles(); - int h = qRound(tiles.unscaledTileHeight() * MINIMUM_SCALE) * y_tiles(); + int w = tqRound(tiles.unscaledTileWidth() * MINIMUM_SCALE) * x_tiles(); + int h = tqRound(tiles.unscaledTileHeight() * MINIMUM_SCALE) * y_tiles(); w += tiles.unscaledTileWidth(); h += tiles.unscaledTileWidth(); @@ -444,7 +444,7 @@ void Board::updateField(int x, int y, bool erase) tiles.tileWidth(), tiles.tileHeight()); - repaint(r, erase); + tqrepaint(r, erase); } void Board::paintEvent(TQPaintEvent *e) @@ -459,7 +459,7 @@ void Board::paintEvent(TQPaintEvent *e) if(paused) { p.setFont(KGlobalSettings::largeFont()); - p.drawText(rect(), Qt::AlignCenter, i18n("Game Paused")); + p.drawText(rect(), TQt::AlignCenter, i18n("Game Paused")); } else { @@ -900,7 +900,7 @@ void Board::dumpBoard() const if(tile == EMPTY) row += " --"; else - row += TQString("%1").arg(getField(x, y), 3); + row += TQString("%1").tqarg(getField(x, y), 3); } kdDebug() << row << endl; } @@ -1071,7 +1071,7 @@ bool Board::pause() return paused; } -TQSize Board::sizeHint() const +TQSize Board::tqsizeHint() const { int dpi = TQPaintDeviceMetrics(this).logicalDpiX(); if (dpi < 75) diff --git a/kshisen/board.h b/kshisen/board.h index 2413d8d4..d6b3940a 100644 --- a/kshisen/board.h +++ b/kshisen/board.h @@ -67,12 +67,13 @@ public: int tile; }; -class Board : public QWidget +class Board : public TQWidget { Q_OBJECT + TQ_OBJECT public: - Board(TQWidget *parent = 0, const char *name=0); + Board(TQWidget *tqparent = 0, const char *name=0); ~Board(); virtual void paintEvent(TQPaintEvent *); @@ -134,7 +135,7 @@ private slots: void gravity(int, bool); protected: - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; private: // functions void initBoard(); diff --git a/kshisen/settings.ui b/kshisen/settings.ui index 7f9846a6..77e7a316 100644 --- a/kshisen/settings.ui +++ b/kshisen/settings.ui @@ -1,10 +1,10 @@ Settings - + Settings - + 0 0 @@ -16,7 +16,7 @@ unnamed - + kcfg_Gravity @@ -24,7 +24,7 @@ Gravity - + kcfg_Solvable @@ -32,7 +32,7 @@ Allow unsolvable games - + difficulty_groupBox @@ -43,7 +43,7 @@ unnamed - + kcfg_Level @@ -63,7 +63,7 @@ Below - + textLabel1 @@ -71,20 +71,20 @@ Easy - + textLabel3 Hard - + AlignVCenter|AlignRight - + speed_groupBox @@ -95,7 +95,7 @@ unnamed - + kcfg_Speed @@ -115,7 +115,7 @@ Below - + textLabel4 @@ -123,20 +123,20 @@ Slow - + textLabel6 Fast - + AlignVCenter|AlignRight - + kcfg_Unscaled @@ -144,7 +144,7 @@ Prefer unscaled tiles - + size_groupBox @@ -155,7 +155,7 @@ unnamed - + textLabel8 @@ -163,40 +163,40 @@ 14x6 - + textLabel9 18x8 - + AlignCenter - + textLabel11 26x14 - + AlignCenter - + textLabel12 30x16 - + AlignVCenter|AlignRight - + kcfg_Size @@ -219,14 +219,14 @@ Below - + textLabel10 24x12 - + AlignCenter @@ -242,7 +242,7 @@ Expanding - + 20 20 @@ -251,5 +251,5 @@ - + diff --git a/kshisen/tileset.cpp b/kshisen/tileset.cpp index 492cde79..e9b50c43 100644 --- a/kshisen/tileset.cpp +++ b/kshisen/tileset.cpp @@ -67,9 +67,9 @@ void TileSet::resizeTiles(int maxWidth, int maxHeight) // and maintain the tile's height-to-width ratio double ratio = static_cast(unscaledTileHeight()) / unscaledTileWidth(); if(maxWidth * ratio < maxHeight) - maxHeight = qRound(maxWidth * ratio); + maxHeight = tqRound(maxWidth * ratio); else - maxWidth = qRound(maxHeight / ratio); + maxWidth = tqRound(maxHeight / ratio); if(maxHeight == tileHeight() && maxWidth == tileWidth()) return; @@ -118,7 +118,7 @@ TQPixmap TileSet::highlightedTile(int n) const int TileSet::lineWidth() const { - int width = qRound(tileHeight() / 10.0); + int width = tqRound(tileHeight() / 10.0); if(width < 3) width = 3; diff --git a/ksirtet/ksirtet/ai.h b/ksirtet/ksirtet/ai.h index 465925ef..21266824 100644 --- a/ksirtet/ksirtet/ai.h +++ b/ksirtet/ksirtet/ai.h @@ -7,6 +7,7 @@ class KSAI : public AI { Q_OBJECT + TQ_OBJECT public: KSAI(); diff --git a/ksirtet/ksirtet/board.cpp b/ksirtet/ksirtet/board.cpp index f50aa1a4..00126e68 100644 --- a/ksirtet/ksirtet/board.cpp +++ b/ksirtet/ksirtet/board.cpp @@ -8,8 +8,8 @@ using namespace KGrid2D; -KSBoard::KSBoard(bool graphic, TQWidget *parent) - : Board(graphic, new GiftPool(parent), parent), +KSBoard::KSBoard(bool graphic, TQWidget *tqparent) + : Board(graphic, new GiftPool(tqparent), tqparent), filled(matrix().height()), linesRemoved(4) { init(); diff --git a/ksirtet/ksirtet/board.h b/ksirtet/ksirtet/board.h index 45ec0f26..a1ac1612 100644 --- a/ksirtet/ksirtet/board.h +++ b/ksirtet/ksirtet/board.h @@ -7,8 +7,9 @@ class KSBoard : public Board { Q_OBJECT + TQ_OBJECT public: - KSBoard(bool graphic, TQWidget *parent); + KSBoard(bool graphic, TQWidget *tqparent); void copy(const GenericTetris &); void start(const GTInitData &); diff --git a/ksirtet/ksirtet/field.cpp b/ksirtet/ksirtet/field.cpp index 46f5c4de..1f7cbbc4 100644 --- a/ksirtet/ksirtet/field.cpp +++ b/ksirtet/ksirtet/field.cpp @@ -11,8 +11,8 @@ #include "piece.h" //----------------------------------------------------------------------------- -KSField::KSField(TQWidget *parent) - : Field(parent) +KSField::KSField(TQWidget *tqparent) + : Field(tqparent) { const Board *b = static_cast(board); TQWhatsThis::add(b->giftPool(), i18n("Indicate the number of garbage lines you received from your opponent.")); @@ -43,7 +43,7 @@ void KSField::settingsChanged() removedList->clear(); TQWhatsThis::remove(removedList); KGameLCD *lcd = new KGameLCD(5, removedList); - TQString s = (Prefs::showDetailedRemoved() ? i18n("Total:") : TQString::null); + TQString s = (Prefs::showDetailedRemoved() ? i18n("Total:") : TQString()); removedList->append(s, lcd); lcd->displayInt( board->nbRemoved() ); lcd->show(); diff --git a/ksirtet/ksirtet/field.h b/ksirtet/ksirtet/field.h index 26378b28..adbe31cd 100644 --- a/ksirtet/ksirtet/field.h +++ b/ksirtet/ksirtet/field.h @@ -8,8 +8,9 @@ class KSField : public Field { Q_OBJECT + TQ_OBJECT public: - KSField(TQWidget *parent); + KSField(TQWidget *tqparent); private slots: virtual void removedUpdated(); diff --git a/ksirtet/ksirtet/main.cpp b/ksirtet/ksirtet/main.cpp index 4c66c22f..09d02461 100644 --- a/ksirtet/ksirtet/main.cpp +++ b/ksirtet/ksirtet/main.cpp @@ -64,9 +64,9 @@ KSFactory::KSFactory() : CommonFactory(MAIN_DATA, BASE_BOARD_INFO, COMMON_BOARD_INFO) {} -BaseInterface *KSFactory::createInterface(TQWidget *parent) +BaseInterface *KSFactory::createInterface(TQWidget *tqparent) { - return new Interface(MP_GAME_INFO, parent); + return new Interface(MP_GAME_INFO, tqparent); } //----------------------------------------------------------------------------- diff --git a/ksirtet/ksirtet/main.h b/ksirtet/ksirtet/main.h index 05af263d..c01bcfae 100644 --- a/ksirtet/ksirtet/main.h +++ b/ksirtet/ksirtet/main.h @@ -16,11 +16,11 @@ class KSFactory : public CommonFactory KSFactory(); protected: - virtual BaseBoard *createBoard(bool graphic, TQWidget *parent) - { return new KSBoard(graphic, parent); } - virtual BaseField *createField(TQWidget *parent) - { return new KSField(parent); } - virtual BaseInterface *createInterface(TQWidget *parent); + virtual BaseBoard *createBoard(bool graphic, TQWidget *tqparent) + { return new KSBoard(graphic, tqparent); } + virtual BaseField *createField(TQWidget *tqparent) + { return new KSField(tqparent); } + virtual BaseInterface *createInterface(TQWidget *tqparent); virtual AI *createAI() { return new KSAI; } virtual TQWidget *createGameConfig() { return new KSGameConfig; } }; @@ -29,6 +29,7 @@ class KSFactory : public CommonFactory class KSMainWindow : public MainWindow { Q_OBJECT + TQ_OBJECT public: KSMainWindow() { init(); } }; diff --git a/ksirtet/ksirtet/settings.h b/ksirtet/ksirtet/settings.h index 7e945db6..bd8dcad1 100644 --- a/ksirtet/ksirtet/settings.h +++ b/ksirtet/ksirtet/settings.h @@ -7,6 +7,7 @@ class KSGameConfig : public GameConfig { Q_OBJECT + TQ_OBJECT public: KSGameConfig(); }; diff --git a/ksmiletris/gamewidget.cpp b/ksmiletris/gamewidget.cpp index f10f9b36..3ba3051a 100644 --- a/ksmiletris/gamewidget.cpp +++ b/ksmiletris/gamewidget.cpp @@ -43,8 +43,8 @@ this software. #include #include -GameWidget::GameWidget(TQWidget *parent, const char *name) - : TQWidget(parent, name) +GameWidget::GameWidget(TQWidget *tqparent, const char *name) + : TQWidget(tqparent, name) { in_game = false; in_pause = false; @@ -131,12 +131,12 @@ void GameWidget::setPieces(PiecesType type) sprites[Sprite_Broken1 + i] = pm; } - if (in_game) repaintChilds(); + if (in_game) tqrepaintChilds(); } void GameWidget::loadSprites() { - sprites = new QPixmap[num_sprites]; + sprites = new TQPixmap[num_sprites]; loadSprite(Sprite_Bg1, "bg1.bmp"); loadSprite(Sprite_Bg2, "bg2.bmp"); loadSprite(Sprite_Bg3, "bg3.bmp"); @@ -153,7 +153,7 @@ void GameWidget::loadSprites() loadSprite(Sprite_Bg14, "bg14.bmp"); loadSprite(Sprite_Bg15, "bg15.bmp"); loadSprite(Sprite_Bg16, "bg16.bmp"); - loadMaskedSprite(Sprite_Broken, "broken.bmp", "broken-mask.bmp"); + loadMaskedSprite(Sprite_Broken, "broken.bmp", "broken-tqmask.bmp"); } void GameWidget::loadSprite(Sprite spr, const TQString & path) @@ -198,17 +198,17 @@ void GameWidget::newGame() updateMirror(); in_game = true; - repaintChilds(); + tqrepaintChilds(); emit changedStats(num_level, num_points); timer_interval = 700; timer->start(timer_interval); } -void GameWidget::repaintChilds() +void GameWidget::tqrepaintChilds() { - screen->repaint(false); - mirror->repaint(false); - next->repaint(false); + screen->tqrepaint(false); + mirror->tqrepaint(false); + next->tqrepaint(false); } void GameWidget::putPiece() @@ -218,7 +218,7 @@ void GameWidget::putPiece() if (piece[2] != bg_sprite) ref(xpos + 0, ypos + 1) = piece[2]; if (piece[3] != bg_sprite) ref(xpos + 1, ypos + 1) = piece[3]; updateMirror(); - screen->repaint(false); + screen->tqrepaint(false); } void GameWidget::getPiece() @@ -241,7 +241,7 @@ void GameWidget::newPiece() next_piece[i] = (Sprite)(Sprite_Block1 + random.getLong(num_pieces_level)); else next_piece[i] = bg_sprite; - next->repaint(false); + next->tqrepaint(false); } void GameWidget::nextPiece() @@ -258,7 +258,7 @@ void GameWidget::nextPiece() || (piece[2] != bg_sprite && ref(xpos + 0, ypos + 1) != bg_sprite) || (piece[3] != bg_sprite && ref(xpos + 1, ypos + 1) != bg_sprite)) { in_game = false; - repaintChilds(); + tqrepaintChilds(); KMessageBox::sorry(this, i18n("Game Over")); emit gameOver(); } @@ -272,7 +272,7 @@ void GameWidget::updateMirror() mirror_sprites[x] = bg_sprite; mirror_sprites[xpos] = piece[2] == bg_sprite ? piece[0] : piece[2]; mirror_sprites[xpos+1] = piece[3] == bg_sprite ? piece[1] : piece[3]; - mirror->repaint(false); + mirror->tqrepaint(false); } void GameWidget::keyUp() @@ -390,7 +390,7 @@ void GameWidget::broke(int x, int y, bool *xmap) emit changedStats(num_level, num_points); #ifdef HAVE_USLEEP - screen->repaint(false); + screen->tqrepaint(false); usleep(75 * 1000); #endif } diff --git a/ksmiletris/gamewidget.h b/ksmiletris/gamewidget.h index f1a84b6c..3eeaac96 100644 --- a/ksmiletris/gamewidget.h +++ b/ksmiletris/gamewidget.h @@ -36,6 +36,7 @@ class TQTimer; class GameWidget : public TQWidget { Q_OBJECT + TQ_OBJECT signals: void changedStats(int, int); @@ -47,7 +48,7 @@ public: int num_level; int num_points; - GameWidget(TQWidget *parent=0, const char *name=0); + GameWidget(TQWidget *tqparent=0, const char *name=0); ~GameWidget(); void setPieces(PiecesType type); @@ -62,7 +63,7 @@ public: return s; } - void repaintChilds(); + void tqrepaintChilds(); private: TQPixmap *sprites; diff --git a/ksmiletris/gamewindow.cpp b/ksmiletris/gamewindow.cpp index 991ff1c3..c28a81d2 100644 --- a/ksmiletris/gamewindow.cpp +++ b/ksmiletris/gamewindow.cpp @@ -46,40 +46,40 @@ GameWindow::GameWindow(TQWidget *, const char *name) : KMainWindow(0, name) { //New Games - (void)KStdGameAction::gameNew(this, + (void)KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(menu_newGame()), actionCollection()); //Pause Game - (void)KStdGameAction::pause(this, + (void)KStdGameAction::pause(TQT_TQOBJECT(this), TQT_SLOT(menu_pause()), actionCollection()); //End Game - (void)KStdGameAction::end(this, + (void)KStdGameAction::end(TQT_TQOBJECT(this), TQT_SLOT(menu_endGame()), actionCollection()); //Highscores - (void)KStdGameAction::highscores(this, + (void)KStdGameAction::highscores(TQT_TQOBJECT(this), TQT_SLOT(menu_highScores()), actionCollection()); //Quit - (void)KStdGameAction::quit(this, + (void)KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); TQStringList list; KSelectAction* piecesAct = - new KSelectAction(i18n("&Pieces"), 0, this, TQT_SLOT(menu_pieces()), + new KSelectAction(i18n("&Pieces"), 0, TQT_TQOBJECT(this), TQT_SLOT(menu_pieces()), actionCollection(), "settings_pieces"); list.append(i18n("&Smiles")); list.append(i18n("S&ymbols")); list.append(i18n("&Icons")); piecesAct->setItems(list); - (void)new KToggleAction(i18n("&Sounds"), 0, this, + (void)new KToggleAction(i18n("&Sounds"), 0, TQT_TQOBJECT(this), TQT_SLOT(menu_sounds()), actionCollection(), "settings_sounds"); @@ -99,14 +99,14 @@ GameWindow::GameWindow(TQWidget *, const char *name) setCentralWidget(game); connect(game, TQT_SIGNAL(changedStats(int, int)), this, TQT_SLOT(updateStats(int, int))); - connect(game, TQT_SIGNAL(gameOver()), this, TQT_SLOT(gameOver())); + connect(game, TQT_SIGNAL(gameOver()), TQT_TQOBJECT(this), TQT_SLOT(gameOver())); //keys - (void)new KAction(i18n("Move Left"), Key_Left, game, TQT_SLOT(keyLeft()), actionCollection(), "left"); - (void)new KAction(i18n("Move Right"), Key_Right, game, TQT_SLOT(keyRight()), actionCollection(), "right"); - (void)new KAction(i18n("Rotate Left"), Key_Up, game, TQT_SLOT(keyUp()), actionCollection(), "up"); - (void)new KAction(i18n("Rotate Right"), Key_Down, game, TQT_SLOT(keyDown()), actionCollection(), "down"); - (void)new KAction(i18n("Drop Down"), Key_Space, game, TQT_SLOT(keySpace()), actionCollection(), "space"); + (void)new KAction(i18n("Move Left"), Key_Left, TQT_TQOBJECT(game), TQT_SLOT(keyLeft()), actionCollection(), "left"); + (void)new KAction(i18n("Move Right"), Key_Right, TQT_TQOBJECT(game), TQT_SLOT(keyRight()), actionCollection(), "right"); + (void)new KAction(i18n("Rotate Left"), Key_Up, TQT_TQOBJECT(game), TQT_SLOT(keyUp()), actionCollection(), "up"); + (void)new KAction(i18n("Rotate Right"), Key_Down, TQT_TQOBJECT(game), TQT_SLOT(keyDown()), actionCollection(), "down"); + (void)new KAction(i18n("Drop Down"), Key_Space, TQT_TQOBJECT(game), TQT_SLOT(keySpace()), actionCollection(), "space"); game->setFixedSize(default_width, default_height); adjustSize(); @@ -137,7 +137,7 @@ void GameWindow::menu_pause() if (game->in_game) { game->in_pause = !game->in_pause; ((KToggleAction*)actionCollection()->action(KStdGameAction::stdName(KStdGameAction::Pause)))->setChecked(game->in_pause); - game->repaintChilds(); + game->tqrepaintChilds(); } } @@ -145,7 +145,7 @@ void GameWindow::menu_endGame() { if (game->in_game) { game->in_game = false; - game->repaintChilds(); + game->tqrepaintChilds(); ((KToggleAction*)actionCollection()->action(KStdGameAction::stdName(KStdGameAction::Pause)))->setChecked(false); gameOver(); } @@ -182,8 +182,8 @@ void GameWindow::updateStats(int level, int points) TQString l, p; l.setNum(level); p.setNum(points); - status->changeItem(i18n("Level: %1").arg(l), 1); - status->changeItem(i18n("Score: %1").arg(p), 2); + status->changeItem(i18n("Level: %1").tqarg(l), 1); + status->changeItem(i18n("Score: %1").tqarg(p), 2); } void GameWindow::gameOver() diff --git a/ksmiletris/gamewindow.h b/ksmiletris/gamewindow.h index f8fff3f8..bdfaabf7 100644 --- a/ksmiletris/gamewindow.h +++ b/ksmiletris/gamewindow.h @@ -35,9 +35,10 @@ class KStatusBar; class GameWindow : public KMainWindow { Q_OBJECT + TQ_OBJECT public: - GameWindow(TQWidget *parent=0, const char *name=0); + GameWindow(TQWidget *tqparent=0, const char *name=0); public slots: void menu_newGame(); diff --git a/ksmiletris/mirrorwidget.cpp b/ksmiletris/mirrorwidget.cpp index 8a7447eb..7a31a166 100644 --- a/ksmiletris/mirrorwidget.cpp +++ b/ksmiletris/mirrorwidget.cpp @@ -31,8 +31,8 @@ this software. #include "mirrorwidget.h" MirrorWidget::MirrorWidget(TQPixmap *s, bool *game, bool *pause, - TQWidget *parent, const char *name) - : TQFrame(parent, name) + TQWidget *tqparent, const char *name) + : TQFrame(tqparent, name) { in_game = game; in_pause = pause; diff --git a/ksmiletris/mirrorwidget.h b/ksmiletris/mirrorwidget.h index 80676a8a..9d3f0a5d 100644 --- a/ksmiletris/mirrorwidget.h +++ b/ksmiletris/mirrorwidget.h @@ -31,7 +31,7 @@ this software. class MirrorWidget : public TQFrame { public: MirrorWidget(TQPixmap *s, bool *game, bool *pause, - TQWidget *parent=0, const char *name=0); + TQWidget *tqparent=0, const char *name=0); void setBackgroundSprite(Sprite s) { bg_sprite = s; } void setMirrorSprites(Sprite *s) { mirror_sprites = s; } diff --git a/ksmiletris/npiecewidget.cpp b/ksmiletris/npiecewidget.cpp index 9e87a9a0..4218df92 100644 --- a/ksmiletris/npiecewidget.cpp +++ b/ksmiletris/npiecewidget.cpp @@ -31,8 +31,8 @@ this software. #include "npiecewidget.h" NextPieceWidget::NextPieceWidget(TQPixmap *s, bool *game, bool *pause, - TQWidget *parent, const char *name) - : TQFrame(parent, name) + TQWidget *tqparent, const char *name) + : TQFrame(tqparent, name) { in_game = game; in_pause = pause; diff --git a/ksmiletris/npiecewidget.h b/ksmiletris/npiecewidget.h index f2d7ac1f..961366f6 100644 --- a/ksmiletris/npiecewidget.h +++ b/ksmiletris/npiecewidget.h @@ -31,7 +31,7 @@ this software. class NextPieceWidget : public TQFrame { public: NextPieceWidget(TQPixmap *s, bool *game, bool *pause, - TQWidget *parent=0, const char *name=0); + TQWidget *tqparent=0, const char *name=0); void setBackgroundSprite(Sprite s) { bg_sprite = s; } void setNextPieceSprites(Sprite *s) { next_piece_sprites = s; } diff --git a/ksmiletris/screenwidget.cpp b/ksmiletris/screenwidget.cpp index d8e87f4c..a8f53c73 100644 --- a/ksmiletris/screenwidget.cpp +++ b/ksmiletris/screenwidget.cpp @@ -33,8 +33,8 @@ this software. #include "screenwidget.h" ScreenWidget::ScreenWidget(TQPixmap *s, bool *game, bool *pause, - TQWidget *parent, const char *name) - : TQFrame(parent, name) + TQWidget *tqparent, const char *name) + : TQFrame(tqparent, name) { in_game = game; in_pause = pause; diff --git a/ksmiletris/screenwidget.h b/ksmiletris/screenwidget.h index a27b3b31..f15a1e23 100644 --- a/ksmiletris/screenwidget.h +++ b/ksmiletris/screenwidget.h @@ -31,7 +31,7 @@ this software. class ScreenWidget : public TQFrame { public: ScreenWidget(TQPixmap *s, bool *game, bool *pause, - TQWidget *parent=0, const char *name=0); + TQWidget *tqparent=0, const char *name=0); void setBackgroundSprite(Sprite s) { bg_sprite = s; } void setScreenSprites(Sprite *s) { screen_sprites = s; } diff --git a/ksnake/appearance.ui b/ksnake/appearance.ui index 0f328f04..cfa4578f 100644 --- a/ksnake/appearance.ui +++ b/ksnake/appearance.ui @@ -1,10 +1,10 @@ Appearance - + Appearance - + 0 0 @@ -16,7 +16,7 @@ unnamed - + buttonGroup1 @@ -27,7 +27,7 @@ unnamed - + kcfg_bgimage @@ -40,7 +40,7 @@ - + kcfg_bgcolor_enabled @@ -51,7 +51,7 @@ true - + kcfg_bgimage_enabled @@ -71,7 +71,7 @@ Expanding - + 21 40 @@ -80,7 +80,7 @@ - + kcolorbutton.h diff --git a/ksnake/ball.cpp b/ksnake/ball.cpp index 2881beb9..dc86d7a0 100644 --- a/ksnake/ball.cpp +++ b/ksnake/ball.cpp @@ -73,7 +73,7 @@ void Ball::nextMove() } } -void Ball::repaint() +void Ball::tqrepaint() { static int i = 0; static bool rotate = true; diff --git a/ksnake/ball.h b/ksnake/ball.h index e7796354..609eef95 100644 --- a/ksnake/ball.h +++ b/ksnake/ball.h @@ -33,7 +33,7 @@ public: Ball(Board *b, PixServer *p); virtual ~Ball(){} virtual void nextMove(); - void repaint(); + void tqrepaint(); void zero(); protected: Board *board; diff --git a/ksnake/basket.cpp b/ksnake/basket.cpp index 138336cd..8d124a45 100644 --- a/ksnake/basket.cpp +++ b/ksnake/basket.cpp @@ -81,7 +81,7 @@ void Basket::newApples() } } -void Basket::repaint(bool dirty ) +void Basket::tqrepaint(bool dirty ) { Kaffee *g; for ( g = list->first(); g != 0; g = list->next()) { diff --git a/ksnake/basket.h b/ksnake/basket.h index 56bc8020..18386acc 100644 --- a/ksnake/basket.h +++ b/ksnake/basket.h @@ -32,9 +32,10 @@ class PixServer; enum Fruits { Red, Golden }; -class Kaffee : public QObject +class Kaffee : public TQObject { Q_OBJECT + TQ_OBJECT public: Kaffee(int pos, int r1, int r2); int position() { return p;} @@ -48,13 +49,14 @@ private: Fruits t; }; -class Basket : public QObject +class Basket : public TQObject { Q_OBJECT + TQ_OBJECT public: Basket(Board *b, PixServer *p); ~Basket(); - void repaint(bool); + void tqrepaint(bool); void newApples(); void clear(); Fruits eaten( int i); diff --git a/ksnake/board.cpp b/ksnake/board.cpp index 0959dee1..e9e44cd0 100644 --- a/ksnake/board.cpp +++ b/ksnake/board.cpp @@ -48,7 +48,7 @@ int Pos::price() const { void Pos::setParent(Pos *p) { _parent = p; } -Pos *Pos::parent() const { +Pos *Pos::tqparent() const { return(_parent); } Pos *Pos::listNext() { @@ -241,7 +241,7 @@ int Board::getNextCloseTo(int s, int d, bool diag, int lastIndex) if(list->index() == d) { // Find first movement after root. for(; ; list = p) { - p = list->parent(); + p = list->tqparent(); if(p == root) { // This is our move. int nextSq = list->index(); @@ -265,7 +265,7 @@ int Board::getNextCloseTo(int s, int d, bool diag, int lastIndex) continue; } - int pi = list->parent() ? list->parent()->index() : lastIndex; + int pi = list->tqparent() ? list->tqparent()->index() : lastIndex; if(pi != -1 && direction(pi, list->index()) != direction(list->index(), i)) { pri += 10; @@ -277,7 +277,7 @@ int Board::getNextCloseTo(int s, int d, bool diag, int lastIndex) // Check price of found position with current one. if(p->price() > pri) { // We found a cheapear way to reach the same - // place, so let's change the parent and price of p. + // place, so let's change the tqparent and price of p. p->setPrice(list->price() + 1); p->setParent(list); list->addList(p); diff --git a/ksnake/board.h b/ksnake/board.h index 0eece38d..c7514d75 100644 --- a/ksnake/board.h +++ b/ksnake/board.h @@ -47,7 +47,7 @@ public: void setPrice(int p); int price() const; void setParent(Pos *p); - Pos *parent() const; + Pos *tqparent() const; Pos *listNext(); void addBTree(Pos *np); Pos *searchBTree(int i); diff --git a/ksnake/game.cpp b/ksnake/game.cpp index 4817b3af..9a9e978f 100644 --- a/ksnake/game.cpp +++ b/ksnake/game.cpp @@ -54,7 +54,7 @@ #define SCORE 1 #define LIVES 2 -Game::Game(TQWidget *parent, const char *name) : KMainWindow(parent,name) +Game::Game(TQWidget *tqparent, const char *name) : KMainWindow(tqparent,name) { // create statusbar statusBar()->insertItem(i18n("Score: 0"), SCORE); @@ -88,17 +88,17 @@ Game::~Game() } void Game::scoreChanged(int score){ - statusBar()->changeItem(i18n("Score: %1").arg(score), SCORE); + statusBar()->changeItem(i18n("Score: %1").tqarg(score), SCORE); } void Game::setTrys(int tries){ - statusBar()->changeItem(i18n("Lives: %1").arg(tries), LIVES); + statusBar()->changeItem(i18n("Lives: %1").tqarg(tries), LIVES); } void Game::gameEnd(int score){ KScoreDialog di(KScoreDialog::Name | KScoreDialog::Score | KScoreDialog::Date, this); KScoreDialog::FieldInfo scoreInfo; - TQString date = TQDateTime::currentDateTime().toString(); + TQString date = TQDateTime::tqcurrentDateTime().toString(); scoreInfo.insert(KScoreDialog::Date, date); if (di.addScore(score, scoreInfo, true)) di.exec(); @@ -120,12 +120,12 @@ void Game::createMenu() actionCollection()->setAutoConnectShortcuts(true); rattler->setActionCollection(actionCollection()); - KStdGameAction::gameNew(rattler, TQT_SLOT(restart()), actionCollection()); - pause = KStdGameAction::pause(rattler, TQT_SLOT(pause()), actionCollection()); - KStdGameAction::highscores(this, TQT_SLOT(showHighScores()), actionCollection()); - KStdGameAction::quit( this, TQT_SLOT(close()), actionCollection()); + KStdGameAction::gameNew(TQT_TQOBJECT(rattler), TQT_SLOT(restart()), actionCollection()); + pause = KStdGameAction::pause(TQT_TQOBJECT(rattler), TQT_SLOT(pause()), actionCollection()); + KStdGameAction::highscores(TQT_TQOBJECT(this), TQT_SLOT(showHighScores()), actionCollection()); + KStdGameAction::quit( TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); - KStdAction::preferences(this, TQT_SLOT(showSettings()), actionCollection()); + KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(showSettings()), actionCollection()); // TODO change and make custom function that pauses game or // modify widget to pause when loosing focus and remove this @@ -163,7 +163,7 @@ void Game::showSettings(){ // since the filename may contain underscore, they // are replaced with spaces in the menu entry TQString s = TQFileInfo( *it ).baseName(); - s = s.replace(TQRegExp("_"), " "); + s = s.tqreplace(TQRegExp("_"), " "); list.append(s); } } diff --git a/ksnake/game.h b/ksnake/game.h index 0c9eb66b..509856e7 100644 --- a/ksnake/game.h +++ b/ksnake/game.h @@ -36,9 +36,10 @@ class View; class Game : public KMainWindow { Q_OBJECT + TQ_OBJECT public: - Game(TQWidget *parent=0, const char *name=0); + Game(TQWidget *tqparent=0, const char *name=0); ~Game(); private slots: diff --git a/ksnake/general.ui b/ksnake/general.ui index de9ef8cb..1a9f7650 100644 --- a/ksnake/general.ui +++ b/ksnake/general.ui @@ -1,10 +1,10 @@ General - + General - + 0 0 @@ -16,7 +16,7 @@ unnamed - + groupBox4 @@ -27,7 +27,7 @@ unnamed - + kcfg_Skill @@ -44,7 +44,7 @@ Below - + textLabel10 @@ -52,20 +52,20 @@ Slow - + textLabel12 Fast - + AlignVCenter|AlignRight - + groupBox6 @@ -76,7 +76,7 @@ unnamed - + textLabel7 @@ -84,7 +84,7 @@ Snake behavior: - + Random @@ -104,7 +104,7 @@ kcfg_SnakesAI - + kcfg_ComputerSnakes @@ -112,7 +112,7 @@ 1 - + textLabel8 @@ -122,7 +122,7 @@ - + groupBox5 @@ -133,7 +133,7 @@ unnamed - + textLabel9 @@ -141,7 +141,7 @@ Number of balls: - + kcfg_Balls @@ -149,7 +149,7 @@ 1 - + Dumb @@ -169,7 +169,7 @@ kcfg_BallsAI - + textLabel13 @@ -189,7 +189,7 @@ Expanding - + 20 70 @@ -198,5 +198,5 @@ - + diff --git a/ksnake/level.cpp b/ksnake/level.cpp index 0ea100f0..5ece0a1f 100644 --- a/ksnake/level.cpp +++ b/ksnake/level.cpp @@ -85,7 +85,7 @@ void Level::initBoard(const TQImage &image) uchar *b; for ( int y = 0;y < image.height();y++ ) { - b = image.scanLine(y); + b = const_cast(image).scanLine(y); for ( int x = 0;x < image.width();x++ ) { if ( image.bitOrder() == TQImage::BigEndian ) { diff --git a/ksnake/pixServer.cpp b/ksnake/pixServer.cpp index ac25f9be..c27e554f 100644 --- a/ksnake/pixServer.cpp +++ b/ksnake/pixServer.cpp @@ -100,7 +100,7 @@ void PixServer::initPixmaps() pm.convertFromImage(qi,TQPixmap::AvoidDither); for (int x = 0 ; x < 18; x++){ compuSnakePix[x].resize(BRICKSIZE, BRICKSIZE); - bitBlt(&compuSnakePix[x] ,0,0, &pm,x*BRICKSIZE, 0, BRICKSIZE, BRICKSIZE, Qt::CopyROP, true); + bitBlt(TQT_TQPAINTDEVICE(&compuSnakePix[x]) ,0,0, TQT_TQPAINTDEVICE(&pm),x*BRICKSIZE, 0, BRICKSIZE, BRICKSIZE, TQt::CopyROP, true); compuSnakePix[x].setMask(compuSnakePix[x].createHeuristicMask()); } @@ -110,7 +110,7 @@ void PixServer::initPixmaps() pm.convertFromImage(qi,TQPixmap::AvoidDither); for (int x = 0 ; x < 18; x++){ samyPix[x].resize(BRICKSIZE, BRICKSIZE); - bitBlt(&samyPix[x] ,0,0, &pm,x*BRICKSIZE, 0, BRICKSIZE, BRICKSIZE, Qt::CopyROP, true); + bitBlt(TQT_TQPAINTDEVICE(&samyPix[x]) ,0,0, TQT_TQPAINTDEVICE(&pm),x*BRICKSIZE, 0, BRICKSIZE, BRICKSIZE, TQt::CopyROP, true); samyPix[x].setMask(samyPix[x].createHeuristicMask()); } @@ -120,7 +120,7 @@ void PixServer::initPixmaps() pm.convertFromImage(qi,TQPixmap::AvoidDither); for (int x = 0 ; x < 4; x++){ ballPix[x].resize(BRICKSIZE, BRICKSIZE); - bitBlt(&ballPix[x] ,0,0, &pm,x*BRICKSIZE, 0, BRICKSIZE, BRICKSIZE, Qt::CopyROP, true); + bitBlt(TQT_TQPAINTDEVICE(&ballPix[x]) ,0,0, TQT_TQPAINTDEVICE(&pm),x*BRICKSIZE, 0, BRICKSIZE, BRICKSIZE, TQt::CopyROP, true); ballPix[x].setMask(ballPix[x].createHeuristicMask()); } @@ -130,7 +130,7 @@ void PixServer::initPixmaps() pm.convertFromImage(qi,TQPixmap::AvoidDither); for (int x = 0 ; x < 2; x++){ applePix[x].resize(BRICKSIZE, BRICKSIZE); - bitBlt(&applePix[x] ,0,0, &pm,x*BRICKSIZE, 0, BRICKSIZE, BRICKSIZE, Qt::CopyROP, true); + bitBlt(TQT_TQPAINTDEVICE(&applePix[x]) ,0,0, TQT_TQPAINTDEVICE(&pm),x*BRICKSIZE, 0, BRICKSIZE, BRICKSIZE, TQt::CopyROP, true); applePix[x].setMask(applePix[x].createHeuristicMask()); } } @@ -181,7 +181,7 @@ void PixServer::initBrickPixmap() { TQPixmap pm = TQPixmap(locate("appdata", "pics/brick.png")); if (pm.isNull()) { - kdFatal() << i18n("error loading %1, aborting\n").arg("brick.png"); + kdFatal() << i18n("error loading %1, aborting\n").tqarg("brick.png"); } int pw = pm.width(); int ph = pm.height(); @@ -216,7 +216,7 @@ void PixServer::drawBrick(TQPainter *p ,int i) TQColor light(180,180,180); TQColor dark(100,100,100); - int topSq = board->getNext(N, i); //find 'address' of neighbouring squares + int topSq = board->getNext(N, i); //tqfind 'address' of neighbouring squares int botSq = board->getNext(S, i); int rightSq = board->getNext(E ,i); int leftSq = board->getNext(W, i); diff --git a/ksnake/progress.cpp b/ksnake/progress.cpp index c5024a0f..1e2c0f72 100644 --- a/ksnake/progress.cpp +++ b/ksnake/progress.cpp @@ -25,8 +25,8 @@ #include "progress.h" -Progress::Progress(TQWidget *parent, const char *name) - : KGameProgress(0, 300, 300, KGameProgress::Horizontal, parent, name) +Progress::Progress(TQWidget *tqparent, const char *name) + : KGameProgress(0, 300, 300, Qt::Horizontal, tqparent, name) { setBarColor("green1"); setTextEnabled(false); diff --git a/ksnake/progress.h b/ksnake/progress.h index 311a2bcf..ae78aa47 100644 --- a/ksnake/progress.h +++ b/ksnake/progress.h @@ -31,8 +31,9 @@ class Progress : public KGameProgress { Q_OBJECT + TQ_OBJECT public: - Progress( TQWidget *parent=0, const char *name=0 ); + Progress( TQWidget *tqparent=0, const char *name=0 ); public slots: void advance(); diff --git a/ksnake/rattler.cpp b/ksnake/rattler.cpp index 1085d6f8..8fc0999f 100644 --- a/ksnake/rattler.cpp +++ b/ksnake/rattler.cpp @@ -43,10 +43,10 @@ TQBitArray gameState(5); TQLabel *label = 0; int speed[4] = { 130, 95, 55, 40 }; -Rattler::Rattler( TQWidget *parent, const char *name ) - : TQWidget( parent, name ) +Rattler::Rattler( TQWidget *tqparent, const char *name ) + : TQWidget( tqparent, name ) { - setFocusPolicy(TQWidget::StrongFocus); + setFocusPolicy(TQ_StrongFocus); numBalls = Settings::balls(); ballsAI = Settings::ballsAI(); @@ -114,7 +114,7 @@ void Rattler::paintEvent( TQPaintEvent *e) return; TQPixmap levelPix = pix->levelPix(); - basket->repaint(true); + basket->tqrepaint(true); bitBlt(this, rect.x(), rect.y(), &levelPix, rect.x(), rect.y(), rect.width(), rect.height()); @@ -130,14 +130,14 @@ void Rattler::timerEvent( TQTimerEvent * ) for (CompuSnake *c = computerSnakes->first(); c != 0; c = computerSnakes->next()){ if(c) { c->nextMove(); - c->repaint(false); + c->tqrepaint(false); } } for (Ball *b = balls->first(); b != 0; b = balls->next()){ if (b) { b->nextMove(); - b->repaint(); + b->tqrepaint(); } } @@ -147,10 +147,10 @@ void Rattler::timerEvent( TQTimerEvent * ) if(!gameState.testBit(Demo)) { state = samy->nextMove(direction); - samy->repaint( false ); + samy->tqrepaint( false ); } - basket->repaint( false); + basket->tqrepaint( false); if (state == ko) newTry(); @@ -313,8 +313,8 @@ void Rattler::pause() label = new TQLabel(this); label->setFont( TQFont( "Times", 14, TQFont::Bold ) ); label->setText(i18n("Game Paused\n Press %1 to resume\n") - .arg(tempPauseAction->shortcutText())); - label->setAlignment( AlignCenter ); + .tqarg(tempPauseAction->shortcutText())); + label->tqsetAlignment( AlignCenter ); label->setFrameStyle( TQFrame::Panel | TQFrame::Raised ); label->setGeometry(182, 206, 198, 80); label->show(); @@ -351,7 +351,7 @@ void Rattler::restartDemo() level->create(Intro); pix->initRoomPixmap(); init(false); - repaint(); + tqrepaint(); start(); } @@ -374,7 +374,7 @@ void Rattler::demo() level->create(Intro); pix->initRoomPixmap(); } - repaint(rect(), false); + tqrepaint(rect(), false); init(false); run(); first_time = false; @@ -413,7 +413,7 @@ void Rattler::restart() cleanLabel(); - repaint(); + tqrepaint(); TQTimer::singleShot( 2000, this, TQT_SLOT(showRoom()) ); } @@ -426,7 +426,7 @@ void Rattler::newTry() gameState.setBit(Over); level->create(GameOver); pix->initRoomPixmap(); - repaint(); + tqrepaint(); TQTimer::singleShot( 5000, this, TQT_SLOT(demo()) ); emit setScore(points); return; @@ -439,7 +439,7 @@ void Rattler::newTry() level->create(Room); pix->initRoomPixmap(); init(true); - repaint(); + tqrepaint(); TQTimer::singleShot( 1000, this, TQT_SLOT(run()) ); } @@ -456,7 +456,7 @@ void Rattler::levelUp() level->nextLevel(); level->create(Banner); pix->initRoomPixmap(); - repaint(); + tqrepaint(); TQTimer::singleShot( 2000, this, TQT_SLOT(showRoom()) ); } @@ -493,7 +493,7 @@ void Rattler::showRoom() level->create(Room); pix->initRoomPixmap(); init(true); - repaint(); + tqrepaint(); TQTimer::singleShot( 1000, this, TQT_SLOT(run()) ); } @@ -534,7 +534,7 @@ void Rattler::start(int t) void Rattler::stop() { - killTimers(); + TQT_TQOBJECT(this)->killTimers(); } void Rattler::restartComputerSnakes(bool play) diff --git a/ksnake/rattler.h b/ksnake/rattler.h index da0c13bd..4c9b72ee 100644 --- a/ksnake/rattler.h +++ b/ksnake/rattler.h @@ -40,12 +40,13 @@ class SamySnake; enum { Init, Playing, Demo, Paused, Over }; -class Rattler : public QWidget +class Rattler : public TQWidget { Q_OBJECT + TQ_OBJECT public: - Rattler ( TQWidget *parent=0, const char *name=0 ); + Rattler ( TQWidget *tqparent=0, const char *name=0 ); ~Rattler(); void setActionCollection(KActionCollection *a){ actionCollection = a;} diff --git a/ksnake/snake.cpp b/ksnake/snake.cpp index c892452b..2d6337ac 100644 --- a/ksnake/snake.cpp +++ b/ksnake/snake.cpp @@ -143,7 +143,7 @@ void Snake::reset(int index, int border) } } -void Snake::repaint( bool dirty) +void Snake::tqrepaint( bool dirty) { int x = 0; for ( Samy *sam = list.first(); sam != 0; sam = list.next(), x++) { diff --git a/ksnake/snake.h b/ksnake/snake.h index 6ea2dac2..206ea126 100644 --- a/ksnake/snake.h +++ b/ksnake/snake.h @@ -30,10 +30,11 @@ #include "pixServer.h" #include "board.h" -class Snake : public QObject +class Snake : public TQObject { Q_OBJECT + TQ_OBJECT signals: void score(bool, int); @@ -45,7 +46,7 @@ signals: public: Snake(Board *b, PixServer *p, Gate g, PixMap x); ~Snake() {} - void repaint( bool ); + void tqrepaint( bool ); void zero(); protected: diff --git a/ksnake/startroom.cpp b/ksnake/startroom.cpp index 24874ee9..a50536e0 100644 --- a/ksnake/startroom.cpp +++ b/ksnake/startroom.cpp @@ -33,23 +33,23 @@ #include "levels.h" -StartRoom::StartRoom( TQWidget *parent, const char *name) - : TQWidget( parent, name ) +StartRoom::StartRoom( TQWidget *tqparent, const char *name) + : TQWidget( tqparent, name ) { TQGridLayout *Form1Layout = new TQGridLayout( this, 1, 1, 11, 6, "Form1Layout"); TQSpacerItem* spacer = new TQSpacerItem( 20, 61, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); Form1Layout->addItem( spacer, 2, 1 ); - TQHBoxLayout *layout1 = new TQHBoxLayout( 0, 0, 6, "layout1"); + TQHBoxLayout *tqlayout1 = new TQHBoxLayout( 0, 0, 6, "tqlayout1"); TQSpacerItem* spacer_2 = new TQSpacerItem( 91, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); - layout1->addItem( spacer_2 ); + tqlayout1->addItem( spacer_2 ); picture = new TQLabel( this, "picture" ); - layout1->addWidget( picture ); + tqlayout1->addWidget( picture ); TQSpacerItem* spacer_3 = new TQSpacerItem( 41, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); - layout1->addItem( spacer_3 ); + tqlayout1->addItem( spacer_3 ); - Form1Layout->addMultiCellLayout( layout1, 0, 0, 0, 1 ); + Form1Layout->addMultiCellLayout( tqlayout1, 0, 0, 0, 1 ); roomRange = new TQSpinBox( this, "kcfg_StartingRoom" ); roomRange->setMaxValue( 25 ); diff --git a/ksnake/startroom.h b/ksnake/startroom.h index 3750b6c4..222bd50f 100644 --- a/ksnake/startroom.h +++ b/ksnake/startroom.h @@ -31,11 +31,12 @@ class TQLabel; class TQSpinBox; -class StartRoom : public QWidget +class StartRoom : public TQWidget { Q_OBJECT + TQ_OBJECT public: - StartRoom( TQWidget *parent=0, const char *name=0 ); + StartRoom( TQWidget *tqparent=0, const char *name=0 ); private slots: void loadLevel(int level); diff --git a/ksnake/view.cpp b/ksnake/view.cpp index a8503700..dec662ea 100644 --- a/ksnake/view.cpp +++ b/ksnake/view.cpp @@ -32,8 +32,8 @@ int MAPWIDTH = BRICKSIZE * 35; int MAPHEIGHT = MAPWIDTH; #define BAR_HEIGHT 12 -View::View( TQWidget *parent, const char *name ) - : TQWidget( parent, name ) +View::View( TQWidget *tqparent, const char *name ) + : TQWidget( tqparent, name ) { progress = new Progress(this); rattler = new Rattler( this); @@ -51,7 +51,7 @@ void View::resizeEvent( TQResizeEvent * ) rattler->setGeometry(0, BAR_HEIGHT, width(), height()-BAR_HEIGHT); } -TQSize View::sizeHint() const +TQSize View::tqsizeHint() const { return TQSize(490,502); } diff --git a/ksnake/view.h b/ksnake/view.h index 68fd2412..2ab132d7 100644 --- a/ksnake/view.h +++ b/ksnake/view.h @@ -30,18 +30,19 @@ class Progress; class Rattler; -class View : public QWidget +class View : public TQWidget { Q_OBJECT + TQ_OBJECT public: - View ( TQWidget *parent=0, const char *name=0 ); + View ( TQWidget *tqparent=0, const char *name=0 ); Progress *progress; Rattler *rattler; protected: void resizeEvent( TQResizeEvent * ); - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; }; #endif // VIEW_H diff --git a/ksokoban/ImageData.cpp b/ksokoban/ImageData.cpp index c34ece36..76fd0f2b 100644 --- a/ksokoban/ImageData.cpp +++ b/ksokoban/ImageData.cpp @@ -144,10 +144,10 @@ ImageData::brighten(TQImage& img) { for (int y=0; y g && r > b) { // only modify redish pixels @@ -163,10 +163,10 @@ ImageData::brighten(TQImage& img) { void ImageData::wall(TQPainter &p, int x, int y, int index, bool left, bool right) { - if (left) p.drawPixmap(x, y, upperLarge(index-1), halfSize_); + if (left) p.tqdrawPixmap(x, y, upperLarge(index-1), halfSize_); else p.drawPixmap(x, y, leftSmall(index)); - if (right) p.drawPixmap(x+halfSize_, y, upperLarge(index), 0, 0, halfSize_); + if (right) p.tqdrawPixmap(x+halfSize_, y, upperLarge(index), 0, 0, halfSize_); else p.drawPixmap(x+halfSize_, y, rightSmall(index)); p.drawPixmap(x, y+halfSize_, lowerLarge(index)); diff --git a/ksokoban/InternalCollections.cpp b/ksokoban/InternalCollections.cpp index 242a724d..5b019f52 100644 --- a/ksokoban/InternalCollections.cpp +++ b/ksokoban/InternalCollections.cpp @@ -38,7 +38,7 @@ InternalCollections::realCollection2Config(int collection) { return collection_save_id[collection]; } -QString +TQString InternalCollections::collectionName(int _level) { switch (_level) { case 0: diff --git a/ksokoban/MainWindow.cpp b/ksokoban/MainWindow.cpp index 1f9ba526..0c28579c 100644 --- a/ksokoban/MainWindow.cpp +++ b/ksokoban/MainWindow.cpp @@ -179,7 +179,7 @@ MainWindow::MainWindow() : KMainWindow(0), externalCollection_(0) { updateBookmark(i); } - help_ = helpMenu(TQString::null, false); + help_ = helpMenu(TQString(), false); menu_->insertSeparator(); menu_->insertItem(i18n("&Help"), help_); @@ -311,7 +311,7 @@ void MainWindow::openURL(KURL _url) { KConfig *cfg=(KApplication::kApplication())->config(); -// int namepos = _url.path().findRev('/') + 1; // NOTE: findRev can return -1 +// int namepos = _url.path().tqfindRev('/') + 1; // NOTE: tqfindRev can return -1 // TQString levelName = _url.path().mid(namepos); TQString levelName = _url.fileName(); diff --git a/ksokoban/MainWindow.h b/ksokoban/MainWindow.h index 30c1fbb3..7551c935 100644 --- a/ksokoban/MainWindow.h +++ b/ksokoban/MainWindow.h @@ -35,6 +35,7 @@ class LevelCollection; class MainWindow : public KMainWindow { Q_OBJECT + TQ_OBJECT public: MainWindow(); ~MainWindow(); diff --git a/ksokoban/ModalLabel.cpp b/ksokoban/ModalLabel.cpp index c0ccbbad..cf813779 100644 --- a/ksokoban/ModalLabel.cpp +++ b/ksokoban/ModalLabel.cpp @@ -28,9 +28,9 @@ #include "ModalLabel.moc" -ModalLabel::ModalLabel(const TQString &text, TQWidget *parent, +ModalLabel::ModalLabel(const TQString &text, TQWidget *tqparent, const char *name, WFlags f) - : TQLabel(text, parent, name, f) { + : TQLabel(text, tqparent, name, f) { TQFont font(KGlobalSettings::generalFont().family(), 24, TQFont::Bold); TQFontMetrics fontMet(font); @@ -40,7 +40,7 @@ ModalLabel::ModalLabel(const TQString &text, TQWidget *parent, for (int linePos=0; linePos < (int) text.length(); linePos += lineLen+1) { - lineLen = text.find('\n', linePos); + lineLen = text.tqfind('\n', linePos); if (lineLen < 0) lineLen = text.length() - linePos; else lineLen -= linePos; @@ -57,15 +57,15 @@ ModalLabel::ModalLabel(const TQString &text, TQWidget *parent, if (width < 300) width = 300; if (height < 75) height = 75; - setAlignment (AlignCenter); + tqsetAlignment (AlignCenter); setFrameStyle (TQFrame::Panel | TQFrame::Raised); setLineWidth (4); setFont (font); - move (parent->width ()/2 - width/2, parent->height ()/2 - height/2); + move (tqparent->width ()/2 - width/2, tqparent->height ()/2 - height/2); resize (width, height); show (); - TQWidgetList *list = TQApplication::allWidgets(); + TQWidgetList *list = TQApplication::tqallWidgets(); TQWidgetListIt it( *list ); while (it.current()) { it.current()->installEventFilter (this); @@ -107,9 +107,9 @@ ModalLabel::eventFilter (TQObject *, TQEvent *e) { } void -ModalLabel::message (const TQString &text, TQWidget *parent) { +ModalLabel::message (const TQString &text, TQWidget *tqparent) { KApplication *app = KApplication::kApplication (); - ModalLabel cl (text, parent); + ModalLabel cl (text, tqparent); while (!cl.completed_) app->processOneEvent (); } diff --git a/ksokoban/ModalLabel.h b/ksokoban/ModalLabel.h index 2fd010e9..cb4420cc 100644 --- a/ksokoban/ModalLabel.h +++ b/ksokoban/ModalLabel.h @@ -24,15 +24,16 @@ class ModalLabel : public TQLabel { Q_OBJECT + TQ_OBJECT public: - static void message (const TQString &text, TQWidget *parent); + static void message (const TQString &text, TQWidget *tqparent); void timerEvent (TQTimerEvent *); bool eventFilter (TQObject *, TQEvent *); bool completed_; protected: - ModalLabel (const TQString &text, TQWidget *parent, const char *name=0, WFlags f=0); + ModalLabel (const TQString &text, TQWidget *tqparent, const char *name=0, WFlags f=0); }; diff --git a/ksokoban/NEWS b/ksokoban/NEWS index bf717f78..5377962f 100644 --- a/ksokoban/NEWS +++ b/ksokoban/NEWS @@ -48,7 +48,7 @@ New features: * Bookmarks * Animation speed menu -* Status bar +* tqStatus bar * Internationalisation ------------------------------------------------------------------------------- diff --git a/ksokoban/PlayField.cpp b/ksokoban/PlayField.cpp index f277192e..68b97f76 100644 --- a/ksokoban/PlayField.cpp +++ b/ksokoban/PlayField.cpp @@ -45,8 +45,8 @@ #include "PlayField.moc" -PlayField::PlayField(TQWidget *parent, const char *name, WFlags f) - : TQWidget(parent, name, f|WResizeNoErase), imageData_(0), lastLevel_(-1), +PlayField::PlayField(TQWidget *tqparent, const char *name, WFlags f) + : TQWidget(tqparent, name, f|WResizeNoErase), imageData_(0), lastLevel_(-1), moveSequence_(0), moveInProgress_(false), dragInProgress_(false), xOffs_(0), yOffs_(0), wheelDelta_(0), @@ -54,9 +54,9 @@ PlayField::PlayField(TQWidget *parent, const char *name, WFlags f) pushesText_(i18n("Pushes:")), statusFont_(KGlobalSettings::generalFont().family(), 18, TQFont::Bold), statusMetrics_(statusFont_) { - setFocusPolicy(TQWidget::StrongFocus); + setFocusPolicy(TQ_StrongFocus); setFocus(); - setBackgroundMode(Qt::NoBackground); + setBackgroundMode(TQt::NoBackground); setMouseTracking(true); highlightX_ = highlightY_ = 0; @@ -72,7 +72,7 @@ PlayField::PlayField(TQWidget *parent, const char *name, WFlags f) history_ = new History; background_.setPixmap(imageData_->background()); - floor_ = TQColor(0x66,0x66,0x66); + floor_ = TQBrush(TQColor(0x66,0x66,0x66)); levelMap_ = new LevelMap; mapDelta_ = new MapDelta(levelMap_); @@ -187,7 +187,7 @@ void PlayField::paintDelta() { TQPainter paint(this); - // the following line is a workaround for a bug in Qt 2.0.1 + // the following line is a workaround for a bug in TQt 2.0.1 // (and possibly earlier versions) paint.setBrushOrigin(0, 0); @@ -204,7 +204,7 @@ void PlayField::paintEvent(TQPaintEvent *e) { TQPainter paint(this); - // the following line is a workaround for a bug in Qt 2.0.1 + // the following line is a workaround for a bug in TQt 2.0.1 // (and possibly earlier versions) paint.setBrushOrigin(0, 0); @@ -324,26 +324,26 @@ PlayField::mouseMoveEvent(TQMouseEvent *e) { dragImage_ = dragXpm_; for (int yy=0; yyobjectImg().pixel(xx, yy); - int r1 = qRed(rgb1); - int g1 = qGreen(rgb1); - int b1 = qBlue(rgb1); + TQRgb rgb1 = imageData_->objectImg().pixel(xx, yy); + int r1 = tqRed(rgb1); + int g1 = tqGreen(rgb1); + int b1 = tqBlue(rgb1); if (r1 != g1 || r1 != b1 || r1 == 255) { - QRgb rgb2 = dragImage_.pixel(xx, yy); - int r2 = qRed(rgb2); - int g2 = qGreen(rgb2); - int b2 = qBlue(rgb2); + TQRgb rgb2 = dragImage_.pixel(xx, yy); + int r2 = tqRed(rgb2); + int g2 = tqGreen(rgb2); + int b2 = tqBlue(rgb2); r2 = (int) (0.75 * r1 + 0.25 * r2 + 0.5); g2 = (int) (0.75 * g1 + 0.25 * g2 + 0.5); b2 = (int) (0.75 * b1 + 0.25 * b2 + 0.5); - dragImage_.setPixel(xx, yy, qRgb(r2, g2, b2)); + dragImage_.setPixel(xx, yy, tqRgb(r2, g2, b2)); } } } paint.begin(this); - // the following line is a workaround for a bug in Qt 2.0.1 + // the following line is a workaround for a bug in TQt 2.0.1 // (and possibly earlier versions) paint.setBrushOrigin(0, 0); @@ -421,7 +421,7 @@ PlayField::highlight() { void PlayField::stopMoving() { - killTimers(); + TQT_TQOBJECT(this)->killTimers(); delete moveSequence_; moveSequence_ = 0; moveInProgress_ = false; @@ -456,7 +456,7 @@ void PlayField::timerEvent(TQTimerEvent *) { assert(moveInProgress_); if (moveSequence_ == 0) { - killTimers(); + TQT_TQOBJECT(this)->killTimers(); moveInProgress_ = false; return; } @@ -599,7 +599,7 @@ PlayField::keyPressEvent(TQKeyEvent * e) { case Key_X: levelMap_->random(); levelChange(); - repaint(false); + tqrepaint(false); break; case Key_R: @@ -620,7 +620,7 @@ PlayField::keyPressEvent(TQKeyEvent * e) { break; case Key_I: history_->redo(levelMap_); - repaint(false); + tqrepaint(false); return; break; @@ -644,7 +644,7 @@ PlayField::keyPressEvent(TQKeyEvent * e) { } updateStepsXpm(); updatePushesXpm(); - repaint(false); + tqrepaint(false); return; break; #endif @@ -669,7 +669,7 @@ PlayField::stopDrag() { TQPainter paint(this); - // the following line is a workaround for a bug in Qt 2.0.1 + // the following line is a workaround for a bug in TQt 2.0.1 // (and possibly earlier versions) paint.setBrushOrigin(0, 0); @@ -700,7 +700,7 @@ PlayField::mousePressEvent(TQMouseEvent *e) { if (!canMoveNow()) return; if (dragInProgress_) { - if (e->button() == LeftButton) dragObject(e->x(), e->y()); + if (e->button() == Qt::LeftButton) dragObject(e->x(), e->y()); else stopDrag(); return; } @@ -711,7 +711,7 @@ PlayField::mousePressEvent(TQMouseEvent *e) { if (x < 0 || y < 0 || x >= levelMap_->width() || y >= levelMap_->height()) return; - if (e->button() == LeftButton && pathFinder_.canDrag(x, y)) { + if (e->button() == Qt::LeftButton && pathFinder_.canDrag(x, y)) { TQPainter paint(this); changeCursor(&sizeAllCursor); @@ -732,7 +732,7 @@ PlayField::mousePressEvent(TQMouseEvent *e) { Move *m; switch (e->button()) { - case LeftButton: + case Qt::LeftButton: m = pathFinder_.search(levelMap_, x, y); if (m != 0) { history_->add(m); @@ -740,11 +740,11 @@ PlayField::mousePressEvent(TQMouseEvent *e) { startMoving(m); } break; - case MidButton: + case Qt::MidButton: undo(); return; break; - case RightButton: + case Qt::RightButton: push(x, y); break; @@ -855,7 +855,7 @@ this level yet."), this); level(levelMap_->level()+1); levelChange(); - repaint(false); + tqrepaint(false); } void @@ -868,7 +868,7 @@ the current collection."), this); } level(levelMap_->level()-1); levelChange(); - repaint(false); + tqrepaint(false); } void @@ -892,7 +892,7 @@ PlayField::restartLevel() { level(levelMap_->level()); updateStepsXpm(); updatePushesXpm(); - repaint(false); + tqrepaint(false); } void @@ -901,7 +901,7 @@ PlayField::changeCollection(LevelCollection *collection) { levelMap_->changeCollection(collection); levelChange(); //erase(collRect_); - repaint(false); + tqrepaint(false); } void @@ -1030,7 +1030,7 @@ PlayField::goToBookmark(Bookmark *bm) { //updateLevelXpm(); updateStepsXpm(); updatePushesXpm(); - repaint(false); + tqrepaint(false); } bool diff --git a/ksokoban/PlayField.h b/ksokoban/PlayField.h index 2a70b4b9..161c49d0 100644 --- a/ksokoban/PlayField.h +++ b/ksokoban/PlayField.h @@ -43,8 +43,9 @@ class TQCursor; class PlayField : public TQWidget { Q_OBJECT + TQ_OBJECT public: - PlayField(TQWidget *parent, const char *name=0, WFlags f=0); + PlayField(TQWidget *tqparent, const char *name=0, WFlags f=0); ~PlayField (); bool canMoveNow(); diff --git a/ksokoban/Queue.h b/ksokoban/Queue.h index cab9db90..4e193f54 100644 --- a/ksokoban/Queue.h +++ b/ksokoban/Queue.h @@ -17,8 +17,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QUEUE_H -#define QUEUE_H +#ifndef TQUEUE_H +#define TQUEUE_H #include @@ -53,4 +53,4 @@ public: } }; -#endif /* QUEUE_H */ +#endif /* TQUEUE_H */ diff --git a/ksokoban/StaticImage.cpp b/ksokoban/StaticImage.cpp index 49a2aafa..d0a9f76a 100644 --- a/ksokoban/StaticImage.cpp +++ b/ksokoban/StaticImage.cpp @@ -72,7 +72,7 @@ StaticImage::StaticImage () { if (!valid) { background_.resize(128, 128); - background_.fill(Qt::black); + background_.fill(TQt::black); } for (int i=0; isetFrameStyle(TQFrame::NoFrame); @@ -157,9 +157,9 @@ ConfigSetup::ConfigSetup(SConfig *custom,TQWidget *parent,const char *name) configCombo->insertItem(i18n(predefinedConfigName[i])); configCombo->insertItem(i18n("Custom")); - boxlayout->addSpacing( 2 * 6 ); - boxlayout->addWidget(configCombo); - boxlayout->addWidget(tabs); + boxtqlayout->addSpacing( 2 * 6 ); + boxtqlayout->addWidget(configCombo); + boxtqlayout->addWidget(tabs); for(i=0;i General - + General - + 0 0 @@ -16,7 +16,7 @@ unnamed - + groupBox3 @@ -33,7 +33,7 @@ unnamed - + lCDNumber2 @@ -44,7 +44,7 @@ 99 - + lCDNumber1 @@ -55,7 +55,7 @@ 99 - + textLabel3 @@ -63,7 +63,7 @@ Red player: - + textLabel4 @@ -71,7 +71,7 @@ Blue player: - + kcfg_StartHitPoints1 @@ -82,7 +82,7 @@ Horizontal - + kcfg_StartHitPoints0 @@ -95,7 +95,7 @@ - + groupBox4 @@ -106,7 +106,7 @@ unnamed - + textLabel5 @@ -114,7 +114,7 @@ Refresh time: - + kcfg_RefreshTime @@ -131,7 +131,7 @@ Horizontal - + lCDNumber3 @@ -154,14 +154,14 @@ Expanding - + 20 91 - + groupBox1 @@ -172,7 +172,7 @@ unnamed - + kcfg_Player0IsAi @@ -180,7 +180,7 @@ Player is AI - + textLabel1 @@ -191,7 +191,7 @@ Difficulty: - + Trainee @@ -224,7 +224,7 @@ - + groupBox2 @@ -235,7 +235,7 @@ unnamed - + kcfg_Player1IsAi @@ -243,7 +243,7 @@ Player is AI - + textLabel2 @@ -254,7 +254,7 @@ Difficulty: - + Trainee @@ -333,5 +333,5 @@ setEnabled(bool) - + diff --git a/kspaceduel/mainview.cpp b/kspaceduel/mainview.cpp index 5448c1a3..ea17594d 100644 --- a/kspaceduel/mainview.cpp +++ b/kspaceduel/mainview.cpp @@ -18,8 +18,8 @@ KToggleAction *MyMainView::pauseAction = 0; -MyMainView::MyMainView(TQWidget *parent) - :TQWidget(parent), +MyMainView::MyMainView(TQWidget *tqparent) + :TQWidget(tqparent), field(DEF_WIDTH,DEF_HEIGHT), view(&field,this) { @@ -27,7 +27,7 @@ MyMainView::MyMainView(TQWidget *parent) setMinimumSize(600,400); random.setSeed(0); TQPixmap backgr(locate("appdata", MV_BACKGROUND)); - field.setBackgroundPixmap(backgr); + field.tqsetBackgroundPixmap(backgr); view.setResizePolicy(TQScrollView::AutoOne); view.setHScrollBarMode(TQScrollView::AlwaysOff); @@ -99,7 +99,7 @@ MyMainView::MyMainView(TQWidget *parent) MyMainView::~MyMainView() { - killTimers(); + TQT_TQOBJECT(this)->killTimers(); writeConfig(); } @@ -340,7 +340,7 @@ void MyMainView::pause() pauseAction->setChecked( true ); waitForStart=true; - killTimers(); + TQT_TQOBJECT(this)->killTimers(); emit setStatusText(i18n(" paused "), IDS_PAUSE); } } @@ -375,7 +375,7 @@ void MyMainView::stop() pauseAction->setEnabled( false ); pauseAction->setChecked( false ); - killTimers(); + TQT_TQOBJECT(this)->killTimers(); waitForStart = true; } @@ -444,7 +444,7 @@ void MyMainView::newRound() timeToNextPowerup=random.getDouble() * config.powerupRefreshTime; powerups.clear(); - killTimers(); + TQT_TQOBJECT(this)->killTimers(); mx=width()/2.0; my=height()/2.0; ship[0]->move(mx+config.startPosX,my+config.startPosY); @@ -492,7 +492,7 @@ void MyMainView::newRound() field.update(); TQString str = i18n("Press %1 to start") - .arg(KShortcut(GAME_START_SHORTCUT).toString()); + .tqarg(KShortcut(GAME_START_SHORTCUT).toString()); emit(setStatusText(str,IDS_MAIN)); emit( setStatusText( "", IDS_PAUSE ) ); stop( ); @@ -517,7 +517,7 @@ void MyMainView::timerEvent(TQTimerEvent *event) if(event->timerId()==timerID) { - killTimers(); + TQT_TQOBJECT(this)->killTimers(); if(gameEnd>0.0) { gameEnd-=1.0; @@ -534,7 +534,7 @@ void MyMainView::timerEvent(TQTimerEvent *event) textSprite=new TQCanvasText(&field); textSprite->move(width()/2,height()/2-90); textSprite->setTextFlags(AlignCenter); - textSprite->setColor(qRgb(255,160,0)); + textSprite->setColor(tqRgb(255,160,0)); textSprite->setFont(TQFont(KGlobalSettings::generalFont().family(),14)); textSprite->show( ); if(ship[0]->getHitPoints()==0) @@ -557,7 +557,7 @@ void MyMainView::timerEvent(TQTimerEvent *event) emit(wins(0,w)); } TQString str = i18n("Press %1 for new round") - .arg(KShortcut(GAME_START_SHORTCUT).toString()); + .tqarg(KShortcut(GAME_START_SHORTCUT).toString()); emit(setStatusText(str,IDS_MAIN)); stop( ); } @@ -815,7 +815,7 @@ void MyMainView::collisions() if((sprite->rtti()!=S_EXPLOSION) && !((sprite->rtti()!=S_SUN)&&(ship[pl]->getHitPoints()==0))) if(ship[pl]->collidesWith(sprite)) - if(!hitlist.contains(sprite)) + if(!hitlist.tqcontains(sprite)) hitlist.append(sprite); } @@ -906,7 +906,7 @@ void MyMainView::collisions() sprite = (*it); if(sprite->rtti()==S_BULLET) if(mine->collidesWith(sprite)) - if(!hitlist.contains(sprite)) + if(!hitlist.tqcontains(sprite)) hitlist.append(sprite); } if(hitlist.count()>0) @@ -932,13 +932,13 @@ void MyMainView::collisions() { case S_BULLET: if(sun->collidesWith(sprite)) - if(!hitlist.contains(sprite)) + if(!hitlist.tqcontains(sprite)) hitlist.append(sprite); break; case S_MINE: if(!((MobileSprite*)sprite)->isStopped()) if(sun->collidesWith(sprite)) - if(!hitlist.contains(sprite)) + if(!hitlist.tqcontains(sprite)) hitlist.append(sprite); break; } @@ -1002,12 +1002,12 @@ void MyMainView::closeSettings(){ } TQCanvasPixmapArray* MyMainView::loadOldPixmapSequence(const TQString& datapattern, - const TQString& maskpattern, int framecount) + const TQString& tqmaskpattern, int framecount) { int image; TQPtrList pixmaplist; TQPtrList pointlist; - TQString dataname, maskname; + TQString dataname, tqmaskname; TQPixmap *pix; TQBitmap *bitmap; int hotx=0, hoty=0; @@ -1015,9 +1015,9 @@ TQCanvasPixmapArray* MyMainView::loadOldPixmapSequence(const TQString& datapatte for( image=0; image < framecount; image++ ) { - // #### Why is this a QString?? + // #### Why is this a TQString?? dataname.sprintf( datapattern.ascii(), image ); - maskname.sprintf( maskpattern.ascii(), image ); + tqmaskname.sprintf( tqmaskpattern.ascii(), image ); TQFile file(dataname); if( file.open( IO_ReadOnly ) ) @@ -1039,7 +1039,7 @@ TQCanvasPixmapArray* MyMainView::loadOldPixmapSequence(const TQString& datapatte } pix = new TQPixmap( dataname ); - bitmap = new TQBitmap( maskname ); + bitmap = new TQBitmap( tqmaskname ); pix->setMask( *bitmap ); pixmaplist.append( pix ); diff --git a/kspaceduel/mainview.h b/kspaceduel/mainview.h index c56a4f12..ab4a4fcc 100644 --- a/kspaceduel/mainview.h +++ b/kspaceduel/mainview.h @@ -16,11 +16,12 @@ class Ai; #undef sun #endif -class MyMainView:public QWidget +class MyMainView:public TQWidget { Q_OBJECT + TQ_OBJECT public: - MyMainView(TQWidget *parent=0); + MyMainView(TQWidget *tqparent=0); ~MyMainView(); static KToggleAction *pauseAction; @@ -51,7 +52,7 @@ protected: virtual void keyReleaseEvent(TQKeyEvent *event); SConfig modifyConfig(SConfig conf); TQCanvasPixmapArray* loadOldPixmapSequence(const TQString& datapattern, - const TQString& maskpattern, int framecount=1); + const TQString& tqmaskpattern, int framecount=1); void moveShips(); void moveBullets(); void moveMines(); diff --git a/kspaceduel/playerinfo.cpp b/kspaceduel/playerinfo.cpp index 2e1ef91d..07020fb3 100644 --- a/kspaceduel/playerinfo.cpp +++ b/kspaceduel/playerinfo.cpp @@ -5,8 +5,8 @@ #include -PlayerInfo::PlayerInfo(int pnr,TQWidget *parent,const char *name) - :TQFrame(parent,name), +PlayerInfo::PlayerInfo(int pnr,TQWidget *tqparent,const char *name) + :TQFrame(tqparent,name), lplayer(this),lenergy(this),lwins(this), hitpoints(2,this),energy(2,this),wins(2,this) { @@ -34,9 +34,9 @@ PlayerInfo::PlayerInfo(int pnr,TQWidget *parent,const char *name) for(i=0;i<4;i++) { - str = TQString::fromLatin1("sprites/playerinfo/ship%1%2.pnm") - .arg(pnr+1) - .arg(i); + str = TQString::tqfromLatin1("sprites/playerinfo/ship%1%2.pnm") + .tqarg(pnr+1) + .tqarg(i); pix[i]=new TQPixmap(locate("appdata", str)); } diff --git a/kspaceduel/playerinfo.h b/kspaceduel/playerinfo.h index 022d533e..0963b405 100644 --- a/kspaceduel/playerinfo.h +++ b/kspaceduel/playerinfo.h @@ -7,11 +7,12 @@ class TQPixmap; #include #include -class PlayerInfo:public QFrame +class PlayerInfo:public TQFrame { Q_OBJECT + TQ_OBJECT public: - PlayerInfo(int pnr,TQWidget *parent=0,const char *name=0); + PlayerInfo(int pnr,TQWidget *tqparent=0,const char *name=0); public slots: void setHitpoints(int h); void setEnergy(int e); diff --git a/kspaceduel/sprites.cpp b/kspaceduel/sprites.cpp index ba163429..5c408e46 100644 --- a/kspaceduel/sprites.cpp +++ b/kspaceduel/sprites.cpp @@ -6,7 +6,7 @@ SunSprite::SunSprite(TQCanvasPixmapArray *seq, TQCanvas* canvas) :TQCanvasSprite(seq, canvas) { - // doesn't work with Qt 2.2.2 anymore + // doesn't work with TQt 2.2.2 anymore // setZ(0); } diff --git a/kspaceduel/sprites.h b/kspaceduel/sprites.h index 8011301e..e05c8674 100644 --- a/kspaceduel/sprites.h +++ b/kspaceduel/sprites.h @@ -14,7 +14,7 @@ struct AiSprite bool sun, border; }; -class SunSprite:public QCanvasSprite +class SunSprite:public TQCanvasSprite { public: SunSprite(TQCanvasPixmapArray* seq, TQCanvas* canvas); @@ -22,7 +22,7 @@ public: }; -class PowerupSprite:public QCanvasSprite +class PowerupSprite:public TQCanvasSprite { public: enum {PowerupMine=0, PowerupBullet, PowerupShield, PowerupEnergy, @@ -38,7 +38,7 @@ private: int type; }; -class MobileSprite:public QCanvasSprite +class MobileSprite:public TQCanvasSprite { public: MobileSprite(TQCanvasPixmapArray* array, TQCanvas* canvas, int pn); @@ -126,7 +126,7 @@ private: double activateTime,fuel,timeToGo,explosiontime; }; -class ExplosionSprite:public QCanvasSprite +class ExplosionSprite:public TQCanvasSprite { public: ExplosionSprite(TQCanvasPixmapArray *seq, TQCanvas* field, MobileSprite *sp); diff --git a/kspaceduel/topwidget.cpp b/kspaceduel/topwidget.cpp index 510da675..999f546b 100644 --- a/kspaceduel/topwidget.cpp +++ b/kspaceduel/topwidget.cpp @@ -25,21 +25,21 @@ void MyTopLevelWidget::initGameWidgets( ){ playerinfo[1]=new PlayerInfo(1,w); playfield=new MyMainView(w); - TQBoxLayout *toplayout=new TQHBoxLayout(w); - toplayout->addWidget(playerinfo[0]); - toplayout->addWidget(playfield); - toplayout->addWidget(playerinfo[1]); - toplayout->activate(); + TQBoxLayout *toptqlayout=new TQHBoxLayout(w); + toptqlayout->addWidget(playerinfo[0]); + toptqlayout->addWidget(playfield); + toptqlayout->addWidget(playerinfo[1]); + toptqlayout->activate(); - playfield->setFocusPolicy(TQWidget::StrongFocus); + playfield->setFocusPolicy(TQ_StrongFocus); playfield->setFocus(); - TQObject::connect(playfield,TQT_SIGNAL(energy(int,int)), + TQT_BASE_OBJECT_NAME::connect(TQT_TQOBJECT(playfield),TQT_SIGNAL(energy(int,int)), TQT_SLOT(energy(int,int))); - TQObject::connect(playfield,TQT_SIGNAL(hitPoints(int,int)), + TQT_BASE_OBJECT_NAME::connect(TQT_TQOBJECT(playfield),TQT_SIGNAL(hitPoints(int,int)), TQT_SLOT(hitPoints(int,int))); - TQObject::connect(playfield,TQT_SIGNAL(wins(int,int)),TQT_SLOT(wins(int,int))); - TQObject::connect(playfield,TQT_SIGNAL(setStatusText(const TQString &,int)), + TQT_BASE_OBJECT_NAME::connect(TQT_TQOBJECT(playfield),TQT_SIGNAL(wins(int,int)),TQT_SLOT(wins(int,int))); + TQT_BASE_OBJECT_NAME::connect(TQT_TQOBJECT(playfield),TQT_SIGNAL(setStatusText(const TQString &,int)), TQT_SLOT(setStatusText(const TQString &,int))); setCentralWidget(w); @@ -62,18 +62,18 @@ void MyTopLevelWidget::wins(int pn,int w) void MyTopLevelWidget::initActions( ) { - KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); - KStdGameAction::gameNew(playfield, TQT_SLOT(newGame()), actionCollection()); + KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); + KStdGameAction::gameNew(TQT_TQOBJECT(playfield), TQT_SLOT(newGame()), actionCollection()); ( void )new KAction( i18n( "&New Round" ), "spnewround", - CTRL + Key_R, playfield, TQT_SLOT( newRound( ) ), + CTRL + Key_R, TQT_TQOBJECT(playfield), TQT_SLOT( newRound( ) ), actionCollection( ), "new_round" ); MyMainView::pauseAction = - KStdGameAction::pause(playfield, TQT_SLOT(togglePause()), actionCollection()); + KStdGameAction::pause(TQT_TQOBJECT(playfield), TQT_SLOT(togglePause()), actionCollection()); MyMainView::pauseAction->setChecked( false ); KAction* gameStart = new KAction( i18n( "Start" ), GAME_START_SHORTCUT, - playfield, TQT_SLOT( start( ) ), actionCollection( ), "game_start" ); + TQT_TQOBJECT(playfield), TQT_SLOT( start( ) ), actionCollection( ), "game_start" ); - KStdAction::preferences(playfield, TQT_SLOT(gameSetup()), actionCollection()); + KStdAction::preferences(TQT_TQOBJECT(playfield), TQT_SLOT(gameSetup()), actionCollection()); KAccel* acc = new KAccel(this); gameStart->plugAccel(acc); diff --git a/kspaceduel/topwidget.h b/kspaceduel/topwidget.h index 7c86a39c..9563fe35 100644 --- a/kspaceduel/topwidget.h +++ b/kspaceduel/topwidget.h @@ -9,6 +9,7 @@ class MyMainView; class MyTopLevelWidget:public KMainWindow { Q_OBJECT + TQ_OBJECT public: MyTopLevelWidget(); void start(); diff --git a/ktron/ai.ui b/ktron/ai.ui index 3abcef57..63284c9a 100644 --- a/ktron/ai.ui +++ b/ktron/ai.ui @@ -1,10 +1,10 @@ Ai - + Ai - + 0 0 @@ -22,7 +22,7 @@ 0 - + frame9 @@ -39,7 +39,7 @@ unnamed - + groupBox3 @@ -50,7 +50,7 @@ unnamed - + kcfg_Computerplayer1 @@ -58,7 +58,7 @@ Player &1 - + kcfg_Computerplayer2 @@ -78,14 +78,14 @@ Expanding - + 101 20 - + textLabel15 @@ -93,7 +93,7 @@ Intelligence: - + Beginner @@ -126,7 +126,7 @@ Expanding - + 20 60 @@ -137,5 +137,5 @@ - + diff --git a/ktron/appearance.ui b/ktron/appearance.ui index af50183f..9c2ef5a6 100644 --- a/ktron/appearance.ui +++ b/ktron/appearance.ui @@ -1,10 +1,10 @@ Appearance - + Appearance - + 0 0 @@ -22,7 +22,7 @@ 0 - + frame4 @@ -39,7 +39,7 @@ unnamed - + textLabel16 @@ -47,7 +47,7 @@ Line style: - + 3D Line @@ -72,7 +72,7 @@ kcfg_Style - + groupBox4 @@ -83,40 +83,40 @@ unnamed - + textLabel13 Large - + AlignVCenter|AlignRight - + textLabel11 Small - + AlignVCenter|AlignLeft - + textLabel12 Medium - + AlignCenter - + kcfg_RectSize @@ -147,7 +147,7 @@ - + kcfg_BackgroundImageChoice @@ -158,7 +158,7 @@ unnamed - + BackgroundColorChoice @@ -177,7 +177,7 @@ false - + BackgroundImageChoice @@ -205,7 +205,7 @@ - + textLabel7 @@ -228,7 +228,7 @@ - + textLabel8 @@ -261,7 +261,7 @@ Expanding - + 20 16 @@ -292,7 +292,7 @@ kcfg_Color_Player1 kcfg_Color_Player2 - + kurlrequester.h klineedit.h diff --git a/ktron/general.ui b/ktron/general.ui index ca492b9e..22827e7b 100644 --- a/ktron/general.ui +++ b/ktron/general.ui @@ -1,10 +1,10 @@ General - + General - + 0 0 @@ -22,7 +22,7 @@ 0 - + frame4 @@ -39,7 +39,7 @@ unnamed - + groupBox1 @@ -50,7 +50,7 @@ unnamed - + kcfg_ChangeWinnerColor @@ -58,7 +58,7 @@ &Show winner by changing color - + kcfg_AcceleratorBlocked @@ -66,7 +66,7 @@ &Disable acceleration - + kcfg_OppositeDirCrashes @@ -76,7 +76,7 @@ - + groupBox2 @@ -87,17 +87,17 @@ unnamed - + kcfg_NamePlayer1 - + kcfg_NamePlayer2 - + textLabel1 @@ -105,7 +105,7 @@ Player 1: - + textLabel2 @@ -115,7 +115,7 @@ - + groupBox3 @@ -126,7 +126,7 @@ unnamed - + kcfg_Velocity @@ -152,15 +152,15 @@ 1 - + - layout1 + tqlayout1 unnamed - + textLabel4 @@ -168,25 +168,25 @@ Slow - + textLabel5 Default - + AlignCenter - + textLabel6 Fast - + AlignVCenter|AlignRight @@ -204,7 +204,7 @@ Expanding - + 20 21 @@ -215,5 +215,5 @@ - + diff --git a/ktron/ktron.cpp b/ktron/ktron.cpp index c9a5ea77..16628fd9 100644 --- a/ktron/ktron.cpp +++ b/ktron/ktron.cpp @@ -42,11 +42,11 @@ /** * Constuctor */ -KTron::KTron(TQWidget *parent, const char *name) : KMainWindow(parent, name) { +KTron::KTron(TQWidget *tqparent, const char *name) : KMainWindow(tqparent, name) { playerPoints[0]=playerPoints[1]=0; tron=new Tron(this, "Tron"); - connect(tron,TQT_SIGNAL(gameEnds(Player)),TQT_SLOT(changeStatus(Player))); + connect(tron,TQT_SIGNAL(gameEnds(Player)),TQT_SLOT(changetqStatus(Player))); setCentralWidget(tron); tron->setMinimumSize(200,180); @@ -81,10 +81,10 @@ KTron::KTron(TQWidget *parent, const char *name) : KMainWindow(parent, name) { tron->setActionCollection(actionCollection()); - KStdGameAction::pause(tron, TQT_SLOT(togglePause()), actionCollection()); - KStdGameAction::gameNew( tron, TQT_SLOT( newGame() ), actionCollection() ); - KStdGameAction::quit(this, TQT_SLOT( close() ), actionCollection()); - KStdAction::preferences(this, TQT_SLOT(showSettings()), actionCollection()); + KStdGameAction::pause(TQT_TQOBJECT(tron), TQT_SLOT(togglePause()), actionCollection()); + KStdGameAction::gameNew( TQT_TQOBJECT(tron), TQT_SLOT( newGame() ), actionCollection() ); + KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT( close() ), actionCollection()); + KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(showSettings()), actionCollection()); setupGUI( KMainWindow::Keys | StatusBar | Save | Create); loadSettings(); @@ -108,17 +108,17 @@ void KTron::updateStatusbar(){ TQString name; if(tron->isComputer(Both)) - name=i18n("Computer(%1)").arg(i+1); + name=i18n("Computer(%1)").tqarg(i+1); else if(tron->isComputer(player)) name=i18n("Computer"); else name=playerName[i]; - TQString string = TQString("%1: %2").arg(name).arg(playerPoints[i]); + TQString string = TQString("%1: %2").tqarg(name).tqarg(playerPoints[i]); statusBar()->changeItem(string,ID_STATUS_BASE+i+1); } } -void KTron::changeStatus(Player player) { +void KTron::changetqStatus(Player player) { // if player=Nobody, then new game if(player==Nobody){ playerPoints[0]=playerPoints[1]=0; @@ -158,12 +158,12 @@ void KTron::showWinner(Player winner){ if(!tron->isComputer(winner)) winnerName = playerName[winner]; - TQString message=i18n("%1 has won!").arg(winnerName); + TQString message=i18n("%1 has won!").tqarg(winnerName); statusBar()->message(message,MESSAGE_TIME); message = i18n("%1 has won versus %2 with %3 : %4 points!"); - message=message.arg(winnerName).arg(loserName); - message=message.arg(playerPoints[winner]).arg(playerPoints[loser]); + message=message.tqarg(winnerName).tqarg(loserName); + message=message.tqarg(playerPoints[winner]).tqarg(playerPoints[loser]); KMessageBox::information(this, message, i18n("Winner")); tron->newGame(); diff --git a/ktron/ktron.h b/ktron/ktron.h index c61bf42b..e4b9b218 100644 --- a/ktron/ktron.h +++ b/ktron/ktron.h @@ -39,9 +39,10 @@ class Tron; class KTron : public KMainWindow { Q_OBJECT + TQ_OBJECT public: - KTron(TQWidget *parent=0, const char *name=0); + KTron(TQWidget *tqparent=0, const char *name=0); private: KAccel *accel; @@ -57,7 +58,7 @@ protected: private slots: void loadSettings(); /** updates players points in statusbar and checks if someone has won */ - void changeStatus(Player); + void changetqStatus(Player); void showWinner(Player winner); void showSettings(); diff --git a/ktron/tron.cpp b/ktron/tron.cpp index 1c7bf72c..92a5d296 100644 --- a/ktron/tron.cpp +++ b/ktron/tron.cpp @@ -41,8 +41,8 @@ * init-functions **/ -Tron::Tron(TQWidget *parent,const char *name) - : TQWidget(parent,name) +Tron::Tron(TQWidget *tqparent,const char *name) + : TQWidget(tqparent,name) { pixmap=0; playfield=0; @@ -51,7 +51,7 @@ Tron::Tron(TQWidget *parent,const char *name) random.setSeed(0); - setFocusPolicy(TQWidget::StrongFocus); + setFocusPolicy(TQ_StrongFocus); setBackgroundMode(NoBackground); gameBlocked=false; @@ -81,7 +81,7 @@ void Tron::loadSettings(){ // Style if(pixmap){ updatePixmap(); - repaint(); + tqrepaint(); } // Backgroundimage @@ -96,7 +96,7 @@ void Tron::loadSettings(){ setBackgroundPix(pix); } else { TQString msg=i18n("Wasn't able to load wallpaper\n%1"); - msg=msg.arg(tmpFile); + msg=msg.tqarg(tmpFile); KMessageBox::sorry(this, msg); } KIO::NetAccess::removeTempFile(tmpFile); @@ -268,7 +268,7 @@ void Tron::showWinner(Player player) updatePixmap(); } - repaint(); + tqrepaint(); emit gameEnds(player); @@ -302,7 +302,7 @@ void Tron::updatePixmap() TQPainter p; p.begin(pixmap); - // alle Pixel prüfen und evt. zeichnen + // alle Pixel pr�fen und evt. zeichnen for(i=0;icolorGroup().midlight(); - TQColor dark=parentWidget()->colorGroup().mid(); + TQColor light=tqparentWidget()->tqcolorGroup().midlight(); + TQColor dark=tqparentWidget()->tqcolorGroup().mid(); p.setPen(NoPen); p.setBrush(light); @@ -810,18 +810,18 @@ void Tron::showBeginHint() if(players[0].score==0 && players[1].score==0) { beginHint=true; - repaint(); + tqrepaint(); } } } -// doMove() is called from QTimer +// doMove() is called from TQTimer void Tron::doMove() { int i; for(i=0;i<2;i++) { - // Überprüfen, ob Acceleratortaste gedrückt wurde... + // �berpr�fen, ob Acceleratortaste gedr�ckt wurde... if(players[i].accelerated) { updateDirections(i); diff --git a/ktron/tron.h b/ktron/tron.h index 188604d8..16e8722b 100644 --- a/ktron/tron.h +++ b/ktron/tron.h @@ -43,12 +43,13 @@ enum {BACKGROUND=0, PLAYER1=1,PLAYER2=2,TOP=4,BOTTOM=8,LEFT=16,RIGHT=32}; /** * @short The playingfield */ -class Tron : public QWidget +class Tron : public TQWidget { Q_OBJECT + TQ_OBJECT public: - Tron(TQWidget *parent=0, const char *name=0); + Tron(TQWidget *tqparent=0, const char *name=0); ~Tron(); void setActionCollection(KActionCollection*); void updatePixmap(); diff --git a/ktuberling/pics/layout.i18n b/ktuberling/pics/layout.i18n index 373203cb..85c63ed9 100644 --- a/ktuberling/pics/layout.i18n +++ b/ktuberling/pics/layout.i18n @@ -1,6 +1,6 @@ /* ------------------------------------------------------------- KDE Tuberling - List of strings in layout.xml that are translatable + List of strings in tqlayout.xml that are translatable mailto:e.bischoff@noos.fr ------------------------------------------------------------- */ diff --git a/ktuberling/pics/layout.xml b/ktuberling/pics/layout.xml index c5b02fb8..84b09a2a 100644 --- a/ktuberling/pics/layout.xml +++ b/ktuberling/pics/layout.xml @@ -5,13 +5,13 @@ Modify this file if you want to add new playgrounds, new sounds, or modify existing ones. If you do that, don't forget to update: - - layout.i18n (strings that might be translated) + - tqlayout.i18n (strings that might be translated) - ktuberlingui.rc (actions associated with menu items). --> - + @@ -269,7 +269,7 @@ - + @@ -422,7 +422,7 @@ - + diff --git a/ktuberling/playground.cpp b/ktuberling/playground.cpp index 4488fe8d..760ad9b8 100644 --- a/ktuberling/playground.cpp +++ b/ktuberling/playground.cpp @@ -24,10 +24,10 @@ #define YMARGIN 5 // Constructor -PlayGround::PlayGround(TopLevel *parent, const char *name, uint selectedGameboard) - : TQWidget(parent, name) +PlayGround::PlayGround(TopLevel *tqparent, const char *name, uint selectedGameboard) + : TQWidget(tqparent, name) { - topLevel = parent; + topLevel = tqparent; textsLayout = objectsLayout = 0; textsList = soundsList = 0; @@ -38,10 +38,10 @@ PlayGround::PlayGround(TopLevel *parent, const char *name, uint selectedGameboar setBackgroundColor(white); - TQDomDocument layoutsDocument; - bool ok = topLevel->loadLayout(layoutsDocument); - if (ok) ok = registerPlayGrounds(layoutsDocument); - if (ok) ok = loadPlayGround(layoutsDocument, selectedGameboard); + TQDomDocument tqlayoutsDocument; + bool ok = topLevel->loadLayout(tqlayoutsDocument); + if (ok) ok = registerPlayGrounds(tqlayoutsDocument); + if (ok) ok = loadPlayGround(tqlayoutsDocument, selectedGameboard); if (!ok) loadFailure(); currentAction = 0; @@ -71,9 +71,9 @@ void PlayGround::reset() // Change the gameboard void PlayGround::change(uint selectedGameboard) { - TQDomDocument layoutsDocument; - bool ok = topLevel->loadLayout(layoutsDocument); - if (ok) ok = loadPlayGround(layoutsDocument, selectedGameboard); + TQDomDocument tqlayoutsDocument; + bool ok = topLevel->loadLayout(tqlayoutsDocument); + if (ok) ok = loadPlayGround(tqlayoutsDocument, selectedGameboard); if (!ok) loadFailure(); toDraw.clear(); @@ -86,7 +86,7 @@ void PlayGround::change(uint selectedGameboard) } // Repaint all the editable area -void PlayGround::repaintAll() +void PlayGround::tqrepaintAll() { TQRect dirtyArea (editableArea.left() - 10, @@ -94,7 +94,7 @@ void PlayGround::repaintAll() editableArea.width() + 20, editableArea.height() + 20); - repaint(dirtyArea, false); + tqrepaint(dirtyArea, false); } // Undo last action @@ -221,7 +221,7 @@ void PlayGround::drawGameboard( TQPainter &artist, const TQRect &area ) const for (TQPtrListIterator currentObject(toDraw); currentObject.current(); ++currentObject) - currentObject.current()->draw(artist, area, objectsLayout, &gameboard, &masks); + currentObject.current()->draw(artist, area, objectsLayout, &gameboard, &tqmasks); } // Painting event @@ -241,7 +241,7 @@ void PlayGround::paintEvent( TQPaintEvent *event ) drawGameboard(artist, area); - bitBlt(this, destination, &cache, area, Qt::CopyROP); + bitBlt(this, destination, &cache, area, TQt::CopyROP); } // Mouse pressed event @@ -255,10 +255,10 @@ void PlayGround::mousePressEvent( TQMouseEvent *event ) int draggedNumber = draggedObject.getNumber(); TQPixmap object(objectsLayout[draggedNumber].size()); - TQBitmap shape(objectsLayout[draggedNumber].size()); - bitBlt(&object, TQPoint(0, 0), &gameboard, objectsLayout[draggedNumber], Qt::CopyROP); - bitBlt(&shape, TQPoint(0, 0), &masks, objectsLayout[draggedNumber], Qt::CopyROP); - object.setMask(shape); + TQBitmap tqshape(objectsLayout[draggedNumber].size()); + bitBlt(&object, TQPoint(0, 0), &gameboard, objectsLayout[draggedNumber], TQt::CopyROP); + bitBlt(&tqshape, TQPoint(0, 0), &tqmasks, objectsLayout[draggedNumber], TQt::CopyROP); + object.setMask(tqshape); draggedCursor = new TQCursor(object, position.x(), position.y()); setCursor(*draggedCursor); @@ -293,7 +293,7 @@ void PlayGround::mouseReleaseEvent( TQMouseEvent *event ) setCursor(arrow); // If we are not moving the object to the editable area - if (!dirtyArea.contains(event->pos())) + if (!dirtyArea.tqcontains(event->pos())) { // ... then register its deletion (if coming from the editable area), and return if (draggedZOrder == -1) return; @@ -320,18 +320,18 @@ void PlayGround::mouseReleaseEvent( TQMouseEvent *event ) // Repaint the editable area position.moveBy(XMARGIN, YMARGIN); - repaint(position, false); + tqrepaint(position, false); } // Register the various playgrounds -bool PlayGround::registerPlayGrounds(TQDomDocument &layoutDocument) +bool PlayGround::registerPlayGrounds(TQDomDocument &tqlayoutDocument) { TQDomNodeList playGroundsList, menuItemsList, labelsList; TQDomElement playGroundElement, menuItemElement, labelElement; TQDomAttr actionAttribute; - playGroundsList = layoutDocument.elementsByTagName("playground"); + playGroundsList = tqlayoutDocument.elementsByTagName("playground"); if (playGroundsList.count() < 1) return false; @@ -357,20 +357,20 @@ bool PlayGround::registerPlayGrounds(TQDomDocument &layoutDocument) return true; } -// Load background and draggable objects masks -bool PlayGround::loadPlayGround(TQDomDocument &layoutDocument, uint toLoad) +// Load background and draggable objects tqmasks +bool PlayGround::loadPlayGround(TQDomDocument &tqlayoutDocument, uint toLoad) { TQDomNodeList playGroundsList, editableAreasList, categoriesList, objectsList, - gameAreasList, maskAreasList, soundNamesList, labelsList; + gameAreasList, tqmaskAreasList, soundNamesList, labelsList; TQDomElement playGroundElement, editableAreaElement, categoryElement, objectElement, - gameAreaElement, maskAreaElement, soundNameElement, labelElement; - TQDomAttr gameboardAttribute, masksAttribute, + gameAreaElement, tqmaskAreaElement, soundNameElement, labelElement; + TQDomAttr gameboardAttribute, tqmasksAttribute, leftAttribute, topAttribute, rightAttribute, bottomAttribute, refAttribute; - playGroundsList = layoutDocument.elementsByTagName("playground"); + playGroundsList = tqlayoutDocument.elementsByTagName("playground"); if (toLoad >= playGroundsList.count()) return false; @@ -380,8 +380,8 @@ bool PlayGround::loadPlayGround(TQDomDocument &layoutDocument, uint toLoad) if (!gameboard.load(locate("data", "ktuberling/pics/" + gameboardAttribute.value()))) return false; - masksAttribute = playGroundElement.attributeNode("masks"); - if (!masks.load(locate("data", "ktuberling/pics/" + masksAttribute.value()))) + tqmasksAttribute = playGroundElement.attributeNode("tqmasks"); + if (!tqmasks.load(locate("data", "ktuberling/pics/" + tqmasksAttribute.value()))) return false; editableAreasList = playGroundElement.elementsByTagName("editablearea"); @@ -421,9 +421,9 @@ bool PlayGround::loadPlayGround(TQDomDocument &layoutDocument, uint toLoad) return false; delete[] textsLayout; - textsLayout = new QRect[texts]; + textsLayout = new TQRect[texts]; delete[] textsList; - textsList = new QString[texts]; + textsList = new TQString[texts]; for (int text = 0; text < texts; text++) { @@ -460,9 +460,9 @@ bool PlayGround::loadPlayGround(TQDomDocument &layoutDocument, uint toLoad) return false; delete[] objectsLayout; - objectsLayout = new QRect[decorations]; + objectsLayout = new TQRect[decorations]; delete[] soundsList; - soundsList = new QString[decorations]; + soundsList = new TQString[decorations]; for (int decoration = 0; decoration < decorations; decoration++) { @@ -506,7 +506,7 @@ void PlayGround::loadFailure() exit(-1); } -// Set up play ground's geometry +// Set up play ground's tqgeometry void PlayGround::setupGeometry() { int width = gameboard.width() + 2 * XMARGIN, @@ -524,7 +524,7 @@ bool PlayGround::zone(TQPoint &position) int draggedNumber; for (draggedNumber = 0; draggedNumber < decorations; - draggedNumber++) if (objectsLayout[draggedNumber].contains(position)) + draggedNumber++) if (objectsLayout[draggedNumber].tqcontains(position)) { position.setX(position.x() - objectsLayout[draggedNumber].x()); position.setY(position.y() - objectsLayout[draggedNumber].y()); @@ -541,21 +541,21 @@ bool PlayGround::zone(TQPoint &position) for (draggedZOrder = toDraw.count()-1; draggedZOrder >= 0; draggedZOrder--) { currentObject = toDraw.at(draggedZOrder); - if (!currentObject->getPosition().contains(position)) continue; + if (!currentObject->getPosition().tqcontains(position)) continue; TQRect toUpdate(currentObject->getPosition()); draggedObject = *currentObject; draggedNumber = draggedObject.getNumber(); - TQBitmap shape(objectsLayout[draggedNumber].size()); + TQBitmap tqshape(objectsLayout[draggedNumber].size()); TQPoint relative(position.x() - toUpdate.x(), position.y() - toUpdate.y()); - bitBlt(&shape, TQPoint(0, 0), &masks, objectsLayout[draggedNumber], Qt::CopyROP); - if (!shape.convertToImage().pixelIndex(relative.x(), relative.y())) continue; + bitBlt(&tqshape, TQPoint(0, 0), &tqmasks, objectsLayout[draggedNumber], TQt::CopyROP); + if (!tqshape.convertToImage().pixelIndex(relative.x(), relative.y())) continue; toDraw.remove(draggedZOrder); toUpdate.moveBy(XMARGIN, YMARGIN); - repaint(toUpdate, false); + tqrepaint(toUpdate, false); position = relative; @@ -563,7 +563,7 @@ bool PlayGround::zone(TQPoint &position) } // If we are on the gameboard itself, then play "tuberling" sound - if (editableArea.contains(position)) + if (editableArea.tqcontains(position)) topLevel->playSound(editableSound); return false; diff --git a/ktuberling/playground.h b/ktuberling/playground.h index bdb7e47f..146ffe2c 100644 --- a/ktuberling/playground.h +++ b/ktuberling/playground.h @@ -20,18 +20,19 @@ class TQDomDocument; class TopLevel; -class PlayGround : public QWidget +class PlayGround : public TQWidget { Q_OBJECT + TQ_OBJECT public: - PlayGround(TopLevel *parent, const char *name, uint selectedGameboard); + PlayGround(TopLevel *tqparent, const char *name, uint selectedGameboard); ~PlayGround(); void reset(); void change(uint selectedGameboard); - void repaintAll(); + void tqrepaintAll(); bool undo(); bool redo(); bool loadFrom(const TQString &name); @@ -50,8 +51,8 @@ protected: private: - bool registerPlayGrounds(TQDomDocument &layoutDocument); - bool loadPlayGround(TQDomDocument &layoutDocument, uint toLoad); + bool registerPlayGrounds(TQDomDocument &tqlayoutDocument); + bool loadPlayGround(TQDomDocument &tqlayoutDocument, uint toLoad); void loadFailure(); void setupGeometry(); bool zone(TQPoint &position); @@ -61,7 +62,7 @@ private: private: TQPixmap gameboard; // Picture of the game board - TQBitmap masks; // Pictures of the objects' shapes + TQBitmap tqmasks; // Pictures of the objects' tqshapes TQRect editableArea; // Part of the gameboard where the player can lay down objects TQString menuItem, // Menu item describing describing this gameboard editableSound; // Sound associated with this area @@ -72,7 +73,7 @@ private: TQString *textsList, // List of the message numbers associated with categories *soundsList; // List of sounds associated with each object - TQCursor *draggedCursor; // Cursor's shape for currently dragged object + TQCursor *draggedCursor; // Cursor's tqshape for currently dragged object ToDraw draggedObject; // Object currently dragged int draggedZOrder; // Z-order (in to-draw buffer) of this object diff --git a/ktuberling/soundfactory.cpp b/ktuberling/soundfactory.cpp index 9831adcd..5bb309d8 100644 --- a/ktuberling/soundfactory.cpp +++ b/ktuberling/soundfactory.cpp @@ -18,17 +18,17 @@ #include "toplevel.h" // Constructor -SoundFactory::SoundFactory(TopLevel *parent, const char *name, uint selectedLanguage) - : TQObject(parent, name) +SoundFactory::SoundFactory(TopLevel *tqparent, const char *name, uint selectedLanguage) + : TQObject(tqparent, name) { - topLevel = parent; + topLevel = tqparent; namesList = filesList = 0; - TQDomDocument layoutsDocument; - bool ok = topLevel->loadLayout(layoutsDocument); - if (ok) ok = registerLanguages(layoutsDocument); - if (ok) ok = loadLanguage(layoutsDocument, selectedLanguage); + TQDomDocument tqlayoutsDocument; + bool ok = topLevel->loadLayout(tqlayoutsDocument); + if (ok) ok = registerLanguages(tqlayoutsDocument); + if (ok) ok = loadLanguage(tqlayoutsDocument, selectedLanguage); if (!ok) loadFailure(); } @@ -42,9 +42,9 @@ SoundFactory::~SoundFactory() // Change the language void SoundFactory::change(uint selectedLanguage) { - TQDomDocument layoutsDocument; - bool ok = topLevel->loadLayout(layoutsDocument); - if (ok) ok = loadLanguage(layoutsDocument, selectedLanguage); + TQDomDocument tqlayoutsDocument; + bool ok = topLevel->loadLayout(tqlayoutsDocument); + if (ok) ok = loadLanguage(tqlayoutsDocument, selectedLanguage); if (!ok) loadFailure(); } @@ -74,14 +74,14 @@ void SoundFactory::loadFailure() } // Register the various languages -bool SoundFactory::registerLanguages(TQDomDocument &layoutDocument) +bool SoundFactory::registerLanguages(TQDomDocument &tqlayoutDocument) { TQDomNodeList languagesList, menuItemsList, labelsList; TQDomElement languageElement, menuItemElement, labelElement; TQDomAttr codeAttribute, actionAttribute; bool enabled; - languagesList = layoutDocument.elementsByTagName("language"); + languagesList = tqlayoutDocument.elementsByTagName("language"); if (languagesList.count() < 1) return false; @@ -110,7 +110,7 @@ bool SoundFactory::registerLanguages(TQDomDocument &layoutDocument) } // Load the sounds of one given language -bool SoundFactory::loadLanguage(TQDomDocument &layoutDocument, uint toLoad) +bool SoundFactory::loadLanguage(TQDomDocument &tqlayoutDocument, uint toLoad) { TQDomNodeList languagesList, soundNamesList; @@ -118,7 +118,7 @@ bool SoundFactory::loadLanguage(TQDomDocument &layoutDocument, uint toLoad) soundNameElement; TQDomAttr nameAttribute, fileAttribute; - languagesList = layoutDocument.elementsByTagName("language"); + languagesList = tqlayoutDocument.elementsByTagName("language"); if (toLoad >= languagesList.count()) return false; @@ -129,9 +129,9 @@ bool SoundFactory::loadLanguage(TQDomDocument &layoutDocument, uint toLoad) if (sounds < 1) return false; - if (!(namesList = new QString[sounds])) + if (!(namesList = new TQString[sounds])) return false; - if (!(filesList = new QString[sounds])) + if (!(filesList = new TQString[sounds])) return false; for (uint sound = 0; sound < sounds; sound++) diff --git a/ktuberling/soundfactory.h b/ktuberling/soundfactory.h index 6fcf9abb..6fe923bc 100644 --- a/ktuberling/soundfactory.h +++ b/ktuberling/soundfactory.h @@ -13,13 +13,14 @@ class TQDomDocument; class TopLevel; -class SoundFactory : public QObject +class SoundFactory : public TQObject { Q_OBJECT + TQ_OBJECT public: - SoundFactory(TopLevel *parent, const char *name, uint selectedLanguage); + SoundFactory(TopLevel *tqparent, const char *name, uint selectedLanguage); ~SoundFactory(); void change(uint selectedLanguage); @@ -27,8 +28,8 @@ public: protected: - bool registerLanguages(TQDomDocument &layoutDocument); - bool loadLanguage(TQDomDocument &layoutDocument, uint toLoad); + bool registerLanguages(TQDomDocument &tqlayoutDocument); + bool loadLanguage(TQDomDocument &tqlayoutDocument, uint toLoad); private: diff --git a/ktuberling/todraw.cpp b/ktuberling/todraw.cpp index c88328a7..c148b3a0 100644 --- a/ktuberling/todraw.cpp +++ b/ktuberling/todraw.cpp @@ -44,16 +44,16 @@ ToDraw &ToDraw::operator=(const ToDraw &model) // Draw an object previously laid down on the game board void ToDraw::draw(TQPainter &artist, const TQRect &area, const TQRect *objectsLayout, - const TQPixmap *gameboard, const TQBitmap *masks) const + const TQPixmap *gameboard, const TQBitmap *tqmasks) const { if (!position.intersects(area)) return; TQPixmap objectPixmap(objectsLayout[number].size()); - TQBitmap shapeBitmap(objectsLayout[number].size()); + TQBitmap tqshapeBitmap(objectsLayout[number].size()); - bitBlt(&objectPixmap, TQPoint(0, 0), gameboard, objectsLayout[number], Qt::CopyROP); - bitBlt(&shapeBitmap, TQPoint(0, 0), masks, objectsLayout[number], Qt::CopyROP); - objectPixmap.setMask(shapeBitmap); + bitBlt(&objectPixmap, TQPoint(0, 0), gameboard, objectsLayout[number], TQt::CopyROP); + bitBlt(&tqshapeBitmap, TQPoint(0, 0), tqmasks, objectsLayout[number], TQt::CopyROP); + objectPixmap.setMask(tqshapeBitmap); artist.drawPixmap(position.topLeft(), objectPixmap); } diff --git a/ktuberling/toplevel.cpp b/ktuberling/toplevel.cpp index 53566f17..c0822446 100644 --- a/ktuberling/toplevel.cpp +++ b/ktuberling/toplevel.cpp @@ -61,21 +61,21 @@ void TopLevel::registerGameboard(const TQString &menuItem, const char *actionId) switch (gameboards) { - case 0: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard0()), actionCollection(), actionId); + case 0: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard0()), actionCollection(), actionId); break; - case 1: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard1()), actionCollection(), actionId); + case 1: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard1()), actionCollection(), actionId); break; - case 2: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard2()), actionCollection(), actionId); + case 2: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard2()), actionCollection(), actionId); break; - case 3: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard3()), actionCollection(), actionId); + case 3: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard3()), actionCollection(), actionId); break; - case 4: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard4()), actionCollection(), actionId); + case 4: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard4()), actionCollection(), actionId); break; - case 5: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard5()), actionCollection(), actionId); + case 5: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard5()), actionCollection(), actionId); break; - case 6: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard6()), actionCollection(), actionId); + case 6: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard6()), actionCollection(), actionId); break; - case 7: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard7()), actionCollection(), actionId); + case 7: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard7()), actionCollection(), actionId); break; } @@ -93,37 +93,37 @@ void TopLevel::registerLanguage(const TQString &menuItem, const char *actionId, switch (languages) { - case 0: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language0()), actionCollection(), actionId); + case 0: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language0()), actionCollection(), actionId); break; - case 1: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language1()), actionCollection(), actionId); + case 1: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language1()), actionCollection(), actionId); break; - case 2: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language2()), actionCollection(), actionId); + case 2: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language2()), actionCollection(), actionId); break; - case 3: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language3()), actionCollection(), actionId); + case 3: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language3()), actionCollection(), actionId); break; - case 4: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language4()), actionCollection(), actionId); + case 4: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language4()), actionCollection(), actionId); break; - case 5: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language5()), actionCollection(), actionId); + case 5: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language5()), actionCollection(), actionId); break; - case 6: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language6()), actionCollection(), actionId); + case 6: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language6()), actionCollection(), actionId); break; - case 7: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language7()), actionCollection(), actionId); + case 7: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language7()), actionCollection(), actionId); break; - case 8: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language8()), actionCollection(), actionId); + case 8: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language8()), actionCollection(), actionId); break; - case 9: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language9()), actionCollection(), actionId); + case 9: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language9()), actionCollection(), actionId); break; - case 10: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language10()), actionCollection(), actionId); + case 10: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language10()), actionCollection(), actionId); break; - case 11: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language11()), actionCollection(), actionId); + case 11: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language11()), actionCollection(), actionId); break; - case 12: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language12()), actionCollection(), actionId); + case 12: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language12()), actionCollection(), actionId); break; - case 13: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language13()), actionCollection(), actionId); + case 13: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language13()), actionCollection(), actionId); break; - case 14: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language14()), actionCollection(), actionId); + case 14: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language14()), actionCollection(), actionId); break; - case 15: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language15()), actionCollection(), actionId); + case 15: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language15()), actionCollection(), actionId); break; } @@ -186,19 +186,19 @@ void TopLevel::changeLanguage(uint newLanguage) soundFactory->change(newLanguage); } -// Load the layouts file -bool TopLevel::loadLayout(TQDomDocument &layoutDocument) +// Load the tqlayouts file +bool TopLevel::loadLayout(TQDomDocument &tqlayoutDocument) { - TQFile layoutFile(TQFile::encodeName(locate("data", "ktuberling/pics/layout.xml"))); - if (!layoutFile.open(IO_ReadOnly)) + TQFile tqlayoutFile(TQFile::encodeName(locate("data", "ktuberling/pics/tqlayout.xml"))); + if (!tqlayoutFile.open(IO_ReadOnly)) return false; - if (!layoutDocument.setContent(&layoutFile)) + if (!tqlayoutDocument.setContent(&tqlayoutFile)) { - layoutFile.close(); + tqlayoutFile.close(); return false; } - layoutFile.close(); + tqlayoutFile.close(); return true; } @@ -219,7 +219,7 @@ void TopLevel::readOptions() config->setGroup("General"); option = config->readEntry("Sound", "on"); - soundEnabled = option.find("on") == 0; + soundEnabled = option.tqfind("on") == 0; option = config->readEntry("GameboardNumber", "0"); selectedGameboard = option.toInt(); @@ -254,22 +254,22 @@ void TopLevel::writeOptions() void TopLevel::setupKAction() { //Game - KStdGameAction::gameNew(this, TQT_SLOT(fileNew()), actionCollection()); - KStdGameAction::load(this, TQT_SLOT(fileOpen()), actionCollection()); - KStdGameAction::save(this, TQT_SLOT(fileSave()), actionCollection()); - KStdGameAction::print(this, TQT_SLOT(filePrint()), actionCollection()); - KStdGameAction::quit(kapp, TQT_SLOT(quit()), actionCollection()); - (void) new KAction(i18n("Save &as Picture..."), 0, this, TQT_SLOT(filePicture()), actionCollection(), "game_save_picture"); + KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(fileNew()), actionCollection()); + KStdGameAction::load(TQT_TQOBJECT(this), TQT_SLOT(fileOpen()), actionCollection()); + KStdGameAction::save(TQT_TQOBJECT(this), TQT_SLOT(fileSave()), actionCollection()); + KStdGameAction::print(TQT_TQOBJECT(this), TQT_SLOT(filePrint()), actionCollection()); + KStdGameAction::quit(TQT_TQOBJECT(kapp), TQT_SLOT(quit()), actionCollection()); + (void) new KAction(i18n("Save &as Picture..."), 0, TQT_TQOBJECT(this), TQT_SLOT(filePicture()), actionCollection(), "game_save_picture"); //Edit - KStdAction::copy(this, TQT_SLOT(editCopy()), actionCollection()); - KStdAction::undo(this, TQT_SLOT(editUndo()), actionCollection()); - KStdAction::redo(this, TQT_SLOT(editRedo()), actionCollection()); + KStdAction::copy(TQT_TQOBJECT(this), TQT_SLOT(editCopy()), actionCollection()); + KStdAction::undo(TQT_TQOBJECT(this), TQT_SLOT(editUndo()), actionCollection()); + KStdAction::redo(TQT_TQOBJECT(this), TQT_SLOT(editRedo()), actionCollection()); enableUndo(false); enableRedo(false); //Speech - KToggleAction* t = new KToggleAction(i18n("&No Sound"), 0, this, TQT_SLOT(soundOff()), actionCollection(), "speech_no_sound"); + KToggleAction* t = new KToggleAction(i18n("&No Sound"), 0, TQT_TQOBJECT(this), TQT_SLOT(soundOff()), actionCollection(), "speech_no_sound"); if (!soundEnabled) t->setChecked(true); setupGUI(); @@ -283,14 +283,14 @@ void TopLevel::fileNew() enableUndo(false); enableRedo(false); - playGround->repaintAll(); + playGround->tqrepaintAll(); } // Load gameboard void TopLevel::fileOpen() { TQString dir = locate("data", "ktuberling/museum/miss.tuberling"); - dir.truncate(dir.findRev('/') + 1); + dir.truncate(dir.tqfindRev('/') + 1); KURL url = KFileDialog::getOpenURL(dir, "*.tuberling"); @@ -314,7 +314,7 @@ void TopLevel::open(const KURL &url) enableUndo(!playGround->isFirstAction()); enableRedo(false); - playGround->repaintAll(); + playGround->tqrepaintAll(); KIO::NetAccess::removeTempFile( name ); } @@ -323,7 +323,7 @@ void TopLevel::open(const KURL &url) void TopLevel::fileSave() { KURL url = KFileDialog::getSaveURL - ( TQString::null, + ( TQString(), "*.tuberling"); if (url.isEmpty()) @@ -340,7 +340,7 @@ void TopLevel::fileSave() TQString name = url.path(); int suffix; - suffix = name.findRev('.'); + suffix = name.tqfindRev('.'); if (suffix == -1) { name += ".tuberling"; @@ -356,7 +356,7 @@ void TopLevel::filePicture() TQPixmap picture(playGround->getPicture()); KURL url = KFileDialog::getSaveURL - ( TQString::null, + ( TQString(), i18n( "*.xpm|UNIX Pixmaps (*.xpm)\n" "*.jpg|JPEG Compressed Files (*.jpg)\n" "*.png|Next Generation Pictures (*.png)\n" @@ -379,7 +379,7 @@ void TopLevel::filePicture() int suffix; TQString end; - suffix = name.findRev('.'); + suffix = name.tqfindRev('.'); if (suffix == -1) { name += ".xpm"; @@ -408,9 +408,9 @@ void TopLevel::filePrint() KPrinter printer; bool ok; - ok = printer.setup(this, i18n("Print %1").arg(actionCollection()->action(gameboardActions[selectedGameboard].latin1())->plainText())); + ok = printer.setup(this, i18n("Print %1").tqarg(actionCollection()->action(gameboardActions[selectedGameboard].latin1())->plainText())); if (!ok) return; - playGround->repaint(true); + playGround->tqrepaint(true); if (!playGround->printPicture(printer)) KMessageBox::error(this, i18n("Could not print picture.")); @@ -422,7 +422,7 @@ void TopLevel::filePrint() // Copy modified area to clipboard void TopLevel::editCopy() { - QClipboard *clipboard = TQApplication::clipboard(); + TQClipboard *clipboard = TQApplication::tqclipboard(); TQPixmap picture(playGround->getPicture()); clipboard->setPixmap(picture); @@ -438,7 +438,7 @@ void TopLevel::editUndo() if (playGround->isFirstAction()) enableUndo(false); enableRedo(true); - playGround->repaintAll(); + playGround->tqrepaintAll(); } // Redo last action @@ -451,7 +451,7 @@ void TopLevel::editRedo() if (playGround->isLastAction()) enableRedo(false); enableUndo(true); - playGround->repaintAll(); + playGround->tqrepaintAll(); } // Switch to gameboard #0 diff --git a/ktuberling/toplevel.h b/ktuberling/toplevel.h index 26993202..04ceaa96 100644 --- a/ktuberling/toplevel.h +++ b/ktuberling/toplevel.h @@ -18,6 +18,7 @@ class SoundFactory; class TopLevel : public KMainWindow { Q_OBJECT + TQ_OBJECT public: @@ -31,7 +32,7 @@ public: void registerLanguage(const TQString &menuItem, const char *actionId, bool enabled); void changeGameboard(uint newGameboard); void changeLanguage(uint newLanguage); - bool loadLayout(TQDomDocument &layoutDocument); + bool loadLayout(TQDomDocument &tqlayoutDocument); void playSound(const TQString &ref) const; inline bool isSoundEnabled() const {return soundEnabled;} diff --git a/kwin4/index.html b/kwin4/index.html index ea969510..13d28255 100644 --- a/kwin4/index.html +++ b/kwin4/index.html @@ -1,6 +1,6 @@ - + Four wins manual diff --git a/kwin4/install-sh b/kwin4/install-sh index 67c94290..a3789027 100755 --- a/kwin4/install-sh +++ b/kwin4/install-sh @@ -113,7 +113,7 @@ else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. +# if $src (and thus $dsttmp) tqcontains '*'. if [ -f "$src" -o -d "$src" ] then diff --git a/kwin4/kwin4/kspritecache.cpp b/kwin4/kwin4/kspritecache.cpp index d8ab3b9b..342369c9 100644 --- a/kwin4/kwin4/kspritecache.cpp +++ b/kwin4/kwin4/kspritecache.cpp @@ -27,8 +27,8 @@ // KSprite #include -KSpriteCache::KSpriteCache(TQString grafixdir, TQObject* parent,const char * name) - : TQObject(parent,name) +KSpriteCache::KSpriteCache(TQString grafixdir, TQObject* tqparent,const char * name) + : TQObject(tqparent,name) { kdDebug(11002) << "KSpriteCache:: grafixdir=" << grafixdir << endl; mConfig=0; @@ -90,7 +90,7 @@ void KSpriteCache::deleteAllItems() void KSpriteCache::deleteItem(TQString s,int no) { TQCanvasItem *item; - TQString name=s+TQString("_%1").arg(no); + TQString name=s+TQString("_%1").tqarg(no); //kdDebug(11002) << "KSpriteCache::deleteItem name=" << name << endl; item=mItemDict[name]; if (item) @@ -122,7 +122,7 @@ void KSpriteCache::deleteItem(TQCanvasItem *item) TQCanvasItem *KSpriteCache::getItem(TQString name,int no) { - TQString dictname=name+TQString("_%1").arg(no); + TQString dictname=name+TQString("_%1").tqarg(no); TQCanvasItem *item=mItemDict[dictname]; //kdDebug(11002) << " -> getItem("<"<load(dir+file); } - if (result1 && !mask.isNull()) + if (result1 && !tqmask.isNull()) { - TQBitmap bitmask; - if (mask==TQString("auto")) // self mask..slow but quick to create + TQBitmap bittqmask; + if (tqmask==TQString("auto")) // self tqmask..slow but quick to create { newP->setMask( newP->createHeuristicMask() ); result2=true; } else { - result2=bitmask.load(dir+mask); - if (result2) newP->setMask(bitmask); + result2=bittqmask.load(dir+tqmask); + if (result2) newP->setMask(bittqmask); } } - //kdDebug(11002) << "KSpriteCache::loadPixmap: file="<readPathEntry(name+"file"); - TQString maskfile=config->readPathEntry(name+"mask"); + TQString tqmaskfile=config->readPathEntry(name+"tqmask"); // Load a given set of images or replace a %d by a sequence if there are // less image names than number given @@ -230,12 +230,12 @@ TQCanvasPixmapArray *KSpriteCache::createPixmapArray(KConfig *config,TQString na // Read images for (unsigned int i=0;i1) step=(100.0-finalscale)/100.0/(double)(number-1); else step=1.0; - //kdDebug(11002) << " Scaling " << number << " pics axis="<hasKey(anim)) { //kdDebug(11002) << "Found animation key " << anim << endl; diff --git a/kwin4/kwin4/kspritecache.h b/kwin4/kwin4/kspritecache.h index 9d762a13..94cb83d9 100644 --- a/kwin4/kwin4/kspritecache.h +++ b/kwin4/kwin4/kspritecache.h @@ -30,13 +30,14 @@ class KSprite; * You do not need this directly. * TODO: Can be part of the KSprite class **/ - class KSpriteNotify : public QObject + class KSpriteNotify : public TQObject { Q_OBJECT + TQ_OBJECT public: KSpriteNotify() :TQObject(0,0) {mRefCnt=0;} - void emitSignal(TQCanvasItem *parent,int mode) {emit signalNotify(parent,mode);} + void emitSignal(TQCanvasItem *tqparent,int mode) {emit signalNotify(tqparent,mode);} void incRefCnt() {mRefCnt++;} void decRefCnt() {mRefCnt--;} int refCnt() {return mRefCnt;} @@ -66,11 +67,11 @@ class KSprite; * @author Martin Heni * */ -class KSprite : public QCanvasSprite +class KSprite : public TQCanvasSprite { public: /** - * Contructs a KSprite object. It is anlogous to the @ref QCanvasSprite + * Contructs a KSprite object. It is anlogous to the @ref TQCanvasSprite * constructor * * @param array - the frames of the sprite @@ -146,7 +147,7 @@ class KSprite : public QCanvasSprite /** * Creates a notification object. You can connect to it and it will emit - * the signal signalNotify(TQCanvasItem *parent, intmode) when a move or + * the signal signalNotify(TQCanvasItem *tqparent, intmode) when a move or * animation is finished. * Example: *
    @@ -243,17 +244,17 @@ class KSprite : public QCanvasSprite
      * 
      * Example:
      * 
    - * # Sprite with three frames and a common mask for them
    + * # Sprite with three frames and a common tqmask for them
      * # z position given but x,y set manually in the program
      *  [arrow]
      *  file=arrow%d.png
    - *  mask=arrow_mask.png
    + *  tqmask=arrow_tqmask.png
      *  number=3
      *  offset=19,5
      *  rtti=32
      *  z=9.0
      *
    - * # Simple sprite which is already positioned correcly. No mask just one file
    + * # Simple sprite which is already positioned correcly. No tqmask just one file
      *  [board]
      *  file=board.png
      *  rtti=32
    @@ -266,7 +267,7 @@ class KSprite : public QCanvasSprite
      *  [star]
      *  anim0=0,4,2,8
      *  file=star%d.png
    - *  mask=star%d_mask.png
    + *  tqmask=star%d_tqmask.png
      *  number=5
      *  offset=19,20
      *  rtti=32
    @@ -281,9 +282,10 @@ class KSprite : public QCanvasSprite
      * @author Martin Heni 
      *
      */
    -class KSpriteCache : public QObject
    +class KSpriteCache : public TQObject
     {
       Q_OBJECT
    +  TQ_OBJECT
     
       public:
       /**
    @@ -291,7 +293,7 @@ class KSpriteCache : public QObject
       * 
       * @param grafixdir - the directory where the configuration file and the graphics reside
       **/
    -  KSpriteCache(TQString grafixdir, TQObject* parent=0,const char * name=0);
    +  KSpriteCache(TQString grafixdir, TQObject* tqparent=0,const char * name=0);
     
       /**
       * Delete the sprite cache
    @@ -357,7 +359,7 @@ class KSpriteCache : public QObject
       * 
       * @param name - the name of the sprite resp. the secion in the rc file
       * @param no - the unique number of the sprite 
    -  * @return sprite - returns the sprite pointer as @ref QCanvasItem
    +  * @return sprite - returns the sprite pointer as @ref TQCanvasItem
       *
       * @todo support call without number argument as single sprite's
       * @todo support loading of frame sequence via one big pixmap
    @@ -367,10 +369,10 @@ class KSpriteCache : public QObject
     
       /**
       * This function loads a pixmap from the given file. Optional you can also
    -  * provide a mask file. Also optinal you can provide the directory. Default
    +  * provide a tqmask file. Also optinal you can provide the directory. Default
       * is the directory which is set with this @ref KSpriteCache
       **/
    -  TQPixmap * loadPixmap(TQString file,TQString mask=TQString::null,TQString dir=TQString::null);
    +  TQPixmap * loadPixmap(TQString file,TQString tqmask=TQString(),TQString dir=TQString());
     
       /** 
       * Deletes a item form the sprite cache given as a pointer to it
    @@ -389,7 +391,7 @@ class KSpriteCache : public QObject
     
       protected:
       /**
    -  * Loads the default properties for all QCanvasItems from the given config
    +  * Loads the default properties for all TQCanvasItems from the given config
       * file. This is at the moment
       * 
       * x=(double)
    @@ -400,7 +402,7 @@ class KSpriteCache : public QObject
       void configureCanvasItem(KConfig *config,TQCanvasItem *item);
       
       /**
    -  * Copies the default properties for all QCanvasItems from another sprite.
    +  * Copies the default properties for all TQCanvasItems from another sprite.
       * Same as above.
       **/
       void configureCanvasItem(TQCanvasItem *original,TQCanvasItem *item);
    @@ -436,7 +438,7 @@ class KSpriteCache : public QObject
       *   number=(int)      : how many frames to generate
       *   file=(Qstring)    : the filename to load (can contain printf format args
       *                       as %d which are replaced, e.g. file=hello_%d.png
    -  *   mask=(TQString)    : Same for the mask of the pixmaps
    +  *   tqmask=(TQString)    : Same for the tqmask of the pixmaps
       *   axis=(int)        : (scale only): scale axis (1=x,2=y,3=x+y)
       *   final=(double)    : final scale in percent (default 0.0, i.e. complete scaling)
       *   colorfilter=1,h,s,v: make a HSV transform of all sprite images
    diff --git a/kwin4/kwin4/kwin4.cpp b/kwin4/kwin4/kwin4.cpp
    index 16b37da5..84056254 100644
    --- a/kwin4/kwin4/kwin4.cpp
    +++ b/kwin4/kwin4/kwin4.cpp
    @@ -63,8 +63,8 @@
      * Constructor for the chat widget. This widget
      * is derived from the libkdegames chat widget
      */
    -ChatDlg::ChatDlg(KGame *game,TQWidget *parent)
    -    : KDialogBase(Plain,i18n("Chat Dlg"),Ok,Ok,parent,0,false,true),mChat(0), mChatDlg(0)
    +ChatDlg::ChatDlg(KGame *game,TQWidget *tqparent)
    +    : KDialogBase(Plain,i18n("Chat Dlg"),Ok,Ok,tqparent,0,false,true),mChat(0), mChatDlg(0)
     {
      setMinimumSize(TQSize(200,200));
     
    @@ -107,7 +107,7 @@ void ChatDlg::setPlayer(Kwin4Player *p)
     /**
      * Construct the main application window 
      */
    -Kwin4App::Kwin4App(TQWidget *parent, const char *name) : KMainWindow(parent,name), view(0), doc(0), mChat(0), mMyChatDlg(0)
    +Kwin4App::Kwin4App(TQWidget *tqparent, const char *name) : KMainWindow(tqparent,name), view(0), doc(0), mChat(0), mMyChatDlg(0)
     {
       initGUI();
       initStatusBar();
    @@ -138,7 +138,7 @@ Kwin4App::Kwin4App(TQWidget *parent, const char *name) : KMainWindow(parent,name
     void Kwin4App::checkMenus(CheckFlags menu)
     {
       bool localgame=(!doc->isNetwork());
    -  bool isRunning = (doc->gameStatus()==KGame::Run);
    +  bool isRunning = (doc->gametqStatus()==KGame::Run);
       if (!menu || (menu&CheckFileMenu))
       {
         changeAction("hint", !(!isRunning && localgame));
    @@ -188,50 +188,50 @@ void Kwin4App::checkMenus(CheckFlags menu)
      */
     void Kwin4App::initGUI()
     {
    -  KStdGameAction::gameNew(this, TQT_SLOT(newGame()), actionCollection(), "new_game");
    +  KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(newGame()), actionCollection(), "new_game");
       ACTION("new_game")->setStatusText(i18n("Start a new game"));
     
    -  KStdGameAction::load(this, TQT_SLOT(slotOpenGame()), actionCollection(), "open");
    +  KStdGameAction::load(TQT_TQOBJECT(this), TQT_SLOT(slotOpenGame()), actionCollection(), "open");
       ACTION("open")->setStatusText(i18n("Open a saved game..."));
     
    -  KStdGameAction::save(this, TQT_SLOT(slotSaveGame()), actionCollection(), "save");
    +  KStdGameAction::save(TQT_TQOBJECT(this), TQT_SLOT(slotSaveGame()), actionCollection(), "save");
       ACTION("save")->setStatusText(i18n("Save a game..."));
     
    -  KStdGameAction::end(this, TQT_SLOT(endGame()), actionCollection(), "end_game");
    +  KStdGameAction::end(TQT_TQOBJECT(this), TQT_SLOT(endGame()), actionCollection(), "end_game");
       ACTION("end_game")->setStatusText(i18n("Ending the current game..."));
       ACTION("end_game")->setWhatsThis(i18n("Aborts a currently played game. No winner will be declared."));
     
    -  new KAction(i18n("&Network Configuration..."),0, this, TQT_SLOT(slotInitNetwork()),
    +  new KAction(i18n("&Network Configuration..."),0, TQT_TQOBJECT(this), TQT_SLOT(slotInitNetwork()),
                            actionCollection(), "network_conf");
     
    -  new KAction(i18n("Network Chat..."),0, this, TQT_SLOT(slotChat()),
    +  new KAction(i18n("Network Chat..."),0, TQT_TQOBJECT(this), TQT_SLOT(slotChat()),
                            actionCollection(), "network_chat");
     
       if (global_debug>0)                     
    -    new KAction(i18n("Debug KGame"), 0, this, TQT_SLOT(slotDebugKGame()),
    +    new KAction(i18n("Debug KGame"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotDebugKGame()),
                             actionCollection(), "file_debug");
     
    -  new KAction(i18n("&Show Statistics"),"flag", 0, this,
    +  new KAction(i18n("&Show Statistics"),"flag", 0, TQT_TQOBJECT(this),
                TQT_SLOT(showStatistics()), actionCollection(), "statistics");
       ACTION("statistics")->setStatusText(i18n("Show statistics."));
     
    -  KStdGameAction::hint(doc, TQT_SLOT(calcHint()), actionCollection(), "hint");
    +  KStdGameAction::hint(TQT_TQOBJECT(doc), TQT_SLOT(calcHint()), actionCollection(), "hint");
       ACTION("hint")->setStatusText(i18n("Shows a hint on how to move."));
     
    -  KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection(), "game_exit");
    +  KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection(), "game_exit");
       ACTION("game_exit")->setStatusText(i18n("Quits the program."));
     
    -  KStdGameAction::undo(this, TQT_SLOT(slotUndo()), actionCollection(), "edit_undo");
    +  KStdGameAction::undo(TQT_TQOBJECT(this), TQT_SLOT(slotUndo()), actionCollection(), "edit_undo");
       ACTION("edit_undo")->setStatusText(i18n("Undo last move."));
     
    -  KStdGameAction::redo(this, TQT_SLOT(slotRedo()), actionCollection(), "edit_redo");
    +  KStdGameAction::redo(TQT_TQOBJECT(this), TQT_SLOT(slotRedo()), actionCollection(), "edit_redo");
       ACTION("edit_redo")->setStatusText(i18n("Redo last move."));
       
       actionCollection()->setHighlightingEnabled(true);
       connect(actionCollection(), TQT_SIGNAL(actionStatusText(const TQString &)), TQT_SLOT(slotStatusMsg(const TQString &)));
       connect(actionCollection(), TQT_SIGNAL(clearStatusText()), TQT_SLOT(slotClearStatusText()));
     
    -  KStdAction::preferences(this, TQT_SLOT(showSettings()), actionCollection());
    +  KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(showSettings()), actionCollection());
     }
     
     /**
    @@ -338,11 +338,11 @@ void Kwin4App::slotSaveGame()
     void Kwin4App::newGame()
     {
       // End the intro if it is running
    -  doc->setGameStatus(Kwin4Doc::End);
    +  doc->setGametqStatus(Kwin4Doc::End);
       // Init the board and Clear the old game out
    -  doc->setGameStatus(Kwin4Doc::Init);
    +  doc->setGametqStatus(Kwin4Doc::Init);
       // Run it
    -  doc->setGameStatus(Kwin4Doc::Run);
    +  doc->setGametqStatus(Kwin4Doc::Run);
     }
     
     /**
    @@ -360,7 +360,7 @@ void Kwin4App::slotNewGame()
      */
     void Kwin4App::endGame()
     {
    -  doc->setGameStatus(Kwin4Doc::Abort);
    +  doc->setGametqStatus(Kwin4Doc::Abort);
     }
     
     /** 
    @@ -453,7 +453,7 @@ void Kwin4App::EndGame(TABLE mode)
      */
     void Kwin4App::slotStatusNames(){
       TQString msg;
    -  if (!(doc->gameStatus()==KGame::Run))
    +  if (!(doc->gametqStatus()==KGame::Run))
         msg=i18n("No game  ");
       else if (doc->QueryCurrentPlayer()==Gelb)
         msg=TQString(" ")+doc->QueryName(Gelb)+ i18n(" - Yellow ");
    @@ -480,7 +480,7 @@ void Kwin4App::slotNetworkBroken(int /*id*/, int oldstatus ,KGame * /*game */)
       doc->getPlayer(doc->QueryCurrentPlayer())->setTurn(true,true);
     
       KMessageBox::information(this,i18n("The network game ended!\n"));
    -  doc->setGameStatus(oldstatus);
    +  doc->setGametqStatus(oldstatus);
     }
     
     /**
    @@ -509,7 +509,7 @@ void Kwin4App::slotGameOver(int status, KPlayer * p, KGame * /*me*/)
           EndGame(TWin);
         else
           EndGame(TLost);
    -    TQString msg=i18n("%1 won the game. Please restart next round.").arg(doc->QueryName(((FARBE)p->userId())));
    +    TQString msg=i18n("%1 won the game. Please restart next round.").tqarg(doc->QueryName(((FARBE)p->userId())));
         slotStatusMsg(msg);
       }
       else if (status==2) // Abort
    @@ -527,7 +527,7 @@ void Kwin4App::slotGameOver(int status, KPlayer * p, KGame * /*me*/)
     
     void Kwin4App::slotInitNetwork()
     {
    -  if (doc->gameStatus()==Kwin4Doc::Intro) doc->setGameStatus(Kwin4Doc::Pause);
    +  if (doc->gametqStatus()==Kwin4Doc::Intro) doc->setGametqStatus(Kwin4Doc::Pause);
     
       TQString host = Prefs::host();
       int port=Prefs::port();
    @@ -539,11 +539,11 @@ void Kwin4App::slotInitNetwork()
       dlg.networkConfig()->setDiscoveryInfo("_kwin4._tcp",Prefs::gamename());
     
       TQVBox *box=dlg.configPage(KGameDialog::NetworkConfig);
    -  TQVBoxLayout *l=(TQVBoxLayout *)(box->layout());
    +  TQVBoxLayout *l=(TQVBoxLayout *)(box->tqlayout());
     
       mColorGroup=new TQVButtonGroup(box);
    -  connect(mColorGroup, TQT_SIGNAL(clicked(int)), this, TQT_SLOT(slotRemoteChanged(int)));
    -  connect(dlg.networkConfig(), TQT_SIGNAL(signalServerTypeChanged(int)), this, TQT_SLOT(slotServerTypeChanged(int)));
    +  connect(mColorGroup, TQT_SIGNAL(clicked(int)), TQT_TQOBJECT(this), TQT_SLOT(slotRemoteChanged(int)));
    +  connect(dlg.networkConfig(), TQT_SIGNAL(signalServerTypeChanged(int)), TQT_TQOBJECT(this), TQT_SLOT(slotServerTypeChanged(int)));
     
       new TQRadioButton(i18n("Yellow should be played by remote"), mColorGroup);
       new TQRadioButton(i18n("Red should be played by remote"), mColorGroup);
    diff --git a/kwin4/kwin4/kwin4.h b/kwin4/kwin4/kwin4.h
    index a2de5052..e3ab0ebc 100644
    --- a/kwin4/kwin4/kwin4.h
    +++ b/kwin4/kwin4/kwin4.h
    @@ -38,8 +38,9 @@ class KPlayer;
     class KDE_EXPORT ChatDlg : public KDialogBase
     {
       Q_OBJECT
    +  TQ_OBJECT
     public:
    -  ChatDlg(KGame *game,TQWidget* parent=0);
    +  ChatDlg(KGame *game,TQWidget* tqparent=0);
     
     public slots:  
       void setPlayer(Kwin4Player *p);
    @@ -56,9 +57,10 @@ class Kwin4App : public KMainWindow
     {
     
     Q_OBJECT
    +  TQ_OBJECT
     
     public:
    -  Kwin4App(TQWidget *parent=0, const char *name=0);
    +  Kwin4App(TQWidget *tqparent=0, const char *name=0);
     
     protected:
       void EndGame(TABLE mode);
    diff --git a/kwin4/kwin4/kwin4doc.cpp b/kwin4/kwin4/kwin4doc.cpp
    index cfc99c63..73ea8520 100644
    --- a/kwin4/kwin4/kwin4doc.cpp
    +++ b/kwin4/kwin4/kwin4doc.cpp
    @@ -17,7 +17,7 @@
     
     #include "kwin4doc.h"
     
    -// include files for Qt
    +// include files for TQt
     #include 
     #include 
     
    @@ -36,16 +36,16 @@
     #include "prefs.h"
     #include "statuswidget.h"
     
    -Kwin4Doc::Kwin4Doc(TQWidget *parent, const char *) : KGame(1234,parent), pView(0), mHintProcess(0)
    +Kwin4Doc::Kwin4Doc(TQWidget *tqparent, const char *) : KGame(1234,TQT_TQOBJECT(tqparent)), pView(0), mHintProcess(0)
     {
       connect(this,TQT_SIGNAL(signalPropertyChanged(KGamePropertyBase *,KGame *)),
               this,TQT_SLOT(slotPropertyChanged(KGamePropertyBase *,KGame *)));
     
       dataHandler()->Debug();
    -  //kdDebug(12010) << "Property 7 policy=" << dataHandler()->find(7)->policy() << endl; 
    +  //kdDebug(12010) << "Property 7 policy=" << dataHandler()->tqfind(7)->policy() << endl; 
       setPolicy(KGame::PolicyDirty,true);
     
    -  //kdDebug(12010) << "Property 7 policy=" << dataHandler()->find(7)->policy() << endl; 
    +  //kdDebug(12010) << "Property 7 policy=" << dataHandler()->tqfind(7)->policy() << endl; 
     
       // Game design
       setMaxPlayers(2);
    @@ -90,13 +90,13 @@ Kwin4Doc::Kwin4Doc(TQWidget *parent, const char *) : KGame(1234,parent), pView(0
       // last in init
       ResetGame(false);
       
    -  setGameStatus(Intro);
    +  setGametqStatus(Intro);
     
       // Listen to network
    -  connect(this,TQT_SIGNAL(signalMessageUpdate(int,Q_UINT32,Q_UINT32)),
    -         this,TQT_SLOT(slotMessageUpdate(int, Q_UINT32,Q_UINT32)));
    -  connect(this,TQT_SIGNAL(signalClientJoinedGame(Q_UINT32,KGame *)),
    -         this,TQT_SLOT(slotClientConnected(Q_UINT32, KGame *)));
    +  connect(this,TQT_SIGNAL(signalMessageUpdate(int,TQ_UINT32,TQ_UINT32)),
    +         this,TQT_SLOT(slotMessageUpdate(int, TQ_UINT32,TQ_UINT32)));
    +  connect(this,TQT_SIGNAL(signalClientJoinedGame(TQ_UINT32,KGame *)),
    +         this,TQT_SLOT(slotClientConnected(TQ_UINT32, KGame *)));
     
       // Debug only
       connect(this,TQT_SIGNAL(signalGameOver(int, KPlayer *,KGame *)),
    @@ -203,7 +203,7 @@ void Kwin4Doc::preparePlayerTurn()
      */
     void Kwin4Doc::EndGame(TABLE mode)
     {
    -  setGameStatus(End);
    +  setGametqStatus(End);
       pView->clearError();
       pView->EndGame();
       Kwin4Player *yellow=getPlayer(Gelb);
    @@ -799,7 +799,7 @@ TQString Kwin4Doc::QueryProcessName()
       return empty;
     }
     
    -void Kwin4Doc::slotMessageUpdate(int /*id*/,Q_UINT32 /*sender*/,Q_UINT32 /*recv*/)
    +void Kwin4Doc::slotMessageUpdate(int /*id*/,TQ_UINT32 /*sender*/,TQ_UINT32 /*recv*/)
     {
     //  kdDebug(12010) << "MSG: id=" << id << " sender=" << sender << " receiver="<1) kdDebug(12010) << "Creating KEYBOARD IO " << endl;
         // We want the player to work over keyboard
         KGameKeyIO  *input;
    -    input=new KGameKeyIO(pView->parentWidget());
    +    input=new KGameKeyIO(pView->tqparentWidget());
         // Connect keys input to a function to process the actual input
         connect((KGameKeyIO *)input,TQT_SIGNAL(signalKeyEvent(KGameIO *,TQDataStream &,TQKeyEvent *,bool *)),
                 pView,TQT_SLOT(slotKeyInput(KGameIO *,TQDataStream &,TQKeyEvent *,bool *)));
    @@ -954,7 +954,7 @@ void Kwin4Doc::slotPrepareTurn(TQDataStream &stream,bool b,KGameIO *input,bool *
       if (!player->myTurn()) return ;
       if (!b) return ; // only on setTurn(true)
     
    -  Q_INT32 pl;
    +  TQ_INT32 pl;
       if (global_debug>1) kdDebug(12010) << "slotPrepareComputerTurn for player id= " << player->id() << endl;
       pl=player->userId();
     
    @@ -968,23 +968,23 @@ void Kwin4Doc::slotPrepareTurn(TQDataStream &stream,bool b,KGameIO *input,bool *
      * Careful: The data needs to be the same than the computer
      * player reading on the other side
      **/
    -void Kwin4Doc::prepareGameMessage(TQDataStream &stream, Q_INT32 pl)
    +void Kwin4Doc::prepareGameMessage(TQDataStream &stream, TQ_INT32 pl)
     {
       if (global_debug>1) kdDebug(12010) << "          sending col=" << pl << endl;
       stream << pl ;
       // This needs to be the same than the computer player reads!
    -  stream << (Q_INT32)QueryCurrentMove();
    -  stream << (Q_INT32)QueryCurrentPlayer();
    -  stream << (Q_INT32)QueryPlayerColour(0);
    -  stream << (Q_INT32)QueryPlayerColour(1);
    -  stream << (Q_INT32)Prefs::level();
    +  stream << (TQ_INT32)QueryCurrentMove();
    +  stream << (TQ_INT32)QueryCurrentPlayer();
    +  stream << (TQ_INT32)QueryPlayerColour(0);
    +  stream << (TQ_INT32)QueryPlayerColour(1);
    +  stream << (TQ_INT32)Prefs::level();
     
       int i,j;
       for (i=0;i> cid;
       switch(cid)
       {
    @@ -1025,7 +1025,7 @@ void Kwin4Doc::slotProcessQuery(TQDataStream &in,KGameProcessIO * /*me*/)
      * cid is the id of the client connected. if this is equal
      * gameId() WE are the client
      */
    -void Kwin4Doc::slotClientConnected(Q_UINT32 cid,KGame *)
    +void Kwin4Doc::slotClientConnected(TQ_UINT32 cid,KGame *)
     {
       if (global_debug>1) kdDebug(12010) << " void Kwin4Doc::slotClientConnected id="<> cid;
       switch(cid)
       {
         case 2:  // Hint
         {
    -      Q_INT32 pl;
    -      Q_INT32 move;
    +      TQ_INT32 pl;
    +      TQ_INT32 move;
           long value;
           in >>  pl >> move  >> value;
           if (global_debug>1) kdDebug(12010) << "#### Computer thinks pl=" << pl << " move =" << move << endl;
    @@ -1181,20 +1181,20 @@ void Kwin4Doc::slotPropertyChanged(KGamePropertyBase *prop,KGame *)
          if (global_debug>1) kdDebug(12010) << "Amzug changed to " << mAmzug.value()<scoreWidget()->setTurn(mAmzug);
        }
    -   else if (prop->id()==KGamePropertyBase::IdGameStatus)
    +   else if (prop->id()==KGamePropertyBase::IdGametqStatus)
        {
    -     if (gameStatus()==Abort)
    +     if (gametqStatus()==Abort)
          {
            if (global_debug>1) kdDebug(12010) << "PropertyChanged::status signal game abort +++" << endl;
            emit signalGameOver(2,getPlayer(QueryCurrentPlayer()),0); // 2 indicates Abort
          }
    -     else if (gameStatus()==Run)
    +     else if (gametqStatus()==Run)
          {
            if (global_debug>1) kdDebug(12010) << "PropertyChanged::status signal game run +++" << endl;
            preparePlayerTurn(); // Set the current player to play
            emit signalGameRun();
          }
    -     else if (gameStatus()==Init)
    +     else if (gametqStatus()==Init)
          {
            if (global_debug>1) kdDebug(12010) << "PropertyChanged::status signal game INIT +++" << endl;
            ResetGame(true);
    @@ -1227,7 +1227,7 @@ bool Kwin4Doc::loadgame(TQDataStream &stream,bool network,bool reset)
     {
       if (global_debug>1)
         kdDebug () << "loadgame() network=" << network << " reset="<< reset << endl;
    -  if (!network) setGameStatus(End);
    +  if (!network) setGametqStatus(End);
     
       // Clear out the old game 
       if (global_debug>1) kdDebug(12010)<<"loadgame wants to reset the game"<> pl ;
       in >> tmp;
       aktzug=tmp;
    @@ -120,13 +120,13 @@ long KComputer::think(TQDataStream &in,TQDataStream &out,bool hint)
     
       InitField();
     
    -  // Field as 42 Q_INT8's
    +  // Field as 42 TQ_INT8's
       int i,j;
       for (i=0;i<=SIZE_Y;i++)
       {
         for (j=0;j<=SIZE_X;j++)
         {
    -      Q_INT8 col;
    +      TQ_INT8 col;
           in >> col;
           Farbe colour;
           if (col<2) colour=(Farbe)(col+1);
    @@ -183,9 +183,9 @@ void KComputer::slotCommand(TQDataStream &in,int msgid,int receiver,int sender)
       {
         case 2:  // hint
         {
    -      Q_INT8 cid=2;
    -      Q_INT32 pl=0;
    -      Q_INT32 move=3;
    +      TQ_INT8 cid=2;
    +      TQ_INT32 pl=0;
    +      TQ_INT32 move=3;
           out << cid;
           long value=think(in,out,true);
           out << value;
    diff --git a/kwin4/kwin4/kwin4proc.h b/kwin4/kwin4/kwin4proc.h
    index d18f5bf3..0efea7bf 100644
    --- a/kwin4/kwin4/kwin4proc.h
    +++ b/kwin4/kwin4/kwin4proc.h
    @@ -28,10 +28,11 @@ typedef char FARBE;
     #define SIZE_X 6
     #define SIZE_Y 5
     
    -class KComputer : public QObject
    +class KComputer : public TQObject
     {
     
     Q_OBJECT
    +  TQ_OBJECT
     
     public:
       KComputer();
    diff --git a/kwin4/kwin4/kwin4view.cpp b/kwin4/kwin4/kwin4view.cpp
    index 1a3e11f9..6877860b 100644
    --- a/kwin4/kwin4/kwin4view.cpp
    +++ b/kwin4/kwin4/kwin4view.cpp
    @@ -101,8 +101,8 @@ private:
     
     };
     
    -Kwin4View::Kwin4View(Kwin4Doc *theDoc, TQWidget *parent, const char *name)
    -        : TQCanvasView(0,parent, name), doc(theDoc)
    +Kwin4View::Kwin4View(Kwin4Doc *theDoc, TQWidget *tqparent, const char *name)
    +        : TQCanvasView(0,tqparent, name), doc(theDoc)
     {
       mLastArrow=-1;
     
    @@ -129,13 +129,13 @@ Kwin4View::Kwin4View(Kwin4Doc *theDoc, TQWidget *parent, const char *name)
       //setBackgroundMode(PaletteBase);
       setBackgroundColor(TQColor(0,0,128));
     
    -  mCanvas=new TQCanvas(parent);
    -  mCanvas->resize(parent->width(),parent->height()); 
    +  mCanvas=new TQCanvas(TQT_TQOBJECT(tqparent));
    +  mCanvas->resize(tqparent->width(),tqparent->height()); 
       mCanvas->setDoubleBuffering(true);
       mCanvas->setBackgroundColor(TQColor(0,0,128));
       setCanvas(mCanvas);
     
    -  mCache=new KSpriteCache(mGrafix,this);
    +  mCache=new KSpriteCache(mGrafix,TQT_TQOBJECT(this));
       mCache->setCanvas(mCanvas);
       KConfig *config=mCache->config();
     
    @@ -200,12 +200,12 @@ void Kwin4View::initView(bool deleteall)
     
       TQPixmap *pixmap=loadPixmap("background.png");
       if (pixmap)
    -    mCanvas->setBackgroundPixmap(*pixmap);
    +    mCanvas->tqsetBackgroundPixmap(*pixmap);
       else
         mCanvas->setBackgroundColor(TQColor(0,0,128));
       delete pixmap;
     
    -  if (doc->gameStatus()==KGame::Intro)
    +  if (doc->gametqStatus()==KGame::Intro)
       {
         mScoreWidget->hide();
         mStatusWidget->hide();
    @@ -481,7 +481,7 @@ void Kwin4View::setSprite(int no, int x, int col, bool enable)
     {
       KSprite *sprite;
       sprite=(KSprite *)(mCache->getItem("piece",no));
    -  if (sprite) sprite->setVisible(enable);
    +  if (sprite) sprite->tqsetVisible(enable);
       setArrow(x,col);
     }
     
    @@ -497,7 +497,7 @@ void Kwin4View::setHint(int x,int y,bool enabled)
           sprite->move(x*(sprite->width()+mSpreadX)+mBoardX,
                        y*(sprite->height()+mSpreadY)+mBoardY);
         }
    -    sprite->setVisible(enabled);
    +    sprite->tqsetVisible(enabled);
       }
     }
     
    @@ -601,7 +601,7 @@ bool Kwin4View::wrongPlayer(KPlayer *player,KGameIO::IOMode io)
       clearError();
       int rnd=(kapp->random()%4) +1;
       TQString m;
    -  m=TQString("text%1").arg(rnd);
    +  m=TQString("text%1").tqarg(rnd);
       TQString ms;
       if (rnd==1)      ms=i18n("Hold on... the other player has not been yet..."); 
       else if (rnd==2) ms=i18n("Hold your horses..."); 
    @@ -650,7 +650,7 @@ void Kwin4View::slotKeyInput(KGameIO *input,TQDataStream &stream,TQKeyEvent *e,b
       }
     
       // Create a move
    -  Q_INT32 move,pl;
    +  TQ_INT32 move,pl;
       move=code-'1';
       pl=player->userId();
       stream << pl << move;
    @@ -680,7 +680,7 @@ void Kwin4View::slotMouseInput(KGameIO *input,TQDataStream &stream,TQMouseEvent
         return;
       }
     
    -  if (mouse->button()!=LeftButton) return ;
    +  if (mouse->button()!=Qt::LeftButton) return ;
       //if (!doc->IsRunning()) return ;
     
       TQPoint point;
    @@ -696,7 +696,7 @@ void Kwin4View::slotMouseInput(KGameIO *input,TQDataStream &stream,TQMouseEvent
       if (x<0 || x>=FIELD_SIZE_X) return;
     
       // Create a move
    -  Q_INT32 move,pl;
    +  TQ_INT32 move,pl;
       move=x;
       pl=player->userId();
       stream << pl << move;
    diff --git a/kwin4/kwin4/kwin4view.h b/kwin4/kwin4/kwin4view.h
    index 775aee1c..30bcfce6 100644
    --- a/kwin4/kwin4/kwin4view.h
    +++ b/kwin4/kwin4/kwin4view.h
    @@ -29,12 +29,13 @@ class KSpriteCache;
     /**
      * The Kwin4View class provides the view widget for the Kwin4App instance.
      */
    -class Kwin4View : public QCanvasView
    +class Kwin4View : public TQCanvasView
     {
     Q_OBJECT
    +  TQ_OBJECT
     
     public:
    -  Kwin4View(Kwin4Doc *theDoc, TQWidget *parent = 0, const char *name=0);
    +  Kwin4View(Kwin4Doc *theDoc, TQWidget *tqparent = 0, const char *name=0);
     
       void initView(bool deleteall=true);
       void drawBoard(bool remove=false);
    diff --git a/kwin4/kwin4/scorewidget.cpp b/kwin4/kwin4/scorewidget.cpp
    index 2d2551e8..ad53f49e 100644
    --- a/kwin4/kwin4/scorewidget.cpp
    +++ b/kwin4/kwin4/scorewidget.cpp
    @@ -31,8 +31,8 @@
     #define COL_STATUSDARK   TQColor(0,0,65)
     #define COL_STATUSLIGHT  TQColor(210,210,255)
     
    -ScoreWidget::ScoreWidget( TQWidget* parent,  const char* name, WFlags fl )
    -    : TQFrame( parent, name, fl )
    +ScoreWidget::ScoreWidget( TQWidget* tqparent,  const char* name, WFlags fl )
    +    : TQFrame( tqparent, name, fl )
     {
       setFrameStyle( TQFrame::Box | TQFrame::Raised );
       setLineWidth( 2 );
    @@ -52,14 +52,14 @@ ScoreWidget::ScoreWidget( TQWidget* parent,  const char* name, WFlags fl )
         TextLabel7 = new TQLabel( this, "TextLabel7" );
         setPlayer("-----",0);
         TextLabel7->setBackgroundColor( COL_STATUSFIELD );
    -    TextLabel7->setAlignment(Qt::AlignHCenter);
    +    TextLabel7->tqsetAlignment(TQt::AlignHCenter);
         LayoutB->addMultiCellWidget( TextLabel7, row, row,0,2 );
         row++;
         
         TextLabel8 = new TQLabel( this, "TextLabel8" );
         TextLabel8->setText( i18n( "vs" ) );
         TextLabel8->setBackgroundColor( COL_STATUSFIELD );
    -    TextLabel8->setAlignment(Qt::AlignHCenter);
    +    TextLabel8->tqsetAlignment(TQt::AlignHCenter);
         LayoutB->addMultiCellWidget( TextLabel8, row, row,0,2 );
         row++;
         
    @@ -68,7 +68,7 @@ ScoreWidget::ScoreWidget( TQWidget* parent,  const char* name, WFlags fl )
       //  TextLabel9->setFrameShape(TQFrame::Box );
       //  TextLabel9->setLineWidth(5);
         TextLabel9->setBackgroundColor( COL_STATUSFIELD );
    -    TextLabel9->setAlignment(Qt::AlignHCenter);
    +    TextLabel9->tqsetAlignment(TQt::AlignHCenter);
         LayoutB->addMultiCellWidget( TextLabel9, row, row,0,2 );
         row++;
     
    @@ -86,7 +86,7 @@ ScoreWidget::ScoreWidget( TQWidget* parent,  const char* name, WFlags fl )
     
         TextLabel4 = new TQLabel( this, "L" );
         setLevel(Prefs::level());
    -    TextLabel4->setAlignment(Qt::AlignRight);
    +    TextLabel4->tqsetAlignment(TQt::AlignRight);
         TextLabel4->setBackgroundColor( COL_STATUSFIELD );
         LayoutB->addWidget( TextLabel4, row, 2 );
     
    @@ -100,7 +100,7 @@ ScoreWidget::ScoreWidget( TQWidget* parent,  const char* name, WFlags fl )
     
         TextLabel5 = new TQLabel( this, "M" );
         setMove(0);
    -    TextLabel5->setAlignment(Qt::AlignRight);
    +    TextLabel5->tqsetAlignment(TQt::AlignRight);
         TextLabel5->setBackgroundColor( COL_STATUSFIELD );
         LayoutB->addWidget( TextLabel5, row, 2 );
     
    @@ -114,7 +114,7 @@ ScoreWidget::ScoreWidget( TQWidget* parent,  const char* name, WFlags fl )
     
         TextLabel6 = new TQLabel( this, "C" );
         setChance(0);
    -    TextLabel6->setAlignment(Qt::AlignRight);
    +    TextLabel6->tqsetAlignment(TQt::AlignRight);
         TextLabel6->setBackgroundColor( COL_STATUSFIELD );
         LayoutB->addWidget( TextLabel6, row, 2 );
     
    @@ -148,12 +148,12 @@ void ScoreWidget::Paint(TQPainter *p,TQRect /*cliprect*/)
     
     void ScoreWidget::setMove(int i)
     {
    -  TextLabel5->setText( TQString("%1").arg(i));
    +  TextLabel5->setText( TQString("%1").tqarg(i));
     }
     
     void ScoreWidget::setLevel(int i)
     {
    -  TextLabel4->setText( TQString("%1").arg(i));
    +  TextLabel4->setText( TQString("%1").tqarg(i));
     }
     
     void ScoreWidget::setChance(int i)
    @@ -165,7 +165,7 @@ void ScoreWidget::setChance(int i)
       else if (i<=-999) 
         TextLabel6->setText(i18n("Loser"));
       else
    -    TextLabel6->setText(TQString("%1").arg(i));
    +    TextLabel6->setText(TQString("%1").tqarg(i));
     }
     
     void ScoreWidget::setPlayer(TQString s,int no)
    diff --git a/kwin4/kwin4/scorewidget.h b/kwin4/kwin4/scorewidget.h
    index c6e525cd..d6476061 100644
    --- a/kwin4/kwin4/scorewidget.h
    +++ b/kwin4/kwin4/scorewidget.h
    @@ -8,12 +8,13 @@ class TQGridLayout;
     class TQGroupBox;
     class TQLabel;
     
    -class ScoreWidget : public QFrame
    +class ScoreWidget : public TQFrame
     { 
         Q_OBJECT
    +  TQ_OBJECT
     
     public:
    -    ScoreWidget( TQWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
    +    ScoreWidget( TQWidget* tqparent = 0, const char* name = 0, WFlags fl = 0 );
         void setMove(int i);
         void setLevel(int i);
         void setChance(int i);
    diff --git a/kwin4/kwin4/settings.ui b/kwin4/kwin4/settings.ui
    index 130ce4ee..6ebd18f3 100644
    --- a/kwin4/kwin4/settings.ui
    +++ b/kwin4/kwin4/settings.ui
    @@ -1,10 +1,10 @@
     
     Settings
    -
    +
         
             Settings
         
    -    
    +    
             
                 0
                 0
    @@ -16,7 +16,7 @@
             
                 unnamed
             
    -        
    +        
                 
                     groupBox2
                 
    @@ -27,7 +27,7 @@
                     
                         unnamed
                     
    -                
    +                
                         
                             textLabel3
                         
    @@ -35,7 +35,7 @@
                             Player 1:
                         
                     
    -                
    +                
                         
                             textLabel4
                         
    @@ -43,19 +43,19 @@
                             Player 2:
                         
                     
    -                
    +                
                         
                             kcfg_Name1
                         
                     
    -                
    +                
                         
                             kcfg_Name2
                         
                     
                 
             
    -        
    +        
                 
                     groupBox1
                 
    @@ -66,7 +66,7 @@
                     
                         unnamed
                     
    -                
    +                
                         
                             textLabel1
                         
    @@ -74,18 +74,18 @@
                             Easy
                         
                     
    -                
    +                
                         
                             textLabel2
                         
                         
                             Hard
                         
    -                    
    +                    
                             AlignVCenter|AlignRight
                         
                     
    -                
    +                
                         
                             kcfg_level
                         
    @@ -113,7 +113,7 @@
                     
                 
             
    -        
    +        
                 
                     kcfg_Colour1
                 
    @@ -124,7 +124,7 @@
                     
                         unnamed
                     
    -                
    +                
                         
                             radioButton1
                         
    @@ -135,7 +135,7 @@
                             true
                         
                     
    -                
    +                
                         
                             radioButton2
                         
    @@ -145,7 +145,7 @@
                     
                 
             
    -        
    +        
                 
                     kcfg_Input2
                 
    @@ -156,7 +156,7 @@
                     
                         unnamed
                     
    -                
    +                
                         
                             radioButton6
                         
    @@ -167,7 +167,7 @@
                             true
                         
                     
    -                
    +                
                         
                             radioButton7
                         
    @@ -175,7 +175,7 @@
                             Computer
                         
                     
    -                
    +                
                         
                             radioButton8
                         
    @@ -185,7 +185,7 @@
                     
                 
             
    -        
    +        
                 
                     kcfg_Input1
                 
    @@ -196,7 +196,7 @@
                     
                         unnamed
                     
    -                
    +                
                         
                             radioButton3
                         
    @@ -207,7 +207,7 @@
                             true
                         
                     
    -                
    +                
                         
                             radioButton4
                         
    @@ -215,7 +215,7 @@
                             Computer
                         
                     
    -                
    +                
                         
                             radioButton5
                         
    @@ -235,7 +235,7 @@
                 
                     Expanding
                 
    -            
    +            
                     
                         20
                         20
    @@ -244,5 +244,5 @@
             
         
     
    -
    +
     
    diff --git a/kwin4/kwin4/statistics.ui b/kwin4/kwin4/statistics.ui
    index d6d39c07..6014820c 100644
    --- a/kwin4/kwin4/statistics.ui
    +++ b/kwin4/kwin4/statistics.ui
    @@ -1,10 +1,10 @@
     
     Statistics
    -
    +
         
             Statistics
         
    -    
    +    
             
                 0
                 0
    @@ -43,19 +43,19 @@
                 
                     Expanding
                 
    -            
    +            
                     
                         20
                         16
                     
                 
             
    -        
    +        
                 
                     p2_lost
                 
             
    -        
    +        
                 
                     p1_name
                 
    @@ -63,85 +63,85 @@
                     Player 1
                 
             
    -        
    +        
                 
                     Name
                 
                 
                     Name
                 
    -            
    +            
                     AlignCenter
                 
             
    -        
    +        
                 
                     won
                 
                 
                     Won
                 
    -            
    +            
                     AlignCenter
                 
             
    -        
    +        
                 
                     p2_drawn
                 
             
    -        
    +        
                 
                     lost
                 
                 
                     Lost
                 
    -            
    +            
                     AlignCenter
                 
             
    -        
    +        
                 
                     p2_aborted
                 
             
    -        
    +        
                 
                     p2_sum
                 
             
    -        
    +        
                 
                     sum
                 
                 
                     Sum
                 
    -            
    +            
                     AlignCenter
                 
             
    -        
    +        
                 
                     aborted
                 
                 
                     Aborted
                 
    -            
    +            
                     AlignCenter
                 
             
    -        
    +        
                 
    -                layout1
    +                tqlayout1
                 
                 
                     
                         unnamed
                     
    -                
    +                
                         
                             pushButton1
                         
    @@ -159,14 +159,14 @@
                         
                             Expanding
                         
    -                    
    +                    
                             
                                 51
                                 20
                             
                         
                     
    -                
    +                
                         
                             pushButton2
                         
    @@ -176,12 +176,12 @@
                     
                 
             
    -        
    +        
                 
                     p1_won
                 
             
    -        
    +        
                 
                     p2_name
                 
    @@ -189,38 +189,38 @@
                     Player 2
                 
             
    -        
    +        
                 
                     p2_won
                 
             
    -        
    +        
                 
                     drawn
                 
                 
                     Drawn
                 
    -            
    +            
                     AlignCenter
                 
             
    -        
    +        
                 
                     p1_drawn
                 
             
    -        
    +        
                 
                     p1_lost
                 
             
    -        
    +        
                 
                     p1_aborted
                 
             
    -        
    +        
                 
                     p1_sum
                 
    @@ -245,5 +245,5 @@
         pushButton2
         pushButton1
     
    -
    +
     
    diff --git a/kwin4/kwin4/statuswidget.ui b/kwin4/kwin4/statuswidget.ui
    index 0c9613b5..5dc2a4be 100644
    --- a/kwin4/kwin4/statuswidget.ui
    +++ b/kwin4/kwin4/statuswidget.ui
    @@ -1,10 +1,10 @@
     
     StatusWidget
    -
    +
         
             StatusWidget
         
    -    
    +    
             
                 0
                 0
    @@ -38,7 +38,7 @@
                 
                     Expanding
                 
    -            
    +            
                     
                         20
                         41
    @@ -55,69 +55,69 @@
                 
                     Expanding
                 
    -            
    +            
                     
                         90
                         20
                     
                 
             
    -        
    +        
                 
                     wins
                 
                 
                     W
                 
    -            
    +            
                     AlignCenter
                 
             
    -        
    +        
                 
                     draws
                 
                 
                     D
                 
    -            
    +            
                     AlignCenter
                 
             
    -        
    +        
                 
                     loses
                 
                 
                     L
                 
    -            
    +            
                     AlignCenter
                 
             
    -        
    +        
                 
                     num
                 
                 
                     No
                 
    -            
    +            
                     AlignCenter
                 
             
    -        
    +        
                 
                     bk
                 
                 
                     Bk
                 
    -            
    +            
                     AlignCenter
                 
             
    -        
    +        
                 
                     p1_name
                 
    @@ -125,7 +125,7 @@
                     Player 1
                 
             
    -        
    +        
                 
                     p1_w
                 
    @@ -136,7 +136,7 @@
                     2
                 
             
    -        
    +        
                 
                     p1_d
                 
    @@ -147,7 +147,7 @@
                     2
                 
             
    -        
    +        
                 
                     p1_l
                 
    @@ -158,7 +158,7 @@
                     2
                 
             
    -        
    +        
                 
                     p1_n
                 
    @@ -169,7 +169,7 @@
                     2
                 
             
    -        
    +        
                 
                     p1_b
                 
    @@ -180,7 +180,7 @@
                     2
                 
             
    -        
    +        
                 
                     p2_d
                 
    @@ -191,7 +191,7 @@
                     2
                 
             
    -        
    +        
                 
                     p2_b
                 
    @@ -202,7 +202,7 @@
                     2
                 
             
    -        
    +        
                 
                     p2_l
                 
    @@ -213,7 +213,7 @@
                     2
                 
             
    -        
    +        
                 
                     p2_n
                 
    @@ -224,7 +224,7 @@
                     2
                 
             
    -        
    +        
                 
                     p2_w
                 
    @@ -235,7 +235,7 @@
                     2
                 
             
    -        
    +        
                 
                     p2_name
                 
    @@ -259,5 +259,5 @@
             
         
     
    -
    +
     
    diff --git a/libkdegames/carddecks/convertpysols b/libkdegames/carddecks/convertpysols
    index 5ed10b25..f2434475 100755
    --- a/libkdegames/carddecks/convertpysols
    +++ b/libkdegames/carddecks/convertpysols
    @@ -2,68 +2,68 @@
     
     cd $1
     
    -convert -format png -geometry "72x96" 01c.gif 1.png
    -convert -format png -geometry "72x96" 01s.gif 2.png
    -convert -format png -geometry "72x96" 01h.gif 3.png
    -convert -format png -geometry "72x96" 01d.gif 4.png
    +convert -format png -tqgeometry "72x96" 01c.gif 1.png
    +convert -format png -tqgeometry "72x96" 01s.gif 2.png
    +convert -format png -tqgeometry "72x96" 01h.gif 3.png
    +convert -format png -tqgeometry "72x96" 01d.gif 4.png
     
    -convert -format png -geometry "72x96" 13c.gif 5.png
    -convert -format png -geometry "72x96" 13s.gif 6.png
    -convert -format png -geometry "72x96" 13h.gif 7.png
    -convert -format png -geometry "72x96" 13d.gif 8.png
    +convert -format png -tqgeometry "72x96" 13c.gif 5.png
    +convert -format png -tqgeometry "72x96" 13s.gif 6.png
    +convert -format png -tqgeometry "72x96" 13h.gif 7.png
    +convert -format png -tqgeometry "72x96" 13d.gif 8.png
     
    -convert -format png -geometry "72x96" 12c.gif 9.png
    -convert -format png -geometry "72x96" 12s.gif 10.png
    -convert -format png -geometry "72x96" 12h.gif 11.png
    -convert -format png -geometry "72x96" 12d.gif 12.png
    +convert -format png -tqgeometry "72x96" 12c.gif 9.png
    +convert -format png -tqgeometry "72x96" 12s.gif 10.png
    +convert -format png -tqgeometry "72x96" 12h.gif 11.png
    +convert -format png -tqgeometry "72x96" 12d.gif 12.png
     
    -convert -format png -geometry "72x96" 11c.gif 13.png
    -convert -format png -geometry "72x96" 11s.gif 14.png
    -convert -format png -geometry "72x96" 11h.gif 15.png
    -convert -format png -geometry "72x96" 11d.gif 16.png
    +convert -format png -tqgeometry "72x96" 11c.gif 13.png
    +convert -format png -tqgeometry "72x96" 11s.gif 14.png
    +convert -format png -tqgeometry "72x96" 11h.gif 15.png
    +convert -format png -tqgeometry "72x96" 11d.gif 16.png
     
    -convert -format png -geometry "72x96" 10c.gif 17.png
    -convert -format png -geometry "72x96" 10s.gif 18.png
    -convert -format png -geometry "72x96" 10h.gif 19.png
    -convert -format png -geometry "72x96" 10d.gif 20.png
    +convert -format png -tqgeometry "72x96" 10c.gif 17.png
    +convert -format png -tqgeometry "72x96" 10s.gif 18.png
    +convert -format png -tqgeometry "72x96" 10h.gif 19.png
    +convert -format png -tqgeometry "72x96" 10d.gif 20.png
     
    -convert -format png -geometry "72x96" 09c.gif 21.png
    -convert -format png -geometry "72x96" 09s.gif 22.png
    -convert -format png -geometry "72x96" 09h.gif 23.png
    -convert -format png -geometry "72x96" 09d.gif 24.png
    +convert -format png -tqgeometry "72x96" 09c.gif 21.png
    +convert -format png -tqgeometry "72x96" 09s.gif 22.png
    +convert -format png -tqgeometry "72x96" 09h.gif 23.png
    +convert -format png -tqgeometry "72x96" 09d.gif 24.png
     
    -convert -format png -geometry "72x96" 08c.gif 25.png
    -convert -format png -geometry "72x96" 08s.gif 26.png
    -convert -format png -geometry "72x96" 08h.gif 27.png
    -convert -format png -geometry "72x96" 08d.gif 28.png
    +convert -format png -tqgeometry "72x96" 08c.gif 25.png
    +convert -format png -tqgeometry "72x96" 08s.gif 26.png
    +convert -format png -tqgeometry "72x96" 08h.gif 27.png
    +convert -format png -tqgeometry "72x96" 08d.gif 28.png
     
    -convert -format png -geometry "72x96" 07c.gif 29.png
    -convert -format png -geometry "72x96" 07s.gif 30.png
    -convert -format png -geometry "72x96" 07h.gif 31.png
    -convert -format png -geometry "72x96" 07d.gif 32.png
    +convert -format png -tqgeometry "72x96" 07c.gif 29.png
    +convert -format png -tqgeometry "72x96" 07s.gif 30.png
    +convert -format png -tqgeometry "72x96" 07h.gif 31.png
    +convert -format png -tqgeometry "72x96" 07d.gif 32.png
     
    -convert -format png -geometry "72x96" 06c.gif 33.png
    -convert -format png -geometry "72x96" 06s.gif 34.png
    -convert -format png -geometry "72x96" 06h.gif 35.png
    -convert -format png -geometry "72x96" 06d.gif 36.png
    +convert -format png -tqgeometry "72x96" 06c.gif 33.png
    +convert -format png -tqgeometry "72x96" 06s.gif 34.png
    +convert -format png -tqgeometry "72x96" 06h.gif 35.png
    +convert -format png -tqgeometry "72x96" 06d.gif 36.png
     
    -convert -format png -geometry "72x96" 05c.gif 37.png
    -convert -format png -geometry "72x96" 05s.gif 38.png
    -convert -format png -geometry "72x96" 05h.gif 39.png
    -convert -format png -geometry "72x96" 05d.gif 40.png
    +convert -format png -tqgeometry "72x96" 05c.gif 37.png
    +convert -format png -tqgeometry "72x96" 05s.gif 38.png
    +convert -format png -tqgeometry "72x96" 05h.gif 39.png
    +convert -format png -tqgeometry "72x96" 05d.gif 40.png
     
    -convert -format png -geometry "72x96" 04c.gif 41.png
    -convert -format png -geometry "72x96" 04s.gif 42.png
    -convert -format png -geometry "72x96" 04h.gif 43.png
    -convert -format png -geometry "72x96" 04d.gif 44.png
    +convert -format png -tqgeometry "72x96" 04c.gif 41.png
    +convert -format png -tqgeometry "72x96" 04s.gif 42.png
    +convert -format png -tqgeometry "72x96" 04h.gif 43.png
    +convert -format png -tqgeometry "72x96" 04d.gif 44.png
     
    -convert -format png -geometry "72x96" 03c.gif 45.png
    -convert -format png -geometry "72x96" 03s.gif 46.png
    -convert -format png -geometry "72x96" 03h.gif 47.png
    -convert -format png -geometry "72x96" 03d.gif 48.png
    +convert -format png -tqgeometry "72x96" 03c.gif 45.png
    +convert -format png -tqgeometry "72x96" 03s.gif 46.png
    +convert -format png -tqgeometry "72x96" 03h.gif 47.png
    +convert -format png -tqgeometry "72x96" 03d.gif 48.png
     
    -convert -format png -geometry "72x96" 02c.gif 49.png
    -convert -format png -geometry "72x96" 02s.gif 50.png
    -convert -format png -geometry "72x96" 02h.gif 51.png
    -convert -format png -geometry "72x96" 02d.gif 52.png
    +convert -format png -tqgeometry "72x96" 02c.gif 49.png
    +convert -format png -tqgeometry "72x96" 02s.gif 50.png
    +convert -format png -tqgeometry "72x96" 02h.gif 51.png
    +convert -format png -tqgeometry "72x96" 02d.gif 52.png
     
    diff --git a/libkdegames/highscore/kconfigrawbackend.cpp b/libkdegames/highscore/kconfigrawbackend.cpp
    index 29ffa845..c2643056 100644
    --- a/libkdegames/highscore/kconfigrawbackend.cpp
    +++ b/libkdegames/highscore/kconfigrawbackend.cpp
    @@ -25,7 +25,7 @@
     
     
     KConfigRawBackEnd::KConfigRawBackEnd(KConfigBase *_config, int fd)
    -    : KConfigINIBackEnd(_config, TQString::null, "config", false),
    +    : KConfigINIBackEnd(_config, TQString(), "config", false),
           _fd(fd), _stream(0)
     {
         _file.open(IO_ReadOnly, _fd);
    diff --git a/libkdegames/highscore/kconfigrawbackend.h b/libkdegames/highscore/kconfigrawbackend.h
    index 0c5fde03..6a1ea4b9 100644
    --- a/libkdegames/highscore/kconfigrawbackend.h
    +++ b/libkdegames/highscore/kconfigrawbackend.h
    @@ -48,6 +48,7 @@ private:
     class KRawConfig : public KSimpleConfig
     {
         Q_OBJECT
    +  TQ_OBJECT
     public:
         KRawConfig(int fd, bool readOnly)
             : KSimpleConfig(new KConfigRawBackEnd(this, fd), readOnly) {}
    diff --git a/libkdegames/highscore/kexthighscore.cpp b/libkdegames/highscore/kexthighscore.cpp
    index 585dafd4..22fa4a85 100644
    --- a/libkdegames/highscore/kexthighscore.cpp
    +++ b/libkdegames/highscore/kexthighscore.cpp
    @@ -44,19 +44,19 @@ void setGameType(uint type)
         internal->setGameType(type);
     }
     
    -bool configure(TQWidget *parent)
    +bool configure(TQWidget *tqparent)
     {
         internal->checkFirst();
    -    ConfigDialog *cd = new ConfigDialog(parent);
    +    ConfigDialog *cd = new ConfigDialog(tqparent);
         cd->exec();
         bool saved = cd->hasBeenSaved();
         delete cd;
         return saved;
     }
     
    -void show(TQWidget *parent, int rank)
    +void show(TQWidget *tqparent, int rank)
     {
    -    HighscoresDialog *hd = new HighscoresDialog(rank, parent);
    +    HighscoresDialog *hd = new HighscoresDialog(rank, tqparent);
         hd->exec();
         delete hd;
     }
    @@ -208,19 +208,19 @@ Item *Manager::createItem(ItemType type)
         Item *item = 0;
         switch (type) {
         case ScoreDefault:
    -        item = new Item((uint)0, i18n("Score"), Qt::AlignRight);
    +        item = new Item((uint)0, i18n("Score"), TQt::AlignRight);
             break;
         case MeanScoreDefault:
    -        item = new Item((double)0, i18n("Mean Score"), Qt::AlignRight);
    +        item = new Item((double)0, i18n("Mean Score"), TQt::AlignRight);
             item->setPrettyFormat(Item::OneDecimal);
             item->setPrettySpecial(Item::DefaultNotDefined);
             break;
         case BestScoreDefault:
    -        item = new Item((uint)0, i18n("Best Score"), Qt::AlignRight);
    +        item = new Item((uint)0, i18n("Best Score"), TQt::AlignRight);
             item->setPrettySpecial(Item::DefaultNotDefined);
             break;
         case ElapsedTime:
    -        item = new Item((uint)0, i18n("Elapsed Time"), Qt::AlignRight);
    +        item = new Item((uint)0, i18n("Elapsed Time"), TQt::AlignRight);
             item->setPrettyFormat(Item::MinuteTime);
             item->setPrettySpecial(Item::ZeroNotDefined);
             break;
    @@ -272,7 +272,7 @@ TQString Manager::gameTypeLabel(uint gameType, LabelType type) const
         case I18N:     break;
         case WW:       return "normal";
         }
    -    return TQString::null;
    +    return TQString();
     }
     
     void Manager::addToQueryURL(KURL &url, const TQString &item,
    diff --git a/libkdegames/highscore/kexthighscore.h b/libkdegames/highscore/kexthighscore.h
    index 5809a896..575ab592 100644
    --- a/libkdegames/highscore/kexthighscore.h
    +++ b/libkdegames/highscore/kexthighscore.h
    @@ -51,17 +51,17 @@ KDE_EXPORT void setGameType(uint gameType);
      * Configure the highscores.
      * @return true if the configuration has been modified and saved
      */
    -KDE_EXPORT bool configure(TQWidget *parent);
    +KDE_EXPORT bool configure(TQWidget *tqparent);
     
     /**
      * Show the highscores lists.
      */
    -KDE_EXPORT void show(TQWidget *parent);
    +KDE_EXPORT void show(TQWidget *tqparent);
     
     /**
      * Submit a score. See @ref Manager for usage example.
      *
    - * @param widget a widget used as parent for error message box.
    + * @param widget a widget used as tqparent for error message box.
      */
     KDE_EXPORT void submitScore(const Score &score, TQWidget *widget);
     
    @@ -111,7 +111,7 @@ KDE_EXPORT Score firstScore();
      * You can replace the score item (for e.g. displaying it differently) with
      * setScoreItem or add an item with addScoreItem.
      *
    - * The players list contains :
    + * The players list tqcontains :
      * 
      *
    • the player name (as defined by the user in the configuration * dialog)
    • diff --git a/libkdegames/highscore/kexthighscore_gui.cpp b/libkdegames/highscore/kexthighscore_gui.cpp index 3786f529..9aa28e89 100644 --- a/libkdegames/highscore/kexthighscore_gui.cpp +++ b/libkdegames/highscore/kexthighscore_gui.cpp @@ -58,8 +58,8 @@ void ShowItem::paintCell(TQPainter *p, const TQColorGroup &cg, } //----------------------------------------------------------------------------- -ScoresList::ScoresList(TQWidget *parent) - : KListView(parent) +ScoresList::ScoresList(TQWidget *tqparent) + : KListView(tqparent) { setSelectionMode(TQListView::NoSelection); setItemMargin(3); @@ -92,15 +92,15 @@ void ScoresList::addLineItem(const ItemArray &items, if (line) line->setText(k, itemText(container, index)); else { addColumn( container.item()->label() ); - setColumnAlignment(k, container.item()->alignment()); + setColumnAlignment(k, container.item()->tqalignment()); } k++; } } //----------------------------------------------------------------------------- -HighscoresList::HighscoresList(TQWidget *parent) - : ScoresList(parent) +HighscoresList::HighscoresList(TQWidget *tqparent) + : ScoresList(tqparent) {} TQString HighscoresList::itemText(const ItemContainer &item, uint row) const @@ -120,8 +120,8 @@ void HighscoresList::load(const ItemArray &items, int highlight) } //----------------------------------------------------------------------------- -HighscoresWidget::HighscoresWidget(TQWidget *parent) - : TQWidget(parent, "show_highscores_widget"), +HighscoresWidget::HighscoresWidget(TQWidget *tqparent) + : TQWidget(tqparent, "show_highscores_widget"), _scoresUrl(0), _playersUrl(0), _statsTab(0), _histoTab(0) { const ScoreInfos &s = internal->scoreInfos(); @@ -197,10 +197,10 @@ void HighscoresWidget::load(int rank) } //----------------------------------------------------------------------------- -HighscoresDialog::HighscoresDialog(int rank, TQWidget *parent) +HighscoresDialog::HighscoresDialog(int rank, TQWidget *tqparent) : KDialogBase(internal->nbGameTypes()>1 ? TreeList : Plain, i18n("Highscores"), Close|User1|User2, Close, - parent, "show_highscores", true, true, + tqparent, "show_highscores", true, true, KGuiItem(i18n("Configure..."), "configure"), KGuiItem(i18n("Export..."))), _rank(rank), _tab(0) { @@ -210,7 +210,7 @@ HighscoresDialog::HighscoresDialog(int rank, TQWidget *parent) for (uint i=0; inbGameTypes(); i++) { TQString title = internal->manager.gameTypeLabel(i, Manager::I18N); TQString icon = internal->manager.gameTypeLabel(i, Manager::Icon); - TQWidget *w = addVBoxPage(title, TQString::null, + TQWidget *w = addVBoxPage(title, TQString(), BarIcon(icon, KIcon::SizeLarge)); if ( i==internal->gameType() ) createPage(w); } @@ -251,7 +251,7 @@ void HighscoresDialog::slotUser1() void HighscoresDialog::slotUser2() { - KURL url = KFileDialog::getSaveURL(TQString::null, TQString::null, this); + KURL url = KFileDialog::getSaveURL(TQString(), TQString(), this); if ( url.isEmpty() ) return; if ( KIO::NetAccess::exists(url, true, this) ) { KGuiItem gi = KStdGuiItem::save(); @@ -270,8 +270,8 @@ void HighscoresDialog::slotUser2() //----------------------------------------------------------------------------- LastMultipleScoresList::LastMultipleScoresList( - const TQValueVector &scores, TQWidget *parent) - : ScoresList(parent), _scores(scores) + const TQValueVector &scores, TQWidget *tqparent) + : ScoresList(tqparent), _scores(scores) { const ScoreInfos &s = internal->scoreInfos(); addHeader(s); @@ -289,7 +289,7 @@ void LastMultipleScoresList::addLineItem(const ItemArray &si, if (line) line->setText(i, itemText(*container, index)); else { addColumn( container->item()->label() ); - setColumnAlignment(i, container->item()->alignment()); + setColumnAlignment(i, container->item()->tqalignment()); } } } @@ -299,7 +299,7 @@ TQString LastMultipleScoresList::itemText(const ItemContainer &item, { TQString name = item.name(); if ( name=="rank" ) - return (_scores[row].type()==Won ? i18n("Winner") : TQString::null); + return (_scores[row].type()==Won ? i18n("Winner") : TQString()); TQVariant v = _scores[row].data(name); if ( name=="name" ) return v.toString(); return item.item()->pretty(row, v); @@ -307,8 +307,8 @@ TQString LastMultipleScoresList::itemText(const ItemContainer &item, //----------------------------------------------------------------------------- TotalMultipleScoresList::TotalMultipleScoresList( - const TQValueVector &scores, TQWidget *parent) - : ScoresList(parent), _scores(scores) + const TQValueVector &scores, TQWidget *tqparent) + : ScoresList(tqparent), _scores(scores) { const ScoreInfos &s = internal->scoreInfos(); addHeader(s); @@ -333,7 +333,7 @@ void TotalMultipleScoresList::addLineItem(const ItemArray &si, TQString label = (i==2 ? i18n("Won Games") : container->item()->label()); addColumn(label); - setColumnAlignment(i, container->item()->alignment()); + setColumnAlignment(i, container->item()->tqalignment()); } } } @@ -352,10 +352,10 @@ TQString TotalMultipleScoresList::itemText(const ItemContainer &item, //----------------------------------------------------------------------------- -ConfigDialog::ConfigDialog(TQWidget *parent) +ConfigDialog::ConfigDialog(TQWidget *tqparent) : KDialogBase(Swallow, i18n("Configure Highscores"), Ok|Apply|Cancel, Cancel, - parent, "configure_highscores", true, true), + tqparent, "configure_highscores", true, true), _saved(false), _WWHEnabled(0) { TQWidget *page = 0; @@ -456,7 +456,7 @@ void ConfigDialog::removeSlot() i18n("This will permanently remove your " "registration key. You will not be able to use " "the currently registered nickname anymore."), - TQString::null, gi); + TQString(), gi); if ( res==KMessageBox::Continue ) { internal->playerInfos().removeKey(); _registeredName->clear(); @@ -471,7 +471,7 @@ void ConfigDialog::load() { internal->hsConfig().readCurrentConfig(); const PlayerInfos &infos = internal->playerInfos(); - _nickname->setText(infos.isAnonymous() ? TQString::null : infos.name()); + _nickname->setText(infos.isAnonymous() ? TQString() : infos.name()); _comment->setText(infos.comment()); if (_WWHEnabled) { _WWHEnabled->setChecked(infos.isWWEnabled()); @@ -516,9 +516,9 @@ bool ConfigDialog::save() } //----------------------------------------------------------------------------- -AskNameDialog::AskNameDialog(TQWidget *parent) +AskNameDialog::AskNameDialog(TQWidget *tqparent) : KDialogBase(Plain, i18n("Enter Your Nickname"), Ok | Cancel, Ok, - parent, "ask_name_dialog") + tqparent, "ask_name_dialog") { internal->hsConfig().readCurrentConfig(); diff --git a/libkdegames/highscore/kexthighscore_gui.h b/libkdegames/highscore/kexthighscore_gui.h index 2a142856..fc2d3912 100644 --- a/libkdegames/highscore/kexthighscore_gui.h +++ b/libkdegames/highscore/kexthighscore_gui.h @@ -58,8 +58,9 @@ class ShowItem : public KListViewItem class ScoresList : public KListView { Q_OBJECT + TQ_OBJECT public: - ScoresList(TQWidget *parent); + ScoresList(TQWidget *tqparent); void addHeader(const ItemArray &); @@ -76,8 +77,9 @@ class ScoresList : public KListView class HighscoresList : public ScoresList { Q_OBJECT + TQ_OBJECT public: - HighscoresList(TQWidget *parent); + HighscoresList(TQWidget *tqparent); void load(const ItemArray &, int highlight); @@ -85,11 +87,12 @@ class HighscoresList : public ScoresList TQString itemText(const ItemContainer &, uint row) const; }; -class HighscoresWidget : public QWidget +class HighscoresWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - HighscoresWidget(TQWidget *parent); + HighscoresWidget(TQWidget *tqparent); void load(int rank); @@ -113,8 +116,9 @@ class HighscoresWidget : public QWidget class HighscoresDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - HighscoresDialog(int rank, TQWidget *parent); + HighscoresDialog(int rank, TQWidget *tqparent); private slots: void slotUser1(); @@ -132,8 +136,9 @@ class HighscoresDialog : public KDialogBase class LastMultipleScoresList : public ScoresList { Q_OBJECT + TQ_OBJECT public: - LastMultipleScoresList(const TQValueVector &, TQWidget *parent); + LastMultipleScoresList(const TQValueVector &, TQWidget *tqparent); private: void addLineItem(const ItemArray &, uint index, TQListViewItem *line); @@ -146,8 +151,9 @@ private: class TotalMultipleScoresList : public ScoresList { Q_OBJECT + TQ_OBJECT public: - TotalMultipleScoresList(const TQValueVector &, TQWidget *parent); + TotalMultipleScoresList(const TQValueVector &, TQWidget *tqparent); private: void addLineItem(const ItemArray &, uint index, TQListViewItem *line); @@ -161,8 +167,9 @@ private: class ConfigDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - ConfigDialog(TQWidget *parent); + ConfigDialog(TQWidget *tqparent); bool hasBeenSaved() const { return _saved; } @@ -188,8 +195,9 @@ class ConfigDialog : public KDialogBase class AskNameDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - AskNameDialog(TQWidget *parent); + AskNameDialog(TQWidget *tqparent); TQString name() const { return _edit->text(); } bool dontAskAgain() const { return _checkbox->isChecked(); } diff --git a/libkdegames/highscore/kexthighscore_internal.cpp b/libkdegames/highscore/kexthighscore_internal.cpp index 3c73c3aa..a1dfd747 100644 --- a/libkdegames/highscore/kexthighscore_internal.cpp +++ b/libkdegames/highscore/kexthighscore_internal.cpp @@ -160,8 +160,8 @@ void ItemArray::_setItem(uint i, const TQString &name, Item *item, { at(i)->setItem(item); at(i)->setName(name); - at(i)->setGroup(stored ? _group : TQString::null); - at(i)->setSubGroup(canHaveSubGroup ? _subGroup : TQString::null); + at(i)->setGroup(stored ? _group : TQString()); + at(i)->setSubGroup(canHaveSubGroup ? _subGroup : TQString()); } void ItemArray::setGroup(const TQString &group) @@ -262,14 +262,14 @@ PlayerInfos::PlayerInfos() // standard items addItem("name", new NameItem); - Item *it = new Item((uint)0, i18n("Games Count"),Qt::AlignRight); + Item *it = new Item((uint)0, i18n("Games Count"),TQt::AlignRight); addItem("nb games", it, true, true); it = Manager::createItem(Manager::MeanScoreDefault); addItem("mean score", it, true, true); it = Manager::createItem(Manager::BestScoreDefault); addItem("best score", it, true, true); addItem("date", new DateItem, true, true); - it = new Item(TQString::null, i18n("Comment"), Qt::AlignLeft); + it = new Item(TQString(), i18n("Comment"), TQt::AlignLeft); addItem("comment", it); // statistics items @@ -314,13 +314,13 @@ PlayerInfos::PlayerInfos() #ifdef HIGHSCORE_DIRECTORY if (_oldLocalPlayer) { // player already exists in local config file // copy player data - TQString prefix = TQString("%1_").arg(_oldLocalId+1); + TQString prefix = TQString("%1_").tqarg(_oldLocalId+1); TQMap entries = cg.config()->entryMap("KHighscore_players"); TQMap::const_iterator it; for (it=entries.begin(); it!=entries.end(); ++it) { TQString key = it.key(); - if ( key.find(prefix)==0 ) { + if ( key.tqfind(prefix)==0 ) { TQString name = key.right(key.length()-prefix.length()); if ( name!="name" || !isNameUsed(it.data()) ) internal->hsConfig().writeEntry(_id+1, name, it.data()); @@ -364,7 +364,7 @@ uint PlayerInfos::nbEntries() const TQString PlayerInfos::key() const { ConfigGroup cg; - return cg.config()->readEntry(HS_KEY, TQString::null); + return cg.config()->readEntry(HS_KEY, TQString()); } bool PlayerInfos::isWWEnabled() const @@ -378,8 +378,8 @@ TQString PlayerInfos::histoName(uint i) const const TQMemArray &sh = _histogram; Q_ASSERT( ireadEntry(HS_REGISTERED_NAME, TQString::null); + return cg.config()->readEntry(HS_REGISTERED_NAME, TQString()); } void PlayerInfos::removeKey() @@ -497,10 +497,10 @@ void PlayerInfos::removeKey() TQString sk; do { i++; - sk = str.arg(HS_KEY).arg(i); - } while ( !cg.config()->readEntry(sk, TQString::null).isEmpty() ); + sk = str.tqarg(HS_KEY).tqarg(i); + } while ( !cg.config()->readEntry(sk, TQString()).isEmpty() ); cg.config()->writeEntry(sk, key()); - cg.config()->writeEntry(str.arg(HS_REGISTERED_NAME).arg(i), + cg.config()->writeEntry(str.tqarg(HS_REGISTERED_NAME).tqarg(i), registeredName()); // clear current key/nickname @@ -602,15 +602,15 @@ const char *DUMMY_STRINGS[] = { const char *UNABLE_TO_CONTACT = I18N_NOOP("Unable to contact world-wide highscore server"); -bool ManagerPrivate::doQuery(const KURL &url, TQWidget *parent, +bool ManagerPrivate::doQuery(const KURL &url, TQWidget *tqparent, TQDomNamedNodeMap *map) { KIO::http_update_cache(url, true, 0); // remove cache ! TQString tmpFile; - if ( !KIO::NetAccess::download(url, tmpFile, parent) ) { - TQString details = i18n("Server URL: %1").arg(url.host()); - KMessageBox::detailedSorry(parent, i18n(UNABLE_TO_CONTACT), details); + if ( !KIO::NetAccess::download(url, tmpFile, tqparent) ) { + TQString details = i18n("Server URL: %1").tqarg(url.host()); + KMessageBox::detailedSorry(tqparent, i18n(UNABLE_TO_CONTACT), details); return false; } @@ -618,7 +618,7 @@ bool ManagerPrivate::doQuery(const KURL &url, TQWidget *parent, if ( !file.open(IO_ReadOnly) ) { KIO::NetAccess::removeTempFile(tmpFile); TQString details = i18n("Unable to open temporary file."); - KMessageBox::detailedSorry(parent, i18n(UNABLE_TO_CONTACT), details); + KMessageBox::detailedSorry(tqparent, i18n(UNABLE_TO_CONTACT), details); return false; } @@ -641,26 +641,26 @@ bool ManagerPrivate::doQuery(const KURL &url, TQWidget *parent, TQString msg = i18n(attr.value().latin1()); TQString caption = i18n("Message from world-wide highscores " "server"); - KMessageBox::sorry(parent, msg, caption); + KMessageBox::sorry(tqparent, msg, caption); return false; } } } TQString msg = i18n("Invalid answer from world-wide highscores server."); - TQString details = i18n("Raw message: %1").arg(content); - KMessageBox::detailedSorry(parent, msg, details); + TQString details = i18n("Raw message: %1").tqarg(content); + KMessageBox::detailedSorry(tqparent, msg, details); return false; } bool ManagerPrivate::getFromQuery(const TQDomNamedNodeMap &map, const TQString &name, TQString &value, - TQWidget *parent) + TQWidget *tqparent) { TQDomAttr attr = map.namedItem(name).toAttr(); if ( attr.isNull() ) { - KMessageBox::sorry(parent, + KMessageBox::sorry(tqparent, i18n("Invalid answer from world-wide " - "highscores server (missing item: %1).").arg(name)); + "highscores server (missing item: %1).").tqarg(name)); return false; } value = attr.value(); @@ -780,7 +780,7 @@ int ManagerPrivate::submitScore(const Score &ascore, Score score = ascore; score.setData("id", _playerInfos->id() + 1); - score.setData("date", TQDateTime::currentDateTime()); + score.setData("date", TQDateTime::tqcurrentDateTime()); // ask new name if anonymous and winner const char *dontAskAgainName = "highscore_ask_name_dialog"; diff --git a/libkdegames/highscore/kexthighscore_internal.h b/libkdegames/highscore/kexthighscore_internal.h index ff70c5cd..e0aa8ca5 100644 --- a/libkdegames/highscore/kexthighscore_internal.h +++ b/libkdegames/highscore/kexthighscore_internal.h @@ -46,7 +46,7 @@ class RankItem : public Item { public: RankItem() - : Item((uint)0, i18n("Rank"), Qt::AlignRight) {} + : Item((uint)0, i18n("Rank"), TQt::AlignRight) {} TQVariant read(uint rank, const TQVariant &) const { return rank; } TQString pretty(uint rank, const TQVariant &) const @@ -57,7 +57,7 @@ class NameItem : public Item { public: NameItem() - : Item(TQString::null, i18n("Name"), Qt::AlignLeft) { + : Item(TQString(), i18n("Name"), TQt::AlignLeft) { setPrettySpecial(Anonymous); } }; @@ -66,7 +66,7 @@ class DateItem : public Item { public: DateItem() - : Item(TQDateTime(), i18n("Date"), Qt::AlignRight) { + : Item(TQDateTime(), i18n("Date"), TQt::AlignRight) { setPrettyFormat(DateTime); } }; @@ -75,7 +75,7 @@ class SuccessPercentageItem : public Item { public: SuccessPercentageItem() - : Item((double)-1, i18n("Success"), Qt::AlignRight) { + : Item((double)-1, i18n("Success"), TQt::AlignRight) { setPrettyFormat(Percentage); setPrettySpecial(NegativeNotDefined); } @@ -176,7 +176,7 @@ class ScoreInfos : public ItemArray class ConfigGroup : public KConfigGroupSaver { public: - ConfigGroup(const TQString &group = TQString::null) + ConfigGroup(const TQString &group = TQString()) : KConfigGroupSaver(kapp->config(), group) {} }; @@ -243,7 +243,7 @@ class ManagerPrivate PlayerInfos &playerInfos() { return *_playerInfos; } KHighscore &hsConfig() { return *_hsConfig; } enum QueryType { Submit, Register, Change, Players, Scores }; - KURL queryURL(QueryType type, const TQString &newName=TQString::null) const; + KURL queryURL(QueryType type, const TQString &newName=TQString()) const; void exportHighscores(TQTextStream &); @@ -264,11 +264,11 @@ class ManagerPrivate // return -1 if not a local best score int rank(const Score &score) const; - bool submitWorldWide(const Score &score, TQWidget *parent) const; - static bool doQuery(const KURL &url, TQWidget *parent, + bool submitWorldWide(const Score &score, TQWidget *tqparent) const; + static bool doQuery(const KURL &url, TQWidget *tqparent, TQDomNamedNodeMap *map = 0); static bool getFromQuery(const TQDomNamedNodeMap &map, const TQString &name, - TQString &value, TQWidget *parent); + TQString &value, TQWidget *tqparent); void convertToGlobal(); }; diff --git a/libkdegames/highscore/kexthighscore_item.cpp b/libkdegames/highscore/kexthighscore_item.cpp index fa6c7e2c..44fe64fa 100644 --- a/libkdegames/highscore/kexthighscore_item.cpp +++ b/libkdegames/highscore/kexthighscore_item.cpp @@ -33,8 +33,8 @@ namespace KExtHighscore { //----------------------------------------------------------------------------- -Item::Item(const TQVariant &def, const TQString &label, int alignment) - : _default(def), _label(label), _alignment(alignment), +Item::Item(const TQVariant &def, const TQString &label, int tqalignment) + : _default(def), _label(label), _tqalignment(tqalignment), _format(NoFormat), _special(NoSpecial) {} @@ -154,13 +154,13 @@ Score::~Score() const TQVariant &Score::data(const TQString &name) const { - Q_ASSERT( _data.contains(name) ); + Q_ASSERT( _data.tqcontains(name) ); return _data[name]; } void Score::setData(const TQString &name, const TQVariant &value) { - Q_ASSERT( _data.contains(name) ); + Q_ASSERT( _data.tqcontains(name) ); Q_ASSERT( _data[name].type()==value.type() ); _data[name] = value; } @@ -178,14 +178,14 @@ bool Score::operator <(const Score &score) TQDataStream &operator <<(TQDataStream &s, const Score &score) { - s << (Q_UINT8)score.type(); + s << (TQ_UINT8)score.type(); s << score._data; return s; } TQDataStream &operator >>(TQDataStream &s, Score &score) { - Q_UINT8 type; + TQ_UINT8 type; s >> type; score._type = (ScoreType)type; s >> score._data; @@ -238,7 +238,7 @@ void MultiplayerScores::addScore(uint i, const Score &score) _scores[i]._data["nb won games"] = won; } -void MultiplayerScores::show(TQWidget *parent) +void MultiplayerScores::show(TQWidget *tqparent) { // check consistency if ( _nbGames.size()<2 ) kdWarning(11002) << "less than 2 players" << endl; @@ -271,7 +271,7 @@ void MultiplayerScores::show(TQWidget *parent) // show the scores KDialogBase dialog(KDialogBase::Plain, i18n("Multiplayers Scores"), KDialogBase::Close, KDialogBase::Close, - parent, "show_multiplayers_score", true, true); + tqparent, "show_multiplayers_score", true, true); TQHBoxLayout *hbox = new TQHBoxLayout(dialog.plainPage(), KDialog::marginHint(), KDialog::spacingHint()); @@ -287,7 +287,7 @@ void MultiplayerScores::show(TQWidget *parent) vbox = new TQVBox(dialog.plainPage()); hbox->addWidget(vbox); (void)new TQLabel(i18n("Scores for the last %1 games:") - .arg(_nbGames[0]), vbox); + .tqarg(_nbGames[0]), vbox); (void)new TotalMultipleScoresList(ordered, vbox); } diff --git a/libkdegames/highscore/kexthighscore_item.h b/libkdegames/highscore/kexthighscore_item.h index 490908d7..d5faa380 100644 --- a/libkdegames/highscore/kexthighscore_item.h +++ b/libkdegames/highscore/kexthighscore_item.h @@ -79,10 +79,10 @@ class KDE_EXPORT Item * Be sure to cast the value to the required type (for e.g. with uint). * @param label the label corresponding to the item. If empty, the item * is not shown. - * @param alignment the alignment of the item. + * @param tqalignment the tqalignment of the item. */ Item(const TQVariant &def = TQVariant::Invalid, - const TQString &label = TQString::null, int alignment = Qt::AlignRight); + const TQString &label = TQString(), int tqalignment = TQt::AlignRight); virtual ~Item(); @@ -114,9 +114,9 @@ class KDE_EXPORT Item TQString label() const { return _label; } /** - * @return the alignment. + * @return the tqalignment. */ - int alignment() const { return _alignment; } + int tqalignment() const { return _tqalignment; } /** * Set default value. @@ -149,7 +149,7 @@ class KDE_EXPORT Item private: TQVariant _default; TQString _label; - int _alignment; + int _tqalignment; Format _format; Special _special; @@ -294,7 +294,7 @@ class KDE_EXPORT MultiplayerScores /** * Show scores. */ - void show(TQWidget *parent); + void show(TQWidget *tqparent); private: TQValueVector _nbGames; diff --git a/libkdegames/highscore/kexthighscore_tab.cpp b/libkdegames/highscore/kexthighscore_tab.cpp index 3b2b5852..8c41227c 100644 --- a/libkdegames/highscore/kexthighscore_tab.cpp +++ b/libkdegames/highscore/kexthighscore_tab.cpp @@ -39,8 +39,8 @@ namespace KExtHighscore { //----------------------------------------------------------------------------- -PlayersCombo::PlayersCombo(TQWidget *parent, const char *name) - : TQComboBox(parent, name) +PlayersCombo::PlayersCombo(TQWidget *tqparent, const char *name) + : TQComboBox(tqparent, name) { const PlayerInfos &p = internal->playerInfos(); for (uint i = 0; i(layout()); + TQVBoxLayout *top = static_cast(tqlayout()); TQHBoxLayout *hbox = new TQHBoxLayout(top); TQVBoxLayout *vbox = new TQVBoxLayout(hbox); @@ -184,7 +184,7 @@ void StatisticsTab::load() TQString StatisticsTab::percent(const Data &d, Count count) const { - if ( count==Total ) return TQString::null; + if ( count==Total ) return TQString(); return AdditionalTab::percent(d.count[count], d.count[Total], true); } @@ -205,11 +205,11 @@ void StatisticsTab::display(uint i) } //----------------------------------------------------------------------------- -HistogramTab::HistogramTab(TQWidget *parent) - : AdditionalTab(parent, "histogram_tab") +HistogramTab::HistogramTab(TQWidget *tqparent) + : AdditionalTab(tqparent, "histogram_tab") { // construct GUI - TQVBoxLayout *top = static_cast(layout()); + TQVBoxLayout *top = static_cast(tqlayout()); _list = new KListView(this); _list->setSelectionMode(TQListView::NoSelection); @@ -225,7 +225,7 @@ HistogramTab::HistogramTab(TQWidget *parent) _list->addColumn(i18n("Count")); _list->addColumn(i18n("Percent")); for (uint i=0; i<4; i++) _list->setColumnAlignment(i, AlignRight); - _list->addColumn(TQString::null); + _list->addColumn(TQString()); const Item *sitem = internal->scoreInfos().item("score")->item(); const PlayerInfos &pi = internal->playerInfos(); @@ -270,7 +270,7 @@ void HistogramTab::display(uint i) uint nb = _counts[i*s + k]; item->setText(2, TQString::number(nb)); item->setText(3, percent(nb, _data[i])); - uint width = (_data[i]==0 ? 0 : qRound(150.0 * nb / _data[i])); + uint width = (_data[i]==0 ? 0 : tqRound(150.0 * nb / _data[i])); TQPixmap pixmap(width, 10); pixmap.fill(blue); item->setPixmap(4, pixmap); diff --git a/libkdegames/highscore/kexthighscore_tab.h b/libkdegames/highscore/kexthighscore_tab.h index 4303209d..dc0d7536 100644 --- a/libkdegames/highscore/kexthighscore_tab.h +++ b/libkdegames/highscore/kexthighscore_tab.h @@ -31,11 +31,12 @@ namespace KExtHighscore { //----------------------------------------------------------------------------- -class PlayersCombo : public QComboBox +class PlayersCombo : public TQComboBox { Q_OBJECT + TQ_OBJECT public: - PlayersCombo(TQWidget *parent = 0, const char *name = 0); + PlayersCombo(TQWidget *tqparent = 0, const char *name = 0); void load(); @@ -49,11 +50,12 @@ class PlayersCombo : public QComboBox }; //----------------------------------------------------------------------------- -class AdditionalTab : public QWidget +class AdditionalTab : public TQWidget { Q_OBJECT + TQ_OBJECT public: - AdditionalTab(TQWidget *parent, const char *name); + AdditionalTab(TQWidget *tqparent, const char *name); virtual void load(); @@ -74,8 +76,9 @@ class AdditionalTab : public QWidget class StatisticsTab : public AdditionalTab { Q_OBJECT + TQ_OBJECT public: - StatisticsTab(TQWidget *parent); + StatisticsTab(TQWidget *tqparent); void load(); @@ -99,8 +102,9 @@ class StatisticsTab : public AdditionalTab class HistogramTab : public AdditionalTab { Q_OBJECT + TQ_OBJECT public: - HistogramTab(TQWidget *parent); + HistogramTab(TQWidget *tqparent); void load(); diff --git a/libkdegames/highscore/khighscore.cpp b/libkdegames/highscore/khighscore.cpp index 26bb47c3..dd10f2ab 100644 --- a/libkdegames/highscore/khighscore.cpp +++ b/libkdegames/highscore/khighscore.cpp @@ -56,14 +56,14 @@ static KStaticDeleter lockSD; static KStaticDeleter configSD; -KHighscore::KHighscore(TQObject* parent) - : TQObject(parent) +KHighscore::KHighscore(TQObject* tqparent) + : TQObject(tqparent) { init(true); } -KHighscore::KHighscore(bool forceLocal, TQObject* parent) - : TQObject(parent) +KHighscore::KHighscore(bool forceLocal, TQObject* tqparent) + : TQObject(tqparent) { init(forceLocal); } @@ -96,7 +96,7 @@ void KHighscore::init(const char *appname) { #ifdef HIGHSCORE_DIRECTORY const TQString filename = TQString::fromLocal8Bit("%1/%2.scores") - .arg(HIGHSCORE_DIRECTORY).arg(appname); + .tqarg(HIGHSCORE_DIRECTORY).tqarg(appname); int fd = open(filename.local8Bit(), O_RDWR); if ( fd<0 ) kdFatal(11002) << "cannot open global highscore file \"" << filename << "\"" << endl; @@ -132,7 +132,7 @@ bool KHighscore::lockForWriting(TQWidget *widget) if ( !first ) { KGuiItem item = KStdGuiItem::cont(); item.setText(i18n("Retry")); - int res = KMessageBox::warningContinueCancel(widget, i18n("Cannot access the highscore file. Another user is probably currently writing to it."), TQString::null, item, "ask_lock_global_highscore_file"); + int res = KMessageBox::warningContinueCancel(widget, i18n("Cannot access the highscore file. Another user is probably currently writing to it."), TQString(), item, "ask_lock_global_highscore_file"); if ( res==KMessageBox::Cancel ) break; } else sleep(1); first = false; @@ -169,7 +169,7 @@ void KHighscore::writeEntry(int entry, const TQString& key, const TQVariant& val { Q_ASSERT( isLocked() ); KConfigGroupSaver cg(config(), group()); - TQString confKey = TQString("%1_%2").arg(entry).arg(key); + TQString confKey = TQString("%1_%2").tqarg(entry).tqarg(key); cg.config()->writeEntry(confKey, value); } @@ -177,7 +177,7 @@ void KHighscore::writeEntry(int entry, const TQString& key, int value) { Q_ASSERT( isLocked() ); KConfigGroupSaver cg(config(), group()); - TQString confKey = TQString("%1_%2").arg(entry).arg(key); + TQString confKey = TQString("%1_%2").tqarg(entry).tqarg(key); cg.config()->writeEntry(confKey, value); } @@ -185,35 +185,35 @@ void KHighscore::writeEntry(int entry, const TQString& key, const TQString &valu { Q_ASSERT (isLocked() ); KConfigGroupSaver cg(config(), group()); - TQString confKey = TQString("%1_%2").arg(entry).arg(key); + TQString confKey = TQString("%1_%2").tqarg(entry).tqarg(key); cg.config()->writeEntry(confKey, value); } TQVariant KHighscore::readPropertyEntry(int entry, const TQString& key, const TQVariant& pDefault) const { KConfigGroupSaver cg(config(), group()); - TQString confKey = TQString("%1_%2").arg(entry).arg(key); + TQString confKey = TQString("%1_%2").tqarg(entry).tqarg(key); return cg.config()->readPropertyEntry(confKey, pDefault); } TQString KHighscore::readEntry(int entry, const TQString& key, const TQString& pDefault) const { KConfigGroupSaver cg(config(), group()); - TQString confKey = TQString("%1_%2").arg(entry).arg(key); + TQString confKey = TQString("%1_%2").tqarg(entry).tqarg(key); return cg.config()->readEntry(confKey, pDefault); } int KHighscore::readNumEntry(int entry, const TQString& key, int pDefault) const { KConfigGroupSaver cg(config(), group()); - TQString confKey = TQString("%1_%2").arg(entry).arg(key); + TQString confKey = TQString("%1_%2").tqarg(entry).tqarg(key); return cg.config()->readNumEntry(confKey, pDefault); } bool KHighscore::hasEntry(int entry, const TQString& key) const { KConfigGroupSaver cg(config(), group()); - TQString confKey = TQString("%1_%2").arg(entry).arg(key); + TQString confKey = TQString("%1_%2").tqarg(entry).tqarg(key); return cg.config()->hasKey(confKey); } @@ -246,9 +246,9 @@ const TQString& KHighscore::highscoreGroup() const TQString KHighscore::group() const { if ( highscoreGroup().isNull() ) - return (d->global ? TQString::null : GROUP); + return (d->global ? TQString() : GROUP); return (d->global ? highscoreGroup() - : TQString("%1_%2").arg(GROUP).arg(highscoreGroup())); + : TQString("%1_%2").tqarg(GROUP).tqarg(highscoreGroup())); } bool KHighscore::hasTable() const diff --git a/libkdegames/highscore/khighscore.h b/libkdegames/highscore/khighscore.h index 42c9fcda..ba7a4bd0 100644 --- a/libkdegames/highscore/khighscore.h +++ b/libkdegames/highscore/khighscore.h @@ -67,7 +67,7 @@ class KHighscorePrivate; * single player, so the "best times" of a player. To write highscores for a * specific player in a specific level you will have to use a more complex way: * \code - * TQString group = TQString("%1_%2").arg(player).arg(level); + * TQString group = TQString("%1_%2").tqarg(player).tqarg(level); * table->setGroup(group); * writeHighscore(table, player, level); * \endcode @@ -81,15 +81,16 @@ class KHighscorePrivate; * Easy, what? * @author Andreas Beckermann **/ -class KDE_EXPORT KHighscore : public QObject +class KDE_EXPORT KHighscore : public TQObject { Q_OBJECT + TQ_OBJECT public: /** @obsolete * Constructor. The highscore file is forced to be local to support * games using the old behaviour. */ - KHighscore(TQObject* parent = 0); + KHighscore(TQObject* tqparent = 0); /** * Constructor. @@ -97,10 +98,10 @@ public: * @param forceLocal if true, the local highscore file is used even * when the configuration has been set to use a system-wide file. This * is convenient for converting highscores from legacy applications. - * @param parent parent widget for this widget + * @param tqparent tqparent widget for this widget * @since 3.2 */ - KHighscore(bool forceLocal, TQObject *parent); + KHighscore(bool forceLocal, TQObject *tqparent); /** * Read the current state of the highscore file. Remember that when @@ -132,7 +133,7 @@ public: * If the config file cannot be locked, * the method waits for 1 second and, if it failed again, displays * a message box asking for retry or cancel. - * @param widget used as the parent of the message box. + * @param widget used as the tqparent of the message box. * * @return false on error or if the config file is locked by another * process. In such case, the config stays read-only. @@ -193,7 +194,7 @@ public: * @return The value of this entry+key pair or pDefault if the entry+key * pair doesn't exist **/ - TQString readEntry(int entry, const TQString& key, const TQString& pDefault = TQString::null) const; + TQString readEntry(int entry, const TQString& key, const TQString& pDefault = TQString()) const; /** * Read a numeric value. @@ -273,15 +274,15 @@ public: * Set the new highscore group. The group is being prefixed with * "KHighscore_" in the table. * @param groupname The new groupname. E.g. use "easy" for the easy - * level of your game. If you use TQString::null (the default) the + * level of your game. If you use TQString() (the default) the * default group is used. **/ - void setHighscoreGroup(const TQString& groupname = TQString::null); + void setHighscoreGroup(const TQString& groupname = TQString()); /** * @return The currently used group. This doesn't contain the prefix * ("KHighscore_") but the same as setHighscoreGroup uses. The - * default is TQString::null + * default is TQString() **/ const TQString& highscoreGroup() const; diff --git a/libkdegames/highscore/kscoredialog.cpp b/libkdegames/highscore/kscoredialog.cpp index 7bed0c6b..0a3710f4 100644 --- a/libkdegames/highscore/kscoredialog.cpp +++ b/libkdegames/highscore/kscoredialog.cpp @@ -44,7 +44,7 @@ class KScoreDialog::KScoreDialogPrivate public: TQPtrList scores; TQWidget *page; - TQGridLayout *layout; + TQGridLayout *tqlayout; TQLineEdit *edit; TQPtrVector stack; TQPtrVector labels; @@ -64,8 +64,8 @@ public: }; -KScoreDialog::KScoreDialog(int fields, TQWidget *parent, const char *oname) - : KDialogBase(parent, oname, true, i18n("High Scores"), Ok, Ok, true) +KScoreDialog::KScoreDialog(int fields, TQWidget *tqparent, const char *oname) + : KDialogBase(tqparent, oname, true, i18n("High Scores"), Ok, Ok, true) { d = new KScoreDialogPrivate(); d->edit = 0; @@ -126,36 +126,36 @@ void KScoreDialog::setupDialog() d->col[field] = d->nrCols++; } - d->layout = new TQGridLayout(d->page, 15, d->nrCols, marginHint() + 20, spacingHint()); - d->layout->addRowSpacing(4, 15); + d->tqlayout = new TQGridLayout(d->page, 15, d->nrCols, marginHint() + 20, spacingHint()); + d->tqlayout->addRowSpacing(4, 15); d->commentLabel = new TQLabel(d->page); - d->commentLabel->setAlignment(AlignVCenter | AlignHCenter); - d->layout->addMultiCellWidget(d->commentLabel, 1, 1, 0, d->nrCols-1); + d->commentLabel->tqsetAlignment(AlignVCenter | AlignHCenter); + d->tqlayout->addMultiCellWidget(d->commentLabel, 1, 1, 0, d->nrCols-1); TQFont bold = font(); bold.setBold(true); TQLabel *label; - d->layout->addColSpacing(0, 50); + d->tqlayout->addColSpacing(0, 50); label = new TQLabel(i18n("Rank"), d->page); - d->layout->addWidget(label, 3, 0); + d->tqlayout->addWidget(label, 3, 0); label->setFont(bold); for(int field = 1; field < d->fields; field = field * 2) { if (d->fields & field) { - d->layout->addColSpacing(d->col[field], 50); + d->tqlayout->addColSpacing(d->col[field], 50); label = new TQLabel(d->header[field], d->page); - d->layout->addWidget(label, 3, d->col[field], field <= Name ? AlignLeft : AlignRight); + d->tqlayout->addWidget(label, 3, d->col[field], field <= Name ? AlignLeft : AlignRight); label->setFont(bold); } } - KSeparator *sep = new KSeparator(Horizontal, d->page); - d->layout->addMultiCellWidget(sep, 4, 4, 0, d->nrCols-1); + KSeparator *sep = new KSeparator(Qt::Horizontal, d->page); + d->tqlayout->addMultiCellWidget(sep, 4, 4, 0, d->nrCols-1); d->labels.resize(d->nrCols * 10); d->stack.resize(10); @@ -164,14 +164,14 @@ void KScoreDialog::setupDialog() for (int i = 1; i <= 10; ++i) { TQLabel *label; num.setNum(i); - label = new TQLabel(i18n("#%1").arg(num), d->page); + label = new TQLabel(i18n("#%1").tqarg(num), d->page); d->labels.insert((i-1)*d->nrCols + 0, label); - d->layout->addWidget(label, i+4, 0); + d->tqlayout->addWidget(label, i+4, 0); if (d->fields & Name) { TQWidgetStack *stack = new TQWidgetStack(d->page); d->stack.insert(i-1, stack); - d->layout->addWidget(stack, i+4, d->col[Name]); + d->tqlayout->addWidget(stack, i+4, d->col[Name]); label = new TQLabel(d->page); d->labels.insert((i-1)*d->nrCols + d->col[Name], label); stack->addWidget(label); @@ -183,7 +183,7 @@ void KScoreDialog::setupDialog() { label = new TQLabel(d->page); d->labels.insert((i-1)*d->nrCols + d->col[field], label); - d->layout->addWidget(label, i+4, d->col[field], AlignRight); + d->tqlayout->addWidget(label, i+4, d->col[field], AlignRight); } } } @@ -202,17 +202,17 @@ void KScoreDialog::aboutToShow() { d->commentLabel->setMinimumSize(TQSize(1,1)); d->commentLabel->hide(); - d->layout->addRowSpacing(0, -15); - d->layout->addRowSpacing(2, -15); + d->tqlayout->addRowSpacing(0, -15); + d->tqlayout->addRowSpacing(2, -15); } else { - d->commentLabel->setMinimumSize(d->commentLabel->sizeHint()); + d->commentLabel->setMinimumSize(d->commentLabel->tqsizeHint()); d->commentLabel->show(); - d->layout->addRowSpacing(0, -10); - d->layout->addRowSpacing(2, 10); + d->tqlayout->addRowSpacing(0, -10); + d->tqlayout->addRowSpacing(2, 10); } - d->comment = TQString::null; + d->comment = TQString(); TQFont normal = font(); TQFont bold = normal; @@ -267,7 +267,7 @@ void KScoreDialog::aboutToShow() } } d->latest = -1; - setFixedSize(minimumSizeHint()); + setFixedSize(tqminimumSizeHint()); } void KScoreDialog::loadScores() diff --git a/libkdegames/highscore/kscoredialog.h b/libkdegames/highscore/kscoredialog.h index d5a7eac0..35a593b3 100644 --- a/libkdegames/highscore/kscoredialog.h +++ b/libkdegames/highscore/kscoredialog.h @@ -39,6 +39,7 @@ class TQWidgetStack; */ class KDE_EXPORT KScoreDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: enum Fields { Name = 1 << 0, @@ -56,10 +57,10 @@ public: /** * @param fields Which fields should be listed. - * @param parent passed to parent TQWidget constructor - * @param name passed to parent TQWidget constructor + * @param tqparent passed to tqparent TQWidget constructor + * @param name passed to tqparent TQWidget constructor */ - KScoreDialog(int fields, TQWidget *parent=0, const char *name=0); + KScoreDialog(int fields, TQWidget *tqparent=0, const char *name=0); ~KScoreDialog(); diff --git a/libkdegames/kcanvasrootpixmap.cpp b/libkdegames/kcanvasrootpixmap.cpp index 5e036740..20440458 100644 --- a/libkdegames/kcanvasrootpixmap.cpp +++ b/libkdegames/kcanvasrootpixmap.cpp @@ -33,7 +33,7 @@ KCanvasRootPixmap::KCanvasRootPixmap(TQCanvasView *view, const char *name) void KCanvasRootPixmap::backgroundUpdatedSlot(const TQPixmap &pixmap) { if ( _view && _view->canvas() ) - _view->canvas()->setBackgroundPixmap(pixmap); + _view->canvas()->tqsetBackgroundPixmap(pixmap); } #include "kcanvasrootpixmap.moc" diff --git a/libkdegames/kcanvasrootpixmap.h b/libkdegames/kcanvasrootpixmap.h index 6aedef16..91dfa8bd 100644 --- a/libkdegames/kcanvasrootpixmap.h +++ b/libkdegames/kcanvasrootpixmap.h @@ -40,6 +40,7 @@ class TQCanvasView; class KDE_EXPORT KCanvasRootPixmap : public KRootPixmap { Q_OBJECT + TQ_OBJECT public: /** diff --git a/libkdegames/kcarddialog.cpp b/libkdegames/kcarddialog.cpp index 73011c9a..89e48e42 100644 --- a/libkdegames/kcarddialog.cpp +++ b/libkdegames/kcarddialog.cpp @@ -41,9 +41,9 @@ #include #include -#define KCARD_DEFAULTDECK TQString::fromLatin1("deck0.png") -#define KCARD_DEFAULTCARD TQString::fromLatin1("11.png") -#define KCARD_DEFAULTCARDDIR TQString::fromLatin1("cards-default/") +#define KCARD_DEFAULTDECK TQString::tqfromLatin1("deck0.png") +#define KCARD_DEFAULTCARD TQString::tqfromLatin1("11.png") +#define KCARD_DEFAULTCARDDIR TQString::tqfromLatin1("cards-default/") // values for the resize slider #define SLIDER_MIN 400 @@ -51,19 +51,19 @@ // KConfig entries #define CONF_GROUP "KCardDialog" -#define CONF_RANDOMDECK TQString::fromLatin1("RandomDeck") -#define CONF_DECK TQString::fromLatin1("Deck") -#define CONF_CARDDIR TQString::fromLatin1("CardDir") -#define CONF_RANDOMCARDDIR TQString::fromLatin1("RandomCardDir") -#define CONF_USEGLOBALDECK TQString::fromLatin1("GlobalDeck") -#define CONF_USEGLOBALCARDDIR TQString::fromLatin1("GlobalCardDir") -#define CONF_SCALE TQString::fromLatin1("Scale") +#define CONF_RANDOMDECK TQString::tqfromLatin1("RandomDeck") +#define CONF_DECK TQString::tqfromLatin1("Deck") +#define CONF_CARDDIR TQString::tqfromLatin1("CardDir") +#define CONF_RANDOMCARDDIR TQString::tqfromLatin1("RandomCardDir") +#define CONF_USEGLOBALDECK TQString::tqfromLatin1("GlobalDeck") +#define CONF_USEGLOBALCARDDIR TQString::tqfromLatin1("GlobalCardDir") +#define CONF_SCALE TQString::tqfromLatin1("Scale") -#define CONF_GLOBAL_GROUP TQString::fromLatin1("KCardDialog Settings") -#define CONF_GLOBAL_DECK TQString::fromLatin1("GlobalDeck") -#define CONF_GLOBAL_CARDDIR TQString::fromLatin1("GlobalCardDir") -#define CONF_GLOBAL_RANDOMDECK TQString::fromLatin1("GlobalRandomDeck") -#define CONF_GLOBAL_RANDOMCARDDIR TQString::fromLatin1("GlobalRandomCardDir") +#define CONF_GLOBAL_GROUP TQString::tqfromLatin1("KCardDialog Settings") +#define CONF_GLOBAL_DECK TQString::tqfromLatin1("GlobalDeck") +#define CONF_GLOBAL_CARDDIR TQString::tqfromLatin1("GlobalCardDir") +#define CONF_GLOBAL_RANDOMDECK TQString::tqfromLatin1("GlobalRandomDeck") +#define CONF_GLOBAL_RANDOMCARDDIR TQString::tqfromLatin1("GlobalRandomCardDir") class KCardDialogPrivate @@ -128,9 +128,9 @@ int KCardDialog::getCardDeck(TQString &pDeck, TQString &pCardDir, TQWidget *pPar // TODO check for global cards/decks!!!! pDeck=dlg.deck(); pCardDir=dlg.cardDir(); - if (!pCardDir.isNull() && pCardDir.right(1)!=TQString::fromLatin1("/")) + if (!pCardDir.isNull() && pCardDir.right(1)!=TQString::tqfromLatin1("/")) { - pCardDir+=TQString::fromLatin1("/"); + pCardDir+=TQString::tqfromLatin1("/"); } if (pRandomDeck) { @@ -218,7 +218,7 @@ void KCardDialog::getConfigCardDeck(KConfig* conf, TQString &pDeck, TQString &pC TQString KCardDialog::getDefaultDeck() { KCardDialog::init(); - return locate("cards", TQString::fromLatin1("decks/") + KCARD_DEFAULTDECK); + return locate("cards", TQString::tqfromLatin1("decks/") + KCARD_DEFAULTDECK); } TQString KCardDialog::getDefaultCardDir() @@ -234,14 +234,14 @@ TQString KCardDialog::getCardPath(const TQString &carddir, int index) KCardDialog::init(); TQString entry = carddir + TQString::number(index); - if (KStandardDirs::exists(entry + TQString::fromLatin1(".png"))) - return entry + TQString::fromLatin1(".png"); + if (KStandardDirs::exists(entry + TQString::tqfromLatin1(".png"))) + return entry + TQString::tqfromLatin1(".png"); // rather theoretical - if (KStandardDirs::exists(entry + TQString::fromLatin1(".xpm"))) - return entry + TQString::fromLatin1(".xpm"); + if (KStandardDirs::exists(entry + TQString::tqfromLatin1(".xpm"))) + return entry + TQString::tqfromLatin1(".xpm"); - return TQString::null; + return TQString(); } const TQString& KCardDialog::deck() const { return d->cDeck; } @@ -271,11 +271,11 @@ void KCardDialog::setupDialog(bool showResizeBox) if (! (flags() & NoDeck)) { - TQHBoxLayout* layout = new TQHBoxLayout(cardLayout); + TQHBoxLayout* tqlayout = new TQHBoxLayout(cardLayout); // Deck iconview - TQGroupBox* grp1 = new TQGroupBox(1, Horizontal, i18n("Choose Backside"), plainPage()); - layout->addWidget(grp1); + TQGroupBox* grp1 = new TQGroupBox(1,Qt::Horizontal, i18n("Choose Backside"), plainPage()); + tqlayout->addWidget(grp1); d->deckIconView = new KIconView(grp1,"decks"); d->deckIconView->setSpacing(8); @@ -293,13 +293,13 @@ void KCardDialog::setupDialog(bool showResizeBox) d->deckIconView->showToolTips(); // deck select - TQVBoxLayout* l = new TQVBoxLayout(layout); + TQVBoxLayout* l = new TQVBoxLayout(tqlayout); TQGroupBox* grp3 = new TQGroupBox(i18n("Backside"), plainPage()); grp3->setFixedSize(100, 130); l->addWidget(grp3, 0, AlignTop|AlignHCenter); d->deckLabel = new TQLabel(grp3); d->deckLabel->setText(i18n("empty")); - d->deckLabel->setAlignment(AlignHCenter|AlignVCenter); + d->deckLabel->tqsetAlignment(AlignHCenter|AlignVCenter); d->deckLabel->setGeometry(10, 20, 80, 90); d->randomDeck = new TQCheckBox(plainPage()); @@ -325,9 +325,9 @@ void KCardDialog::setupDialog(bool showResizeBox) if (! (flags() & NoCards)) { // Cards iconview - TQHBoxLayout* layout = new TQHBoxLayout(cardLayout); - TQGroupBox* grp2 = new TQGroupBox(1, Horizontal, i18n("Choose Frontside"), plainPage()); - layout->addWidget(grp2); + TQHBoxLayout* tqlayout = new TQHBoxLayout(cardLayout); + TQGroupBox* grp2 = new TQGroupBox(1,Qt::Horizontal, i18n("Choose Frontside"), plainPage()); + tqlayout->addWidget(grp2); d->cardIconView =new KIconView(grp2,"cards"); /* @@ -343,13 +343,13 @@ void KCardDialog::setupDialog(bool showResizeBox) d->cardIconView->showToolTips(); // Card select - TQVBoxLayout* l = new TQVBoxLayout(layout); + TQVBoxLayout* l = new TQVBoxLayout(tqlayout); TQGroupBox* grp4 = new TQGroupBox(i18n("Frontside"), plainPage()); grp4->setFixedSize(100, 130); l->addWidget(grp4, 0, AlignTop|AlignHCenter); d->cardLabel = new TQLabel(grp4); d->cardLabel->setText(i18n("empty")); - d->cardLabel->setAlignment(AlignHCenter|AlignVCenter); + d->cardLabel->tqsetAlignment(AlignHCenter|AlignVCenter); d->cardLabel->setGeometry(10, 20, 80, 90 ); d->randomCardDir = new TQCheckBox(plainPage()); @@ -422,16 +422,16 @@ void KCardDialog::setupDialog(bool showResizeBox) // large. This is desired behaviour as i don't want to make the box even // larger but i want the complete pixmap to be displayed. the dialog is not // resized if you make the pixmap smaller again. - TQVBoxLayout* layout = new TQVBoxLayout(topLayout); - TQGroupBox* grp = new TQGroupBox(1, Horizontal, i18n("Resize Cards"), plainPage()); - layout->setResizeMode(TQLayout::Fixed); - layout->addWidget(grp); + TQVBoxLayout* tqlayout = new TQVBoxLayout(topLayout); + TQGroupBox* grp = new TQGroupBox(1,Qt::Horizontal, i18n("Resize Cards"), plainPage()); + tqlayout->setResizeMode(TQLayout::Fixed); + tqlayout->addWidget(grp); TQWidget* box = new TQWidget(grp); TQHBoxLayout* hbox = new TQHBoxLayout(box, 0, spacingHint()); TQVBoxLayout* boxLayout = new TQVBoxLayout(hbox); hbox->addStretch(0); - d->scaleSlider = new TQSlider(1, SLIDER_MAX, 1, (-1000+SLIDER_MIN+SLIDER_MAX), Horizontal, box); + d->scaleSlider = new TQSlider(1, SLIDER_MAX, 1, (-1000+SLIDER_MIN+SLIDER_MAX),Qt::Horizontal, box); d->scaleSlider->setMinValue(SLIDER_MIN); connect(d->scaleSlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotCardResized(int))); boxLayout->addWidget(d->scaleSlider, 0, AlignLeft); @@ -465,8 +465,8 @@ void KCardDialog::insertCardIcons() for (TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { KSimpleConfig cfg(*it); - cfg.setGroup(TQString::fromLatin1("KDE Backdeck")); - TQString path = (*it).left((*it).findRev('/') + 1); + cfg.setGroup(TQString::tqfromLatin1("KDE Backdeck")); + TQString path = (*it).left((*it).tqfindRev('/') + 1); assert(path[path.length() - 1] == '/'); TQPixmap pixmap(path + cfg.readEntry("Preview", "12c.png")); @@ -507,7 +507,7 @@ void KCardDialog::insertDeckIcons() // pixmap=pixmap.xForm(m); - cfg.setGroup(TQString::fromLatin1("KDE Cards")); + cfg.setGroup(TQString::tqfromLatin1("KDE Cards")); TQString name=cfg.readEntry("Name", i18n("unnamed")); TQIconViewItem *item= new TQIconViewItem(d->deckIconView,name, pixmap); @@ -528,8 +528,8 @@ KCardDialog::~KCardDialog() // Create the dialog -KCardDialog::KCardDialog( TQWidget *parent, const char *name, CardFlags mFlags) - : KDialogBase( Plain, i18n("Carddeck Selection"), Ok|Cancel, Ok, parent, name, true, true) +KCardDialog::KCardDialog( TQWidget *tqparent, const char *name, CardFlags mFlags) + : KDialogBase( Plain, i18n("Carddeck Selection"), Ok|Cancel, Ok, tqparent, name, true, true) { KCardDialog::init(); @@ -562,13 +562,13 @@ void KCardDialog::slotCardClicked(TQIconViewItem *item) TQString KCardDialog::getDeckName(const TQString &desktop) { TQString entry = desktop.left(desktop.length() - strlen(".desktop")); - if (KStandardDirs::exists(entry + TQString::fromLatin1(".png"))) - return entry + TQString::fromLatin1(".png"); + if (KStandardDirs::exists(entry + TQString::tqfromLatin1(".png"))) + return entry + TQString::tqfromLatin1(".png"); // rather theoretical - if (KStandardDirs::exists(entry + TQString::fromLatin1(".xpm"))) - return entry + TQString::fromLatin1(".xpm"); - return TQString::null; + if (KStandardDirs::exists(entry + TQString::tqfromLatin1(".xpm"))) + return entry + TQString::tqfromLatin1(".xpm"); + return TQString(); } TQString KCardDialog::getRandomDeck() @@ -577,7 +577,7 @@ TQString KCardDialog::getRandomDeck() TQStringList list = KGlobal::dirs()->findAllResources("cards", "decks/*.desktop"); if (list.isEmpty()) - return TQString::null; + return TQString(); int d = KApplication::random() % list.count(); return getDeckName(*list.at(d)); @@ -589,7 +589,7 @@ TQString KCardDialog::getRandomCardDir() TQStringList list = KGlobal::dirs()->findAllResources("cards", "card*/index.desktop"); if (list.isEmpty()) - return TQString::null; + return TQString(); int d = KApplication::random() % list.count(); TQString entry = *list.at(d); @@ -634,8 +634,8 @@ void KCardDialog::slotRandomCardDirToggled(bool on) if (on) { d->cardLabel->setText("random"); setCardDir(getRandomCardDir()); - if (cardDir().length()>0 && cardDir().right(1)!=TQString::fromLatin1("/")) { - setCardDir(cardDir() + TQString::fromLatin1("/")); + if (cardDir().length()>0 && cardDir().right(1)!=TQString::tqfromLatin1("/")) { + setCardDir(cardDir() + TQString::tqfromLatin1("/")); } } else { d->cardLabel->setText("empty"); @@ -742,7 +742,7 @@ void KCardDialog::saveConfig(KConfig* conf) void KCardDialog::slotSetGlobalDeck() { - KSimpleConfig* conf = new KSimpleConfig(TQString::fromLatin1("kdeglobals"), false); + KSimpleConfig* conf = new KSimpleConfig(TQString::tqfromLatin1("kdeglobals"), false); conf->setGroup(CONF_GLOBAL_GROUP); conf->writeEntry(CONF_GLOBAL_DECK, deck()); @@ -753,7 +753,7 @@ void KCardDialog::slotSetGlobalDeck() void KCardDialog::slotSetGlobalCardDir() { - KSimpleConfig* conf = new KSimpleConfig(TQString::fromLatin1("kdeglobals"), false); + KSimpleConfig* conf = new KSimpleConfig(TQString::tqfromLatin1("kdeglobals"), false); conf->setGroup(CONF_GLOBAL_GROUP); conf->writePathEntry(CONF_GLOBAL_CARDDIR, cardDir()); @@ -764,7 +764,7 @@ void KCardDialog::slotSetGlobalCardDir() void KCardDialog::getGlobalDeck(TQString& deck, bool& random) { - KSimpleConfig* conf = new KSimpleConfig(TQString::fromLatin1("kdeglobals"), true); + KSimpleConfig* conf = new KSimpleConfig(TQString::tqfromLatin1("kdeglobals"), true); conf->setGroup(CONF_GLOBAL_GROUP); if (!conf->hasKey(CONF_GLOBAL_DECK) || conf->readBoolEntry(CONF_GLOBAL_RANDOMDECK, false)) { @@ -780,7 +780,7 @@ void KCardDialog::getGlobalDeck(TQString& deck, bool& random) void KCardDialog::getGlobalCardDir(TQString& dir, bool& random) { - KSimpleConfig* conf = new KSimpleConfig(TQString::fromLatin1("kdeglobals"), true); + KSimpleConfig* conf = new KSimpleConfig(TQString::tqfromLatin1("kdeglobals"), true); conf->setGroup(CONF_GLOBAL_GROUP); if (!conf->hasKey(CONF_GLOBAL_CARDDIR) || conf->readBoolEntry(CONF_GLOBAL_RANDOMCARDDIR, false)) { @@ -799,7 +799,7 @@ void KCardDialog::init() static bool _inited = false; if (_inited) return; - KGlobal::dirs()->addResourceType("cards", KStandardDirs::kde_default("data") + TQString::fromLatin1("carddecks/")); + KGlobal::dirs()->addResourceType("cards", KStandardDirs::kde_default("data") + TQString::tqfromLatin1("carddecks/")); KGlobal::locale()->insertCatalogue("libkdegames"); _inited = true; diff --git a/libkdegames/kcarddialog.h b/libkdegames/kcarddialog.h index 7cdc82b6..e0681f5b 100644 --- a/libkdegames/kcarddialog.h +++ b/libkdegames/kcarddialog.h @@ -90,6 +90,7 @@ class KCardDialogPrivate; class KDE_EXPORT KCardDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: @@ -103,11 +104,11 @@ public: /** * Constructs a card deck selection dialog. * - * @param parent The parent widget of the dialog, if any. + * @param tqparent The tqparent widget of the dialog, if any. * @param name The name of the dialog. * @param flags Specifies whether the dialog is modal or not. */ - KCardDialog (TQWidget* parent = NULL,const char* name = NULL, + KCardDialog (TQWidget* tqparent = NULL,const char* name = NULL, CardFlags flags = Both); /** * Destructs a card deck selection dialog. @@ -125,7 +126,7 @@ public: * @param carddir a reference to the directory name used as front of the * cards. The directory contains the card images as 1.png to 52.png * - * @param parent an optional pointer to the parent window of the dialog + * @param tqparent an optional pointer to the tqparent window of the dialog * * @param flags what to show * @@ -153,7 +154,7 @@ public: * * @return TQDialog::result(). */ - static int getCardDeck(TQString &deck,TQString &carddir, TQWidget *parent=0, + static int getCardDeck(TQString &deck,TQString &carddir, TQWidget *tqparent=0, CardFlags flags=Both, bool* randomDeck=0, bool* randomCardDir=0, double* scale=0, KConfig* conf=0); diff --git a/libkdegames/kchat.cpp b/libkdegames/kchat.cpp index 2a9c3913..71471497 100644 --- a/libkdegames/kchat.cpp +++ b/libkdegames/kchat.cpp @@ -36,7 +36,7 @@ public: int mFromId; }; -KChat::KChat(TQWidget* parent, bool twoPlayerGame) : KChatBase(parent, twoPlayerGame) +KChat::KChat(TQWidget* tqparent, bool twoPlayerGame) : KChatBase(tqparent, twoPlayerGame) { init(); } diff --git a/libkdegames/kchat.h b/libkdegames/kchat.h index 5eabb9d3..a28578c7 100644 --- a/libkdegames/kchat.h +++ b/libkdegames/kchat.h @@ -36,14 +36,15 @@ class KChatPrivate; class KDE_EXPORT KChat : public KChatBase { Q_OBJECT + TQ_OBJECT public: /** - * @param parent The parent widget for this widget. + * @param tqparent The tqparent widget for this widget. * @param twoPlayerGame If true the combo box where the player can * choose to send to a single player or to all players will not be added * as you will hardly need it in 2-player games. **/ - KChat(TQWidget* parent, bool twoPlayerGame = false); + KChat(TQWidget* tqparent, bool twoPlayerGame = false); virtual ~KChat(); diff --git a/libkdegames/kchatbase.cpp b/libkdegames/kchatbase.cpp index 421e0224..182f96a9 100644 --- a/libkdegames/kchatbase.cpp +++ b/libkdegames/kchatbase.cpp @@ -73,14 +73,14 @@ void KChatBaseText::init() void KChatBaseText::setName(const TQString& n) { // d->mName = n; - d->mName = TQString("%1: ").arg(n); - setText(TQString("%1: %2").arg(name()).arg(message())); // esp. for sorting + d->mName = TQString("%1: ").tqarg(n); + setText(TQString("%1: %2").tqarg(name()).tqarg(message())); // esp. for sorting } void KChatBaseText::setMessage(const TQString& m) { d->mMessage = m; - setText(TQString("%1: %2").arg(name()).arg(message())); // esp. for sorting + setText(TQString("%1: %2").tqarg(name()).tqarg(message())); // esp. for sorting } const TQString& KChatBaseText::name() const @@ -135,7 +135,7 @@ int KChatBaseText::width(TQListBox* lb) const w += TQFontMetrics(messageFont()).width(message()); } // int w = lb ? lb->fontMetrics().width( text() ) + 6 : 0; // QT orig - return QMAX(w, TQApplication::globalStrut().width()); + return TQMAX(w, TQApplication::globalStrut().width()); } int KChatBaseText::height(TQListBox* lb) const @@ -151,7 +151,7 @@ int KChatBaseText::height(TQListBox* lb) const } } // int h = lb ? lb->fontMetrics().lineSpacing() + 2 : 0; // QT orig - return QMAX(h, TQApplication::globalStrut().height()); + return TQMAX(h, TQApplication::globalStrut().height()); } @@ -182,7 +182,7 @@ public: TQFont mSystemMessageFont; }; -KChatBase::KChatBase(TQWidget* parent, bool noComboBox) : TQFrame(parent) +KChatBase::KChatBase(TQWidget* tqparent, bool noComboBox) : TQFrame(tqparent) { init(noComboBox); } @@ -211,7 +211,7 @@ void KChatBase::init(bool noComboBox) l->addWidget(d->mBox); d->mBox->setVScrollBarMode(TQScrollView::AlwaysOn); d->mBox->setHScrollBarMode(TQScrollView::AlwaysOff); - d->mBox->setFocusPolicy(TQWidget::NoFocus); + d->mBox->setFocusPolicy(TQ_NoFocus); // d->mBox->setSelectionMode(TQListBox::NoSelection); d->mBox->setSelectionMode(TQListBox::Single); @@ -236,7 +236,7 @@ void KChatBase::init(bool noComboBox) setMaxItems(-1); // unlimited if (kapp) { - // kapp might be NULL as well - in case we are in Qt designer. + // kapp might be NULL as well - in case we are in TQt designer. readConfig(); } } @@ -262,7 +262,7 @@ bool KChatBase::insertSendingEntry(const TQString& text, int id, int index) kdWarning(11000) << "KChatBase: Cannot add an entry to the combo box" << endl; return false; } - if (d->mIndex2Id.findIndex(id) != -1) { + if (d->mIndex2Id.tqfindIndex(id) != -1) { kdError(11000) << "KChatBase: Cannot add more than one entry with the same ID! " << endl; kdError(11000) << "KChatBase: Text="<mIndex2Id.findIndex(id); + return d->mIndex2Id.tqfindIndex(id); } int KChatBase::nextId() const { int i = SendToAll + 1; - while (d->mIndex2Id.findIndex(i) != -1) { + while (d->mIndex2Id.tqfindIndex(i) != -1) { i++; } return i; @@ -349,26 +349,26 @@ void KChatBase::addItem(const TQListBoxItem* text) void KChatBase::addMessage(const TQString& fromName, const TQString& text) { //maybe "%1 says: %2" or so - addItem(layoutMessage(fromName, text)); + addItem(tqlayoutMessage(fromName, text)); } void KChatBase::addSystemMessage(const TQString& fromName, const TQString& text) { - addItem(layoutSystemMessage(fromName, text)); + addItem(tqlayoutSystemMessage(fromName, text)); } -TQListBoxItem* KChatBase::layoutMessage(const TQString& fromName, const TQString& text) +TQListBoxItem* KChatBase::tqlayoutMessage(const TQString& fromName, const TQString& text) { //TODO: KChatBaseConfigure? - e.g. color TQListBoxItem* message; if (text.startsWith("/me ")) { - // replace "/me" by a nice star. leave one space after the star + // tqreplace "/me" by a nice star. leave one space after the star TQPixmap pix; - pix.load(locate("data", TQString::fromLatin1("kdegames/pics/star.png"))); + pix.load(locate("data", TQString::tqfromLatin1("kdegames/pics/star.png"))); //TODO KChatBasePixmap? Should change the font here! - message = (TQListBoxItem*)new TQListBoxPixmap(pix, i18n("%1 %2").arg(fromName).arg(text.mid(3))); + message = (TQListBoxItem*)new TQListBoxPixmap(pix, i18n("%1 %2").tqarg(fromName).tqarg(text.mid(3))); } else { // the text is not edited in any way. just return an item KChatBaseText* m = new KChatBaseText(fromName, text); @@ -379,12 +379,12 @@ TQListBoxItem* KChatBase::layoutMessage(const TQString& fromName, const TQString return message; } -TQListBoxItem* KChatBase::layoutSystemMessage(const TQString& fromName, const TQString& text) +TQListBoxItem* KChatBase::tqlayoutSystemMessage(const TQString& fromName, const TQString& text) { //TODO: KChatBaseConfigure? - e.g. color // no need to check for /me etc. - KChatBaseText* m = new KChatBaseText(i18n("--- %1").arg(fromName), text); + KChatBaseText* m = new KChatBaseText(i18n("--- %1").tqarg(fromName), text); m->setNameFont(&d->mSystemNameFont); m->setMessageFont(&d->mSystemMessageFont); return (TQListBoxItem*)m; @@ -406,7 +406,7 @@ void KChatBase::slotReturnPressed(const TQString& text) TQString KChatBase::comboBoxItem(const TQString& name) const { // TODO: such a function for "send to all" and "send to my group" - return i18n("Send to %1").arg(name); + return i18n("Send to %1").tqarg(name); } void KChatBase::slotClear() diff --git a/libkdegames/kchatbase.h b/libkdegames/kchatbase.h index 7dc5ff59..5e97b80c 100644 --- a/libkdegames/kchatbase.h +++ b/libkdegames/kchatbase.h @@ -46,7 +46,7 @@ class KChatBaseTextPrivate; * will probably some kind of KChatBaseDialog which offers the user the ability * to configure things like color and font on the fly. **/ -class KChatBaseText : public QListBoxText +class KChatBaseText : public TQListBoxText { public: @@ -171,8 +171,8 @@ class KChatBasePrivate; * * To add a message just call addMessage with the nickname of the player * who sent the message and the message itself. If you don't want to use - * layoutMessage by any reason you can also call addItem directly. But you - * should better replace layoutMessage instead. + * tqlayoutMessage by any reason you can also call addItem directly. But you + * should better replace tqlayoutMessage instead. * * You probably don't want to use the abstract class KChatBase directly but use * one of the derived classess KChat or KGameChat. The latter is the @@ -181,17 +181,18 @@ class KChatBasePrivate; * * @author Andreas Beckermann **/ -class KDE_EXPORT KChatBase : public QFrame +class KDE_EXPORT KChatBase : public TQFrame { Q_OBJECT + TQ_OBJECT public: /** - * @param parent The parent widget for this widget. + * @param tqparent The tqparent widget for this widget. * @param noComboBox If true then the combo box where the player can * choose where to send messages to (either globally or just to some * players) will not be added. **/ - KChatBase(TQWidget* parent, bool noComboBox = false); + KChatBase(TQWidget* tqparent, bool noComboBox = false); /** * Destruct the KChatBase object @@ -313,35 +314,35 @@ public: /** * Same as setNameFont but applies only to system messages. - * @see layoutSystemMessage + * @see tqlayoutSystemMessage **/ void setSystemNameFont(const TQFont& font); /** * Same as setMessageFont but applies only to system messages. - * @see layoutSystemMessage + * @see tqlayoutSystemMessage **/ void setSystemMessageFont(const TQFont& font); /** * Same as setBothFont but applies only to system messages. - * @see layoutSystemMessage + * @see tqlayoutSystemMessage **/ void setSystemBothFont(const TQFont& font); /** * This font should be used for the name (the "from: " part) of a - * message. layoutMessage uses this to set the font using + * message. tqlayoutMessage uses this to set the font using * KChatBaseText::setNameFont but if you want to overwrite - * layoutMessage you should do this yourself. + * tqlayoutMessage you should do this yourself. * @return The font that is used for the name part of the message. **/ const TQFont& nameFont() const; /** - * This font should be used for a message. layoutMessage sets the + * This font should be used for a message. tqlayoutMessage sets the * font of a message using KChatBaseText::setMessageFont but if ypu - * replace layoutMessage with your own function you should use + * replace tqlayoutMessage with your own function you should use * messageFont() yourself. * @return The font that is used for a message **/ @@ -349,13 +350,13 @@ public: /** * Same as systemNameFont but applies only to system messages. - * @see layoutSystemMessage + * @see tqlayoutSystemMessage **/ const TQFont& systemNameFont() const; /** * Same as systemMessageFont but applies only to system messages. - * @see layoutSystemMessage + * @see tqlayoutSystemMessage **/ const TQFont& systemMessageFont() const; @@ -405,7 +406,7 @@ public slots: * Maybe you want to replace this with a function that creates a nicer text * than "fromName: text" * - * Update: the function layoutMessage is called by this now. This + * Update: the function tqlayoutMessage is called by this now. This * means that you will get user defined outlook on the messages :-) * @param fromName The player who sent this message * @param text The text to be added @@ -414,7 +415,7 @@ public slots: /** * This works just like addMessage but adds a system message. - * layoutSystemMessage is used to generate the displayed item. System + * tqlayoutSystemMessage is used to generate the displayed item. System * messages will have a different look than player messages. * * You may wish to use this to display status information from your game. @@ -470,7 +471,7 @@ protected: /** * Replace to customise the combo box. * - * Default: i18n("Send to %1).arg(name) + * Default: i18n("Send to %1).tqarg(name) * @param name The name of the player * @return The string as it will be shown in the combo box **/ @@ -478,20 +479,20 @@ protected: /** * Create a TQListBoxItem for this message. This function is not yet - * written usefully - currently just a QListBoxTex object is + * written usefully - currently just a TQListBoxTex object is * created which shows the message in this format: "fromName: text". * This should fit most peoples needs but needs further improvements. **/ - virtual TQListBoxItem* layoutMessage(const TQString& fromName, const TQString& text); + virtual TQListBoxItem* tqlayoutMessage(const TQString& fromName, const TQString& text); /** * Create a TQListBoxItem for this message. This does the same as - * layoutMessage but generates a system message. You might want to + * tqlayoutMessage but generates a system message. You might want to * use such a message to display e.g. status information from your game. * * The default implementation just prepends "--- ". **/ - virtual TQListBoxItem* layoutSystemMessage(const TQString& fromName, const TQString& text); + virtual TQListBoxItem* tqlayoutSystemMessage(const TQString& fromName, const TQString& text); private slots: /** diff --git a/libkdegames/kchatdialog.cpp b/libkdegames/kchatdialog.cpp index 9cfbefff..58c90e69 100644 --- a/libkdegames/kchatdialog.cpp +++ b/libkdegames/kchatdialog.cpp @@ -55,17 +55,17 @@ class KChatDialogPrivate KChatBase* mChat; }; -KChatDialog::KChatDialog(KChatBase* chat, TQWidget* parent, bool modal) -// : KDialogBase(Tabbed, i18n("Configure Chat"), Ok|Default|Apply|Cancel, Ok, parent, 0, modal, true) - : KDialogBase(Plain, i18n("Configure Chat"), Ok|Default|Apply|Cancel, Ok, parent, 0, modal, true) +KChatDialog::KChatDialog(KChatBase* chat, TQWidget* tqparent, bool modal) +// : KDialogBase(Tabbed, i18n("Configure Chat"), Ok|Default|Apply|Cancel, Ok, tqparent, 0, modal, true) + : KDialogBase(Plain, i18n("Configure Chat"), Ok|Default|Apply|Cancel, Ok, tqparent, 0, modal, true) { init(); plugChatWidget(chat); } -KChatDialog::KChatDialog(TQWidget* parent, bool modal) -// : KDialogBase(Tabbed, i18n("Configure Chat"), Ok|Default|Apply|Cancel, Ok, parent, 0, modal, true) - : KDialogBase(Plain, i18n("Configure Chat"), Ok|Default|Apply|Cancel, Ok, parent, 0, modal, true) +KChatDialog::KChatDialog(TQWidget* tqparent, bool modal) +// : KDialogBase(Tabbed, i18n("Configure Chat"), Ok|Default|Apply|Cancel, Ok, tqparent, 0, modal, true) + : KDialogBase(Plain, i18n("Configure Chat"), Ok|Default|Apply|Cancel, Ok, tqparent, 0, modal, true) { init(); } @@ -80,42 +80,42 @@ void KChatDialog::init() d = new KChatDialogPrivate; // d->mTextPage = addPage(i18n("&Messages"));// not a good name - game Messages? d->mTextPage = plainPage(); - TQGridLayout* layout = new TQGridLayout(d->mTextPage, 7, 2, KDialog::marginHint(), KDialog::spacingHint()); + TQGridLayout* tqlayout = new TQGridLayout(d->mTextPage, 7, 2, KDialog::marginHint(), KDialog::spacingHint()); // General fonts TQPushButton* nameFont = new TQPushButton(i18n("Name Font..."), d->mTextPage); connect(nameFont, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotGetNameFont())); - layout->addWidget(nameFont, 0, 0); + tqlayout->addWidget(nameFont, 0, 0); TQPushButton* textFont = new TQPushButton(i18n("Text Font..."), d->mTextPage); connect(textFont, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotGetTextFont())); - layout->addWidget(textFont, 0, 1); + tqlayout->addWidget(textFont, 0, 1); TQFrame* messagePreview = new TQFrame(d->mTextPage); messagePreview->setFrameStyle(TQFrame::StyledPanel | TQFrame::Sunken); TQHBoxLayout* messageLayout = new TQHBoxLayout(messagePreview); - layout->addMultiCellWidget(messagePreview, 1, 1, 0, 1); + tqlayout->addMultiCellWidget(messagePreview, 1, 1, 0, 1); d->mNamePreview = new TQLabel(i18n("Player: "), messagePreview); messageLayout->addWidget(d->mNamePreview, 0); d->mTextPreview = new TQLabel(i18n("This is a player message"), messagePreview); messageLayout->addWidget(d->mTextPreview, 1); - layout->addRowSpacing(2, 10); + tqlayout->addRowSpacing(2, 10); // System Message fonts TQLabel* systemMessages = new TQLabel(i18n("System Messages - Messages directly sent from the game"), d->mTextPage); - layout->addMultiCellWidget(systemMessages, 3, 3, 0, 1); + tqlayout->addMultiCellWidget(systemMessages, 3, 3, 0, 1); TQPushButton* systemNameFont = new TQPushButton(i18n("Name Font..."), d->mTextPage); connect(systemNameFont, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotGetSystemNameFont())); - layout->addWidget(systemNameFont, 4, 0); + tqlayout->addWidget(systemNameFont, 4, 0); TQPushButton* systemTextFont = new TQPushButton(i18n("Text Font..."), d->mTextPage); connect(systemTextFont, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotGetSystemTextFont())); - layout->addWidget(systemTextFont, 4, 1); + tqlayout->addWidget(systemTextFont, 4, 1); TQFrame* systemMessagePreview = new TQFrame(d->mTextPage); systemMessagePreview->setFrameStyle(TQFrame::StyledPanel | TQFrame::Sunken); TQHBoxLayout* systemMessageLayout = new TQHBoxLayout(systemMessagePreview); - layout->addMultiCellWidget(systemMessagePreview, 5, 5, 0, 1); + tqlayout->addMultiCellWidget(systemMessagePreview, 5, 5, 0, 1); d->mSystemNamePreview = new TQLabel(i18n("--- Game: "), systemMessagePreview); systemMessageLayout->addWidget(d->mSystemNamePreview, 0); @@ -124,10 +124,10 @@ void KChatDialog::init() // message count TQLabel* maxMessages = new TQLabel(i18n("Maximal number of messages (-1 = unlimited):"), d->mTextPage); - layout->addWidget(maxMessages, 6, 0); + tqlayout->addWidget(maxMessages, 6, 0); d->mMaxMessages = new TQLineEdit(d->mTextPage); d->mMaxMessages->setText(TQString::number(-1)); - layout->addWidget(d->mMaxMessages, 6, 1); + tqlayout->addWidget(d->mMaxMessages, 6, 1); } void KChatDialog::slotGetNameFont() diff --git a/libkdegames/kchatdialog.h b/libkdegames/kchatdialog.h index 853dd94a..5e5ff70d 100644 --- a/libkdegames/kchatdialog.h +++ b/libkdegames/kchatdialog.h @@ -30,18 +30,19 @@ class KChatDialogPrivate; class KDE_EXPORT KChatDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: /** * Construct a KChatDialog widget **/ - KChatDialog(TQWidget* parent, bool modal = false); + KChatDialog(TQWidget* tqparent, bool modal = false); /** * Construct a KChatDialog widget which automatically configures the * @ref KChatBase widget. You probably want to use this as you don't * have to care about the configuration stuff yourself. **/ - KChatDialog(KChatBase* chatWidget, TQWidget* parent, bool modal = false); + KChatDialog(KChatBase* chatWidget, TQWidget* tqparent, bool modal = false); /** * Destruct the dialog diff --git a/libkdegames/kgame/COMPAT b/libkdegames/kgame/COMPAT index 146d3a88..4551c679 100644 --- a/libkdegames/kgame/COMPAT +++ b/libkdegames/kgame/COMPAT @@ -10,7 +10,7 @@ KGameIO::signalPrepareMove(..., bool*): don't know why this was necessary but it didn't work anymore... 16.09.2001: KGamePropertyHandler uses bool* for the sent parameter now. This is - because QT3 obviously doesn't honor referneces in signals/slots. + because QT3 obviously doesn't honor referneces in Q_SIGNALS/Q_SLOTS. This might even be a QT bug. Bad situation - we use references everywhere in KGame... hope nothing else is affecterd by this problem (signalPrepareMove was fixed already by me) @@ -38,7 +38,7 @@ too! The API stays the same. 11.10.2001 KGameDialogGeneralConfig now doesn't provide setMin/maxPlayers() - anymore. The game should manage this internally. layout() is + anymore. The game should manage this internally. tqlayout() is obsolete as well 18.10.2001 KPlayer::signalNetworkData contained QDataStream& instead of const QByteArray& parameter (oops!). This is fixed now. All apps which @@ -47,7 +47,7 @@ KPlayer::sendProperty() and related functions contain a "int msgid" parameter. This is the id() of the property handler. This parameter enables us to easily add any number of property handler to a game - just by connecting it to existing send slots and call + just by connecting it to existing send Q_SLOTS and call processMessage() in slotNetworkData() 03.11.2001 KPlayer::signalNetworkData now emits msgid-KGameMessage::IdUser just like KGame::signalNetworkData does diff --git a/libkdegames/kgame/DESIGN b/libkdegames/kgame/DESIGN index b1c48146..cd737e3a 100644 --- a/libkdegames/kgame/DESIGN +++ b/libkdegames/kgame/DESIGN @@ -359,7 +359,7 @@ KDialogBase::addVBoxPage() (for example). 5.1.1 Debug KGame ----------------- The first page, "Debug KGame" shows on the left most or even all status values of -KGame. That contains e.g. minPlayers(), isAdmin(), gameStatus(), ... +KGame. That contains e.g. minPlayers(), isAdmin(), gametqStatus(), ... The right side is probably the more important one. It lists *all* KGameProperties which have been inserted to this KGame object (only to this KGame object - not the ones that have been added to the players!). Most of the status variables of diff --git a/libkdegames/kgame/dialogs/kgameconnectdialog.cpp b/libkdegames/kgame/dialogs/kgameconnectdialog.cpp index 575b3090..f0e0c606 100644 --- a/libkdegames/kgame/dialogs/kgameconnectdialog.cpp +++ b/libkdegames/kgame/dialogs/kgameconnectdialog.cpp @@ -56,7 +56,7 @@ class KGameConnectWidgetPrivate TQString mType; }; -KGameConnectWidget::KGameConnectWidget(TQWidget* parent) : TQWidget(parent) +KGameConnectWidget::KGameConnectWidget(TQWidget* tqparent) : TQWidget(tqparent) { d = new KGameConnectWidgetPrivate; @@ -165,7 +165,7 @@ TQString KGameConnectWidget::host() const if (d->mHost->isEnabled()) { return d->mHost->text(); } else { - return TQString::null; + return TQString(); } } @@ -212,9 +212,9 @@ class KGameConnectDialogPrivate KGameConnectWidget* mConnect; }; -// buttonmask =Ok|Cancel -KGameConnectDialog::KGameConnectDialog(TQWidget* parent,int buttonmask) : KDialogBase(Plain, - i18n("Network Game"),buttonmask , Ok, parent, 0, true, buttonmask!=0) +// buttontqmask =Ok|Cancel +KGameConnectDialog::KGameConnectDialog(TQWidget* tqparent,int buttontqmask) : KDialogBase(Plain, + i18n("Network Game"),buttontqmask , Ok, tqparent, 0, true, buttontqmask!=0) { d = new KGameConnectDialogPrivate; TQVBoxLayout* vb = new TQVBoxLayout(plainPage(), spacingHint()); @@ -228,9 +228,9 @@ KGameConnectDialog::~KGameConnectDialog() } int KGameConnectDialog::initConnection( unsigned short int& port, - TQString& host, TQWidget* parent, bool server) + TQString& host, TQWidget* tqparent, bool server) { - KGameConnectDialog d(parent); + KGameConnectDialog d(tqparent); d.setHost(host); d.setPort(port); if (server) { diff --git a/libkdegames/kgame/dialogs/kgameconnectdialog.h b/libkdegames/kgame/dialogs/kgameconnectdialog.h index fdb0be4f..ad4ff7d1 100644 --- a/libkdegames/kgame/dialogs/kgameconnectdialog.h +++ b/libkdegames/kgame/dialogs/kgameconnectdialog.h @@ -26,11 +26,12 @@ class KGameConnectDialogPrivate; class KGameConnectWidgetPrivate; -class KGameConnectWidget : public QWidget +class KGameConnectWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - KGameConnectWidget(TQWidget* parent); + KGameConnectWidget(TQWidget* tqparent); virtual ~KGameConnectWidget(); /** @@ -39,7 +40,7 @@ public: void setHost(const TQString& host); /** - * @return The host to connect to or TQString::null if the user wants to + * @return The host to connect to or TQString() if the user wants to * be the MASTER **/ TQString host() const; @@ -108,16 +109,17 @@ private: * @short Dialog to ask for host and port * * This Dialog is used to create a game. You call initConnection(port, - * TQString::null, parent, true) to create a network game (as a server) - * or initConnection(port, host, parent) to join a network game. + * TQString(), tqparent, true) to create a network game (as a server) + * or initConnection(port, host, tqparent) to join a network game. * * @author Andreas Beckermann **/ class KGameConnectDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - KGameConnectDialog(TQWidget* parent = 0,int buttonmask=Ok|Cancel); + KGameConnectDialog(TQWidget* tqparent = 0,int buttontqmask=Ok|Cancel); virtual ~KGameConnectDialog(); /** @@ -125,12 +127,12 @@ public: * server game, depending on user's choice. * @param port The port the user wants to connect to. * @param host The host the user wants to connect to. Will be - * TQString::null if server game is chosen - * @param parent The parent of the dialog + * TQString() if server game is chosen + * @param tqparent The tqparent of the dialog * @param server True to create a network game per default, false to * join a game by default **/ - static int initConnection(unsigned short int& port, TQString& host, TQWidget* parent, bool server = false); + static int initConnection(unsigned short int& port, TQString& host, TQWidget* tqparent, bool server = false); /** * @param host The host to connect to by default @@ -138,7 +140,7 @@ public: void setHost(const TQString& host); /** - * @return The host to connect to or TQString::null if the user wants to + * @return The host to connect to or TQString() if the user wants to * be the MASTER **/ TQString host() const; diff --git a/libkdegames/kgame/dialogs/kgamedebugdialog.cpp b/libkdegames/kgame/dialogs/kgamedebugdialog.cpp index 09a35e56..06987aad 100644 --- a/libkdegames/kgame/dialogs/kgamedebugdialog.cpp +++ b/libkdegames/kgame/dialogs/kgamedebugdialog.cpp @@ -56,7 +56,7 @@ public: mGameMaster = 0; mGameAdmin = 0; mGameOffering = 0; - mGameStatus = 0; + mGametqStatus = 0; mGameRunning = 0; mGameMaxPlayers = 0; mGameMinPlayers = 0; @@ -93,7 +93,7 @@ public: TQListViewItem* mGameMaster; TQListViewItem* mGameAdmin; TQListViewItem* mGameOffering; - TQListViewItem* mGameStatus; + TQListViewItem* mGametqStatus; TQListViewItem* mGameRunning; TQListViewItem* mGameMaxPlayers; TQListViewItem* mGameMinPlayers; @@ -120,9 +120,9 @@ public: KListBox* mHideIdList; }; -KGameDebugDialog::KGameDebugDialog(KGame* g, TQWidget* parent, bool modal) : +KGameDebugDialog::KGameDebugDialog(KGame* g, TQWidget* tqparent, bool modal) : KDialogBase(Tabbed, i18n("KGame Debug Dialog"), Close, Close, - parent, 0, modal, true) + tqparent, 0, modal, true) { d = new KGameDebugDialogPrivate; @@ -142,18 +142,18 @@ void KGameDebugDialog::initGamePage() { d->mGamePage = addPage(i18n("Debug &KGame")); TQVBoxLayout* topLayout = new TQVBoxLayout(d->mGamePage, marginHint(), spacingHint()); - TQHBoxLayout* layout = new TQHBoxLayout(topLayout); + TQHBoxLayout* tqlayout = new TQHBoxLayout(topLayout); KListView* v = new KListView(d->mGamePage); v->addColumn(i18n("Data")); v->addColumn(i18n("Value")); - layout->addWidget(v); + tqlayout->addWidget(v); d->mGameProperties = new KListView(d->mGamePage); d->mGameProperties->addColumn(i18n("Property")); d->mGameProperties->addColumn(i18n("Value")); d->mGameProperties->addColumn(i18n("Policy")); - layout->addWidget(d->mGameProperties); + tqlayout->addWidget(d->mGameProperties); TQPushButton* b = new TQPushButton(i18n("Update"), d->mGamePage); connect(b, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotUpdateGameData())); @@ -166,7 +166,7 @@ void KGameDebugDialog::initGamePage() d->mGameMaster = new TQListViewItem(v, i18n("Is Master")); d->mGameAdmin = new TQListViewItem(v, i18n("Is Admin")); d->mGameOffering = new TQListViewItem(v, i18n("Is Offering Connections")); - d->mGameStatus = new TQListViewItem(v, i18n("Game Status")); + d->mGametqStatus = new TQListViewItem(v, i18n("Game tqStatus")); d->mGameRunning = new TQListViewItem(v, i18n("Game is Running")); d->mGameMaxPlayers = new TQListViewItem(v, i18n("Maximal Players")); d->mGameMinPlayers = new TQListViewItem(v, i18n("Minimal Players")); @@ -177,19 +177,19 @@ void KGameDebugDialog::initPlayerPage() { d->mPlayerPage = addPage(i18n("Debug &Players")); TQVBoxLayout* topLayout = new TQVBoxLayout(d->mPlayerPage, marginHint(), spacingHint()); - TQHBoxLayout* layout = new TQHBoxLayout(topLayout); + TQHBoxLayout* tqlayout = new TQHBoxLayout(topLayout); //TODO: connect to the KGame signals for joined/removed players!!! - TQVBoxLayout* listLayout = new TQVBoxLayout(layout); + TQVBoxLayout* listLayout = new TQVBoxLayout(tqlayout); TQLabel* listLabel = new TQLabel(i18n("Available Players"), d->mPlayerPage); listLayout->addWidget(listLabel); d->mPlayerList = new KListBox(d->mPlayerPage); connect(d->mPlayerList, TQT_SIGNAL(executed(TQListBoxItem*)), this, TQT_SLOT(slotUpdatePlayerData(TQListBoxItem*))); listLayout->addWidget(d->mPlayerList); - d->mPlayerList->setSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Expanding)); + d->mPlayerList->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Expanding)); KListView* v = new KListView(d->mPlayerPage); - layout->addWidget(v); + tqlayout->addWidget(v); v->addColumn(i18n("Data")); v->addColumn(i18n("Value")); @@ -197,7 +197,7 @@ void KGameDebugDialog::initPlayerPage() d->mPlayerProperties->addColumn(i18n("Property")); d->mPlayerProperties->addColumn(i18n("Value")); d->mPlayerProperties->addColumn(i18n("Policy")); - layout->addWidget(d->mPlayerProperties); + tqlayout->addWidget(d->mPlayerProperties); TQPushButton* b = new TQPushButton(i18n("Update"), d->mPlayerPage); connect(b, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotUpdatePlayerList())); @@ -220,9 +220,9 @@ void KGameDebugDialog::initPlayerPage() void KGameDebugDialog::initMessagePage() { d->mMessagePage = addPage(i18n("Debug &Messages")); - TQGridLayout* layout = new TQGridLayout(d->mMessagePage, 11, 7, marginHint(), spacingHint()); + TQGridLayout* tqlayout = new TQGridLayout(d->mMessagePage, 11, 7, marginHint(), spacingHint()); d->mMessageList = new KListView(d->mMessagePage); - layout->addMultiCellWidget(d->mMessageList, 0, 9, 0, 3); + tqlayout->addMultiCellWidget(d->mMessageList, 0, 9, 0, 3); d->mMessageList->addColumn(i18n("Time")); d->mMessageList->addColumn(i18n("ID")); d->mMessageList->addColumn(i18n("Receiver")); @@ -231,20 +231,20 @@ void KGameDebugDialog::initMessagePage() TQPushButton* hide = new TQPushButton(i18n("&>>"), d->mMessagePage); connect(hide, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotHideId())); - layout->addWidget(hide, 4, 4); + tqlayout->addWidget(hide, 4, 4); TQPushButton* show = new TQPushButton(i18n("&<<"), d->mMessagePage); connect(show, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotShowId())); - layout->addWidget(show, 6, 4); + tqlayout->addWidget(show, 6, 4); TQLabel* l = new TQLabel(i18n("Do not show IDs:"), d->mMessagePage); - layout->addMultiCellWidget(l, 0, 0, 5, 6); + tqlayout->addMultiCellWidget(l, 0, 0, 5, 6); d->mHideIdList = new KListBox(d->mMessagePage); - layout->addMultiCellWidget(d->mHideIdList, 1, 8, 5, 6); + tqlayout->addMultiCellWidget(d->mHideIdList, 1, 8, 5, 6); TQPushButton* clear = new KPushButton(KStdGuiItem::clear(), d->mMessagePage); connect(clear, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotClearMessages())); - layout->addMultiCellWidget(clear, 10, 10, 0, 6); + tqlayout->addMultiCellWidget(clear, 10, 10, 0, 6); //TODO: "show all but..." and "show nothing but..." } @@ -274,7 +274,7 @@ void KGameDebugDialog::clearGameData() d->mGameMaster->setText(1, ""); d->mGameAdmin->setText(1, ""); d->mGameOffering->setText(1, ""); - d->mGameStatus->setText(1, ""); + d->mGametqStatus->setText(1, ""); d->mGameRunning->setText(1, ""); d->mGameMaxPlayers->setText(1, ""); d->mGameMinPlayers->setText(1, ""); @@ -320,7 +320,7 @@ void KGameDebugDialog::slotUpdateGameData() d->mGameMaster->setText(1, d->mGame->isMaster() ? i18n("True") : i18n("False")); d->mGameAdmin->setText(1, d->mGame->isAdmin() ? i18n("True") : i18n("False")); d->mGameOffering->setText(1, d->mGame->isOfferingConnections() ? i18n("True") : i18n("False")); - d->mGameStatus->setText(1, TQString::number(d->mGame->gameStatus())); + d->mGametqStatus->setText(1, TQString::number(d->mGame->gametqStatus())); d->mGameRunning->setText(1, d->mGame->isRunning() ? i18n("True") : i18n("False")); d->mGameMaxPlayers->setText(1, TQString::number(d->mGame->maxPlayers())); d->mGameMinPlayers->setText(1, TQString::number(d->mGame->minPlayers())); @@ -441,7 +441,7 @@ void KGameDebugDialog::setKGame(const KGame* g) slotUpdateGameData(); - connect(d->mGame, TQT_SIGNAL(signalMessageUpdate(int, Q_UINT32, Q_UINT32)), this, TQT_SLOT(slotMessageUpdate(int, Q_UINT32, Q_UINT32))); + connect(d->mGame, TQT_SIGNAL(signalMessageUpdate(int, TQ_UINT32, TQ_UINT32)), this, TQT_SLOT(slotMessageUpdate(int, TQ_UINT32, TQ_UINT32))); } } @@ -481,7 +481,7 @@ void KGameDebugDialog::removePlayer(TQListBoxItem* i) delete i; } -void KGameDebugDialog::slotMessageUpdate(int msgid, Q_UINT32 receiver, Q_UINT32 sender) +void KGameDebugDialog::slotMessageUpdate(int msgid, TQ_UINT32 receiver, TQ_UINT32 sender) { if (!showId(msgid)) { return; diff --git a/libkdegames/kgame/dialogs/kgamedebugdialog.h b/libkdegames/kgame/dialogs/kgamedebugdialog.h index 57f20c34..924037ff 100644 --- a/libkdegames/kgame/dialogs/kgamedebugdialog.h +++ b/libkdegames/kgame/dialogs/kgamedebugdialog.h @@ -34,8 +34,9 @@ class KGameDebugDialogPrivate; class KDE_EXPORT KGameDebugDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - KGameDebugDialog(KGame* g, TQWidget* parent, bool modal = false); + KGameDebugDialog(KGame* g, TQWidget* tqparent, bool modal = false); ~KGameDebugDialog(); /** @@ -77,7 +78,7 @@ public slots: signals: /** - * This signal is emitted when the "debug messages" page couldn't find + * This signal is emitted when the "debug messages" page couldn't tqfind * the name of a message id. This is usually the case for user-defined * messages. KGameDebugDialog asks you to give the msgid a name. * @param messageid The ID of the message. As given to @ref @@ -134,7 +135,7 @@ protected slots: /** * A message has been received - see @ref KGame::signalMessageUpdate **/ - void slotMessageUpdate(int msgid, Q_UINT32 receiver, Q_UINT32 sender); + void slotMessageUpdate(int msgid, TQ_UINT32 receiver, TQ_UINT32 sender); private: void initGamePage(); diff --git a/libkdegames/kgame/dialogs/kgamedialog.cpp b/libkdegames/kgame/dialogs/kgamedialog.cpp index c03df4ff..f589333e 100644 --- a/libkdegames/kgame/dialogs/kgamedialog.cpp +++ b/libkdegames/kgame/dialogs/kgamedialog.cpp @@ -64,17 +64,17 @@ public: }; KGameDialog::KGameDialog(KGame* g, KPlayer* owner, const TQString& title, - TQWidget* parent, bool modal) + TQWidget* tqparent, bool modal) : KDialogBase(Tabbed, title, Ok|Default|Apply, - Ok, parent, 0, modal, true) + Ok, tqparent, 0, modal, true) { init(g, owner); } KGameDialog::KGameDialog(KGame* g, KPlayer* owner, const TQString& title, - TQWidget* parent, long initConfigs, int chatMsgId, bool modal) + TQWidget* tqparent, long initConfigs, int chatMsgId, bool modal) : KDialogBase(Tabbed, title, Ok|Default|Apply, - Ok, parent, 0, modal, true) + Ok, tqparent, 0, modal, true) { init(g, owner); if ((ConfigOptions)initConfigs!=NoConfig) { @@ -165,34 +165,34 @@ void KGameDialog::addMsgServerConfig(KGameDialogMsgServerConfig* msgConf) d->mMsgServerPage = addConfigPage(msgConf, i18n("&Message Server")); } -void KGameDialog::addChatWidget(KGameDialogChatConfig* chat, TQVBox* parent) +void KGameDialog::addChatWidget(KGameDialogChatConfig* chat, TQVBox* tqparent) { if (!chat) { return; } - if (!parent) { - parent = d->mGamePage; + if (!tqparent) { + tqparent = d->mGamePage; } - if (!parent) { + if (!tqparent) { kdError(11001) << "cannot add chat widget without page" << endl; return; } - addConfigWidget(chat, parent); + addConfigWidget(chat, tqparent); } -void KGameDialog::addConnectionList(KGameDialogConnectionConfig* c, TQVBox* parent) +void KGameDialog::addConnectionList(KGameDialogConnectionConfig* c, TQVBox* tqparent) { if (!c) { return; } - if (!parent) { - parent = d->mNetworkPage; + if (!tqparent) { + tqparent = d->mNetworkPage; } - if (!parent) { + if (!tqparent) { kdError(11001) << "Cannot add connection list without page" << endl; return; } - addConfigWidget(c, parent); + addConfigWidget(c, tqparent); } TQVBox *KGameDialog::configPage(ConfigOptions which) @@ -226,18 +226,18 @@ TQVBox* KGameDialog::addConfigPage(KGameDialogConfig* widget, const TQString& ti return page; } -void KGameDialog::addConfigWidget(KGameDialogConfig* widget, TQWidget* parent) +void KGameDialog::addConfigWidget(KGameDialogConfig* widget, TQWidget* tqparent) { if (!widget) { kdError(11001) << "Cannot add NULL config widget" << endl; return; } - if (!parent) { + if (!tqparent) { kdError(11001) << "Cannot reparent to NULL widget" << endl; return; } // kdDebug(11001) << "reparenting widget" << endl; - widget->reparent(parent, TQPoint(0,0)); + widget->reparent(tqparent, TQPoint(0,0)); d->mConfigWidgets.append(widget); connect(widget, TQT_SIGNAL(destroyed(TQObject*)), this, TQT_SLOT(slotRemoveConfigWidget(TQObject*))); if (!d->mGame) { diff --git a/libkdegames/kgame/dialogs/kgamedialog.h b/libkdegames/kgame/dialogs/kgamedialog.h index 709f71c6..cb731993 100644 --- a/libkdegames/kgame/dialogs/kgamedialog.h +++ b/libkdegames/kgame/dialogs/kgamedialog.h @@ -74,6 +74,7 @@ class KGameDialogPrivate; class KDE_EXPORT KGameDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: enum ConfigOptions @@ -94,11 +95,11 @@ public: * @param owner The KPlayer object who is responsible for this * dialog, aka "the local player" * @param title The title of the dialog - see KDialog::setCaption - * @param parent The parent of the dialog + * @param tqparent The tqparent of the dialog * @param modal Whether the dialog is modal or not **/ KGameDialog(KGame* g, KPlayer* owner, const TQString& title, - TQWidget* parent, bool modal = false); + TQWidget* tqparent, bool modal = false); /** * Create a KGameDialog with the standard configuration widgets. This @@ -121,7 +122,7 @@ public: * @param owner The KPlayer object who is responsible for this * dialog, aka "the local player" * @param title The title of the dialog - see KDialog::setCaption - * @param parent The parent of the dialog + * @param tqparent The tqparent of the dialog * @param modal Whether the dialog is modal or not * @param initConfigs whether the default KGameDialogConfig widgets * shall be created using initDefaultDialog. Use false if you want @@ -130,7 +131,7 @@ public: * if initConfigs = false **/ KGameDialog(KGame* g, KPlayer* owner, const TQString& title, - TQWidget* parent, long initConfigs = AllConfig, + TQWidget* tqparent, long initConfigs = AllConfig, int chatMsgId = 15432, bool modal = false); virtual ~KGameDialog(); @@ -168,14 +169,14 @@ public: virtual void submitToKGame(); /** - * Adds a KGameChat to the dialog. If no parent is specified the + * Adds a KGameChat to the dialog. If no tqparent is specified the * game page will be used. * @param chat The chat widget - * @param parent The parent of the chat widget. This MUST be an + * @param tqparent The tqparent of the chat widget. This MUST be an * already added config widget. Note that the game page will be used - * if parent is 0. + * if tqparent is 0. **/ - void addChatWidget(KGameDialogChatConfig* chat, TQVBox* parent = 0); + void addChatWidget(KGameDialogChatConfig* chat, TQVBox* tqparent = 0); /** * Add a connection list to the dialog. The list consists of a @@ -186,10 +187,10 @@ public: * This is another not-really-config-config-widget. It just displays the * connections and lets you ban players. * @param c The KGameDialogConnectionConfig object - * @param parent The parent of the widget. If 0 the networkConfig + * @param tqparent The tqparent of the widget. If 0 the networkConfig * page is used. **/ - void addConnectionList(KGameDialogConnectionConfig* c, TQVBox* parent = 0); + void addConnectionList(KGameDialogConnectionConfig* c, TQVBox* tqparent = 0); /** * Add a new page to the dialog. The page will contain you new config @@ -222,12 +223,12 @@ public: KGameDialogGeneralConfig* gameConfig() const; /** - * Add a config widget to the specified parent. Usually you call + * Add a config widget to the specified tqparent. Usually you call * addConfigPage for one widget and addConfigWidget for another to add * it to the same page. Just use the returned page of * addConfigPage. **/ - void addConfigWidget(KGameDialogConfig* widget, TQWidget* parent); + void addConfigWidget(KGameDialogConfig* widget, TQWidget* tqparent); /** * Used to add the main network config widget in a new page. Use this to diff --git a/libkdegames/kgame/dialogs/kgamedialogconfig.cpp b/libkdegames/kgame/dialogs/kgamedialogconfig.cpp index 44eaa3c7..af0172ef 100644 --- a/libkdegames/kgame/dialogs/kgamedialogconfig.cpp +++ b/libkdegames/kgame/dialogs/kgamedialogconfig.cpp @@ -57,7 +57,7 @@ public: KPlayer* mOwner; }; -KGameDialogConfig::KGameDialogConfig(TQWidget* parent) : TQWidget(parent) +KGameDialogConfig::KGameDialogConfig(TQWidget* tqparent) : TQWidget(tqparent) { d = new KGameDialogConfigPrivate; } @@ -116,13 +116,13 @@ public: }; -KGameDialogNetworkConfig::KGameDialogNetworkConfig(TQWidget* parent) - : KGameDialogConfig(parent) +KGameDialogNetworkConfig::KGameDialogNetworkConfig(TQWidget* tqparent) + : KGameDialogConfig(tqparent) { // kdDebug(11001) << k_funcinfo << ": this=" << this << endl; d = new KGameDialogNetworkConfigPrivate(); - TQVBoxLayout* topLayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint(), "toplayout"); + TQVBoxLayout* topLayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint(), "toptqlayout"); TQHBoxLayout *hb = new TQHBoxLayout(topLayout, KDialog::spacingHint()); @@ -261,8 +261,8 @@ public: TQVBoxLayout* mTopLayout; }; -KGameDialogGeneralConfig::KGameDialogGeneralConfig(TQWidget* parent, bool initializeGUI) - : KGameDialogConfig(parent) +KGameDialogGeneralConfig::KGameDialogGeneralConfig(TQWidget* tqparent, bool initializeGUI) + : KGameDialogConfig(tqparent) { // kdDebug(11001) << k_funcinfo << ": this=" << this << endl; d = new KGameDialogGeneralConfigPrivate; @@ -295,7 +295,7 @@ void KGameDialogGeneralConfig::setPlayerName(const TQString& name) TQString KGameDialogGeneralConfig::playerName() const { - return d->mName ? d->mName->text() : TQString::null; + return d->mName ? d->mName->text() : TQString(); } void KGameDialogGeneralConfig::setOwner(KPlayer* p) @@ -386,10 +386,10 @@ public: // TODO: change ADMIN ID, remove CLIENTS, change MAXCLIENTS -// we do everything here with QPushButtons as we want to wait a moment before +// we do everything here with TQPushButtons as we want to wait a moment before // continuing - the message must be sent over network first -KGameDialogMsgServerConfig::KGameDialogMsgServerConfig(TQWidget* parent) - : KGameDialogConfig(parent) +KGameDialogMsgServerConfig::KGameDialogMsgServerConfig(TQWidget* tqparent) + : KGameDialogConfig(tqparent) { d = new KGameDialogMsgServerConfigPrivate; @@ -465,12 +465,12 @@ void KGameDialogMsgServerConfig::slotChangeAdmin() return; } //TODO - Q_UINT32 newAdmin = 0; + TQ_UINT32 newAdmin = 0; // newAdmin = ; game()->electAdmin(newAdmin); } -void KGameDialogMsgServerConfig::removeClient(Q_UINT32 /*id*/) +void KGameDialogMsgServerConfig::removeClient(TQ_UINT32 /*id*/) { //TODO } @@ -531,7 +531,7 @@ void KGameDialogMsgServerConfig::setHasMsgServer(bool has) } //TODO // list all connections, data (max clients) and so on - // cannot be done above (together with QPushButtons) as it is possible that + // cannot be done above (together with TQPushButtons) as it is possible that // this client is ADMIN but not MASTER (i.e. doesn't own the messageserver) } @@ -547,8 +547,8 @@ public: KGameChat* mChat; }; -KGameDialogChatConfig::KGameDialogChatConfig(int chatMsgId, TQWidget* parent) - : KGameDialogConfig(parent) +KGameDialogChatConfig::KGameDialogChatConfig(int chatMsgId, TQWidget* tqparent) + : KGameDialogConfig(tqparent) { d = new KGameDialogChatConfigPrivate; TQVBoxLayout* topLayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); @@ -599,8 +599,8 @@ public: KListBox* mPlayerBox; }; -KGameDialogConnectionConfig::KGameDialogConnectionConfig(TQWidget* parent) - : KGameDialogConfig(parent) +KGameDialogConnectionConfig::KGameDialogConnectionConfig(TQWidget* tqparent) + : KGameDialogConfig(tqparent) { //TODO: prevent player to ban himself d = new KGameDialogConnectionConfigPrivate; @@ -714,7 +714,7 @@ void KGameDialogConnectionConfig::slotPlayerLeftGame(KPlayer* p) // disconnect first this->disconnect(p); if (!item(p)) { - kdError(11001) << k_funcinfo << ": cannot find " << p->id() + kdError(11001) << k_funcinfo << ": cannot tqfind " << p->id() << " in list" << endl; return; } @@ -743,8 +743,8 @@ void KGameDialogConnectionConfig::slotKickPlayerOut(TQListBoxItem* item) return; } - if (KMessageBox::questionYesNo(this, i18n("Do you want to ban player \"%1\" from the game?").arg( - p->name()), TQString::null, i18n("Ban Player"), i18n("Do Not Ban")) == KMessageBox::Yes) { + if (KMessageBox::questionYesNo(this, i18n("Do you want to ban player \"%1\" from the game?").tqarg( + p->name()), TQString(), i18n("Ban Player"), i18n("Do Not Ban")) == KMessageBox::Yes) { kdDebug(11001) << "will remove player " << p << endl; game()->removePlayer(p); // d->mPlayerBox->removeItem(d->mPlayerBox->index(item)); // should be done by signalPlayerLeftGame diff --git a/libkdegames/kgame/dialogs/kgamedialogconfig.h b/libkdegames/kgame/dialogs/kgamedialogconfig.h index 911c63aa..7c42d05d 100644 --- a/libkdegames/kgame/dialogs/kgamedialogconfig.h +++ b/libkdegames/kgame/dialogs/kgamedialogconfig.h @@ -48,11 +48,12 @@ class KGameDialogConfigPrivate; * @short Base class for configuration widgets * @author Andreas Beckermann **/ -class KDE_EXPORT KGameDialogConfig : public QWidget +class KDE_EXPORT KGameDialogConfig : public TQWidget { Q_OBJECT + TQ_OBJECT public: - KGameDialogConfig(TQWidget* parent = 0); + KGameDialogConfig(TQWidget* tqparent = 0); virtual ~KGameDialogConfig(); /** @@ -136,7 +137,7 @@ private: * The main game configuration widget. * * It currently contains a line edit for the name of the player only. You can - * add widgets by using the KGameDialogGeneralConfig as parent parameter as it + * add widgets by using the KGameDialogGeneralConfig as tqparent parameter as it * uses TQLayout::autoAdd == true. * @author Andreas Beckermann **/ @@ -144,23 +145,24 @@ class KGameDialogGeneralConfigPrivate; class KGameDialogGeneralConfig : public KGameDialogConfig { Q_OBJECT + TQ_OBJECT public: /** * Construct a KGameDialogGeneralConfig. Currently it contains a line * edit widget to change the player name only. * * If you just want to add more widgets you can just create your widgets - * with the KGameDialogGeneralConfig as parent as it uses + * with the KGameDialogGeneralConfig as tqparent as it uses * TQLayout::setAutoAdd(true). * - * @param parent Parent widget for this dialog. + * @param tqparent Parent widget for this dialog. * @param initializeGUI If you really don't want to use the - * predefined widget and/or layout use FALSE here. Note that then none + * predefined widget and/or tqlayout use FALSE here. Note that then none * of the predefined widgets (currently only the name of the player) * will exist anymore. * **/ - KGameDialogGeneralConfig(TQWidget* parent = 0, bool initializeGUI = true); + KGameDialogGeneralConfig(TQWidget* tqparent = 0, bool initializeGUI = true); virtual ~KGameDialogGeneralConfig(); /** @@ -211,8 +213,9 @@ class KGameDialogNetworkConfigPrivate; class KDE_EXPORT KGameDialogNetworkConfig : public KGameDialogConfig { Q_OBJECT + TQ_OBJECT public: - KGameDialogNetworkConfig(TQWidget* parent = 0); + KGameDialogNetworkConfig(TQWidget* tqparent = 0); virtual ~KGameDialogNetworkConfig(); @@ -248,7 +251,7 @@ public: * @param type Service type (something like _kwin4._tcp). It should be unique for application. * @since 3.4 **/ - void setDiscoveryInfo(const TQString& type, const TQString& name=TQString::null); + void setDiscoveryInfo(const TQString& type, const TQString& name=TQString()); signals: /** @@ -277,8 +280,9 @@ class KGameDialogMsgServerConfigPrivate; class KGameDialogMsgServerConfig : public KGameDialogConfig { Q_OBJECT + TQ_OBJECT public: - KGameDialogMsgServerConfig(TQWidget* parent = 0); + KGameDialogMsgServerConfig(TQWidget* tqparent = 0); virtual ~KGameDialogMsgServerConfig(); virtual void submitToKGame(KGame*, KPlayer*) {} @@ -294,7 +298,7 @@ protected slots: void slotRemoveClient(); protected: - void removeClient(Q_UINT32 id); + void removeClient(TQ_UINT32 id); private: KGameDialogMsgServerConfigPrivate* d; @@ -310,8 +314,9 @@ class KGameDialogChatConfigPrivate; class KGameDialogChatConfig : public KGameDialogConfig { Q_OBJECT + TQ_OBJECT public: - KGameDialogChatConfig(int chatMsgId, TQWidget* parent = 0); + KGameDialogChatConfig(int chatMsgId, TQWidget* tqparent = 0); virtual ~KGameDialogChatConfig(); virtual void setKGame(KGame* g); @@ -331,8 +336,9 @@ class KGameDialogConnectionConfigPrivate; class KGameDialogConnectionConfig : public KGameDialogConfig { Q_OBJECT + TQ_OBJECT public: - KGameDialogConnectionConfig(TQWidget* parent = 0); + KGameDialogConnectionConfig(TQWidget* tqparent = 0); virtual ~KGameDialogConnectionConfig(); virtual void setKGame(KGame* g); diff --git a/libkdegames/kgame/dialogs/kgameerrordialog.cpp b/libkdegames/kgame/dialogs/kgameerrordialog.cpp index 7c3b0509..d5df6ba3 100644 --- a/libkdegames/kgame/dialogs/kgameerrordialog.cpp +++ b/libkdegames/kgame/dialogs/kgameerrordialog.cpp @@ -37,7 +37,7 @@ public: const KGame* mGame; }; -KGameErrorDialog::KGameErrorDialog(TQWidget* parent) : TQObject(parent) +KGameErrorDialog::KGameErrorDialog(TQWidget* tqparent) : TQObject(tqparent) { d = new KGameErrorDialogPrivate; } @@ -59,8 +59,8 @@ void KGameErrorDialog::setKGame(const KGame* g) this, TQT_SLOT(slotError(int, TQString))); connect(d->mGame, TQT_SIGNAL(signalConnectionBroken()), this, TQT_SLOT(slotServerConnectionLost())); - connect(d->mGame, TQT_SIGNAL(signalClientDisconnected(Q_UINT32,bool)), - this, TQT_SLOT(slotClientConnectionLost(Q_UINT32,bool))); + connect(d->mGame, TQT_SIGNAL(signalClientDisconnected(TQ_UINT32,bool)), + this, TQT_SLOT(slotClientConnectionLost(TQ_UINT32,bool))); } void KGameErrorDialog::slotUnsetKGame() @@ -71,33 +71,33 @@ void KGameErrorDialog::slotUnsetKGame() d->mGame = 0; } -void KGameErrorDialog::error(const TQString& errorText, TQWidget* parent) -{ KMessageBox::error(parent, errorText); } +void KGameErrorDialog::error(const TQString& errorText, TQWidget* tqparent) +{ KMessageBox::error(tqparent, errorText); } void KGameErrorDialog::slotServerConnectionLost() { // TODO: add IP/port of the server TQString message = i18n("Connection to the server has been lost!"); - error(message, (TQWidget*)parent()); + error(message, (TQWidget*)tqparent()); } -void KGameErrorDialog::slotClientConnectionLost(Q_UINT32 /*id*/,bool) +void KGameErrorDialog::slotClientConnectionLost(TQ_UINT32 /*id*/,bool) { //TODO: add IP/port of the client TQString message; // if (c) { -// message = i18n("Connection to client has been lost!\nID: %1\nIP: %2").arg(c->id()).arg(c->IP()); +// message = i18n("Connection to client has been lost!\nID: %1\nIP: %2").tqarg(c->id()).tqarg(c->IP()); // } else { // message = i18n("Connection to client has been lost!"); // } message = i18n("Connection to client has been lost!"); - error(message, (TQWidget*)parent()); + error(message, (TQWidget*)tqparent()); } void KGameErrorDialog::slotError(int errorNo, TQString text) { - TQString message = i18n("Received a network error!\nError number: %1\nError message: %2").arg(errorNo).arg(text); - error(message, (TQWidget*)parent()); + TQString message = i18n("Received a network error!\nError number: %1\nError message: %2").tqarg(errorNo).tqarg(text); + error(message, (TQWidget*)tqparent()); } void KGameErrorDialog::connectionError(TQString s) @@ -106,17 +106,17 @@ void KGameErrorDialog::connectionError(TQString s) if (s.isNull()) { message = i18n("No connection could be created."); } else { - message = i18n("No connection could be created.\nThe error message was:\n%1").arg(s); + message = i18n("No connection could be created.\nThe error message was:\n%1").tqarg(s); } - error(message, (TQWidget*)parent()); + error(message, (TQWidget*)tqparent()); } // should become the real dialog - currently we just use messageboxes // -> maybe unused forever -KGameErrorMessageDialog::KGameErrorMessageDialog(TQWidget* parent) - : KDialogBase(Plain, i18n("Error"), Ok, Ok, parent, 0, true, true) +KGameErrorMessageDialog::KGameErrorMessageDialog(TQWidget* tqparent) + : KDialogBase(Plain, i18n("Error"), Ok, Ok, tqparent, 0, true, true) { } diff --git a/libkdegames/kgame/dialogs/kgameerrordialog.h b/libkdegames/kgame/dialogs/kgameerrordialog.h index 3883399b..b8d34c1a 100644 --- a/libkdegames/kgame/dialogs/kgameerrordialog.h +++ b/libkdegames/kgame/dialogs/kgameerrordialog.h @@ -36,11 +36,12 @@ class KGameErrorDialogPrivate; * @short Error handling for KGame * @author Andreas Beckermann **/ -class KGameErrorDialog : public QObject +class KGameErrorDialog : public TQObject { Q_OBJECT + TQ_OBJECT public: - KGameErrorDialog(TQWidget* parent); + KGameErrorDialog(TQWidget* tqparent); ~KGameErrorDialog(); /** @@ -55,9 +56,9 @@ public: * KGame couldn't establish a connection. Use this if * KGame::initConnection returns false * @param s A string that describes the error further (like port is - * already in use). Will be ignored if TQString::null + * already in use). Will be ignored if TQString() **/ - void connectionError(TQString s = TQString::null); + void connectionError(TQString s = TQString()); public slots: void slotError(int error, TQString text); @@ -74,7 +75,7 @@ public slots: * * See @ref KGameNetwork::signalClientDisconnected **/ - void slotClientConnectionLost(Q_UINT32 clientID,bool broken); + void slotClientConnectionLost(TQ_UINT32 clientID,bool broken); /** * Unsets a @ref KGame which has been set using @ref setKGame before. @@ -87,7 +88,7 @@ public slots: void slotUnsetKGame(); protected: - void error(const TQString& errorText, TQWidget* parent = 0); + void error(const TQString& errorText, TQWidget* tqparent = 0); private: KGameErrorDialogPrivate* d; @@ -103,8 +104,9 @@ private: class KGameErrorMessageDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - KGameErrorMessageDialog(TQWidget* parent); + KGameErrorMessageDialog(TQWidget* tqparent); ~KGameErrorMessageDialog(); private: diff --git a/libkdegames/kgame/kgame.cpp b/libkdegames/kgame/kgame.cpp index ff215837..42a21580 100644 --- a/libkdegames/kgame/kgame.cpp +++ b/libkdegames/kgame/kgame.cpp @@ -75,13 +75,13 @@ public: //KGamePropertys KGamePropertyInt mMaxPlayer; KGamePropertyUInt mMinPlayer; - KGamePropertyInt mGameStatus; // Game running? + KGamePropertyInt mGametqStatus; // Game running? TQValueList mInactiveIdList; }; // ------------------- GAME CLASS -------------------------- -KGame::KGame(int cookie,TQObject* parent) : KGameNetwork(cookie,parent) +KGame::KGame(int cookie,TQObject* tqparent) : KGameNetwork(cookie,tqparent) { kdDebug(11001) << k_funcinfo << " - " << this << ", sizeof(KGame)=" << sizeof(KGame) << endl; d = new KGamePrivate; @@ -95,16 +95,16 @@ KGame::KGame(int cookie,TQObject* parent) : KGameNetwork(cookie,parent) d->mMaxPlayer.setLocal(-1); // Infinite d->mMinPlayer.registerData(KGamePropertyBase::IdMinPlayer, this, i18n("MinPlayers")); d->mMinPlayer.setLocal(0); // Always ok - d->mGameStatus.registerData(KGamePropertyBase::IdGameStatus, this, i18n("GameStatus")); - d->mGameStatus.setLocal(Init); + d->mGametqStatus.registerData(KGamePropertyBase::IdGametqStatus, this, i18n("GametqStatus")); + d->mGametqStatus.setLocal(Init); // d->mUniquePlayerNumber = 0; d->mRandom = new KRandomSequence; d->mRandom->setSeed(0); - connect(this, TQT_SIGNAL(signalClientConnected(Q_UINT32)), - this, TQT_SLOT(slotClientConnected(Q_UINT32))); - connect(this, TQT_SIGNAL(signalClientDisconnected(Q_UINT32,bool)), - this, TQT_SLOT(slotClientDisconnected(Q_UINT32,bool))); + connect(this, TQT_SIGNAL(signalClientConnected(TQ_UINT32)), + this, TQT_SLOT(slotClientConnected(TQ_UINT32))); + connect(this, TQT_SIGNAL(signalClientDisconnected(TQ_UINT32,bool)), + this, TQT_SLOT(slotClientDisconnected(TQ_UINT32,bool))); connect(this, TQT_SIGNAL(signalConnectionBroken()), this, TQT_SLOT(slotServerDisconnected())); @@ -184,7 +184,7 @@ bool KGame::loadgame(TQDataStream &stream, bool network,bool resetgame) // Load Game Data // internal data - Q_INT32 c; + TQ_INT32 c; stream >> c; // cookie if (c!=cookie()) @@ -241,7 +241,7 @@ bool KGame::loadgame(TQDataStream &stream, bool network,bool resetgame) systemAddPlayer(newplayer); } - Q_INT16 cookie; + TQ_INT16 cookie; stream >> cookie; if (cookie==KGAME_LOAD_COOKIE) { kdDebug(11001) << " Game loaded propertly"<rtti(); - stream << (Q_INT32)p->id(); - stream << (Q_INT32)p->calcIOValue(); + stream << (TQ_INT32)p->rtti(); + stream << (TQ_INT32)p->id(); + stream << (TQ_INT32)p->calcIOValue(); p->save(stream); } @@ -336,7 +336,7 @@ void KGame::savePlayers(TQDataStream &stream, KGamePlayerList *list) list=playerList(); } - Q_INT32 cnt=list->count(); + TQ_INT32 cnt=list->count(); kdDebug(11001) << "Saving KGame " << cnt << " KPlayer objects " << endl; stream << cnt; KPlayer *player; @@ -353,7 +353,7 @@ KPlayer *KGame::createPlayer(int /*rtti*/,int /*io*/,bool /*isvirtual*/) } KPlayer *KGame::loadPlayer(TQDataStream& stream,bool isvirtual) { - Q_INT32 rtti,id,iovalue; + TQ_INT32 rtti,id,iovalue; stream >> rtti >> id >> iovalue; KPlayer *newplayer=findPlayer(id); if (!newplayer) @@ -383,7 +383,7 @@ KPlayer *KGame::loadPlayer(TQDataStream& stream,bool isvirtual) // ----------------- Player handling ----------------------- -KPlayer * KGame::findPlayer(Q_UINT32 id) const +KPlayer * KGame::findPlayer(TQ_UINT32 id) const { for (TQPtrListIterator it(d->mPlayerList); it.current(); ++it) { @@ -507,7 +507,7 @@ void KGame::playerDeleted(KPlayer *player) } } -bool KGame::removePlayer(KPlayer * player, Q_UINT32 receiver) +bool KGame::removePlayer(KPlayer * player, TQ_UINT32 receiver) {//transmit to all clients, or to receiver only if (!player) { @@ -542,10 +542,10 @@ void KGame::systemRemovePlayer(KPlayer* player,bool deleteit) kdWarning(11001) << "player " << player << "(" << player->id() << ") Could not be found!" << endl; } - if (gameStatus()==(int)Run && playerCount()mPlayerList.count(); } -int KGame::gameStatus() const -{ return d->mGameStatus.value(); } +int KGame::gametqStatus() const +{ return d->mGametqStatus.value(); } bool KGame::isRunning() const -{ return d->mGameStatus.value() == Run; } +{ return d->mGametqStatus.value() == Run; } KGamePropertyHandler* KGame::dataHandler() const { return d->mProperties; } @@ -706,7 +706,7 @@ KRandomSequence* KGame::random() const { return d->mRandom; } -bool KGame::sendPlayerInput(TQDataStream &msg, KPlayer *player, Q_UINT32 sender) +bool KGame::sendPlayerInput(TQDataStream &msg, KPlayer *player, TQ_UINT32 sender) { if (!player) { @@ -724,7 +724,7 @@ bool KGame::sendPlayerInput(TQDataStream &msg, KPlayer *player, Q_UINT32 sender) return true; } -bool KGame::systemPlayerInput(TQDataStream &msg, KPlayer *player, Q_UINT32 sender) +bool KGame::systemPlayerInput(TQDataStream &msg, KPlayer *player, TQ_UINT32 sender) { if (!player) { @@ -772,7 +772,7 @@ KPlayer * KGame::playerInputFinished(KPlayer *player) { player->setTurn(false); } - setGameStatus(End); + setGametqStatus(End); emit signalGameOver(gameOver,player,this); } else if (!player->asyncInput()) @@ -829,7 +829,7 @@ KPlayer *KGame::nextPlayer(KPlayer *last,bool exclusive) return 0; } -void KGame::setGameStatus(int status) +void KGame::setGametqStatus(int status) { kdDebug(11001) << k_funcinfo << ": GAMESTATUS CHANGED to" << status << endl; if (status==(int)Run && playerCount()mGameStatus = status; + d->mGametqStatus = status; } -void KGame::networkTransmission(TQDataStream &stream, int msgid, Q_UINT32 receiver, Q_UINT32 sender, Q_UINT32 /*clientID*/) +void KGame::networkTransmission(TQDataStream &stream, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender, TQ_UINT32 /*clientID*/) {//clientID is unused // message targets a playerobject. If we find it we forward the message to the // player. Otherwise we proceed here and hope the best that the user processes @@ -884,8 +884,8 @@ void KGame::networkTransmission(TQDataStream &stream, int msgid, Q_UINT32 receiv { case KGameMessage::IdSetupGame: // Client: First step in setup game { - Q_INT16 v; - Q_INT32 c; + TQ_INT16 v; + TQ_INT32 c; stream >> v >> c; kdDebug(11001) << " ===================> (Client) " << k_funcinfo << ": Got IdSetupGame ================== " << endl; kdDebug(11001) << "our game id is " << gameId() << " Lib version=" << v << " App Cookie=" << c << endl; @@ -1043,10 +1043,10 @@ void KGame::networkTransmission(TQDataStream &stream, int msgid, Q_UINT32 receiv // called by the IdSetupGameContinue Message - MASTER SIDE // Here the master needs to decide which players can take part at the game // and which will be deactivated -void KGame::setupGameContinue(TQDataStream& stream, Q_UINT32 sender) +void KGame::setupGameContinue(TQDataStream& stream, TQ_UINT32 sender) { KPlayer *player; - Q_INT32 cnt; + TQ_INT32 cnt; int i; stream >> cnt; @@ -1093,7 +1093,7 @@ void KGame::setupGameContinue(TQDataStream& stream, Q_UINT32 sender) for ( player=newPlayerList.first(); player != 0; player=newPlayerList.next() ) { // Already in the list - if (inactivateIds.find(player->id())!=inactivateIds.end()) + if (inactivateIds.tqfind(player->id())!=inactivateIds.end()) { continue; } @@ -1109,7 +1109,7 @@ void KGame::setupGameContinue(TQDataStream& stream, Q_UINT32 sender) for ( player=d->mPlayerList.first(); player != 0; player=d->mPlayerList.next() ) { // Already in the list - if (inactivateIds.find(player->id())!=inactivateIds.end()) + if (inactivateIds.tqfind(player->id())!=inactivateIds.end()) { continue; } @@ -1171,9 +1171,9 @@ void KGame::setupGameContinue(TQDataStream& stream, Q_UINT32 sender) // Now send out the player list which the client can activate for ( player=newPlayerList.first(); player != 0; player=newPlayerList.next() ) { - kdDebug(11001) << " newplayerlist contains " << player->id() << endl; + kdDebug(11001) << " newplayerlist tqcontains " << player->id() << endl; // Only activate what is not in the list - if (inactivateIds.find(player->id())!=inactivateIds.end()) + if (inactivateIds.tqfind(player->id())!=inactivateIds.end()) { continue; } @@ -1195,14 +1195,14 @@ void KGame::setupGameContinue(TQDataStream& stream, Q_UINT32 sender) // called by the IdSetupGame Message - CLIENT SIDE // Client needs to prepare for network transfer -void KGame::setupGame(Q_UINT32 sender) +void KGame::setupGame(TQ_UINT32 sender) { TQByteArray bufferS; TQDataStream streamS(bufferS,IO_WriteOnly); // Deactivate all players KGamePlayerList mTmpList(d->mPlayerList); // we need copy otherwise the removal crashes - Q_INT32 cnt=mTmpList.count(); + TQ_INT32 cnt=mTmpList.count(); kdDebug(11001) << "Client: playerlistcount=" << d->mPlayerList.count() << " tmplistcout=" << cnt << endl; streamS << cnt; @@ -1244,14 +1244,14 @@ void KGame::Debug() kdDebug(11001) << "------------------- KGAME -------------------------" << endl; kdDebug(11001) << "this: " << this << endl; kdDebug(11001) << "uniquePlayer " << d->mUniquePlayerNumber << endl; - kdDebug(11001) << "gameStatus " << gameStatus() << endl; + kdDebug(11001) << "gametqStatus " << gametqStatus() << endl; kdDebug(11001) << "MaxPlayers : " << maxPlayers() << endl; kdDebug(11001) << "NoOfPlayers : " << playerCount() << endl; kdDebug(11001) << "NoOfInactive: " << d->mInactivePlayerList.count() << endl; kdDebug(11001) << "---------------------------------------------------" << endl; } -void KGame::slotClientConnected(Q_UINT32 clientID) +void KGame::slotClientConnected(TQ_UINT32 clientID) { if (isAdmin()) { @@ -1264,7 +1264,7 @@ void KGame::slotServerDisconnected() // Client side kdDebug(11001) << "======= SERVER DISCONNECT ======="<buffer(), msgid, sender, group); } -bool KGame::sendGroupMessage(const TQString& msg, int msgid, Q_UINT32 sender, const TQString& group) +bool KGame::sendGroupMessage(const TQString& msg, int msgid, TQ_UINT32 sender, const TQString& group) { TQByteArray buffer; TQDataStream stream(buffer, IO_WriteOnly); @@ -1425,7 +1425,7 @@ bool KGame::sendGroupMessage(const TQString& msg, int msgid, Q_UINT32 sender, co bool KGame::addProperty(KGamePropertyBase* data) { return dataHandler()->addProperty(data); } -bool KGame::sendPlayerProperty(int msgid, TQDataStream& s, Q_UINT32 playerId) +bool KGame::sendPlayerProperty(int msgid, TQDataStream& s, TQ_UINT32 playerId) { return sendSystemMessage(s, msgid, playerId); } void KGame::sendProperty(int msgid, TQDataStream& stream, bool* sent) @@ -1443,7 +1443,7 @@ void KGame::emitSignal(KGamePropertyBase *me) } KGamePropertyBase* KGame::findProperty(int id) const -{ return d->mProperties->find(id); } +{ return d->mProperties->tqfind(id); } KGame::GamePolicy KGame::policy() const { diff --git a/libkdegames/kgame/kgame.h b/libkdegames/kgame/kgame.h index 85a8356c..af278d5a 100644 --- a/libkdegames/kgame/kgame.h +++ b/libkdegames/kgame/kgame.h @@ -62,6 +62,7 @@ class KGamePrivate; class KDE_EXPORT KGame : public KGameNetwork { Q_OBJECT + TQ_OBJECT public: typedef TQPtrList KGamePlayerList; @@ -100,7 +101,7 @@ public: * game in load/save and network operations. Change this between * games. */ - KGame(int cookie=42,TQObject* parent=0); + KGame(int cookie=42,TQObject* tqparent=0); /** * Destructs the game @@ -117,7 +118,7 @@ public: * The KGame e.g. sets the status to Pause when you have * less player than the minimum amount */ - enum GameStatus + enum GametqStatus { Init = 0, Run = 1, @@ -126,7 +127,7 @@ public: Abort = 4, SystemPause = 5, Intro = 6, - UserStatus = 7 + UsertqStatus = 7 }; // Properties @@ -178,7 +179,7 @@ public: * @param id Player id * @return player object */ - KPlayer *findPlayer(Q_UINT32 id) const; + KPlayer *findPlayer(TQ_UINT32 id) const; /** * Set a new @ref KGameSequence to control player management. By default @@ -282,7 +283,7 @@ public: * Called by KPlayer to send a player input to the * KMessageServer. **/ - virtual bool sendPlayerInput(TQDataStream &msg,KPlayer *player,Q_UINT32 sender=0); + virtual bool sendPlayerInput(TQDataStream &msg,KPlayer *player,TQ_UINT32 sender=0); /** * Called when a player input arrives from KMessageServer. @@ -294,7 +295,7 @@ public: * * For documentation see playerInput. **/ - virtual bool systemPlayerInput(TQDataStream &msg,KPlayer *player,Q_UINT32 sender=0); + virtual bool systemPlayerInput(TQDataStream &msg,KPlayer *player,TQ_UINT32 sender=0); /** * This virtual function is called if the KGame needs to create a new player. @@ -386,14 +387,14 @@ public: * * @return game status */ - int gameStatus() const; + int gametqStatus() const; /** * sets the game status * * @param status the new status */ - void setGameStatus(int status); + void setGametqStatus(int status); /** * docu: see KPlayer @@ -403,7 +404,7 @@ public: /** * This is called by KPlayer::sendProperty only! Internal function! **/ - bool sendPlayerProperty(int msgid, TQDataStream& s, Q_UINT32 playerId); + bool sendPlayerProperty(int msgid, TQDataStream& s, TQ_UINT32 playerId); /** * This function allows to find the pointer to a player @@ -432,13 +433,13 @@ public: * @param msg the message which will be send. See messages.txt for contents * @param msgid an id for this message * @param sender the id of the sender - * @param group the group of the receivers + * @param group the group of the tqreceivers * @return true if worked */ - bool sendGroupMessage(const TQByteArray& msg, int msgid, Q_UINT32 sender, const TQString& group); - bool sendGroupMessage(const TQDataStream &msg, int msgid, Q_UINT32 sender, const TQString& group); - bool sendGroupMessage(int msg, int msgid, Q_UINT32 sender, const TQString& group); - bool sendGroupMessage(const TQString& msg, int msgid, Q_UINT32 sender, const TQString& group); + bool sendGroupMessage(const TQByteArray& msg, int msgid, TQ_UINT32 sender, const TQString& group); + bool sendGroupMessage(const TQDataStream &msg, int msgid, TQ_UINT32 sender, const TQString& group); + bool sendGroupMessage(int msg, int msgid, TQ_UINT32 sender, const TQString& group); + bool sendGroupMessage(const TQString& msg, int msgid, TQ_UINT32 sender, const TQString& group); /** * This will either forward an incoming message to a specified player @@ -458,7 +459,7 @@ public: * @param sender * @param clientID the client from which we received the transmission - hardly used **/ - virtual void networkTransmission(TQDataStream &stream, int msgid, Q_UINT32 receiver, Q_UINT32 sender, Q_UINT32 clientID); + virtual void networkTransmission(TQDataStream &stream, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender, TQ_UINT32 clientID); /** * Returns a pointer to the KGame property handler @@ -487,7 +488,7 @@ protected slots: * Calls negotiateNetworkGame() * See KGameNetwork::signalClientConnected **/ - void slotClientConnected(Q_UINT32 clientId); + void slotClientConnected(TQ_UINT32 clientId); /** * This slot is called whenever the connection to a client is lost (ie the @@ -496,7 +497,7 @@ protected slots: * @param clientId The client the connection has been lost to * @param broken (ignore this - not used) **/ - void slotClientDisconnected(Q_UINT32 clientId,bool broken); + void slotClientDisconnected(TQ_UINT32 clientId,bool broken); /** * This slot is called whenever the connection to the server is lost (ie the @@ -593,14 +594,14 @@ signals: * own methods and has to syncronise them over the network. * Reaction to this is usually a call to a KGame function. */ - void signalNetworkData(int msgid,const TQByteArray& buffer, Q_UINT32 receiver, Q_UINT32 sender); + void signalNetworkData(int msgid,const TQByteArray& buffer, TQ_UINT32 receiver, TQ_UINT32 sender); /** * We got an network message. this can be used to notify us that something * changed. What changed can be seen in the message id. Whether this is * the best possible method to do this is unclear... */ - void signalMessageUpdate(int msgid,Q_UINT32 receiver,Q_UINT32 sender); + void signalMessageUpdate(int msgid,TQ_UINT32 receiver,TQ_UINT32 sender); /** * a player left the game because of a broken connection or so! @@ -649,7 +650,7 @@ signals: * @param clientid - The id of the new client * @param me - our game pointer */ - void signalClientJoinedGame(Q_UINT32 clientid,KGame *me); + void signalClientJoinedGame(TQ_UINT32 clientid,KGame *me); /** * This signal is emitted after a network partner left the @@ -688,7 +689,7 @@ protected: * \code * bool MyClass::playerInput(TQDataStream &msg,KPlayer *player) * { - * Q_INT32 move; + * TQ_INT32 move; * msg >> move; * kdDebug() << " Player " << player->id() << " moved to " << move << * endl; @@ -839,7 +840,7 @@ protected: * Only the ADMIN is allowed to call this. * @param clientID The ID of the message client which has connected **/ - virtual void negotiateNetworkGame(Q_UINT32 clientID); + virtual void negotiateNetworkGame(TQ_UINT32 clientID); /** * syncronise the random numbers with all network clients @@ -896,24 +897,24 @@ private: * ever need this. It it internally used to initialize a newly connected * client. **/ - //void addPlayer(KPlayer* newplayer, Q_UINT32 receiver); + //void addPlayer(KPlayer* newplayer, TQ_UINT32 receiver); /** * Just the same as the public one except receiver: * @param receiver 0 for broadcast, otherwise the receiver. Should only be * used in special circumstances and not outside KGame. **/ - bool removePlayer(KPlayer * player, Q_UINT32 receiver); + bool removePlayer(KPlayer * player, TQ_UINT32 receiver); /** * Helping function - game negotiation **/ - void setupGame(Q_UINT32 sender); + void setupGame(TQ_UINT32 sender); /** * Helping function - game negotiation **/ - void setupGameContinue(TQDataStream& msg, Q_UINT32 sender); + void setupGameContinue(TQDataStream& msg, TQ_UINT32 sender); /** * Removes a player from all lists, removes the @ref KGame pointer from the diff --git a/libkdegames/kgame/kgamechat.cpp b/libkdegames/kgame/kgamechat.cpp index ddc1bd66..29d80807 100644 --- a/libkdegames/kgame/kgamechat.cpp +++ b/libkdegames/kgame/kgamechat.cpp @@ -57,18 +57,18 @@ public: int mToMyGroup; // just as the above - but for the group, not for players }; -KGameChat::KGameChat(KGame* g, int msgid, TQWidget* parent) : KChatBase(parent) +KGameChat::KGameChat(KGame* g, int msgid, TQWidget* tqparent) : KChatBase(tqparent) { init(g, msgid); } -KGameChat::KGameChat(KGame* g, int msgid, KPlayer* fromPlayer, TQWidget* parent) : KChatBase(parent) +KGameChat::KGameChat(KGame* g, int msgid, KPlayer* fromPlayer, TQWidget* tqparent) : KChatBase(tqparent) { init(g, msgid); setFromPlayer(fromPlayer); } -KGameChat::KGameChat(TQWidget* parent) : KChatBase(parent) +KGameChat::KGameChat(TQWidget* tqparent) : KChatBase(tqparent) { init(0, -1); } @@ -92,7 +92,7 @@ void KGameChat::addMessage(int fromId, const TQString& text) { if (!d->mGame) { kdWarning(11001) << "no KGame object has been set" << endl; - addMessage(i18n("Player %1").arg(fromId), text); + addMessage(i18n("Player %1").tqarg(fromId), text); } else { KPlayer* p = d->mGame->findPlayer(fromId); if (p) { @@ -162,10 +162,10 @@ bool KGameChat::isToGroupMessage(int id) const bool KGameChat::isToPlayerMessage(int id) const { -return d->mSendId2PlayerId.contains(id); } +return d->mSendId2PlayerId.tqcontains(id); } TQString KGameChat::sendToPlayerEntry(const TQString& name) const -{ return i18n("Send to %1").arg(name); } +{ return i18n("Send to %1").tqarg(name); } int KGameChat::playerId(int id) const { @@ -188,7 +188,7 @@ int KGameChat::sendingId(int playerId) const } const TQString& KGameChat::fromName() const -{ return d->mFromPlayer ? d->mFromPlayer->name() : TQString::null; } +{ return d->mFromPlayer ? d->mFromPlayer->name() : TQString(); } bool KGameChat::hasPlayer(int id) const { @@ -211,7 +211,7 @@ void KGameChat::setFromPlayer(KPlayer* p) removeSendingEntry(d->mToMyGroup); } d->mToMyGroup = nextId(); - addSendingEntry(i18n("Send to My Group (\"%1\")").arg(p->group()), d->mToMyGroup); + addSendingEntry(i18n("Send to My Group (\"%1\")").tqarg(p->group()), d->mToMyGroup); } d->mFromPlayer = p; kdDebug(11001) << k_funcinfo << " player=" << p << endl; @@ -231,8 +231,8 @@ void KGameChat::setKGame(KGame* g) this, TQT_SLOT(slotAddPlayer(KPlayer*))); connect(d->mGame, TQT_SIGNAL(signalPlayerLeftGame(KPlayer*)), this, TQT_SLOT(slotRemovePlayer(KPlayer*))); - connect(d->mGame, TQT_SIGNAL(signalNetworkData(int, const TQByteArray&, Q_UINT32, Q_UINT32)), - this, TQT_SLOT(slotReceiveMessage(int, const TQByteArray&, Q_UINT32, Q_UINT32))); + connect(d->mGame, TQT_SIGNAL(signalNetworkData(int, const TQByteArray&, TQ_UINT32, TQ_UINT32)), + this, TQT_SLOT(slotReceiveMessage(int, const TQByteArray&, TQ_UINT32, TQ_UINT32))); connect(d->mGame, TQT_SIGNAL(destroyed()), this, TQT_SLOT(slotUnsetKGame())); TQPtrList playerList = *d->mGame->playerList(); @@ -283,8 +283,8 @@ void KGameChat::slotAddPlayer(KPlayer* p) d->mSendId2PlayerId.insert(sendingId, p->id()); connect(p, TQT_SIGNAL(signalPropertyChanged(KGamePropertyBase*, KPlayer*)), this, TQT_SLOT(slotPropertyChanged(KGamePropertyBase*, KPlayer*))); - connect(p, TQT_SIGNAL(signalNetworkData(int, const TQByteArray&, Q_UINT32, KPlayer*)), - this, TQT_SLOT(slotReceivePrivateMessage(int, const TQByteArray&, Q_UINT32, KPlayer*))); + connect(p, TQT_SIGNAL(signalNetworkData(int, const TQByteArray&, TQ_UINT32, KPlayer*)), + this, TQT_SLOT(slotReceivePrivateMessage(int, const TQByteArray&, TQ_UINT32, KPlayer*))); } void KGameChat::slotRemovePlayer(KPlayer* p) @@ -317,7 +317,7 @@ void KGameChat::slotPropertyChanged(KGamePropertyBase* prop, KPlayer* player) } } -void KGameChat::slotReceivePrivateMessage(int msgid, const TQByteArray& buffer, Q_UINT32 sender, KPlayer* me) +void KGameChat::slotReceivePrivateMessage(int msgid, const TQByteArray& buffer, TQ_UINT32 sender, KPlayer* me) { if (!me || me != fromPlayer()) { kdDebug() << k_funcinfo << "nope - not for us!" << endl; @@ -326,7 +326,7 @@ void KGameChat::slotReceivePrivateMessage(int msgid, const TQByteArray& buffer, slotReceiveMessage(msgid, buffer, me->id(), sender); } -void KGameChat::slotReceiveMessage(int msgid, const TQByteArray& buffer, Q_UINT32 , Q_UINT32 sender) +void KGameChat::slotReceiveMessage(int msgid, const TQByteArray& buffer, TQ_UINT32 , TQ_UINT32 sender) { TQDataStream msg(buffer, IO_ReadOnly); if (msgid != messageId()) { diff --git a/libkdegames/kgame/kgamechat.h b/libkdegames/kgame/kgamechat.h index effcca22..f0d8310d 100644 --- a/libkdegames/kgame/kgamechat.h +++ b/libkdegames/kgame/kgamechat.h @@ -43,20 +43,21 @@ class KGameChatPrivate; class KDE_EXPORT KGameChat : public KChatBase { Q_OBJECT + TQ_OBJECT public: /** * Construct a @ref KGame chat widget on @p game that used @p msgid for * the chat message. The @p fromPlayer is the local player (see @ref * setFromPlayer). **/ - KGameChat(KGame* game, int msgid, KPlayer* fromPlayer, TQWidget * parent); + KGameChat(KGame* game, int msgid, KPlayer* fromPlayer, TQWidget * tqparent); /** * @overload * To make use of this widget you need to call @ref setFromPlayer * manually. **/ - KGameChat(KGame* game, int msgId, TQWidget* parent); + KGameChat(KGame* game, int msgId, TQWidget* tqparent); /** * @overload @@ -64,7 +65,7 @@ public: * setGame, setFromPlayer and setMessageId manually. * @since 3.2 **/ - KGameChat(TQWidget* parent); + KGameChat(TQWidget* tqparent); virtual ~KGameChat(); @@ -102,7 +103,7 @@ public: /** * Change the message id of the chat widget. It is recommended that you * don't use this but prefer the constructor instead, but in certain - * situations (such as using this widget in Qt designer) it may be + * situations (such as using this widget in TQt designer) it may be * useful to change the message id. * * See also @ref messageId @@ -121,7 +122,7 @@ public slots: virtual void addMessage(const TQString& fromName, const TQString& text) { KChatBase::addMessage(fromName, text);} virtual void addMessage(int fromId, const TQString& text); - void slotReceiveMessage(int, const TQByteArray&, Q_UINT32 receiver, Q_UINT32 sender); + void slotReceiveMessage(int, const TQByteArray&, TQ_UINT32 receiver, TQ_UINT32 sender); protected: /** @@ -208,7 +209,7 @@ protected slots: * gets forwarded to slotReceiveMessage if @p me equals * fromPlayer. **/ - void slotReceivePrivateMessage(int msgid, const TQByteArray& buffer, Q_UINT32 sender, KPlayer* me); + void slotReceivePrivateMessage(int msgid, const TQByteArray& buffer, TQ_UINT32 sender, KPlayer* me); protected: virtual void returnPressed(const TQString& text); diff --git a/libkdegames/kgame/kgameerror.cpp b/libkdegames/kgame/kgameerror.cpp index eb98a797..ef6145fb 100644 --- a/libkdegames/kgame/kgameerror.cpp +++ b/libkdegames/kgame/kgameerror.cpp @@ -30,8 +30,8 @@ TQByteArray KGameError::errVersion(int remoteVersion) { TQByteArray b; TQDataStream s(b, IO_WriteOnly); - s << (Q_INT32)KGameMessage::version(); - s << (Q_INT32)remoteVersion; + s << (TQ_INT32)KGameMessage::version(); + s << (TQ_INT32)remoteVersion; return b; } @@ -39,8 +39,8 @@ TQByteArray KGameError::errCookie(int localCookie, int remoteCookie) { TQByteArray b; TQDataStream s(b, IO_WriteOnly); - s << (Q_INT32)localCookie; - s << (Q_INT32)remoteCookie; + s << (TQ_INT32)localCookie; + s << (TQ_INT32)remoteCookie; return b; } @@ -56,24 +56,24 @@ TQString KGameError::errorText(int errorCode, TQDataStream& s) switch (errorCode) { case Cookie: { - Q_INT32 cookie1; - Q_INT32 cookie2; + TQ_INT32 cookie1; + TQ_INT32 cookie2; s >> cookie1; s >> cookie2; - text = i18n("Cookie mismatch!\nExpected Cookie: %1\nReceived Cookie: %2").arg(cookie1).arg(cookie2); + text = i18n("Cookie mismatch!\nExpected Cookie: %1\nReceived Cookie: %2").tqarg(cookie1).tqarg(cookie2); break; } case Version: { - Q_INT32 version1; - Q_INT32 version2; + TQ_INT32 version1; + TQ_INT32 version2; s >> version1; s >> version2; - text = i18n("KGame Version mismatch!\nExpected Version: %1\nReceived Version: %2\n").arg(version1).arg(version2); + text = i18n("KGame Version mismatch!\nExpected Version: %1\nReceived Version: %2\n").tqarg(version1).tqarg(version2); break; } default: - text = i18n("Unknown error code %1").arg(errorCode); + text = i18n("Unknown error code %1").tqarg(errorCode); } return text; } diff --git a/libkdegames/kgame/kgameio.cpp b/libkdegames/kgame/kgameio.cpp index 7183d5d3..a408c0cd 100644 --- a/libkdegames/kgame/kgameio.cpp +++ b/libkdegames/kgame/kgameio.cpp @@ -82,7 +82,7 @@ void KGameIO::notifyTurn(bool b) if (sendit) { TQDataStream ostream(buffer,IO_ReadOnly); - Q_UINT32 sender = player()->id(); // force correct sender + TQ_UINT32 sender = player()->id(); // force correct sender kdDebug(11001) << "Prepare turn sendInput" << endl; sendInput(ostream, true, sender); } @@ -97,7 +97,7 @@ KGame* KGameIO::game() const return player()->game(); } -bool KGameIO::sendInput(TQDataStream& s, bool transmit, Q_UINT32 sender) +bool KGameIO::sendInput(TQDataStream& s, bool transmit, TQ_UINT32 sender) { if (!player()) { @@ -117,21 +117,21 @@ void KGameIO::Debug() // ----------------------- Key IO --------------------------- -KGameKeyIO::KGameKeyIO(TQWidget *parent) +KGameKeyIO::KGameKeyIO(TQWidget *tqparent) : KGameIO() { - if (parent) + if (tqparent) { kdDebug(11001) << "Key Event filter installed" << endl; - parent->installEventFilter(this); + tqparent->installEventFilter(this); } } KGameKeyIO::~KGameKeyIO() { - if (parent()) + if (tqparent()) { - parent()->removeEventFilter(this); + tqparent()->removeEventFilter(this); } } @@ -167,22 +167,22 @@ bool KGameKeyIO::eventFilter( TQObject *o, TQEvent *e ) // ----------------------- Mouse IO --------------------------- -KGameMouseIO::KGameMouseIO(TQWidget *parent,bool trackmouse) +KGameMouseIO::KGameMouseIO(TQWidget *tqparent,bool trackmouse) : KGameIO() { - if (parent) + if (tqparent) { kdDebug(11001) << "Mouse Event filter installed tracking=" << trackmouse << endl; - parent->installEventFilter(this); - parent->setMouseTracking(trackmouse); + tqparent->installEventFilter(this); + tqparent->setMouseTracking(trackmouse); } } KGameMouseIO::~KGameMouseIO() { - if (parent()) + if (tqparent()) { - parent()->removeEventFilter(this); + tqparent()->removeEventFilter(this); } } @@ -193,9 +193,9 @@ int KGameMouseIO::rtti() const void KGameMouseIO::setMouseTracking(bool b) { - if (parent()) + if (tqparent()) { - ((TQWidget*)parent())->setMouseTracking(b); + ((TQWidget*)tqparent())->setMouseTracking(b); } } @@ -266,10 +266,10 @@ KGameProcessIO::KGameProcessIO(const TQString& name) //kdDebug(11001) << "================= KMEssage SetSErver ==================== " << endl; //d->mMessageClient->setServer(d->mMessageServer); kdDebug(11001) << "================= KMEssage: Connect ==================== " << endl; - //connect(d->mMessageClient, TQT_SIGNAL(broadcastReceived(const TQByteArray&, Q_UINT32)), - // this, TQT_SLOT(clientMessage(const TQByteArray&, Q_UINT32))); - //connect(d->mMessageClient, TQT_SIGNAL(forwardReceived(const TQByteArray&, Q_UINT32, const TQValueList &)), - // this, TQT_SLOT(clientMessage(const TQByteArray&, Q_UINT32, const TQValueList &))); + //connect(d->mMessageClient, TQT_SIGNAL(broadcastReceived(const TQByteArray&, TQ_UINT32)), + // this, TQT_SLOT(clientMessage(const TQByteArray&, TQ_UINT32))); + //connect(d->mMessageClient, TQT_SIGNAL(forwardReceived(const TQByteArray&, TQ_UINT32, const TQValueList &)), + // this, TQT_SLOT(clientMessage(const TQByteArray&, TQ_UINT32, const TQValueList &))); connect(d->mProcessIO, TQT_SIGNAL(received(const TQByteArray&)), this, TQT_SLOT(receivedMessage(const TQByteArray&))); //kdDebug(11001) << "Our client is id="<mMessageClient->id() << endl; @@ -302,7 +302,7 @@ void KGameProcessIO::initIO(KPlayer *p) // Send 'hello' to process TQByteArray buffer; TQDataStream stream(buffer, IO_WriteOnly); - Q_INT16 id = p->userId(); + TQ_INT16 id = p->userId(); stream << id; bool sendit=true; @@ -311,7 +311,7 @@ void KGameProcessIO::initIO(KPlayer *p) emit signalIOAdded(this,stream,p,&sendit); if (sendit ) { - Q_UINT32 sender = p->id(); + TQ_UINT32 sender = p->id(); kdDebug(11001) << "Sending IOAdded to process player !!!!!!!!!!!!!! " << endl; sendSystemMessage(stream, KGameMessage::IdIOAdded, 0, sender); } @@ -328,27 +328,27 @@ void KGameProcessIO::notifyTurn(bool b) bool sendit=true; TQByteArray buffer; TQDataStream stream(buffer,IO_WriteOnly); - stream << (Q_INT8)b; + stream << (TQ_INT8)b; emit signalPrepareTurn(stream,b,this,&sendit); if (sendit) { - Q_UINT32 sender=player()->id(); + TQ_UINT32 sender=player()->id(); kdDebug(11001) << "Sending Turn to process player !!!!!!!!!!!!!! " << endl; sendSystemMessage(stream, KGameMessage::IdTurn, 0, sender); } } -void KGameProcessIO::sendSystemMessage(TQDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender) +void KGameProcessIO::sendSystemMessage(TQDataStream &stream,int msgid, TQ_UINT32 receiver, TQ_UINT32 sender) { sendAllMessages(stream, msgid, receiver, sender, false); } -void KGameProcessIO::sendMessage(TQDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender) +void KGameProcessIO::sendMessage(TQDataStream &stream,int msgid, TQ_UINT32 receiver, TQ_UINT32 sender) { sendAllMessages(stream, msgid, receiver, sender, true); } -void KGameProcessIO::sendAllMessages(TQDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender, bool usermsg) +void KGameProcessIO::sendAllMessages(TQDataStream &stream,int msgid, TQ_UINT32 receiver, TQ_UINT32 sender, bool usermsg) { kdDebug(11001) << "==============> KGameProcessIO::sendMessage (usermsg="< &recv) +//void KGameProcessIO::clientMessage(const TQByteArray& receiveBuffer, TQ_UINT32 clientID, const TQValueList &recv) void KGameProcessIO::receivedMessage(const TQByteArray& receiveBuffer) { TQDataStream stream(receiveBuffer,IO_ReadOnly); int msgid; - Q_UINT32 sender; - Q_UINT32 receiver; + TQ_UINT32 sender; + TQ_UINT32 receiver; KGameMessage::extractHeader(stream,sender,receiver,msgid); kdDebug(11001) << "************* Got process message sender =" << sender diff --git a/libkdegames/kgame/kgameio.h b/libkdegames/kgame/kgameio.h index 82b84740..2f4b89ab 100644 --- a/libkdegames/kgame/kgameio.h +++ b/libkdegames/kgame/kgameio.h @@ -52,9 +52,10 @@ class KProcess; * * @author Martin Heni */ -class KDE_EXPORT KGameIO : public QObject +class KDE_EXPORT KGameIO : public TQObject { Q_OBJECT + TQ_OBJECT public: /** @@ -128,7 +129,7 @@ public: /** * Send an input message using @ref KPlayer::forwardInput **/ - bool sendInput(TQDataStream& stream, bool transmit = true, Q_UINT32 sender = 0); + bool sendInput(TQDataStream& stream, bool transmit = true, TQ_UINT32 sender = 0); signals: /** @@ -177,6 +178,7 @@ private: class KDE_EXPORT KGameKeyIO : public KGameIO { Q_OBJECT + TQ_OBJECT public: /** @@ -185,7 +187,7 @@ public: * handler signalKeyEvent and can be used to generate * a valid move for the player. * Note the widget you pass to the constructor must be - * the main window of your application, e.g. view->parentWidget() + * the main window of your application, e.g. view->tqparentWidget() * as QT does not forward your keyevents otherwise. This means * that this might be a different widget comapred to the one you * use for mouse inputs! @@ -197,9 +199,9 @@ public: * this,TQT_SLOT(slotKeyInput(KGameIO *,TQDataStream &,TQKeyEvent *,bool *))); * \endcode * - * @param parent The parents widget whose keyboard events * should be grabbed + * @param tqparent The tqparents widget whose keyboard events * should be grabbed */ - KGameKeyIO(TQWidget *parent); + KGameKeyIO(TQWidget *tqparent); virtual ~KGameKeyIO(); /** @@ -221,7 +223,7 @@ signals: * Example: * \code * KPlayer *player=input->player(); // Get the player - * Q_INT32 key=e->key(); + * TQ_INT32 key=e->key(); * stream << key; * eatevent=true; * \endcode @@ -248,6 +250,7 @@ protected: class KDE_EXPORT KGameMouseIO : public KGameIO { Q_OBJECT + TQ_OBJECT public: /** @@ -262,10 +265,10 @@ public: * this,TQT_SLOT(slotMouseInput(KGameIO *,TQDataStream &,TQMouseEvent *,bool *))); * \endcode * - * @param parent The widget whose events should be captured + * @param tqparent The widget whose events should be captured * @param trackmouse enables mouse tracking (gives mouse move events) */ - KGameMouseIO(TQWidget *parent,bool trackmouse=false); + KGameMouseIO(TQWidget *tqparent,bool trackmouse=false); virtual ~KGameMouseIO(); /** @@ -291,7 +294,7 @@ signals: * Example: * \code * KPlayer *player=input->player(); // Get the player - * Q_INT32 button=e->button(); + * TQ_INT32 button=e->button(); * stream << button; * eatevent=true; * \endcode @@ -323,6 +326,7 @@ protected: class KDE_EXPORT KGameProcessIO : public KGameIO { Q_OBJECT + TQ_OBJECT public: /** @@ -364,7 +368,7 @@ public: * @param receiver - not used * @param sender - who send the message */ - void sendMessage(TQDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender); + void sendMessage(TQDataStream &stream,int msgid, TQ_UINT32 receiver, TQ_UINT32 sender); /** * Send a system message to the process. This is analogous to the sendMessage @@ -376,7 +380,7 @@ public: * @param receiver - not used * @param sender - who send the message */ - void sendSystemMessage(TQDataStream &stream, int msgid, Q_UINT32 receiver, Q_UINT32 sender); + void sendSystemMessage(TQDataStream &stream, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender); /** * Init this device by setting the player and e.g. sending an @@ -403,7 +407,7 @@ public: /** * Internal ~ombined function for all message handling **/ - void sendAllMessages(TQDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender, bool usermsg); + void sendAllMessages(TQDataStream &stream,int msgid, TQ_UINT32 receiver, TQ_UINT32 sender, bool usermsg); protected slots: /** @@ -477,6 +481,7 @@ private: class KDE_EXPORT KGameComputerIO : public KGameIO { Q_OBJECT + TQ_OBJECT public: /** diff --git a/libkdegames/kgame/kgamemessage.cpp b/libkdegames/kgame/kgamemessage.cpp index 228708e9..9f5e4694 100644 --- a/libkdegames/kgame/kgamemessage.cpp +++ b/libkdegames/kgame/kgamemessage.cpp @@ -27,7 +27,7 @@ #define MESSAGE_VERSION 2 -Q_UINT32 KGameMessage::createPlayerId(int oldplayerid,Q_UINT32 gameid) +TQ_UINT32 KGameMessage::createPlayerId(int oldplayerid,TQ_UINT32 gameid) { int p; p = oldplayerid & 0x3ff; // remove game id @@ -35,17 +35,17 @@ Q_UINT32 KGameMessage::createPlayerId(int oldplayerid,Q_UINT32 gameid) return p; } -int KGameMessage::rawPlayerId(Q_UINT32 playerid) +int KGameMessage::rawPlayerId(TQ_UINT32 playerid) { return playerid & 0x03ff; } -Q_UINT32 KGameMessage::rawGameId(Q_UINT32 playerid) +TQ_UINT32 KGameMessage::rawGameId(TQ_UINT32 playerid) { return (playerid & 0xfc00) >> 10; } -bool KGameMessage::isPlayer(Q_UINT32 msgid) +bool KGameMessage::isPlayer(TQ_UINT32 msgid) { if (msgid & 0xfc00) { return true; @@ -54,32 +54,32 @@ bool KGameMessage::isPlayer(Q_UINT32 msgid) } } -bool KGameMessage::isGame(Q_UINT32 msgid) +bool KGameMessage::isGame(TQ_UINT32 msgid) { return !isPlayer(msgid); } -void KGameMessage::createHeader(TQDataStream &msg,Q_UINT32 sender,Q_UINT32 receiver,int msgid) +void KGameMessage::createHeader(TQDataStream &msg,TQ_UINT32 sender,TQ_UINT32 receiver,int msgid) { - msg << (Q_INT16)sender << (Q_INT16)receiver << (Q_INT16)msgid; + msg << (TQ_INT16)sender << (TQ_INT16)receiver << (TQ_INT16)msgid; } -void KGameMessage::extractHeader(TQDataStream &msg,Q_UINT32 &sender,Q_UINT32 &receiver,int &msgid) +void KGameMessage::extractHeader(TQDataStream &msg,TQ_UINT32 &sender,TQ_UINT32 &receiver,int &msgid) { - Q_INT16 d3,d4,d5; + TQ_INT16 d3,d4,d5; msg >> d3 >> d4 >> d5; sender=d3;receiver=d4;msgid=d5; } void KGameMessage::createPropertyHeader(TQDataStream &msg,int id) { - msg << (Q_INT16)id; + msg << (TQ_INT16)id; } void KGameMessage::extractPropertyHeader(TQDataStream &msg,int &id) { - Q_INT16 d1; + TQ_INT16 d1; msg >> d1; id=d1; } @@ -87,14 +87,14 @@ void KGameMessage::extractPropertyHeader(TQDataStream &msg,int &id) void KGameMessage::createPropertyCommand(TQDataStream &msg,int cmdid,int pid,int cmd) { createPropertyHeader(msg,cmdid); - msg << (Q_INT16)pid ; - msg << (Q_INT8)cmd ; + msg << (TQ_INT16)pid ; + msg << (TQ_INT8)cmd ; } void KGameMessage::extractPropertyCommand(TQDataStream &msg,int &pid,int &cmd) { - Q_INT16 d1; - Q_INT8 d2; + TQ_INT16 d1; + TQ_INT8 d2; msg >> d1 >> d2; pid=d1; cmd=d2; @@ -151,6 +151,6 @@ TQString KGameMessage::messageId2Text(int msgid) return i18n("Player ID"); case KGameMessage::IdUser: // IdUser must be unknown for use, too! default: - return TQString::null; + return TQString(); } } diff --git a/libkdegames/kgame/kgamemessage.h b/libkdegames/kgame/kgamemessage.h index d671a948..f4029895 100644 --- a/libkdegames/kgame/kgamemessage.h +++ b/libkdegames/kgame/kgamemessage.h @@ -41,7 +41,7 @@ class KDE_EXPORT KGameMessage * @param gameid The game id (<64). 0 For broadcast. * @return the new player id */ - static Q_UINT32 createPlayerId(int player, Q_UINT32 game); + static TQ_UINT32 createPlayerId(int player, TQ_UINT32 game); /** * Returns the raw playerid, that is, a id which does not @@ -51,7 +51,7 @@ class KDE_EXPORT KGameMessage * @param the player id * @return the raw player id **/ - static int rawPlayerId(Q_UINT32 playerid); + static int rawPlayerId(TQ_UINT32 playerid); /** * Returns the raw game id, that is, the game id the player @@ -60,7 +60,7 @@ class KDE_EXPORT KGameMessage * @param the player id * @return the raw game id **/ - static Q_UINT32 rawGameId(Q_UINT32 playerid); + static TQ_UINT32 rawGameId(TQ_UINT32 playerid); /** * Checks whether a message receiver/sender is a player @@ -68,7 +68,7 @@ class KDE_EXPORT KGameMessage * @param id The ID of the sender/receiver * @return true/false */ - static bool isPlayer(Q_UINT32 id); + static bool isPlayer(TQ_UINT32 id); /** * Checks whether the sender/receiver of a message is a game @@ -76,7 +76,7 @@ class KDE_EXPORT KGameMessage * @param id The ID of the sender/receiver * @return true/false */ - static bool isGame(Q_UINT32 id); + static bool isGame(TQ_UINT32 id); /** * Creates a message header given cookie,sender,receiver,... @@ -85,14 +85,14 @@ class KDE_EXPORT KGameMessage * (message length and magic cookie). If you don't need them remove them * with @ref dropExternalHeader */ - static void createHeader(TQDataStream &msg, Q_UINT32 sender, Q_UINT32 receiver, int msgid); + static void createHeader(TQDataStream &msg, TQ_UINT32 sender, TQ_UINT32 receiver, int msgid); /** * Retrieves the information like cookie,sender,receiver,... from a message header * * Note that it could be necessary to call @ref dropExternalHeader first */ - static void extractHeader(TQDataStream &msg,Q_UINT32 &sender, Q_UINT32 &receiver, int &msgid); + static void extractHeader(TQDataStream &msg,TQ_UINT32 &sender, TQ_UINT32 &receiver, int &msgid); /** * Creates a property header given the property id @@ -124,7 +124,7 @@ class KDE_EXPORT KGameMessage * suitable string for it. This string can't be used to identify a message * (as it is i18n'ed) but it can make debugging more easy. See also @ref * KGameDebugDialog. - * @return Either a i18n'ed string (the name of the id) or TQString::null if + * @return Either a i18n'ed string (the name of the id) or TQString() if * the msgid is unknown **/ static TQString messageId2Text(int msgid); diff --git a/libkdegames/kgame/kgamenetwork.cpp b/libkdegames/kgame/kgamenetwork.cpp index 92669834..2fe901b3 100644 --- a/libkdegames/kgame/kgamenetwork.cpp +++ b/libkdegames/kgame/kgamenetwork.cpp @@ -50,7 +50,7 @@ public: public: KMessageClient* mMessageClient; KMessageServer* mMessageServer; - Q_UINT32 mDisconnectId; // Stores gameId() over a disconnect process + TQ_UINT32 mDisconnectId; // Stores gameId() over a disconnect process DNSSD::PublicService* mService; TQString mType; TQString mName; @@ -59,10 +59,10 @@ public: }; // ------------------- NETWORK GAME ------------------------ -KGameNetwork::KGameNetwork(int c, TQObject* parent) : TQObject(parent, 0) +KGameNetwork::KGameNetwork(int c, TQObject* tqparent) : TQObject(tqparent, 0) { d = new KGameNetworkPrivate; - d->mCookie = (Q_INT16)c; + d->mCookie = (TQ_INT16)c; // Init the game as a local game, i.e. // create your own KMessageServer and a KMessageClient connected to it. @@ -83,7 +83,7 @@ KGameNetwork::~KGameNetwork() bool KGameNetwork::isNetwork() const { return isOfferingConnections() || d->mMessageClient->isNetwork();} -Q_UINT32 KGameNetwork::gameId() const +TQ_UINT32 KGameNetwork::gameId() const { //return d->mMessageClient->id() ; // Return stored id in the case of disconnect. In any other @@ -120,25 +120,25 @@ void KGameNetwork::setMaster() } if (!d->mMessageClient) { d->mMessageClient = new KMessageClient (this); - connect (d->mMessageClient, TQT_SIGNAL(broadcastReceived(const TQByteArray&, Q_UINT32)), - this, TQT_SLOT(receiveNetworkTransmission(const TQByteArray&, Q_UINT32))); + connect (d->mMessageClient, TQT_SIGNAL(broadcastReceived(const TQByteArray&, TQ_UINT32)), + this, TQT_SLOT(receiveNetworkTransmission(const TQByteArray&, TQ_UINT32))); connect (d->mMessageClient, TQT_SIGNAL(connectionBroken()), this, TQT_SIGNAL(signalConnectionBroken())); - connect (d->mMessageClient, TQT_SIGNAL(aboutToDisconnect(Q_UINT32)), - this, TQT_SLOT(aboutToLoseConnection(Q_UINT32))); + connect (d->mMessageClient, TQT_SIGNAL(aboutToDisconnect(TQ_UINT32)), + this, TQT_SLOT(aboutToLoseConnection(TQ_UINT32))); connect (d->mMessageClient, TQT_SIGNAL(connectionBroken()), this, TQT_SLOT(slotResetConnection())); connect (d->mMessageClient, TQT_SIGNAL(adminStatusChanged(bool)), this, TQT_SLOT(slotAdminStatusChanged(bool))); - connect (d->mMessageClient, TQT_SIGNAL(eventClientConnected(Q_UINT32)), - this, TQT_SIGNAL(signalClientConnected(Q_UINT32))); - connect (d->mMessageClient, TQT_SIGNAL(eventClientDisconnected(Q_UINT32, bool)), - this, TQT_SIGNAL(signalClientDisconnected(Q_UINT32, bool))); + connect (d->mMessageClient, TQT_SIGNAL(eventClientConnected(TQ_UINT32)), + this, TQT_SIGNAL(signalClientConnected(TQ_UINT32))); + connect (d->mMessageClient, TQT_SIGNAL(eventClientDisconnected(TQ_UINT32, bool)), + this, TQT_SIGNAL(signalClientDisconnected(TQ_UINT32, bool))); // broacast and direct messages are treated equally on receive. - connect (d->mMessageClient, TQT_SIGNAL(forwardReceived(const TQByteArray&, Q_UINT32, const TQValueList&)), - d->mMessageClient, TQT_SIGNAL(broadcastReceived(const TQByteArray&, Q_UINT32))); + connect (d->mMessageClient, TQT_SIGNAL(forwardReceived(const TQByteArray&, TQ_UINT32, const TQValueList&)), + d->mMessageClient, TQT_SIGNAL(broadcastReceived(const TQByteArray&, TQ_UINT32))); } else { // should be no problem but still has to be tested @@ -171,7 +171,7 @@ void KGameNetwork::tryStopPublishing() if (d->mService) d->mService->stop(); } -bool KGameNetwork::offerConnections(Q_UINT16 port) +bool KGameNetwork::offerConnections(TQ_UINT16 port) { kdDebug (11001) << k_funcinfo << "on port " << port << endl; if (!isMaster()) { @@ -201,7 +201,7 @@ bool KGameNetwork::offerConnections(Q_UINT16 port) return true; } -bool KGameNetwork::connectToServer (const TQString& host, Q_UINT16 port) +bool KGameNetwork::connectToServer (const TQString& host, TQ_UINT16 port) { if (host.isEmpty()) { kdError(11001) << k_funcinfo << "No hostname given" << endl; @@ -239,7 +239,7 @@ bool KGameNetwork::connectToServer (const TQString& host, Q_UINT16 port) return true; } -Q_UINT16 KGameNetwork::port() const +TQ_UINT16 KGameNetwork::port() const { if (isNetwork()) { if (isOfferingConnections()) { @@ -276,8 +276,8 @@ void KGameNetwork::disconnect() kdDebug(11001) << k_funcinfo << endl; stopServerConnection(); if (d->mMessageServer) { - TQValueList list=d->mMessageServer->clientIDs(); - TQValueList::Iterator it; + TQValueList list=d->mMessageServer->clientIDs(); + TQValueList::Iterator it; for( it = list.begin(); it != list.end(); ++it ) { kdDebug(11001) << "Client id=" << (*it) << endl; @@ -320,7 +320,7 @@ void KGameNetwork::disconnect() kdDebug(11001) << k_funcinfo << "DONE" << endl; } -void KGameNetwork::aboutToLoseConnection(Q_UINT32 clientID) +void KGameNetwork::aboutToLoseConnection(TQ_UINT32 clientID) { kdDebug(11001) << "Storing client id of connection "<mDisconnectId = clientID; @@ -332,7 +332,7 @@ void KGameNetwork::slotResetConnection() d->mDisconnectId = 0; } -void KGameNetwork::electAdmin(Q_UINT32 clientID) +void KGameNetwork::electAdmin(TQ_UINT32 clientID) { if (!isAdmin()) { kdWarning(11001) << k_funcinfo << "only ADMIN is allowed to call this!" << endl; @@ -340,7 +340,7 @@ void KGameNetwork::electAdmin(Q_UINT32 clientID) } TQByteArray buffer; TQDataStream stream(buffer,IO_WriteOnly); - stream << static_cast( KMessageServer::REQ_ADMIN_CHANGE ); + stream << static_cast( KMessageServer::RETQ_ADMIN_CHANGE ); stream << clientID; d->mMessageClient->sendServerMessage(buffer); } @@ -353,8 +353,8 @@ void KGameNetwork::setMaxClients(int max) } TQByteArray buffer; TQDataStream stream(buffer,IO_WriteOnly); - stream << static_cast( KMessageServer::REQ_MAX_NUM_CLIENTS ); - stream << (Q_INT32)max; + stream << static_cast( KMessageServer::RETQ_MAX_NUM_CLIENTS ); + stream << (TQ_INT32)max; d->mMessageClient->sendServerMessage(buffer); } @@ -374,7 +374,7 @@ void KGameNetwork::unlock() // --------------------- send messages --------------------------- -bool KGameNetwork::sendSystemMessage(int data, int msgid, Q_UINT32 receiver, Q_UINT32 sender) +bool KGameNetwork::sendSystemMessage(int data, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender) { TQByteArray buffer; TQDataStream stream(buffer,IO_WriteOnly); @@ -382,7 +382,7 @@ bool KGameNetwork::sendSystemMessage(int data, int msgid, Q_UINT32 receiver, Q_U return sendSystemMessage(buffer,msgid,receiver,sender); } -bool KGameNetwork::sendSystemMessage(const TQString &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender) +bool KGameNetwork::sendSystemMessage(const TQString &msg, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender) { TQByteArray buffer; TQDataStream stream(buffer, IO_WriteOnly); @@ -390,10 +390,10 @@ bool KGameNetwork::sendSystemMessage(const TQString &msg, int msgid, Q_UINT32 re return sendSystemMessage(buffer, msgid, receiver, sender); } -bool KGameNetwork::sendSystemMessage(const TQDataStream &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender) +bool KGameNetwork::sendSystemMessage(const TQDataStream &msg, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender) { return sendSystemMessage(((TQBuffer*)msg.device())->buffer(), msgid, receiver, sender); } -bool KGameNetwork::sendSystemMessage(const TQByteArray& data, int msgid, Q_UINT32 receiver, Q_UINT32 sender) +bool KGameNetwork::sendSystemMessage(const TQByteArray& data, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender) { TQByteArray buffer; TQDataStream stream(buffer,IO_WriteOnly); @@ -401,7 +401,7 @@ bool KGameNetwork::sendSystemMessage(const TQByteArray& data, int msgid, Q_UINT3 sender = gameId(); } - Q_UINT32 receiverClient = KGameMessage::rawGameId(receiver); // KGame::gameId() + TQ_UINT32 receiverClient = KGameMessage::rawGameId(receiver); // KGame::gameId() int receiverPlayer = KGameMessage::rawPlayerId(receiver); // KPlayer::id() KGameMessage::createHeader(stream, sender, receiver, msgid); @@ -435,35 +435,35 @@ bool KGameNetwork::sendSystemMessage(const TQByteArray& data, int msgid, Q_UINT3 return true; } -bool KGameNetwork::sendMessage(int data, int msgid, Q_UINT32 receiver, Q_UINT32 sender) +bool KGameNetwork::sendMessage(int data, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender) { return sendSystemMessage(data,msgid+KGameMessage::IdUser,receiver,sender); } -bool KGameNetwork::sendMessage(const TQString &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender) +bool KGameNetwork::sendMessage(const TQString &msg, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender) { return sendSystemMessage(msg,msgid+KGameMessage::IdUser,receiver,sender); } -bool KGameNetwork::sendMessage(const TQDataStream &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender) +bool KGameNetwork::sendMessage(const TQDataStream &msg, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender) { return sendSystemMessage(msg, msgid+KGameMessage::IdUser, receiver, sender); } -bool KGameNetwork::sendMessage(const TQByteArray &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender) +bool KGameNetwork::sendMessage(const TQByteArray &msg, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender) { return sendSystemMessage(msg, msgid+KGameMessage::IdUser, receiver, sender); } -void KGameNetwork::sendError(int error,const TQByteArray& message, Q_UINT32 receiver, Q_UINT32 sender) +void KGameNetwork::sendError(int error,const TQByteArray& message, TQ_UINT32 receiver, TQ_UINT32 sender) { TQByteArray buffer; TQDataStream stream(buffer,IO_WriteOnly); - stream << (Q_INT32) error; + stream << (TQ_INT32) error; stream.writeRawBytes(message.data(), message.size()); sendSystemMessage(stream,KGameMessage::IdError,receiver,sender); } // ----------------- receive messages from the network -void KGameNetwork::receiveNetworkTransmission(const TQByteArray& receiveBuffer, Q_UINT32 clientID) +void KGameNetwork::receiveNetworkTransmission(const TQByteArray& receiveBuffer, TQ_UINT32 clientID) { TQDataStream stream(receiveBuffer, IO_ReadOnly); int msgid; - Q_UINT32 sender; // the id of the KGame/KPlayer who sent the message - Q_UINT32 receiver; // the id of the KGame/KPlayer the message is for + TQ_UINT32 sender; // the id of the KGame/KPlayer who sent the message + TQ_UINT32 receiver; // the id of the KGame/KPlayer the message is for KGameMessage::extractHeader(stream, sender, receiver, msgid); // kdDebug(11001) << k_funcinfo << "id=" << msgid << " sender=" << sender << " recv=" << receiver << endl; @@ -481,7 +481,7 @@ void KGameNetwork::receiveNetworkTransmission(const TQByteArray& receiveBuffer, else if (msgid==KGameMessage::IdError) { TQString text; - Q_INT32 error; + TQ_INT32 error; stream >> error; kdDebug(11001) << k_funcinfo << "Got IdError " << error << endl; text = KGameError::errorText(error, stream); diff --git a/libkdegames/kgame/kgamenetwork.h b/libkdegames/kgame/kgamenetwork.h index 47276d06..1766ac90 100644 --- a/libkdegames/kgame/kgamenetwork.h +++ b/libkdegames/kgame/kgamenetwork.h @@ -43,15 +43,16 @@ class KGameNetworkPrivate; * @author Martin Heni * @version $Id$ */ -class KDE_EXPORT KGameNetwork : public QObject +class KDE_EXPORT KGameNetwork : public TQObject { Q_OBJECT + TQ_OBJECT public: /** * Create a KGameNetwork object */ - KGameNetwork(int cookie=42,TQObject* parent=0); + KGameNetwork(int cookie=42,TQObject* tqparent=0); virtual ~KGameNetwork(); /** @@ -96,7 +97,7 @@ public: * * @return int id **/ - Q_UINT32 gameId() const; + TQ_UINT32 gameId() const; /** * Inits a network game as network MASTER. Note that if the @@ -108,7 +109,7 @@ public: * @param port The port on which the service is offered * @return true if it worked **/ - bool offerConnections (Q_UINT16 port); + bool offerConnections (TQ_UINT16 port); /** * Announces game MASTER on network using DNS-SD. Clients then can discover it using @@ -120,7 +121,7 @@ public: * set hostname will be used. In case of name conflict -2, -3 and so on will be added to name. * @since 3.4 **/ - void setDiscoveryInfo(const TQString& type, const TQString& name=TQString::null); + void setDiscoveryInfo(const TQString& type, const TQString& name=TQString()); /** * Inits a network game as a network CLIENT @@ -130,7 +131,7 @@ public: * * @return true if connected **/ - bool connectToServer(const TQString& host, Q_UINT16 port); + bool connectToServer(const TQString& host, TQ_UINT16 port); /** * @since 3.2 @@ -138,7 +139,7 @@ public: * or the port we are connected to if connectToServer was called. * Otherwise 0. **/ - Q_UINT16 port() const; + TQ_UINT16 port() const; /** * @since 3.2 @@ -189,22 +190,22 @@ public: * @return true if worked */ // AB: TODO: doc on how "receiver" and "sender" should be created! - bool sendSystemMessage(const TQByteArray& buffer, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0); + bool sendSystemMessage(const TQByteArray& buffer, int msgid, TQ_UINT32 receiver=0, TQ_UINT32 sender=0); /** * @overload **/ - bool sendSystemMessage(int data, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0); + bool sendSystemMessage(int data, int msgid, TQ_UINT32 receiver=0, TQ_UINT32 sender=0); /** * @overload **/ - bool sendSystemMessage(const TQDataStream &msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0); + bool sendSystemMessage(const TQDataStream &msg, int msgid, TQ_UINT32 receiver=0, TQ_UINT32 sender=0); /** * @overload **/ - bool sendSystemMessage(const TQString& msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0); + bool sendSystemMessage(const TQString& msg, int msgid, TQ_UINT32 receiver=0, TQ_UINT32 sender=0); /** * Sends a network message @@ -217,7 +218,7 @@ public: * the correct value for you. You might want to use this if you send a * message from a specific player. **/ - void sendError(int error, const TQByteArray& message, Q_UINT32 receiver=0, Q_UINT32 sender=0); + void sendError(int error, const TQByteArray& message, TQ_UINT32 receiver=0, TQ_UINT32 sender=0); /** * Are we still offer offering server connections - only for game MASTER @@ -265,29 +266,29 @@ public: * @return true if worked **/ // AB: TODO: doc on how "receiver" and "sender" should be created! - bool sendMessage(const TQByteArray& buffer, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0); + bool sendMessage(const TQByteArray& buffer, int msgid, TQ_UINT32 receiver=0, TQ_UINT32 sender=0); /** * This is an overloaded member function, provided for convenience. **/ - bool sendMessage(const TQDataStream &msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0); + bool sendMessage(const TQDataStream &msg, int msgid, TQ_UINT32 receiver=0, TQ_UINT32 sender=0); /** * This is an overloaded member function, provided for convenience. **/ - bool sendMessage(const TQString& msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0); + bool sendMessage(const TQString& msg, int msgid, TQ_UINT32 receiver=0, TQ_UINT32 sender=0); /** * This is an overloaded member function, provided for convenience. **/ - bool sendMessage(int data, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0); + bool sendMessage(int data, int msgid, TQ_UINT32 receiver=0, TQ_UINT32 sender=0); /** * Called by ReceiveNetworkTransmission(). Will be overwritten by * KGame and handle the incoming message. **/ - virtual void networkTransmission(TQDataStream&, int, Q_UINT32, Q_UINT32, Q_UINT32 clientID) = 0; + virtual void networkTransmission(TQDataStream&, int, TQ_UINT32, TQ_UINT32, TQ_UINT32 clientID) = 0; /** @@ -304,7 +305,7 @@ public: * @param clientID the ID of the new ADMIN (note: this is the _client_ID * which has nothing to do with the player IDs. See KMessageServer) **/ - void electAdmin(Q_UINT32 clientID); + void electAdmin(TQ_UINT32 clientID); /** * Don't use this unless you really know what youre doing! You might @@ -321,13 +322,13 @@ public: * experience some strange behaviour if you use the message server directly! * * @return a pointer to the message server if this is the MASTER KGame - * object. Note that it might be possible that no KGame object contains + * object. Note that it might be possible that no KGame object tqcontains * the KMessageServer at all! It might even run stand alone! **/ KMessageServer* messageServer() const; /** - * You should call this before doing thigs like, e.g. qApp->processEvents(). + * You should call this before doing thigs like, e.g. tqApp->processEvents(). * Don't forget to call unlock once you are done! * * @see KMessageClient::lock @@ -362,7 +363,7 @@ signals: * * @param clientID the ID of the newly connected client **/ - void signalClientConnected(Q_UINT32 clientID); + void signalClientConnected(TQ_UINT32 clientID); /** * This signal is emitted whenever the KMessageServer sends us a message @@ -375,7 +376,7 @@ signals: * @param broken true if the connection was lost because of a network error, false * if the connection was closed by the message server admin. */ - void signalClientDisconnected(Q_UINT32 clientID, bool broken); + void signalClientDisconnected(TQ_UINT32 clientID, bool broken); /** * This client gets or loses the admin status. @@ -401,7 +402,7 @@ protected slots: * If it is valid, the pure virtual method networkTransmission() is called. * (This one is overwritten in KGame.) **/ - void receiveNetworkTransmission(const TQByteArray& a, Q_UINT32 clientID); + void receiveNetworkTransmission(const TQByteArray& a, TQ_UINT32 clientID); /** * This KGame object receives or loses the admin status. @@ -413,7 +414,7 @@ protected slots: * Called when the network connection is about to terminate. Is used * to store the network parameter like the game id */ - void aboutToLoseConnection(Q_UINT32 id); + void aboutToLoseConnection(TQ_UINT32 id); /** * Called when the network connection is terminated. Used to clean diff --git a/libkdegames/kgame/kgameprocess.cpp b/libkdegames/kgame/kgameprocess.cpp index ffbf0936..9dcc66c0 100644 --- a/libkdegames/kgame/kgameprocess.cpp +++ b/libkdegames/kgame/kgameprocess.cpp @@ -52,8 +52,8 @@ KGameProcess::KGameProcess() : TQObject(0,0) mMessageIO=new KMessageFilePipe(this,&rFile,&wFile); // mMessageClient=new KMessageClient(this); // mMessageClient->setServer(mMessageIO); -// connect (mMessageClient, TQT_SIGNAL(broadcastReceived(const TQByteArray&, Q_UINT32)), -// this, TQT_SLOT(receivedMessage(const TQByteArray&, Q_UINT32))); +// connect (mMessageClient, TQT_SIGNAL(broadcastReceived(const TQByteArray&, TQ_UINT32)), +// this, TQT_SLOT(receivedMessage(const TQByteArray&, TQ_UINT32))); connect (mMessageIO, TQT_SIGNAL(received(const TQByteArray&)), this, TQT_SLOT(receivedMessage(const TQByteArray&))); fprintf(stderr,"KGameProcess::constructor %p %p\n",&rFile,&wFile); @@ -88,7 +88,7 @@ bool KGameProcess::exec(int argc, char *argv[]) // TQByteArray buffer; // TQDataStream wstream(buffer,IO_WriteOnly); // then stream data into the stream and call this function -void KGameProcess::sendSystemMessage(TQDataStream &stream,int msgid,Q_UINT32 receiver) +void KGameProcess::sendSystemMessage(TQDataStream &stream,int msgid,TQ_UINT32 receiver) { fprintf(stderr,"KGameProcess::sendMessage id=%d recv=%d",msgid,receiver); TQByteArray a; @@ -107,7 +107,7 @@ void KGameProcess::sendSystemMessage(TQDataStream &stream,int msgid,Q_UINT32 rec if (mMessageIO) mMessageIO->send(a); } -void KGameProcess::sendMessage(TQDataStream &stream,int msgid,Q_UINT32 receiver) +void KGameProcess::sendMessage(TQDataStream &stream,int msgid,TQ_UINT32 receiver) { sendSystemMessage(stream,msgid+KGameMessage::IdUser,receiver); } @@ -133,19 +133,19 @@ void KGameProcess::receivedMessage(const TQByteArray& receiveBuffer) { TQDataStream stream(receiveBuffer, IO_ReadOnly); int msgid; - Q_UINT32 sender; - Q_UINT32 receiver; + TQ_UINT32 sender; + TQ_UINT32 receiver; KGameMessage::extractHeader(stream, sender, receiver, msgid); fprintf(stderr,"------ receiveNetworkTransmission(): id=%d sender=%d,recv=%d\n",msgid,sender,receiver); switch(msgid) { case KGameMessage::IdTurn: - Q_INT8 b; + TQ_INT8 b; stream >> b; emit signalTurn(stream,(bool)b); break; case KGameMessage::IdIOAdded: - Q_INT16 id; + TQ_INT16 id; stream >> id; emit signalInit(stream,(int)id); break; diff --git a/libkdegames/kgame/kgameprocess.h b/libkdegames/kgame/kgameprocess.h index ac6389be..b7e2d145 100644 --- a/libkdegames/kgame/kgameprocess.h +++ b/libkdegames/kgame/kgameprocess.h @@ -37,11 +37,12 @@ class KMessageFilePipe; * This is the process class used on the computer player * side to communicate with its counterpart KProcessIO class. * Using these two classes will give fully transparent communication - * via QDataStreams. + * via TQDataStreams. */ -class KDE_EXPORT KGameProcess: public QObject +class KDE_EXPORT KGameProcess: public TQObject { Q_OBJECT + TQ_OBJECT public: /** @@ -107,7 +108,7 @@ class KDE_EXPORT KGameProcess: public QObject * @param msgid the message id for the message * @param receiver unused */ - void sendMessage(TQDataStream &stream,int msgid,Q_UINT32 receiver=0); + void sendMessage(TQDataStream &stream,int msgid,TQ_UINT32 receiver=0); /** * Sends a system message to the corresonding KGameIO device. @@ -128,7 +129,7 @@ class KDE_EXPORT KGameProcess: public QObject * @param msgid the message id for the message * @param receiver unused */ - void sendSystemMessage(TQDataStream &stream,int msgid,Q_UINT32 receiver=0); + void sendSystemMessage(TQDataStream &stream,int msgid,TQ_UINT32 receiver=0); /** * Returns a pointer to a KRandomSequence. You can generate @@ -164,7 +165,7 @@ class KDE_EXPORT KGameProcess: public QObject * \code * void Computer::slotCommand(int &msgid,TQDataStream &in,TQDataStream &out) * { - * Q_INT32 data,move; + * TQ_INT32 data,move; * in >> data; * // compute move ... * move=data*2; @@ -200,7 +201,7 @@ class KDE_EXPORT KGameProcess: public QObject * { * // Create a move - the format is yours to decide * // It arrives exactly as this in the kgame inputMove function!! - * Q_INT8 x1,y1,pl; + * TQ_INT8 x1,y1,pl; * pl=-1; * x1=proc.random()->getLong(8); * y1=proc.random()->getLong(8); diff --git a/libkdegames/kgame/kgameproperty.cpp b/libkdegames/kgame/kgameproperty.cpp index 3b8c3109..e7d35410 100644 --- a/libkdegames/kgame/kgameproperty.cpp +++ b/libkdegames/kgame/kgameproperty.cpp @@ -29,16 +29,16 @@ #define KPLAYERHANDLER_LOAD_COOKIE 6239 -KGamePropertyBase::KGamePropertyBase(int id, KGame* parent) +KGamePropertyBase::KGamePropertyBase(int id, KGame* tqparent) { init(); - registerData(id, parent); + registerData(id, tqparent); } -KGamePropertyBase::KGamePropertyBase(int id, KPlayer* parent) +KGamePropertyBase::KGamePropertyBase(int id, KPlayer* tqparent) { init(); - registerData(id, parent); + registerData(id, tqparent); } KGamePropertyBase::KGamePropertyBase(int id, KGamePropertyHandler* owner) @@ -173,7 +173,7 @@ void KGamePropertyBase::setLock(bool l) TQDataStream s(b, IO_WriteOnly); KGameMessage::createPropertyCommand(s, IdCommand, id(), CmdLock); - s << (Q_INT8)l; + s << (TQ_INT8)l; if (mOwner) { mOwner->sendProperty(s); } else { @@ -198,7 +198,7 @@ void KGamePropertyBase::command(TQDataStream& s, int cmd, bool isSender) case CmdLock: { if (!isSender) { - Q_INT8 locked; + TQ_INT8 locked; s >> locked; mFlags.bits.locked = (bool)locked ; break; diff --git a/libkdegames/kgame/kgameproperty.h b/libkdegames/kgame/kgameproperty.h index 04474603..03fcae87 100644 --- a/libkdegames/kgame/kgameproperty.h +++ b/libkdegames/kgame/kgameproperty.h @@ -51,7 +51,7 @@ public: IdName=5, //KGame - IdGameStatus=6, + IdGametqStatus=6, IdMaxPlayer=7, IdMinPlayer=8, @@ -66,7 +66,7 @@ public: }; /** - * Commands for advanced properties (Q_INT8) + * Commands for advanced properties (TQ_INT8) **/ enum PropertyCommandIds { @@ -117,7 +117,7 @@ public: /** * Constructs a KGamePropertyBase object and calls registerData. - * @param id The id of this property. MUST be UNIQUE! Used to send and + * @param id The id of this property. MUST be UNITQUE! Used to send and * receive changes in the property of the playere automatically via * network. * @param owner The owner of the object. Must be a KGamePropertyHandler which manages @@ -125,8 +125,8 @@ public: **/ KGamePropertyBase(int id, KGamePropertyHandler* owner); - KGamePropertyBase(int id, KGame* parent); - KGamePropertyBase(int id, KPlayer* parent); + KGamePropertyBase(int id, KGame* tqparent); + KGamePropertyBase(int id, KPlayer* tqparent); /** * Creates a KGamePropertyBase object without an owner. Remember to call @@ -238,7 +238,7 @@ public: int id() const { return mId; } /** - * @return a type_info of the data this property contains. This is used + * @return a type_info of the data this property tqcontains. This is used * e.g. by KGameDebugDialog **/ virtual const type_info* typeinfo() { return &typeid(this); } @@ -344,7 +344,7 @@ protected: bool sendProperty(const TQByteArray& b); /** - * Causes the parent object to emit a signal on value change + * Causes the tqparent object to emit a signal on value change **/ void emitSignal(); @@ -359,7 +359,7 @@ protected: struct { // unsigned char dosave : 1; // do save this property // unsigned char delaytransmit : 1; // do not send immediately on - // change but a KPlayer:QTimer + // change but a KPlayer:TQTimer // sends it later on - fast // changing variables unsigned char emitsignal : 1; // KPlayer notifies on variable change (true) @@ -403,7 +403,7 @@ private: *
    • A Mixture (very dirty) *
    * I repeat: we do not recommend the third option ("a mixture"). Unless - * you have a good reason for this you will probably introduce some hard to find + * you have a good reason for this you will probably introduce some hard to tqfind * (and to fix) bugs. * * @section Always consistent (clean): @@ -413,7 +413,7 @@ private: * property. This is achieved by using send to change the value of the * property. send needs a running KMessageServer and therefore * MUST be plugged into a KGamePropertyHandler using either - * registerData or the constructor. The parent of the dataHandler must be able + * registerData or the constructor. The tqparent of the dataHandler must be able * to send messages (see above: the message server must be running). If you use * send to change the value of a property you won't see the effect * immediately: The new value is first transferred to the message server which @@ -488,7 +488,7 @@ private: * which result in inconsistent properties (like "game running" on client A but * "game ended/paused" on client B). But note that there is a very good reason * for the existence of these different concepts of KGameProperty. I have - * myself experienced such a "strange error" and it took me several days to find + * myself experienced such a "strange error" and it took me several days to tqfind * the reason until I could fix it. So I personally recommend the "clean" way. * On the other hand if you want to port a non-network game to a network game * you will probably start with "dirty" properties as it is you will not have to @@ -546,16 +546,16 @@ private: * }; * TQDataStream& operator<<(TQDataStream& stream, Card& card) * { - * Q_INT16 type = card.type; - * Q_INT16 suite = card.suite; + * TQ_INT16 type = card.type; + * TQ_INT16 suite = card.suite; * s << type; * s << suite; * return s; * } * TQDataStream& operator>>(TQDataStream& stream, Card& card) * { - * Q_INT16 type; - * Q_INT16 suite; + * TQ_INT16 type; + * TQ_INT16 suite; * s >> type; * s >> suite; * card.type = (int)type; @@ -585,15 +585,15 @@ public: * Constructs a KGameProperty object. A KGameProperty object will transmit * any changes to the KMessageServer and then to all clients in the * game (including the one that has sent the new value) - * @param id The id of this property. MUST be UNIQUE! Used to send and + * @param id The id of this property. MUST be UNITQUE! Used to send and * receive changes in the property of the playere automatically via * network. - * @param owner The parent of the object. Must be a KGame which manages + * @param owner The tqparent of the object. Must be a KGame which manages * the changes made to this object, i.e. which will send the new data. * Note that in contrast to most KDE/QT classes KGameProperty objects * are not deleted automatically! **/ -// TODO: ID: Very ugly - better use something like parent()->propertyId() or so which assigns a free id automatically. +// TODO: ID: Very ugly - better use something like tqparent()->propertyId() or so which assigns a free id automatically. KGameProperty(int id, KGamePropertyHandler* owner) : KGamePropertyBase(id, owner) { init(); } /** @@ -651,7 +651,7 @@ public: * \endcode * as myProperty has not yet been set when doSomething is being called. * - * You are informed about a value change by a singal from the parent of + * You are informed about a value change by a singal from the tqparent of * the property which can be deactivated by setEmittingSignal because of * performance (you probably don't have to deactivate it - except you * want to write a real-time game like Command&Conquer with a lot of @@ -842,7 +842,7 @@ private: typedef KGameProperty KGamePropertyInt; typedef KGameProperty KGamePropertyUInt; -typedef KGameProperty KGamePropertyQString; -typedef KGameProperty KGamePropertyBool; +typedef KGameProperty KGamePropertyTQString; +typedef KGameProperty KGamePropertyBool; #endif diff --git a/libkdegames/kgame/kgamepropertyhandler.cpp b/libkdegames/kgame/kgamepropertyhandler.cpp index f395fc66..32e831d8 100644 --- a/libkdegames/kgame/kgamepropertyhandler.cpp +++ b/libkdegames/kgame/kgamepropertyhandler.cpp @@ -51,13 +51,13 @@ public: TQPtrQueue mSignalQueue; }; -KGamePropertyHandler::KGamePropertyHandler(int id, const TQObject* receiver, const char * sendf, const char *emitf, TQObject* parent) : TQObject(parent) +KGamePropertyHandler::KGamePropertyHandler(int id, const TQObject* receiver, const char * sendf, const char *emitf, TQObject* tqparent) : TQObject(tqparent) { init(); registerHandler(id,receiver,sendf,emitf); } -KGamePropertyHandler::KGamePropertyHandler(TQObject* parent) : TQObject(parent) +KGamePropertyHandler::KGamePropertyHandler(TQObject* tqparent) : TQObject(tqparent) { init(); } @@ -117,7 +117,7 @@ bool KGamePropertyHandler::processMessage(TQDataStream &stream, int id, bool isS int cmd; KGameMessage::extractPropertyCommand(stream, propertyId, cmd); //kdDebug(11001) << k_funcinfo << ": Got COMMAND for id= "<mIdDict.find(propertyId); + p = d->mIdDict.tqfind(propertyId); if (p) { if (!isSender || p->policy()==KGamePropertyBase::PolicyClean) { p->command(stream, cmd, isSender); @@ -127,7 +127,7 @@ bool KGamePropertyHandler::processMessage(TQDataStream &stream, int id, bool isS } return true; } - p = d->mIdDict.find(propertyId); + p = d->mIdDict.tqfind(propertyId); if (p) { //kdDebug(11001) << k_funcinfo << ": Loading " << propertyId << endl; if (!isSender || p->policy()==KGamePropertyBase::PolicyClean) { @@ -151,7 +151,7 @@ bool KGamePropertyHandler::removeProperty(KGamePropertyBase* data) bool KGamePropertyHandler::addProperty(KGamePropertyBase* data, TQString name) { //kdDebug(11001) << k_funcinfo << ": " << data->id() << endl; - if (d->mIdDict.find(data->id())) { + if (d->mIdDict.tqfind(data->id())) { // this id already exists kdError(11001) << " -> cannot add property " << data->id() << endl; return false; @@ -172,15 +172,15 @@ bool KGamePropertyHandler::addProperty(KGamePropertyBase* data, TQString name) TQString KGamePropertyHandler::propertyName(int id) const { TQString s; - if (d->mIdDict.find(id)) { - if (d->mNameMap.contains(id)) { - s = i18n("%1 (%2)").arg(d->mNameMap[id]).arg(id); + if (d->mIdDict.tqfind(id)) { + if (d->mNameMap.tqcontains(id)) { + s = i18n("%1 (%2)").tqarg(d->mNameMap[id]).tqarg(id); } else { - s = i18n("Unnamed - ID: %1").arg(id); + s = i18n("Unnamed - ID: %1").tqarg(id); } } else { // Should _never_ happen - s = i18n("%1 unregistered").arg(id); + s = i18n("%1 unregistered").tqarg(id); } return s; } @@ -195,7 +195,7 @@ bool KGamePropertyHandler::load(TQDataStream &stream) for (i = 0; i < count; i++) { processMessage(stream, id(),false); } - Q_INT16 cookie; + TQ_INT16 cookie; stream >> cookie; if (cookie == KPLAYERHANDLER_LOAD_COOKIE) { kdDebug(11001) << " KGamePropertyHandler loaded propertly"<mIdDict.find(id); + return d->mIdDict.tqfind(id); } void KGamePropertyHandler::clear() @@ -338,7 +338,7 @@ void KGamePropertyHandler::clear() while (it.toFirst()) { KGamePropertyBase* p = it.toFirst(); p->unregisterData(); - if (d->mIdDict.find(p->id())) { + if (d->mIdDict.tqfind(p->id())) { // shouldn't happen - but if mOwner in KGamePropertyBase is NULL // this might be possible removeProperty(p); @@ -371,8 +371,8 @@ TQString KGamePropertyHandler::propertyValue(KGamePropertyBase* prop) } else if (*t == typeid(unsigned long int)) { value = TQString::number(((KGameProperty *)prop)->value()); } else if (*t == typeid(TQString)) { - value = ((KGamePropertyQString*)prop)->value(); - } else if (*t == typeid(Q_INT8)) { + value = ((KGamePropertyTQString*)prop)->value(); + } else if (*t == typeid(TQ_INT8)) { value = ((KGamePropertyBool*)prop)->value() ? i18n("True") : i18n("False"); } else { emit signalRequestValue(prop, value); diff --git a/libkdegames/kgame/kgamepropertyhandler.h b/libkdegames/kgame/kgamepropertyhandler.h index 29a57cf1..7388b510 100644 --- a/libkdegames/kgame/kgamepropertyhandler.h +++ b/libkdegames/kgame/kgamepropertyhandler.h @@ -43,8 +43,8 @@ class KGamePropertyHandlerPrivate; // wow - what a name ;-) * to care about the KGamePropertHandler. KGame and KPlayer implement * all features of KGamePropertyHandler so you will rather use it there. * - * You have to use the KGamePropertyHandler as parent for all KGameProperty - * objects but you can also use KPlayer or KGame as parent - then + * You have to use the KGamePropertyHandler as tqparent for all KGameProperty + * objects but you can also use KPlayer or KGame as tqparent - then * KPlayer::dataHandler or KGame::dataHandler will be used. * * Every KGamePropertyHandler must have - just like every KGameProperty - @@ -69,9 +69,10 @@ class KGamePropertyHandlerPrivate; // wow - what a name ;-) * multiplied. * **/ -class KDE_EXPORT KGamePropertyHandler : public QObject +class KDE_EXPORT KGamePropertyHandler : public TQObject { Q_OBJECT + TQ_OBJECT public: /** @@ -80,18 +81,18 @@ public: * You have to call registerHandler before you can use this * handler! **/ - KGamePropertyHandler(TQObject* parent = 0); + KGamePropertyHandler(TQObject* tqparent = 0); /** * Construct a registered handler. * * @see registerHandler **/ - KGamePropertyHandler(int id, const TQObject* receiver, const char* sendf, const char* emitf, TQObject* parent = 0); + KGamePropertyHandler(int id, const TQObject* receiver, const char* sendf, const char* emitf, TQObject* tqparent = 0); ~KGamePropertyHandler(); /** - * Register the handler with a parent. This is to use + * Register the handler with a tqparent. This is to use * if the constructor without arguments has been chosen. * Otherwise you need not call this. * @@ -105,7 +106,7 @@ public: /** * Main message process function. This has to be called by - * the parent's message event handler. If the id of the message + * the tqparent's message event handler. If the id of the message * agrees with the id of the handler, the message is extracted * and processed. Otherwise false is returned. * Example: @@ -169,7 +170,7 @@ public: /** * called by a property to send itself into the * datastream. This call is simply forwarded to - * the parent object + * the tqparent object **/ bool sendProperty(TQDataStream &s); @@ -178,7 +179,7 @@ public: /** * called by a property to emit a signal * This call is simply forwarded to - * the parent object + * the tqparent object **/ void emitSignal(KGamePropertyBase *data); @@ -194,7 +195,7 @@ public: * @param id The ID of the property. See KGamePropertyBase::id * @return The KGameProperty this ID is assigned to **/ - KGamePropertyBase *find(int id); + KGamePropertyBase *tqfind(int id); /** * Clear the KGamePropertyHandler. Note that the properties are @@ -315,7 +316,7 @@ signals: /** * This signal is emitted when a property needs to be sent. Only the - * parent has to react to this. + * tqparent has to react to this. * @param msgid The id of the handler * @param sent set this to true if the property was sent successfully - * otherwise don't touch diff --git a/libkdegames/kgame/kgamepropertylist.h b/libkdegames/kgame/kgamepropertylist.h index df8eb604..af380b0a 100644 --- a/libkdegames/kgame/kgamepropertylist.h +++ b/libkdegames/kgame/kgamepropertylist.h @@ -139,7 +139,7 @@ public: void remove( const type& d ) { - Iterator it=find(d); + Iterator it=tqfind(d); remove(it); } diff --git a/libkdegames/kgame/kgamesequence.h b/libkdegames/kgame/kgamesequence.h index 19699d6b..8047c642 100644 --- a/libkdegames/kgame/kgamesequence.h +++ b/libkdegames/kgame/kgamesequence.h @@ -39,9 +39,10 @@ class KGame; * @short Round/move management class * @author Andreas Beckermann **/ -class KGameSequence : public QObject +class KGameSequence : public TQObject { Q_OBJECT + TQ_OBJECT public: KGameSequence(); virtual ~KGameSequence(); diff --git a/libkdegames/kgame/kmessageclient.cpp b/libkdegames/kgame/kmessageclient.cpp index e490a084..03a39df9 100644 --- a/libkdegames/kgame/kmessageclient.cpp +++ b/libkdegames/kgame/kmessageclient.cpp @@ -40,16 +40,16 @@ public: delete connection; } - Q_UINT32 adminID; - TQValueList clientList; + TQ_UINT32 adminID; + TQValueList clientList; KMessageIO *connection; bool isLocked; TQValueList delayedMessages; }; -KMessageClient::KMessageClient (TQObject *parent, const char *name) - : TQObject (parent, name) +KMessageClient::KMessageClient (TQObject *tqparent, const char *name) + : TQObject (tqparent, name) { d = new KMessageClientPrivate (); d->isLocked = false; @@ -63,7 +63,7 @@ KMessageClient::~KMessageClient () // -- setServer stuff -void KMessageClient::setServer (const TQString &host, Q_UINT16 port) +void KMessageClient::setServer (const TQString &host, TQ_UINT16 port) { setServer (new KMessageSocket (host, port)); } @@ -95,7 +95,7 @@ void KMessageClient::setServer (KMessageIO *connection) // -- id stuff -Q_UINT32 KMessageClient::id () const +TQ_UINT32 KMessageClient::id () const { return (d->connection) ? d->connection->id () : 0; } @@ -105,12 +105,12 @@ bool KMessageClient::isAdmin () const return id() != 0 && id() == adminId(); } -Q_UINT32 KMessageClient::adminId () const +TQ_UINT32 KMessageClient::adminId () const { return d->adminID; } -const TQValueList &KMessageClient::clientList() const +const TQValueList &KMessageClient::clientList() const { return d->clientList; } @@ -125,14 +125,14 @@ bool KMessageClient::isNetwork () const return isConnected() ? d->connection->isNetwork() : false; } -Q_UINT16 KMessageClient::peerPort () const +TQ_UINT16 KMessageClient::peerPort () const { return d->connection ? d->connection->peerPort() : 0; } TQString KMessageClient::peerName () const { - return d->connection ? d->connection->peerName() : TQString::fromLatin1("localhost"); + return d->connection ? d->connection->peerName() : TQString::tqfromLatin1("localhost"); } // --------------------- Sending messages @@ -154,26 +154,26 @@ void KMessageClient::sendBroadcast (const TQByteArray &msg) buffer.open (IO_WriteOnly); TQDataStream stream (&buffer); - stream << static_cast ( KMessageServer::REQ_BROADCAST ); - buffer.TQIODevice::writeBlock (msg); + stream << static_cast ( KMessageServer::RETQ_BROADCAST ); + TQT_TQIODEVICE(&buffer)->writeBlock (msg); sendServerMessage (sendBuffer); } -void KMessageClient::sendForward (const TQByteArray &msg, const TQValueList &clients) +void KMessageClient::sendForward (const TQByteArray &msg, const TQValueList &clients) { TQByteArray sendBuffer; TQBuffer buffer (sendBuffer); buffer.open (IO_WriteOnly); TQDataStream stream (&buffer); - stream << static_cast( KMessageServer::REQ_FORWARD ) << clients; - buffer.TQIODevice::writeBlock (msg); + stream << static_cast( KMessageServer::RETQ_FORWARD ) << clients; + TQT_TQIODEVICE(&buffer)->writeBlock (msg); sendServerMessage (sendBuffer); } -void KMessageClient::sendForward (const TQByteArray &msg, Q_UINT32 client) +void KMessageClient::sendForward (const TQByteArray &msg, TQ_UINT32 client) { - sendForward (msg, TQValueList () << client); + sendForward (msg, TQValueList () << client); } @@ -213,13 +213,13 @@ void KMessageClient::processMessage (const TQByteArray &msg) bool unknown = false; - Q_UINT32 messageID; + TQ_UINT32 messageID; in_stream >> messageID; switch (messageID) { case KMessageServer::MSG_BROADCAST: { - Q_UINT32 clientID; + TQ_UINT32 clientID; in_stream >> clientID; emit broadcastReceived (in_buffer.readAll(), clientID); } @@ -227,17 +227,17 @@ void KMessageClient::processMessage (const TQByteArray &msg) case KMessageServer::MSG_FORWARD: { - Q_UINT32 clientID; - TQValueList receivers; - in_stream >> clientID >> receivers; - emit forwardReceived (in_buffer.readAll(), clientID, receivers); + TQ_UINT32 clientID; + TQValueList tqreceivers; + in_stream >> clientID >> tqreceivers; + emit forwardReceived (in_buffer.readAll(), clientID, tqreceivers); } break; case KMessageServer::ANS_CLIENT_ID: { bool old_admin = isAdmin(); - Q_UINT32 clientID; + TQ_UINT32 clientID; in_stream >> clientID; d->connection->setId (clientID); if (old_admin != isAdmin()) @@ -262,10 +262,10 @@ void KMessageClient::processMessage (const TQByteArray &msg) case KMessageServer::EVNT_CLIENT_CONNECTED: { - Q_UINT32 id; + TQ_UINT32 id; in_stream >> id; - if (d->clientList.contains (id)) + if (d->clientList.tqcontains (id)) kdWarning (11001) << k_funcinfo << ": Adding a client that already existed!" << endl; else d->clientList.append (id); @@ -276,11 +276,11 @@ void KMessageClient::processMessage (const TQByteArray &msg) case KMessageServer::EVNT_CLIENT_DISCONNECTED: { - Q_UINT32 id; - Q_INT8 broken; + TQ_UINT32 id; + TQ_INT8 broken; in_stream >> id >> broken; - if (!d->clientList.contains (id)) + if (!d->clientList.tqcontains (id)) kdWarning (11001) << k_funcinfo << ": Removing a client that doesn't exist!" << endl; else d->clientList.remove (id); diff --git a/libkdegames/kgame/kmessageclient.h b/libkdegames/kgame/kmessageclient.h index 71ab7a1e..f81d7a69 100644 --- a/libkdegames/kgame/kmessageclient.h +++ b/libkdegames/kgame/kmessageclient.h @@ -47,9 +47,10 @@ class KMessageClientPrivate; In that case the messages must be of the format specified in KMessageServer. @author Burkhard Lehner */ -class KMessageClient : public QObject +class KMessageClient : public TQObject { Q_OBJECT + TQ_OBJECT public: @@ -58,7 +59,7 @@ public: Creates an unconnected KMessageClient object. Use setServer() later to connect to a KMessageServer object. */ - KMessageClient (TQObject *parent = 0, const char *name = 0); + KMessageClient (TQObject *tqparent = 0, const char *name = 0); /** Destructor. @@ -73,7 +74,7 @@ public: NOTE: As long as the object is not yet connected to the server, and as long as the server hasn't sent the client ID, this method returns 0. */ - Q_UINT32 id () const; + TQ_UINT32 id () const; /** @return Whether or not this client is the server admin. @@ -90,12 +91,12 @@ public: /** @return The ID of the admin client on the message server. */ - Q_UINT32 adminId() const; + TQ_UINT32 adminId() const; /** @return The list of the IDs of all the message clients connected to the message server. */ - const TQValueList &clientList() const; + const TQValueList &clientList() const; /** Connects the client to (another) server. @@ -108,7 +109,7 @@ public: be resolved to an IP or just an IP @param port The port to connect to */ - void setServer (const TQString &host, Q_UINT16 port); + void setServer (const TQString &host, TQ_UINT16 port); /** Connects the client to (another) server. @@ -168,7 +169,7 @@ public: connected to. See also KMessageIO::peerPort and TQSocket::peerPort. @since 3.2 */ - Q_UINT16 peerPort () const; + TQ_UINT16 peerPort () const; /** @since 3.2 @@ -218,11 +219,11 @@ public: @param clients A list of clients the message should be sent to */ //AB: processForward doesn't exist!! is processIncomingMessage meant? - void sendForward (const TQByteArray &msg, const TQValueList &clients); + void sendForward (const TQByteArray &msg, const TQValueList &clients); /** Sends a message to a single client. This is a convenieance method. It calls - sendForward (const TQByteArray &msg, const TQValueList <Q_UINT32> &clients) + sendForward (const TQByteArray &msg, const TQValueList <TQ_UINT32> &clients) with a list containing only one client ID. To send a message to the admin of the KMessageServer, you can use 0 as clientID, @@ -230,7 +231,7 @@ public: @param msg The message to be sent to the client @param client The id of the client the message shall be sent to */ - void sendForward (const TQByteArray &msg, Q_UINT32 client); + void sendForward (const TQByteArray &msg, TQ_UINT32 client); /** Once this function is called no message will be received anymore. @@ -263,7 +264,7 @@ signals: to ignore broadcast messages that were sent by yourself: \code - void myObject::myBroadcastSlot (const TQByteArray &msg, Q_UINT32 senderID) + void myObject::myBroadcastSlot (const TQByteArray &msg, TQ_UINT32 senderID) { if (senderID == ((KMessageClient *)sender())->id()) return; @@ -273,7 +274,7 @@ signals: @param msg The message that has been sent to us @param senderID The ID of the client which sent the message */ - void broadcastReceived (const TQByteArray &msg, Q_UINT32 senderID); + void broadcastReceived (const TQByteArray &msg, TQ_UINT32 senderID); /** This signal is emitted when the client receives a forward message from the @@ -283,27 +284,27 @@ signals: senderID contains the ID of the client that sent the broadcast message. You can use this e.g. to send a reply message to only that client. - receivers contains the list of the clients that got the message. (If this list + tqreceivers contains the list of the clients that got the message. (If this list only contains one number, this will be your client ID, and it was exclusivly sent to you.) If you don't want to distinguish between broadcast and forward messages and treat them the same, you can connect forwardReceived signal to the - broadcastReceived signal. (Yes, that's possible! You can connect a Qt signal to - a Qt signal, and the second one can have less parameters.) + broadcastReceived signal. (Yes, that's possible! You can connect a TQt signal to + a TQt signal, and the second one can have less parameters.) \code KMessageClient *client = new KMessageClient (); - connect (client, TQT_SIGNAL (forwardReceived (const TQByteArray &, Q_UINT32, const TQValueList &)), - client, TQT_SIGNAL (broadcastReceived (const TQByteArray &, Q_UINT32))); + connect (client, TQT_SIGNAL (forwardReceived (const TQByteArray &, TQ_UINT32, const TQValueList &)), + client, TQT_SIGNAL (broadcastReceived (const TQByteArray &, TQ_UINT32))); \endcode Then connect the broadcast signal to your slot that analyzes the message. @param msg The message that has been sent to us @param senderID The ID of the client which sent the message - @param receivers All clients which receive this message + @param tqreceivers All clients which receive this message */ - void forwardReceived (const TQByteArray &msg, Q_UINT32 senderID, const TQValueList &receivers); + void forwardReceived (const TQByteArray &msg, TQ_UINT32 senderID, const TQValueList &tqreceivers); /** This signal is emitted when the connection to the KMessageServer is broken. @@ -320,7 +321,7 @@ signals: This signal is emitted right before the client disconnects. It can be used to this store the id of the client which is about to be lost. */ - void aboutToDisconnect(Q_UINT32 id); + void aboutToDisconnect(TQ_UINT32 id); /** This signal is emitted when this client becomes the admin client or when it loses @@ -336,7 +337,7 @@ signals: This should usually only be done in one client, e.g. the admin client. @param clientID The ID of the client that has newly connectd. */ - void eventClientConnected (Q_UINT32 clientID); + void eventClientConnected (TQ_UINT32 clientID); /** This signal is emitted when the server has lost the @@ -345,7 +346,7 @@ signals: @param clientID The ID of the client that has disconnected @param broken true if it was disconnected because of a network error */ - void eventClientDisconnected (Q_UINT32 clientID, bool broken); + void eventClientDisconnected (TQ_UINT32 clientID, bool broken); /** This signal is emitted on every message that came from the server. You can connect to this diff --git a/libkdegames/kgame/kmessageio.cpp b/libkdegames/kgame/kmessageio.cpp index 7057a621..ec33b159 100644 --- a/libkdegames/kgame/kmessageio.cpp +++ b/libkdegames/kgame/kmessageio.cpp @@ -29,54 +29,54 @@ // ----------------------- KMessageIO ------------------------- -KMessageIO::KMessageIO (TQObject *parent, const char *name) - : TQObject (parent, name), m_id (0) +KMessageIO::KMessageIO (TQObject *tqparent, const char *name) + : TQObject (tqparent, name), m_id (0) {} KMessageIO::~KMessageIO () {} -void KMessageIO::setId (Q_UINT32 id) +void KMessageIO::setId (TQ_UINT32 id) { m_id = id; } -Q_UINT32 KMessageIO::id () +TQ_UINT32 KMessageIO::id () { return m_id; } // ----------------------KMessageSocket ----------------------- -KMessageSocket::KMessageSocket (TQString host, Q_UINT16 port, TQObject *parent, +KMessageSocket::KMessageSocket (TQString host, TQ_UINT16 port, TQObject *tqparent, const char *name) - : KMessageIO (parent, name) + : KMessageIO (tqparent, name) { mSocket = new TQSocket (); mSocket->connectToHost (host, port); initSocket (); } -KMessageSocket::KMessageSocket (TQHostAddress host, Q_UINT16 port, TQObject -*parent, const char *name) - : KMessageIO (parent, name) +KMessageSocket::KMessageSocket (TQHostAddress host, TQ_UINT16 port, TQObject +*tqparent, const char *name) + : KMessageIO (tqparent, name) { mSocket = new TQSocket (); mSocket->connectToHost (host.toString(), port); initSocket (); } -KMessageSocket::KMessageSocket (TQSocket *socket, TQObject *parent, const char +KMessageSocket::KMessageSocket (TQSocket *socket, TQObject *tqparent, const char *name) - : KMessageIO (parent, name) + : KMessageIO (tqparent, name) { mSocket = socket; initSocket (); } -KMessageSocket::KMessageSocket (int socketFD, TQObject *parent, const char +KMessageSocket::KMessageSocket (int socketFD, TQObject *tqparent, const char *name) - : KMessageIO (parent, name) + : KMessageIO (tqparent, name) { mSocket = new TQSocket (); mSocket->setSocket (socketFD); @@ -96,8 +96,8 @@ bool KMessageSocket::isConnected () const void KMessageSocket::send (const TQByteArray &msg) { TQDataStream str (mSocket); - str << Q_UINT8 ('M'); // magic number for begin of message - str.writeBytes (msg.data(), msg.size()); // writes the length (as Q_UINT32) and the data + str << TQ_UINT8 ('M'); // magic number for begin of message + str.writeBytes (msg.data(), msg.size()); // writes the length (as TQ_UINT32) and the data } void KMessageSocket::processNewData () @@ -121,7 +121,7 @@ void KMessageSocket::processNewData () // Read the magic number first. If something unexpected is found, // start over again, ignoring the data that was read up to then. - Q_UINT8 v; + TQ_UINT8 v; str >> v; if (v != 'M') { @@ -135,7 +135,7 @@ void KMessageSocket::processNewData () else { // Data not completely read => wait for more - if (mSocket->bytesAvailable() < (Q_ULONG) mNextBlockLength) + if (mSocket->bytesAvailable() < (TQ_ULONG) mNextBlockLength) { isRecursive = false; return; @@ -165,7 +165,7 @@ void KMessageSocket::initSocket () isRecursive = false; } -Q_UINT16 KMessageSocket::peerPort () const +TQ_UINT16 KMessageSocket::peerPort () const { return mSocket->peerPort(); } @@ -177,9 +177,9 @@ TQString KMessageSocket::peerName () const // ----------------------KMessageDirect ----------------------- -KMessageDirect::KMessageDirect (KMessageDirect *partner, TQObject *parent, +KMessageDirect::KMessageDirect (KMessageDirect *partner, TQObject *tqparent, const char *name) - : KMessageIO (parent, name), mPartner (0) + : KMessageIO (tqparent, name), mPartner (0) { // 0 as first parameter leaves the object unconnected if (!partner) @@ -238,14 +238,14 @@ KMessageProcess::~KMessageProcess() // Maybe todo: delete mSendBuffer } } -KMessageProcess::KMessageProcess(TQObject *parent, TQString file) : KMessageIO(parent,0) +KMessageProcess::KMessageProcess(TQObject *tqparent, TQString file) : KMessageIO(tqparent,0) { // Start process kdDebug(11001) << "@@@KMessageProcess::Start process" << endl; mProcessName=file; mProcess=new KProcess; int id=0; - *mProcess << mProcessName << TQString("%1").arg(id); + *mProcess << mProcessName << TQString("%1").tqarg(id); kdDebug(11001) << "@@@KMessageProcess::Init:Id= " << id << endl; kdDebug(11001) << "@@@KMessgeProcess::Init:Processname: " << mProcessName << endl; connect(mProcess, TQT_SIGNAL(receivedStdout(KProcess *, char *, int )), @@ -397,7 +397,7 @@ void KMessageProcess::slotProcessExited(KProcess * /*p*/) // ----------------------- KMessageFilePipe --------------------------- -KMessageFilePipe::KMessageFilePipe(TQObject *parent,TQFile *readfile,TQFile *writefile) : KMessageIO(parent,0) +KMessageFilePipe::KMessageFilePipe(TQObject *tqparent,TQFile *readfile,TQFile *writefile) : KMessageIO(tqparent,0) { mReadFile=readfile; mWriteFile=writefile; @@ -430,7 +430,7 @@ void KMessageFilePipe::send(const TQByteArray &msg) mWriteFile->writeBlock(buffer); mWriteFile->flush(); /* - fprintf(stderr,"+++ KMessageFilePipe:: SEND(%d to parent) realsize=%d\n",msg.size(),buffer.size()); + fprintf(stderr,"+++ KMessageFilePipe:: SEND(%d to tqparent) realsize=%d\n",msg.size(),buffer.size()); for (int i=0;imIsRecursive=false; @@ -115,7 +115,7 @@ KMessageServer::~KMessageServer() //------------------------------------- TCP/IP server stuff -bool KMessageServer::initNetwork (Q_UINT16 port) +bool KMessageServer::initNetwork (TQ_UINT16 port) { kdDebug(11001) << k_funcinfo << endl; @@ -143,7 +143,7 @@ bool KMessageServer::initNetwork (Q_UINT16 port) return true; } -Q_UINT16 KMessageServer::serverPort () const +TQ_UINT16 KMessageServer::serverPort () const { if (d->mServerSocket) return d->mServerSocket->port(); @@ -190,18 +190,18 @@ void KMessageServer::addClient (KMessageIO* client) // Tell everyone about the new guest // Note: The new client doesn't get this message! - TQDataStream (msg, IO_WriteOnly) << Q_UINT32 (EVNT_CLIENT_CONNECTED) << client->id(); + TQDataStream (msg, IO_WriteOnly) << TQ_UINT32 (EVNT_CLIENT_CONNECTED) << client->id(); broadcastMessage (msg); // add to our list d->mClientList.append (client); // tell it its ID - TQDataStream (msg, IO_WriteOnly) << Q_UINT32 (ANS_CLIENT_ID) << client->id(); + TQDataStream (msg, IO_WriteOnly) << TQ_UINT32 (ANS_CLIENT_ID) << client->id(); client->send (msg); // Give it the complete list of client IDs - TQDataStream (msg, IO_WriteOnly) << Q_UINT32 (ANS_CLIENT_LIST) << clientIDs(); + TQDataStream (msg, IO_WriteOnly) << TQ_UINT32 (ANS_CLIENT_LIST) << clientIDs(); client->send (msg); @@ -213,7 +213,7 @@ void KMessageServer::addClient (KMessageIO* client) else { // otherwise tell it who is the admin - TQDataStream (msg, IO_WriteOnly) << Q_UINT32 (ANS_ADMIN_ID) << adminID(); + TQDataStream (msg, IO_WriteOnly) << TQ_UINT32 (ANS_ADMIN_ID) << adminID(); client->send (msg); } @@ -222,7 +222,7 @@ void KMessageServer::addClient (KMessageIO* client) void KMessageServer::removeClient (KMessageIO* client, bool broken) { - Q_UINT32 clientID = client->id(); + TQ_UINT32 clientID = client->id(); if (!d->mClientList.removeRef (client)) { kdError(11001) << k_funcinfo << ": Deleting client that wasn't added before!" << endl; @@ -231,7 +231,7 @@ void KMessageServer::removeClient (KMessageIO* client, bool broken) // tell everyone about the removed client TQByteArray msg; - TQDataStream (msg, IO_WriteOnly) << Q_UINT32 (EVNT_CLIENT_DISCONNECTED) << client->id() << (Q_INT8)broken; + TQDataStream (msg, IO_WriteOnly) << TQ_UINT32 (EVNT_CLIENT_DISCONNECTED) << client->id() << (TQ_INT8)broken; broadcastMessage (msg); // If it was the admin, select a new admin. @@ -280,15 +280,15 @@ int KMessageServer::clientCount() const return d->mClientList.count(); } -TQValueList KMessageServer::clientIDs () const +TQValueList KMessageServer::clientIDs () const { - TQValueList list; + TQValueList list; for (TQPtrListIterator iter (d->mClientList); *iter; ++iter) list.append ((*iter)->id()); return list; } -KMessageIO* KMessageServer::findClient (Q_UINT32 no) const +KMessageIO* KMessageServer::findClient (TQ_UINT32 no) const { if (no == 0) no = d->mAdminID; @@ -303,12 +303,12 @@ KMessageIO* KMessageServer::findClient (Q_UINT32 no) const return 0; } -Q_UINT32 KMessageServer::adminID () const +TQ_UINT32 KMessageServer::adminID () const { return d->mAdminID; } -void KMessageServer::setAdmin (Q_UINT32 adminID) +void KMessageServer::setAdmin (TQ_UINT32 adminID) { // Trying to set the the client that is already admin => nothing to do if (adminID == d->mAdminID) @@ -323,7 +323,7 @@ void KMessageServer::setAdmin (Q_UINT32 adminID) d->mAdminID = adminID; TQByteArray msg; - TQDataStream (msg, IO_WriteOnly) << Q_UINT32 (ANS_ADMIN_ID) << adminID; + TQDataStream (msg, IO_WriteOnly) << TQ_UINT32 (ANS_ADMIN_ID) << adminID; // Tell everyone about the new master broadcastMessage (msg); @@ -332,7 +332,7 @@ void KMessageServer::setAdmin (Q_UINT32 adminID) //------------------------------------------- ID stuff -Q_UINT32 KMessageServer::uniqueClientNumber() const +TQ_UINT32 KMessageServer::uniqueClientNumber() const { return d->mUniqueClientNumber++; } @@ -345,16 +345,16 @@ void KMessageServer::broadcastMessage (const TQByteArray &msg) (*iter)->send (msg); } -void KMessageServer::sendMessage (Q_UINT32 id, const TQByteArray &msg) +void KMessageServer::sendMessage (TQ_UINT32 id, const TQByteArray &msg) { KMessageIO *client = findClient (id); if (client) client->send (msg); } -void KMessageServer::sendMessage (const TQValueList &ids, const TQByteArray &msg) +void KMessageServer::sendMessage (const TQValueList &ids, const TQByteArray &msg) { - for (TQValueListConstIterator iter = ids.begin(); iter != ids.end(); ++iter) + for (TQValueListConstIterator iter = ids.begin(); iter != ids.end(); ++iter) sendMessage (*iter, msg); } @@ -367,7 +367,7 @@ void KMessageServer::getReceivedMessage (const TQByteArray &msg) } //kdDebug(11001) << k_funcinfo << ": size=" << msg.size() << endl; KMessageIO *client = (KMessageIO *) sender(); - Q_UINT32 clientID = client->id(); + TQ_UINT32 clientID = client->id(); //TQByteArray *ta=new TQByteArray; //ta->duplicate(msg); @@ -395,7 +395,7 @@ void KMessageServer::processOneMessage () MessageBuffer *msg_buf = d->mMessageQueue.head(); - Q_UINT32 clientID = msg_buf->id; + TQ_UINT32 clientID = msg_buf->id; TQBuffer in_buffer (msg_buf->data); in_buffer.open (IO_ReadOnly); TQDataStream in_stream (&in_buffer); @@ -408,56 +408,56 @@ void KMessageServer::processOneMessage () bool unknown = false; TQByteArray ttt=in_buffer.buffer(); - Q_UINT32 messageID; + TQ_UINT32 messageID; in_stream >> messageID; //kdDebug(11001) << k_funcinfo << ": got message with messageID=" << messageID << endl; switch (messageID) { - case REQ_BROADCAST: - out_stream << Q_UINT32 (MSG_BROADCAST) << clientID; + case RETQ_BROADCAST: + out_stream << TQ_UINT32 (MSG_BROADCAST) << clientID; // FIXME, compiler bug? - // this should be okay, since TQBuffer is subclass of QIODevice! : + // this should be okay, since TQBuffer is subclass of TQIODevice! : // out_buffer.writeBlock (in_buffer.readAll()); - out_buffer.TQIODevice::writeBlock (in_buffer.readAll()); + TQT_TQIODEVICE(&out_buffer)->writeBlock (in_buffer.readAll()); broadcastMessage (out_msg); break; - case REQ_FORWARD: + case RETQ_FORWARD: { - TQValueList clients; + TQValueList clients; in_stream >> clients; - out_stream << Q_UINT32 (MSG_FORWARD) << clientID << clients; + out_stream << TQ_UINT32 (MSG_FORWARD) << clientID << clients; // see above! - out_buffer.TQIODevice::writeBlock (in_buffer.readAll()); + TQT_TQIODEVICE(&out_buffer)->writeBlock (in_buffer.readAll()); sendMessage (clients, out_msg); } break; - case REQ_CLIENT_ID: - out_stream << Q_UINT32 (ANS_CLIENT_ID) << clientID; + case RETQ_CLIENT_ID: + out_stream << TQ_UINT32 (ANS_CLIENT_ID) << clientID; sendMessage (clientID, out_msg); break; - case REQ_ADMIN_ID: - out_stream << Q_UINT32 (ANS_ADMIN_ID) << d->mAdminID; + case RETQ_ADMIN_ID: + out_stream << TQ_UINT32 (ANS_ADMIN_ID) << d->mAdminID; sendMessage (clientID, out_msg); break; - case REQ_ADMIN_CHANGE: + case RETQ_ADMIN_CHANGE: if (clientID == d->mAdminID) { - Q_UINT32 newAdmin; + TQ_UINT32 newAdmin; in_stream >> newAdmin; setAdmin (newAdmin); } break; - case REQ_REMOVE_CLIENT: + case RETQ_REMOVE_CLIENT: if (clientID == d->mAdminID) { - TQValueList client_list; + TQValueList client_list; in_stream >> client_list; - for (TQValueListIterator iter = client_list.begin(); iter != client_list.end(); ++iter) + for (TQValueListIterator iter = client_list.begin(); iter != client_list.end(); ++iter) { KMessageIO *client = findClient (*iter); if (client) @@ -468,18 +468,18 @@ void KMessageServer::processOneMessage () } break; - case REQ_MAX_NUM_CLIENTS: + case RETQ_MAX_NUM_CLIENTS: if (clientID == d->mAdminID) { - Q_INT32 maximum_clients; + TQ_INT32 maximum_clients; in_stream >> maximum_clients; setMaxClients (maximum_clients); } break; - case REQ_CLIENT_LIST: + case RETQ_CLIENT_LIST: { - out_stream << Q_UINT32 (ANS_CLIENT_LIST) << clientIDs(); + out_stream << TQ_UINT32 (ANS_CLIENT_LIST) << clientIDs(); sendMessage (clientID, out_msg); } break; diff --git a/libkdegames/kgame/kmessageserver.h b/libkdegames/kgame/kmessageserver.h index 3d0b1055..3a416a6b 100644 --- a/libkdegames/kgame/kmessageserver.h +++ b/libkdegames/kgame/kmessageserver.h @@ -73,53 +73,53 @@ class KMessageServerPrivate; Here is a list of the messages the KMessageServer understands: << means, the value is inserted into the TQByteArray using TQDataStream. The - messageIDs (REQ_BROADCAST, ...) are of type Q_UINT32. + messageIDs (RETQ_BROADCAST, ...) are of type TQ_UINT32. - - TQByteArray << static_cast<Q_UINT32>( REQ_BROADCAST ) << raw_data + - TQByteArray << static_cast<TQ_UINT32>( RETQ_BROADCAST ) << raw_data When the server receives this message, it sends the following message to ALL connected clients (a broadcast), where the raw_data is left unchanged: - TQByteArray << static_cast <Q_UINT32>( MSG_BROADCAST ) << clientID << raw_data - Q_UINT32 clientID; // the ID of the client that sent the broadcast request + TQByteArray << static_cast <TQ_UINT32>( MSG_BROADCAST ) << clientID << raw_data + TQ_UINT32 clientID; // the ID of the client that sent the broadcast request - - TQByteArray << static_cast<Q_UINT32>( REQ_FORWARD ) << client_list << raw_data - TQValueList <Q_UINT32> client_list; // list of receivers + - TQByteArray << static_cast<TQ_UINT32>( RETQ_FORWARD ) << client_list << raw_data + TQValueList <TQ_UINT32> client_list; // list of tqreceivers When the server receives this message, it sends the following message to the clients in client_list: - TQByteArray << static_cast<Q_UINT32>( MSG_FORWARD ) << senderID << client_list << raw_data - Q_UINT32 senderID; // the sender of the forward request - TQValueList <Q_UINT32> client_list; // a copy of the receiver list + TQByteArray << static_cast<TQ_UINT32>( MSG_FORWARD ) << senderID << client_list << raw_data + TQ_UINT32 senderID; // the sender of the forward request + TQValueList <TQ_UINT32> client_list; // a copy of the receiver list Note: Every client receives the message as many times as he is in the client_list. Note: Since the client_list is sent to all the clients, every client can see who else - got the message. If you want to prevent this, send a single REQ_FORWARD + got the message. If you want to prevent this, send a single RETQ_FORWARD message for every receiver. - - TQByteArray << static_cast<Q_UINT32>( REQ_CLIENT_ID ) + - TQByteArray << static_cast<TQ_UINT32>( RETQ_CLIENT_ID ) When the server receives this message, it sends the following message to the asking client: - TQByteArray << static_cast<Q_UINT32>( ANS_CLIENT_ID ) << clientID - Q_UINT32 clientID; // The ID of the client who asked for it + TQByteArray << static_cast<TQ_UINT32>( ANS_CLIENT_ID ) << clientID + TQ_UINT32 clientID; // The ID of the client who asked for it Note: This answer is also automatically sent to a new connected client, so that he can store his ID. The ID of a client doesn't change during his lifetime, and is unique for this KMessageServer. - - TQByteArray << static_cast<Q_UINT32>( REQ_ADMIN_ID ) + - TQByteArray << static_cast<TQ_UINT32>( RETQ_ADMIN_ID ) When the server receives this message, it sends the following message to the asking client: TQByteArray << ANS_ADMIN_ID << adminID - Q_UINT32 adminID; // The ID of the admin + TQ_UINT32 adminID; // The ID of the admin Note: This answer is also automatically sent to a new connected client, so that he can see if he is the admin or not. It will also be sent to all connected clients - when a new admin is set (see REQ_ADMIN_CHANGE). + when a new admin is set (see RETQ_ADMIN_CHANGE). - - TQByteArray << static_cast<Q_UINT32>( REQ_ADMIN_CHANGE ) << new_admin - Q_UINT32 new_admin; // the ID of the new admin, or 0 for no admin + - TQByteArray << static_cast<TQ_UINT32>( RETQ_ADMIN_CHANGE ) << new_admin + TQ_UINT32 new_admin; // the ID of the new admin, or 0 for no admin When the server receives this message, it sets the admin to the new ID. If no client with that ID exists, nothing happens. With new_admin == 0 no client is a admin. @@ -127,8 +127,8 @@ class KMessageServerPrivate; Note: The server sends a ANS_ADMIN_ID message to every connected client. - - TQByteArray << static_cast<Q_UINT32>( REQ_REMOVE_CLIENT ) << client_list - TQValueList <Q_UINT32> client_list; // The list of clients to be removed + - TQByteArray << static_cast<TQ_UINT32>( RETQ_REMOVE_CLIENT ) << client_list + TQValueList <TQ_UINT32> client_list; // The list of clients to be removed When the server receives this message, it removes the clients with the ids stored in client_list, disconnecting the connection to them. @@ -137,22 +137,22 @@ class KMessageServerPrivate; Note: If one of the clients is the admin himself, he will also be deleted. Another client (if any left) will become the new admin. - - TQByteArray << static_cast<Q_UINT32>( REQ_MAX_NUM_CLIENTS ) << maximum_clients - Q_INT32 maximum_clients; // The maximum of clients connected, or infinite if -1 + - TQByteArray << static_cast<TQ_UINT32>( RETQ_MAX_NUM_CLIENTS ) << maximum_clients + TQ_INT32 maximum_clients; // The maximum of clients connected, or infinite if -1 When the server receives this message, it limits the number of clients to the number given, or sets it unlimited for maximum_clients == -1. ONLY THE ADMIN CAN USE THIS MESSAGE! Note: If there are already more clients, they are not affected. It only prevents new Clients - to be added. To assure this limit, remove clients afterwards (REQ_REMOVE_CLIENT) + to be added. To assure this limit, remove clients afterwards (RETQ_REMOVE_CLIENT) - - TQByteArray << static_cast<Q_UINT32>( REQ_CLIENT_LIST ) + - TQByteArray << static_cast<TQ_UINT32>( RETQ_CLIENT_LIST ) When the server receives this message, it answers by sending a list of IDs of all the clients that are connected at the moment. So it sends the following message to the asking client: - TQByteArray << static_cast<Q_UINT32>( ANS_CLIENT_LIST ) << clientList - TQValueList <Q_UINT32> clientList; // The IDs of the connected clients + TQByteArray << static_cast<TQ_UINT32>( ANS_CLIENT_LIST ) << clientList + TQValueList <TQ_UINT32> clientList; // The IDs of the connected clients Note: This message is also sent to every new connected client, so that he knows the other clients. @@ -160,36 +160,37 @@ class KMessageServerPrivate; There are two more messages that are sent from the server to the every client automatically when a new client connects or a connection to a client is lost: - TQByteArray << static_cast<Q_UINT32>( EVNT_CLIENT_CONNECTED ) << clientID; - Q_UINT32 clientID; // the ID of the new connected client + TQByteArray << static_cast<TQ_UINT32>( EVNT_CLIENT_CONNECTED ) << clientID; + TQ_UINT32 clientID; // the ID of the new connected client - TQByteArray << static_cast<Q_UINT32>( EVNT_CLIENT_DISCONNECTED ) << clientID; - Q_UINT32 clientID; // the ID of the client that lost the connection - Q_UINT8 broken; // 1 if the network connection was closed, 0 if it was disconnected + TQByteArray << static_cast<TQ_UINT32>( EVNT_CLIENT_DISCONNECTED ) << clientID; + TQ_UINT32 clientID; // the ID of the client that lost the connection + TQ_UINT8 broken; // 1 if the network connection was closed, 0 if it was disconnected // on purpose @author Andreas Beckermann , Burkhard Lehner @version $Id$ */ -class KMessageServer : public QObject +class KMessageServer : public TQObject { Q_OBJECT + TQ_OBJECT public: /** MessageIDs for messages from a client to the message server. */ enum { - REQ_BROADCAST = 1, - REQ_FORWARD, - REQ_CLIENT_ID, - REQ_ADMIN_ID, - REQ_ADMIN_CHANGE, - REQ_REMOVE_CLIENT, - REQ_MAX_NUM_CLIENTS, - REQ_CLIENT_LIST, - REQ_MAX_REQ = 0xffff }; + RETQ_BROADCAST = 1, + RETQ_FORWARD, + RETQ_CLIENT_ID, + RETQ_ADMIN_ID, + RETQ_ADMIN_CHANGE, + RETQ_REMOVE_CLIENT, + RETQ_MAX_NUM_CLIENTS, + RETQ_CLIENT_LIST, + RETQ_MAX_REQ = 0xffff }; /** * MessageIDs for messages from the message server to a client. @@ -208,7 +209,7 @@ public: /** * Create a KGameNetwork object **/ - KMessageServer(Q_UINT16 cookie = 42, TQObject* parent = 0); + KMessageServer(TQ_UINT16 cookie = 42, TQObject* tqparent = 0); ~KMessageServer(); @@ -226,7 +227,7 @@ public: * system pick a free port * @return true if it worked */ - bool initNetwork (Q_UINT16 port = 0); + bool initNetwork (TQ_UINT16 port = 0); /** * Returns the TCP/IP port number we are listening to for incoming connections. @@ -234,7 +235,7 @@ public: * especially necessary if you used 0 as port number in initNetwork(). * @return the port number **/ - Q_UINT16 serverPort () const; + TQ_UINT16 serverPort () const; /** * Stops listening for connections. The already running connections are @@ -325,14 +326,14 @@ public: /** * returns a list of the unique IDs of all clients. **/ - TQValueList clientIDs() const; + TQValueList clientIDs() const; /** * Find the @ref KMessageIO object to the given client number. * @param no the client number to look for, or 0 to look for the admin * @return address of the client, or 0 if no client with that number exists **/ - KMessageIO *findClient (Q_UINT32 no) const; + KMessageIO *findClient (TQ_UINT32 no) const; /** * Returns the clientID of the admin, if there is a admin, 0 otherwise. @@ -340,14 +341,14 @@ public: * NOTE: Most often you don't need to know that id, since you can * use clientID 0 to specify the admin. **/ - Q_UINT32 adminID() const; + TQ_UINT32 adminID() const; /** * Sets the admin to a new client with the given ID. * The old admin (if existed) and the new admin will get the ANS_ADMIN message. * If you use 0 as new adminID, no client will be admin. **/ - void setAdmin (Q_UINT32 adminID); + void setAdmin (TQ_UINT32 adminID); //------------------------------ ID stuff @@ -385,7 +386,7 @@ public: * @ref findClient (id)->send(msg) manually, but this method checks for * errors. **/ - virtual void sendMessage (Q_UINT32 id, const TQByteArray &msg); + virtual void sendMessage (TQ_UINT32 id, const TQByteArray &msg); /** * Sends a message to a list of clients. Their ID is given in ids. If @@ -394,7 +395,7 @@ public: * This is just a convenience method. You could also iterate over the * list of IDs. **/ - virtual void sendMessage (const TQValueList &ids, const TQByteArray &msg); + virtual void sendMessage (const TQValueList &ids, const TQByteArray &msg); protected slots: /** @@ -448,7 +449,7 @@ signals: * @param clientID the ID of the KMessageIO object that received the message * @param unknown true, if the message type is not known by the KMessageServer **/ - void messageReceived (const TQByteArray &data, Q_UINT32 clientID, bool &unknown); + void messageReceived (const TQByteArray &data, TQ_UINT32 clientID, bool &unknown); protected: /** @@ -456,7 +457,7 @@ protected: * incremented after every call so if you need the id twice you have to save * it anywhere. It's currently used to initialize newly connected clints only. **/ - Q_UINT32 uniqueClientNumber() const; + TQ_UINT32 uniqueClientNumber() const; private: KMessageServerPrivate* d; @@ -468,17 +469,18 @@ private: connections. NOTE: This has to be here in the header file, because it is a subclass from - TQObject and has to go through the moc. + TQObject and has to go through the tqmoc. @short An internal class for KServerSocket @author Burkhard Lehner */ -class KMessageServerSocket : public QServerSocket +class KMessageServerSocket : public TQServerSocket { Q_OBJECT + TQ_OBJECT public: - KMessageServerSocket (Q_UINT16 port, TQObject *parent = 0); + KMessageServerSocket (TQ_UINT16 port, TQObject *tqparent = 0); ~KMessageServerSocket (); void newConnection (int socket); diff --git a/libkdegames/kgame/kplayer.cpp b/libkdegames/kgame/kplayer.cpp index fdde20d9..adc893ff 100644 --- a/libkdegames/kgame/kplayer.cpp +++ b/libkdegames/kgame/kplayer.cpp @@ -46,7 +46,7 @@ public: mNetworkPlayer = 0; } - Q_UINT32 mId; + TQ_UINT32 mId; bool mVirtual; // virtual player int mPriority; // tag for replacement @@ -55,8 +55,8 @@ public: KGamePropertyHandler mProperties; // Playerdata - KGamePropertyQString mName; - KGamePropertyQString mGroup; + KGamePropertyTQString mName; + KGamePropertyTQString mGroup; }; KPlayer::KPlayer() : TQObject(0,0) @@ -125,7 +125,7 @@ KPlayer::~KPlayer() // kdDebug(11001) << k_funcinfo << " done" << endl; } -bool KPlayer::forwardMessage(TQDataStream &msg,int msgid,Q_UINT32 receiver,Q_UINT32 sender) +bool KPlayer::forwardMessage(TQDataStream &msg,int msgid,TQ_UINT32 receiver,TQ_UINT32 sender) { if (!isActive()) { @@ -139,7 +139,7 @@ bool KPlayer::forwardMessage(TQDataStream &msg,int msgid,Q_UINT32 receiver,Q_UIN return game()->sendSystemMessage(msg,msgid,receiver,sender); } -bool KPlayer::forwardInput(TQDataStream &msg,bool transmit,Q_UINT32 sender) +bool KPlayer::forwardInput(TQDataStream &msg,bool transmit,TQ_UINT32 sender) { if (!isActive()) { @@ -173,7 +173,7 @@ bool KPlayer::forwardInput(TQDataStream &msg,bool transmit,Q_UINT32 sender) } } -void KPlayer::setId(Q_UINT32 newid) +void KPlayer::setId(TQ_UINT32 newid) { // Needs to be after the sendProcess d->mId=newid; @@ -192,7 +192,7 @@ void KPlayer::setName(const TQString& name) const TQString& KPlayer::name() const { return d->mName.value(); } -Q_UINT32 KPlayer::id() const +TQ_UINT32 KPlayer::id() const { return d->mId; } KGamePropertyHandler * KPlayer::dataHandler() @@ -313,7 +313,7 @@ bool KPlayer::setTurn(bool b, bool exclusive) bool KPlayer::load(TQDataStream &stream) { - Q_INT32 id,priority; + TQ_INT32 id,priority; stream >> id >> priority; setId(id); setNetworkPriority(priority); @@ -322,7 +322,7 @@ bool KPlayer::load(TQDataStream &stream) //FIXME: maybe set all properties setEmitSignal(false) before? d->mProperties.load(stream); - Q_INT16 cookie; + TQ_INT16 cookie; stream >> cookie; if (cookie==KPLAYER_LOAD_COOKIE) { @@ -339,18 +339,18 @@ bool KPlayer::load(TQDataStream &stream) bool KPlayer::save(TQDataStream &stream) { - stream << (Q_INT32)id() << (Q_INT32)networkPriority(); + stream << (TQ_INT32)id() << (TQ_INT32)networkPriority(); d->mProperties.save(stream); - stream << (Q_INT16)KPLAYER_LOAD_COOKIE; + stream << (TQ_INT16)KPLAYER_LOAD_COOKIE; //emit signalSave(stream); return true; } -void KPlayer::networkTransmission(TQDataStream &stream,int msgid,Q_UINT32 sender) +void KPlayer::networkTransmission(TQDataStream &stream,int msgid,TQ_UINT32 sender) { //kdDebug(11001) << k_funcinfo ": msgid=" << msgid << " sender=" << sender << " we are=" << id() << endl; // PlayerProperties processed @@ -388,7 +388,7 @@ void KPlayer::networkTransmission(TQDataStream &stream,int msgid,Q_UINT32 sender KGamePropertyBase* KPlayer::findProperty(int id) const { - return d->mProperties.find(id); + return d->mProperties.tqfind(id); } bool KPlayer::addProperty(KGamePropertyBase* data) diff --git a/libkdegames/kgame/kplayer.h b/libkdegames/kgame/kplayer.h index a2d78929..7ad23abc 100644 --- a/libkdegames/kgame/kplayer.h +++ b/libkdegames/kgame/kplayer.h @@ -58,7 +58,7 @@ class KPlayerPrivate; * you gain a *very* big advantage: you can exchange a KGameIO whenever you * want! You can e.g. remove the KGameIO of a local (human) player and just * replace it by a computerIO on the fly! So from that point on all playerInputs - * are done by the computerIO instead of the human player. You also can replace + * are done by the computerIO instead of the human player. You also can tqreplace * all network players by computer players when the network connection is broken * or a player wants to quit. * So remember: use KGameIO whenever possible! A KPlayer should just @@ -66,9 +66,10 @@ class KPlayerPrivate; * functions which are shared by all of your KGameIOs. * */ -class KDE_EXPORT KPlayer : public QObject +class KDE_EXPORT KPlayer : public TQObject { Q_OBJECT + TQ_OBJECT public: typedef TQPtrList KGameIOList; @@ -184,14 +185,14 @@ public: * * @return the player id */ - Q_UINT32 id() const; + TQ_UINT32 id() const; /* Set the players id. This is done automatically by * the game object when adding a new player! * * @param i the player id */ - void setId(Q_UINT32 i); + void setId(TQ_UINT32 i); /** * Returns the user defined id of the player @@ -333,12 +334,12 @@ public: * KGame::playerInput() (if player=false, ie the message *was* sent through * KGame::sendPlayerInput). */ - virtual bool forwardInput(TQDataStream &msg,bool transmit=true, Q_UINT32 sender=0); + virtual bool forwardInput(TQDataStream &msg,bool transmit=true, TQ_UINT32 sender=0); /** * Forwards Message to the game object..internal use only */ - virtual bool forwardMessage(TQDataStream &msg,int msgid,Q_UINT32 receiver=0,Q_UINT32 sender=0); + virtual bool forwardMessage(TQDataStream &msg,int msgid,TQ_UINT32 receiver=0,TQ_UINT32 sender=0); // Game logic /** @@ -390,7 +391,7 @@ public: * @param stream The message itself * @param sender **/ - void networkTransmission(TQDataStream &stream,int msgid,Q_UINT32 sender); + void networkTransmission(TQDataStream &stream,int msgid,TQ_UINT32 sender); /** * Searches for a property of the player given its id. @@ -430,7 +431,7 @@ signals: * means probably a user message. Connecting to this signal * allowed to process it. */ - void signalNetworkData(int msgid, const TQByteArray& buffer, Q_UINT32 sender, KPlayer *me); + void signalNetworkData(int msgid, const TQByteArray& buffer, TQ_UINT32 sender, KPlayer *me); /** * This signal is emmited if a player property changes its value and diff --git a/libkdegames/kgame/messages.txt b/libkdegames/kgame/messages.txt index 151196d5..a2b58880 100644 --- a/libkdegames/kgame/messages.txt +++ b/libkdegames/kgame/messages.txt @@ -82,7 +82,7 @@ IdRemovePlayer Q_INT16 playerid IdError Q_INT32 errorcode QString errortext -IdGameStatus Q_INT32 status +IdGametqStatus Q_INT32 status IdPlayerProperty Q_INT16 propertyId user defined -> the property diff --git a/libkdegames/kgamelcd.cpp b/libkdegames/kgamelcd.cpp index c87930b5..cc6aa5a8 100644 --- a/libkdegames/kgamelcd.cpp +++ b/libkdegames/kgamelcd.cpp @@ -28,8 +28,8 @@ //----------------------------------------------------------------------------- -KGameLCD::KGameLCD(uint nbDigits, TQWidget *parent, const char *name) - : TQLCDNumber(nbDigits, parent, name), _htime(800) +KGameLCD::KGameLCD(uint nbDigits, TQWidget *tqparent, const char *name) + : TQLCDNumber(nbDigits, tqparent, name), _htime(800) { const TQPalette &p = palette(); _fgColor = p.color(TQPalette::Active, TQColorGroup::Foreground); @@ -110,8 +110,8 @@ void KGameLCD::highlight(bool light) } //----------------------------------------------------------------------------- -KGameLCDClock::KGameLCDClock(TQWidget *parent, const char *name) -: KGameLCD(5, parent, name) +KGameLCDClock::KGameLCDClock(TQWidget *tqparent, const char *name) +: KGameLCD(5, tqparent, name) { _timerClock = new TQTimer(this); connect(_timerClock, TQT_SIGNAL(timeout()), TQT_SLOT(timeoutClock())); @@ -191,17 +191,17 @@ public: TQValueVector _leadings; }; -KGameLCDList::KGameLCDList(const TQString &title, TQWidget *parent, +KGameLCDList::KGameLCDList(const TQString &title, TQWidget *tqparent, const char *name) - : TQWidget(parent, name) + : TQWidget(tqparent, name) { init(title); } -KGameLCDList::KGameLCDList(TQWidget *parent, const char *name) - : TQWidget(parent, name) +KGameLCDList::KGameLCDList(TQWidget *tqparent, const char *name) + : TQWidget(tqparent, name) { - init(TQString::null); + init(TQString()); } KGameLCDList::~KGameLCDList() @@ -217,13 +217,13 @@ void KGameLCDList::init(const TQString &title) top->setColStretch(1, 1); _title = new TQLabel(title, this); - _title->setAlignment(AlignCenter); + _title->tqsetAlignment(AlignCenter); top->addMultiCellWidget(_title, 0, 0, 0, 1, AlignCenter); } void KGameLCDList::append(TQLCDNumber *lcd) { - append(TQString::null, lcd); + append(TQString(), lcd); } void KGameLCDList::append(const TQString &leading, TQLCDNumber *lcd) @@ -232,11 +232,11 @@ void KGameLCDList::append(const TQString &leading, TQLCDNumber *lcd) TQLabel *label = 0; if ( !leading.isEmpty() ) { label = new TQLabel(leading, this); - static_cast(layout())->addWidget(label, i+1, 0); + static_cast(tqlayout())->addWidget(label, i+1, 0); } d->_leadings.push_back(label); _lcds.push_back(lcd); - static_cast(layout())->addWidget(lcd, i+1, 1); + static_cast(tqlayout())->addWidget(lcd, i+1, 1); } void KGameLCDList::clear() diff --git a/libkdegames/kgamelcd.h b/libkdegames/kgamelcd.h index 214af1f5..543cfef5 100644 --- a/libkdegames/kgamelcd.h +++ b/libkdegames/kgamelcd.h @@ -39,11 +39,12 @@ class TQTimer; * * @since 3.2 */ -class KDE_EXPORT KGameLCD : public QLCDNumber +class KDE_EXPORT KGameLCD : public TQLCDNumber { Q_OBJECT + TQ_OBJECT public: - KGameLCD(uint nbDigits, TQWidget *parent = 0, const char *name = 0); + KGameLCD(uint nbDigits, TQWidget *tqparent = 0, const char *name = 0); ~KGameLCD(); @@ -86,7 +87,7 @@ public: public slots: /** - * Highlight the LCD with the QColorGourp::HighlightedText color + * Highlight the LCD with the TQColorGourp::HighlightedText color * for a small time (setHighlightTime). */ void highlight(); @@ -126,8 +127,9 @@ private: class KDE_EXPORT KGameLCDClock : public KGameLCD { Q_OBJECT + TQ_OBJECT public: - KGameLCDClock(TQWidget *parent = 0, const char *name = 0); + KGameLCDClock(TQWidget *tqparent = 0, const char *name = 0); ~KGameLCDClock(); @@ -182,37 +184,38 @@ private: //----------------------------------------------------------------------------- /** - * This widget holds a list of @ref TQLCDNumber arranged in a vertical layout. + * This widget holds a list of @ref TQLCDNumber arranged in a vertical tqlayout. * It also shows a label at the top of the list. * * @since 3.2 */ -class KDE_EXPORT KGameLCDList : public QWidget +class KDE_EXPORT KGameLCDList : public TQWidget { Q_OBJECT + TQ_OBJECT public: /** * Constructor. * * @param title is the content of the top label. - * @param parent passed to the TQWidget constructor + * @param tqparent passed to the TQWidget constructor * @param name passed to the TQWidget constructor */ KGameLCDList(const TQString &title, - TQWidget *parent = 0, const char *name = 0); - KGameLCDList(TQWidget *parent = 0, const char *name = 0); + TQWidget *tqparent = 0, const char *name = 0); + KGameLCDList(TQWidget *tqparent = 0, const char *name = 0); ~KGameLCDList(); /** * Append a TQLCDNumber at the bottom of the list. - * The TQLCDNumber should have the KGameLCDList as parent. + * The TQLCDNumber should have the KGameLCDList as tqparent. */ void append(TQLCDNumber *lcd); /** * Append a TQLCDNumber at the bottom of the list. - * The TQLCDNumber should have the KGameLCDList as parent. + * The TQLCDNumber should have the KGameLCDList as tqparent. */ void append(const TQString &leading, TQLCDNumber *lcd); diff --git a/libkdegames/kgameprogress.cpp b/libkdegames/kgameprogress.cpp index c9f122fb..7ed1728f 100644 --- a/libkdegames/kgameprogress.cpp +++ b/libkdegames/kgameprogress.cpp @@ -29,16 +29,16 @@ #include -KGameProgress::KGameProgress(TQWidget *parent, const char *name) - : TQFrame(parent, name), +KGameProgress::KGameProgress(TQWidget *tqparent, const char *name) + : TQFrame(tqparent, name), TQRangeControl(0, 100, 1, 10, 0), - orient(Horizontal) + orient(Qt::Horizontal) { initialize(); } -KGameProgress::KGameProgress(Orientation orientation, TQWidget *parent, const char *name) - : TQFrame(parent, name), +KGameProgress::KGameProgress(Qt::Orientation orientation, TQWidget *tqparent, const char *name) + : TQFrame(tqparent, name), TQRangeControl(0, 100, 1, 10, 0), orient(orientation) { @@ -46,8 +46,8 @@ KGameProgress::KGameProgress(Orientation orientation, TQWidget *parent, const ch } KGameProgress::KGameProgress(int minValue, int maxValue, int value, - Orientation orientation, TQWidget *parent, const char *name) - : TQFrame(parent, name), + Qt::Orientation orientation, TQWidget *tqparent, const char *name) + : TQFrame(tqparent, name), TQRangeControl(minValue, maxValue, 1, 10, value), orient(orientation) { @@ -79,11 +79,11 @@ void KGameProgress::initialize() void KGameProgress::paletteChange() { TQPalette p = kapp->palette(); - const TQColorGroup &colorGroup = p.active(); + const TQColorGroup &tqcolorGroup = p.active(); if (!use_supplied_bar_color) - bar_color = colorGroup.highlight(); - bar_text_color = colorGroup.highlightedText(); - text_color = colorGroup.text(); + bar_color = tqcolorGroup.highlight(); + bar_text_color = tqcolorGroup.highlightedText(); + text_color = tqcolorGroup.text(); setPalette(p); adjustStyle(); @@ -118,7 +118,7 @@ void KGameProgress::setBarStyle(BarStyle style) } } -void KGameProgress::setOrientation(Orientation orientation) +void KGameProgress::setOrientation(Qt::Orientation orientation) { if (orient != orientation) { orient = orientation; @@ -151,11 +151,11 @@ bool KGameProgress::textEnabled() const return text_enabled; } -TQSize KGameProgress::sizeHint() const +TQSize KGameProgress::tqsizeHint() const { TQSize s( size() ); - if(orientation() == KGameProgress::Vertical) { + if(orientation() == Qt::Vertical) { s.setWidth(24); } else { s.setHeight(24); @@ -164,14 +164,14 @@ TQSize KGameProgress::sizeHint() const return s; } -TQSize KGameProgress::minimumSizeHint() const +TQSize KGameProgress::tqminimumSizeHint() const { - return sizeHint(); + return tqsizeHint(); } TQSizePolicy KGameProgress::sizePolicy() const { - if ( orientation()==KGameProgress::Vertical ) + if ( orientation()==Qt::Vertical ) return TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Expanding ); else return TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed ); @@ -196,13 +196,13 @@ int KGameProgress::recalcValue(int range) void KGameProgress::valueChange() { - repaint(contentsRect(), FALSE); + tqrepaint(contentsRect(), FALSE); emit percentageChanged(recalcValue(100)); } void KGameProgress::rangeChange() { - repaint(contentsRect(), FALSE); + tqrepaint(contentsRect(), FALSE); emit percentageChanged(recalcValue(100)); } @@ -213,7 +213,7 @@ void KGameProgress::styleChange(TQStyle&) void KGameProgress::adjustStyle() { - switch (style().styleHint(TQStyle::SH_GUIStyle)) { + switch (tqstyle().tqstyleHint(TQStyle::SH_GUIStyle)) { case WindowsStyle: setFrameStyle(TQFrame::WinPanel | TQFrame::Sunken); break; @@ -242,9 +242,9 @@ void KGameProgress::drawText(TQPainter *p) // the current value and the maximum value respectively. TQString s(format_); - s.replace(TQRegExp(TQString::fromLatin1("%p")), TQString::number(recalcValue(100))); - s.replace(TQRegExp(TQString::fromLatin1("%v")), TQString::number(value())); - s.replace(TQRegExp(TQString::fromLatin1("%m")), TQString::number(maxValue())); + s.tqreplace(TQRegExp(TQString::tqfromLatin1("%p")), TQString::number(recalcValue(100))); + s.tqreplace(TQRegExp(TQString::tqfromLatin1("%v")), TQString::number(value())); + s.tqreplace(TQRegExp(TQString::tqfromLatin1("%m")), TQString::number(maxValue())); p->setPen(text_color); TQFont font = p->font(); @@ -271,7 +271,7 @@ void KGameProgress::drawContents(TQPainter *p) switch (bar_style) { case Solid: - if (orient == Horizontal) { + if (orient ==Qt::Horizontal) { fr.setWidth(recalcValue(cr.width())); er.setLeft(fr.right() + 1); } else { @@ -289,7 +289,7 @@ void KGameProgress::drawContents(TQPainter *p) case Blocked: const int margin = 2; int max, num, dx, dy; - if (orient == Horizontal) { + if (orient ==Qt::Horizontal) { fr.setHeight(cr.height() - 2 * margin); fr.setWidth((int)(0.67 * fr.height())); fr.moveTopLeft(TQPoint(cr.left() + margin, cr.top() + margin)); @@ -315,7 +315,7 @@ void KGameProgress::drawContents(TQPainter *p) } if (num != max) { - if (orient == Horizontal) + if (orient ==Qt::Horizontal) er.setLeft(fr.right() + 1); else er.setBottom(fr.bottom() + 1); diff --git a/libkdegames/kgameprogress.h b/libkdegames/kgameprogress.h index d4cebe7b..087fc27b 100644 --- a/libkdegames/kgameprogress.h +++ b/libkdegames/kgameprogress.h @@ -47,16 +47,17 @@ * @author Martynas Kunigelis * @version $Id$ */ -class KDE_EXPORT KGameProgress : public TQFrame, public QRangeControl +class KDE_EXPORT KGameProgress : public TQFrame, public TQRangeControl { Q_OBJECT + TQ_OBJECT Q_ENUMS( BarStyle ) - Q_PROPERTY( int value READ value WRITE setValue) - Q_PROPERTY( BarStyle barStyle READ barStyle WRITE setBarStyle ) - Q_PROPERTY( TQColor barColor READ barColor WRITE setBarColor ) - Q_PROPERTY( TQPixmap barPixmap READ barPixmap WRITE setBarPixmap ) - Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation ) - Q_PROPERTY( bool textEnabled READ textEnabled WRITE setTextEnabled ) + TQ_PROPERTY( int value READ value WRITE setValue) + TQ_PROPERTY( BarStyle barStyle READ barStyle WRITE setBarStyle ) + TQ_PROPERTY( TQColor barColor READ barColor WRITE setBarColor ) + TQ_PROPERTY( TQPixmap barPixmap READ barPixmap WRITE setBarPixmap ) + TQ_PROPERTY( Qt::Orientation orientation READ orientation WRITE setOrientation ) + TQ_PROPERTY( bool textEnabled READ textEnabled WRITE setTextEnabled ) public: /** @@ -70,18 +71,18 @@ public: /** * Construct a horizontal progress bar. */ - KGameProgress(TQWidget *parent=0, const char *name=0); + KGameProgress(TQWidget *tqparent=0, const char *name=0); /** * Construct a progress bar with orientation @p orient. */ - KGameProgress(Orientation orient, TQWidget *parent=0, const char *name=0); + KGameProgress(Qt::Orientation orient, TQWidget *tqparent=0, const char *name=0); /** * Construct a progress bar with minimum, maximum and initial values. */ - KGameProgress(int minValue, int maxValue, int value, Orientation, - TQWidget *parent=0, const char *name=0); + KGameProgress(int minValue, int maxValue, int value, Qt::Orientation, + TQWidget *tqparent=0, const char *name=0); /** * Destruct the progress bar. @@ -108,9 +109,9 @@ public: /** * Set the orientation of the progress bar. * - * Allowed values are @p Horizontal and @p Vertical. + * Allowed values are @pQt::Horizontal and @pQt::Vertical. */ - void setOrientation(Orientation); + void setOrientation(Qt::Orientation); /** * If this is set to @p true, the progress text will be displayed. @@ -149,7 +150,7 @@ public: * * @see setOrientation() */ - Orientation orientation() const; + Qt::Orientation orientation() const; /** * Returns @p true if progress text will be displayed, @@ -161,11 +162,11 @@ public: /** */ - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; /** */ - virtual TQSize minimumSizeHint() const; + virtual TQSize tqminimumSizeHint() const; /** */ @@ -239,7 +240,7 @@ private: TQColor text_color; TQRect fr; BarStyle bar_style; - Orientation orient; + Qt::Orientation orient; bool text_enabled; TQString format_; void initialize(); diff --git a/libkdegames/kgrid2d.h b/libkdegames/kgrid2d.h index 22a3c19d..833db8ec 100644 --- a/libkdegames/kgrid2d.h +++ b/libkdegames/kgrid2d.h @@ -36,7 +36,7 @@ namespace KGrid2D * This type represents coordinates on a bidimensionnal grid. * @since 3.2 */ - typedef QPair Coord; + typedef TQPair Coord; /** * This type represents a list of @ref Coord. @@ -206,14 +206,14 @@ class Generic template TQDataStream &operator <<(TQDataStream &s, const KGrid2D::Generic &m) { - s << (Q_UINT32)m.width() << (Q_UINT32)m.height(); + s << (TQ_UINT32)m.width() << (TQ_UINT32)m.height(); for (uint i=0; i TQDataStream &operator >>(TQDataStream &s, KGrid2D::Generic &m) { - Q_UINT32 w, h; + TQ_UINT32 w, h; s >> w >> h; m.resize(w, h); for (uint i=0; i> m[i]; @@ -498,9 +498,9 @@ class Hexagonal : public Generic, public HexagonalBase CoordList n = neighbours(*it, insideOnly); CoordList::const_iterator it2; for (it2=n.begin(); it2!=n.end(); ++it2) - if ( center.find(*it2)==center.end() - && ring.find(*it2)==ring.end() - && newRing.find(*it2)==newRing.end() ) + if ( center.tqfind(*it2)==center.end() + && ring.tqfind(*it2)==ring.end() + && newRing.tqfind(*it2)==newRing.end() ) newRing.append(*it2); center.append(*it); } diff --git a/libkdegames/kstdgameaction.cpp b/libkdegames/kstdgameaction.cpp index f37af6cb..4eb54bba 100644 --- a/libkdegames/kstdgameaction.cpp +++ b/libkdegames/kstdgameaction.cpp @@ -33,10 +33,10 @@ KStdGameAction::~KStdGameAction() {} KAction *KStdGameAction::action(StdGameAction act_enum, const TQObject *recvr, - const char *slot, KActionCollection *parent, + const char *slot, KActionCollection *tqparent, const char *name) { - return create( act_enum, name, recvr, slot, parent ); + return create( act_enum, name, recvr, slot, tqparent ); } const char* KStdGameAction::stdName(StdGameAction act_enum) @@ -64,18 +64,18 @@ const KStdGameActionInfo g_rgActionInfo[] = { { KStdGameAction::Save, KStdAccel::Save, 0, "game_save", I18N_NOOP("&Save"), 0, "filesave" }, { KStdGameAction::SaveAs, KStdAccel::AccelNone, 0, "game_save_as", I18N_NOOP("Save &As..."), 0, "filesaveas" }, { KStdGameAction::End, KStdAccel::End, 0, "game_end", I18N_NOOP("&End Game"), 0, "fileclose" }, - { KStdGameAction::Pause, KStdAccel::AccelNone, Qt::Key_P, "game_pause", I18N_NOOP("Pa&use"), 0, "player_pause" }, - { KStdGameAction::Highscores, KStdAccel::AccelNone, Qt::CTRL+Qt::Key_H, "game_highscores", I18N_NOOP("Show &Highscores"), 0, "highscore" }, + { KStdGameAction::Pause, KStdAccel::AccelNone, TQt::Key_P, "game_pause", I18N_NOOP("Pa&use"), 0, "player_pause" }, + { KStdGameAction::Highscores, KStdAccel::AccelNone, TQt::CTRL+TQt::Key_H, "game_highscores", I18N_NOOP("Show &Highscores"), 0, "highscore" }, { KStdGameAction::Print, KStdAccel::Print, 0, "game_print", I18N_NOOP("&Print..."), 0, "fileprint" }, { KStdGameAction::Quit, KStdAccel::Quit, 0, "game_quit", I18N_NOOP("&Quit"), 0, "exit" }, // "move" menu { KStdGameAction::Repeat, KStdAccel::AccelNone, 0, "move_repeat", I18N_NOOP("Repeat"), 0, 0 }, { KStdGameAction::Undo, KStdAccel::Undo, 0, "move_undo", I18N_NOOP("Und&o"), 0, "undo" }, { KStdGameAction::Redo, KStdAccel::Redo, 0, "move_redo", I18N_NOOP("Re&do"), 0, "redo" }, - { KStdGameAction::Roll, KStdAccel::AccelNone, Qt::CTRL+Qt::Key_R, "move_roll", I18N_NOOP("&Roll Dice"), 0, "roll" }, + { KStdGameAction::Roll, KStdAccel::AccelNone, TQt::CTRL+TQt::Key_R, "move_roll", I18N_NOOP("&Roll Dice"), 0, "roll" }, { KStdGameAction::EndTurn, KStdAccel::AccelNone, 0, "move_end_turn", I18N_NOOP("End Turn"), 0, "endturn" }, - { KStdGameAction::Hint, KStdAccel::AccelNone, Qt::Key_H, "move_hint", I18N_NOOP("&Hint"), 0, "idea" }, - { KStdGameAction::Demo, KStdAccel::AccelNone, Qt::Key_D, "move_demo", I18N_NOOP("&Demo"), 0, "1rightarrow" }, + { KStdGameAction::Hint, KStdAccel::AccelNone, TQt::Key_H, "move_hint", I18N_NOOP("&Hint"), 0, "idea" }, + { KStdGameAction::Demo, KStdAccel::AccelNone, TQt::Key_D, "move_demo", I18N_NOOP("&Demo"), 0, "1rightarrow" }, { KStdGameAction::Solve, KStdAccel::AccelNone, 0, "move_solve", I18N_NOOP("&Solve"), 0, "wizard" }, // "settings" menu { KStdGameAction::ChooseGameType, KStdAccel::AccelNone, 0, "options_choose_game_type", I18N_NOOP("Choose Game &Type"), 0, 0 }, @@ -97,11 +97,11 @@ static const KStdGameActionInfo* infoPtr( KStdGameAction::StdGameAction id ) KAction* KStdGameAction::create(StdGameAction id, const char *name, const TQObject *recvr, const char *slot, - KActionCollection* parent ) + KActionCollection* tqparent ) { KAction* pAction = 0; const KStdGameActionInfo* pInfo = infoPtr( id ); - kdDebug(125) << "KStdGameAction::create( " << id << "=" << (pInfo ? pInfo->psName : (const char*)0) << ", " << parent << ", " << name << " )" << endl; + kdDebug(125) << "KStdGameAction::create( " << id << "=" << (pInfo ? pInfo->psName : (const char*)0) << ", " << tqparent << ", " << name << " )" << endl; if( pInfo ) { TQString sLabel = i18n(pInfo->psLabel); KShortcut cut = (pInfo->globalAccel==KStdAccel::AccelNone @@ -111,20 +111,20 @@ KAction* KStdGameAction::create(StdGameAction id, const char *name, switch( id ) { case LoadRecent: pAction = - new KRecentFilesAction(sLabel, cut, recvr, slot, parent, n); + new KRecentFilesAction(sLabel, cut, recvr, slot, tqparent, n); break; case Pause: case Demo: pAction = new KToggleAction( sLabel, pInfo->psIconName, cut, - recvr, slot, parent, n); + recvr, slot, tqparent, n); break; case ChooseGameType: pAction = new KSelectAction( sLabel, pInfo->psIconName, cut, - recvr, slot, parent, n); + recvr, slot, tqparent, n); break; default: pAction = new KAction( sLabel, pInfo->psIconName, cut, - recvr, slot, parent, n); + recvr, slot, tqparent, n); break; } } @@ -138,72 +138,72 @@ const char* KStdGameAction::name( StdGameAction id ) } KAction *KStdGameAction::gameNew(const TQObject *recvr, const char *slot, - KActionCollection *parent, const char *name ) -{ return KStdGameAction::create(New, name, recvr, slot, parent); } + KActionCollection *tqparent, const char *name ) +{ return KStdGameAction::create(New, name, recvr, slot, tqparent); } KAction *KStdGameAction::load(const TQObject *recvr, const char *slot, - KActionCollection *parent, const char *name ) -{ return KStdGameAction::create(Load, name, recvr, slot, parent); } + KActionCollection *tqparent, const char *name ) +{ return KStdGameAction::create(Load, name, recvr, slot, tqparent); } KRecentFilesAction *KStdGameAction::loadRecent(const TQObject *recvr, const char *slot, - KActionCollection *parent, const char *name ) -{ return static_cast(KStdGameAction::create(LoadRecent, name, recvr, slot, parent)); } + KActionCollection *tqparent, const char *name ) +{ return static_cast(KStdGameAction::create(LoadRecent, name, recvr, slot, tqparent)); } KAction *KStdGameAction::save(const TQObject *recvr, const char *slot, - KActionCollection *parent, const char *name ) -{ return KStdGameAction::create(Save, name, recvr, slot, parent); } + KActionCollection *tqparent, const char *name ) +{ return KStdGameAction::create(Save, name, recvr, slot, tqparent); } KAction *KStdGameAction::saveAs(const TQObject *recvr, const char *slot, - KActionCollection *parent, const char *name ) -{ return KStdGameAction::create(SaveAs, name, recvr, slot, parent); } + KActionCollection *tqparent, const char *name ) +{ return KStdGameAction::create(SaveAs, name, recvr, slot, tqparent); } KAction *KStdGameAction::end(const TQObject *recvr, const char *slot, - KActionCollection *parent, const char *name ) -{ return KStdGameAction::create(End, name, recvr, slot, parent); } + KActionCollection *tqparent, const char *name ) +{ return KStdGameAction::create(End, name, recvr, slot, tqparent); } KToggleAction *KStdGameAction::pause(const TQObject *recvr, const char *slot, - KActionCollection *parent, const char *name ) -{ return static_cast(KStdGameAction::create(Pause, name, recvr, slot, parent)); } + KActionCollection *tqparent, const char *name ) +{ return static_cast(KStdGameAction::create(Pause, name, recvr, slot, tqparent)); } KAction *KStdGameAction::highscores(const TQObject *recvr, const char *slot, - KActionCollection *parent, const char *name ) -{ return KStdGameAction::create(Highscores, name, recvr, slot, parent); } + KActionCollection *tqparent, const char *name ) +{ return KStdGameAction::create(Highscores, name, recvr, slot, tqparent); } KAction *KStdGameAction::print(const TQObject *recvr, const char *slot, - KActionCollection *parent, const char *name ) -{ return KStdGameAction::create(Print, name, recvr, slot, parent); } + KActionCollection *tqparent, const char *name ) +{ return KStdGameAction::create(Print, name, recvr, slot, tqparent); } KAction *KStdGameAction::quit(const TQObject *recvr, const char *slot, - KActionCollection *parent, const char *name ) -{ return KStdGameAction::create(Quit, name, recvr, slot, parent); } + KActionCollection *tqparent, const char *name ) +{ return KStdGameAction::create(Quit, name, recvr, slot, tqparent); } KAction *KStdGameAction::repeat(const TQObject *recvr, const char *slot, - KActionCollection *parent, const char *name ) -{ return KStdGameAction::create(Repeat, name, recvr, slot, parent); } + KActionCollection *tqparent, const char *name ) +{ return KStdGameAction::create(Repeat, name, recvr, slot, tqparent); } KAction *KStdGameAction::undo(const TQObject *recvr, const char *slot, - KActionCollection *parent, const char *name ) -{ return KStdGameAction::create(Undo, name, recvr, slot, parent); } + KActionCollection *tqparent, const char *name ) +{ return KStdGameAction::create(Undo, name, recvr, slot, tqparent); } KAction *KStdGameAction::redo(const TQObject *recvr, const char *slot, - KActionCollection *parent, const char *name ) -{ return KStdGameAction::create(Redo, name, recvr, slot, parent); } + KActionCollection *tqparent, const char *name ) +{ return KStdGameAction::create(Redo, name, recvr, slot, tqparent); } KAction *KStdGameAction::roll(const TQObject *recvr, const char *slot, - KActionCollection *parent, const char *name ) -{ return KStdGameAction::create(Roll, name, recvr, slot, parent); } + KActionCollection *tqparent, const char *name ) +{ return KStdGameAction::create(Roll, name, recvr, slot, tqparent); } KAction *KStdGameAction::endTurn(const TQObject *recvr, const char *slot, - KActionCollection *parent, const char *name ) -{ return KStdGameAction::create(EndTurn, name, recvr, slot, parent); } + KActionCollection *tqparent, const char *name ) +{ return KStdGameAction::create(EndTurn, name, recvr, slot, tqparent); } KAction *KStdGameAction::carddecks(const TQObject *recvr, const char *slot, - KActionCollection *parent, const char *name ) -{ return KStdGameAction::create(Carddecks, name, recvr, slot, parent); } + KActionCollection *tqparent, const char *name ) +{ return KStdGameAction::create(Carddecks, name, recvr, slot, tqparent); } KAction *KStdGameAction::configureHighscores(const TQObject*recvr, const char *slot, - KActionCollection *parent, const char *name) -{ return KStdGameAction::create(ConfigureHighscores, name, recvr, slot, parent); } + KActionCollection *tqparent, const char *name) +{ return KStdGameAction::create(ConfigureHighscores, name, recvr, slot, tqparent); } KAction *KStdGameAction::hint(const TQObject*recvr, const char *slot, - KActionCollection *parent, const char *name) -{ return KStdGameAction::create(Hint, name, recvr, slot, parent); } + KActionCollection *tqparent, const char *name) +{ return KStdGameAction::create(Hint, name, recvr, slot, tqparent); } KToggleAction *KStdGameAction::demo(const TQObject*recvr, const char *slot, - KActionCollection *parent, const char *name) -{ return static_cast(KStdGameAction::create(Demo, name, recvr, slot, parent)); } + KActionCollection *tqparent, const char *name) +{ return static_cast(KStdGameAction::create(Demo, name, recvr, slot, tqparent)); } KAction *KStdGameAction::solve(const TQObject*recvr, const char *slot, - KActionCollection *parent, const char *name) -{ return KStdGameAction::create(Solve, name, recvr, slot, parent); } + KActionCollection *tqparent, const char *name) +{ return KStdGameAction::create(Solve, name, recvr, slot, tqparent); } KSelectAction *KStdGameAction::chooseGameType(const TQObject*recvr, const char *slot, - KActionCollection *parent, const char *name) -{ return static_cast(KStdGameAction::create(ChooseGameType, name, recvr, slot, parent)); } + KActionCollection *tqparent, const char *name) +{ return static_cast(KStdGameAction::create(ChooseGameType, name, recvr, slot, tqparent)); } KAction *KStdGameAction::restart(const TQObject*recvr, const char *slot, - KActionCollection *parent, const char *name) -{ return KStdGameAction::create(Restart, name, recvr, slot, parent); } + KActionCollection *tqparent, const char *name) +{ return KStdGameAction::create(Restart, name, recvr, slot, tqparent); } diff --git a/libkdegames/kstdgameaction.h b/libkdegames/kstdgameaction.h index 3ef24dc2..cae5d81c 100644 --- a/libkdegames/kstdgameaction.h +++ b/libkdegames/kstdgameaction.h @@ -79,15 +79,15 @@ public: */ static KAction* create( StdGameAction id, const char *name, const TQObject *recvr, const char *slot, - KActionCollection* parent ); + KActionCollection* tqparent ); /** * @since 3.2 */ static KAction* create( StdGameAction id, const TQObject *recvr, const char *slot, - KActionCollection* parent ) - { return create( id, 0, recvr, slot, parent ); } + KActionCollection* tqparent ) + { return create( id, 0, recvr, slot, tqparent ); } /** @@ -96,7 +96,7 @@ public: * @deprecated */ static KAction *action(StdGameAction act_enum, const TQObject *recvr = 0, - const char *slot = 0, KActionCollection *parent = 0, + const char *slot = 0, KActionCollection *tqparent = 0, const char *name = 0L ); /** @@ -115,43 +115,43 @@ public: * Start a new game **/ static KAction *gameNew(const TQObject *recvr = 0, const char *slot = 0, - KActionCollection *parent = 0, const char *name = 0L ); + KActionCollection *tqparent = 0, const char *name = 0L ); /** * Load a previousely saved game */ static KAction *load(const TQObject *recvr = 0, const char *slot = 0, - KActionCollection *parent = 0, const char *name = 0L ); + KActionCollection *tqparent = 0, const char *name = 0L ); /** * Load a recently loaded game. */ static KRecentFilesAction *loadRecent(const TQObject *recvr = 0, const char *slot = 0, - KActionCollection *parent = 0, const char *name = 0L ); + KActionCollection *tqparent = 0, const char *name = 0L ); /** * Save the current game. */ static KAction *save(const TQObject *recvr = 0, const char *slot = 0, - KActionCollection *parent = 0, const char *name = 0L ); + KActionCollection *tqparent = 0, const char *name = 0L ); /** * Save the current game under a different filename. */ static KAction *saveAs(const TQObject *recvr = 0, const char *slot = 0, - KActionCollection *parent = 0, const char *name = 0L ); + KActionCollection *tqparent = 0, const char *name = 0L ); /** * Pause the game **/ static KToggleAction *pause(const TQObject *recvr = 0, const char *slot = 0, - KActionCollection *parent = 0, const char *name = 0L ); + KActionCollection *tqparent = 0, const char *name = 0L ); /** * Show the highscores. */ static KAction *highscores(const TQObject *recvr = 0, const char *slot = 0, - KActionCollection *parent = 0, const char *name = 0L ); + KActionCollection *tqparent = 0, const char *name = 0L ); /** @@ -159,20 +159,20 @@ public: * entry. */ static KAction *end(const TQObject *recvr = 0, const char *slot = 0, - KActionCollection *parent = 0, const char *name = 0L ); + KActionCollection *tqparent = 0, const char *name = 0L ); /** * Print the current screen? Game? Whatever - hardly used in games but there * is at least one example (ktuberling) */ static KAction *print(const TQObject *recvr = 0, const char *slot = 0, - KActionCollection *parent = 0, const char *name = 0L ); + KActionCollection *tqparent = 0, const char *name = 0L ); /** * Quit the game. */ static KAction *quit(const TQObject *recvr = 0, const char *slot = 0, - KActionCollection *parent = 0, const char *name = 0L ); + KActionCollection *tqparent = 0, const char *name = 0L ); @@ -180,81 +180,81 @@ public: * Repeat the last move. **/ static KAction *repeat(const TQObject *recvr = 0, const char *slot = 0, - KActionCollection *parent = 0, const char *name = 0L ); + KActionCollection *tqparent = 0, const char *name = 0L ); /** * Undo the last move **/ static KAction *undo(const TQObject *recvr = 0, const char *slot = 0, - KActionCollection *parent = 0, const char *name = 0L ); + KActionCollection *tqparent = 0, const char *name = 0L ); /** * Redo the last move (which has been undone) **/ static KAction *redo(const TQObject *recvr = 0, const char *slot = 0, - KActionCollection *parent = 0, const char *name = 0L ); + KActionCollection *tqparent = 0, const char *name = 0L ); /** * Roll die or dice **/ static KAction *roll(const TQObject *recvr = 0, const char *slot = 0, - KActionCollection *parent = 0, const char *name = 0L ); + KActionCollection *tqparent = 0, const char *name = 0L ); /** * End the current turn (not the game). Usually to let the next player * start **/ static KAction *endTurn(const TQObject *recvr = 0, const char *slot = 0, - KActionCollection *parent = 0, const char *name = 0L ); + KActionCollection *tqparent = 0, const char *name = 0L ); /** * Display configure carddecks dialog. */ static KAction *carddecks(const TQObject *recvr = 0, const char *slot = 0, - KActionCollection *parent = 0, const char *name = 0L ); + KActionCollection *tqparent = 0, const char *name = 0L ); /** * Display configure highscores dialog. * @since 3.2 */ static KAction *configureHighscores(const TQObject *recvr = 0, const char *slot = 0, - KActionCollection *parent = 0, const char *name = 0L ); + KActionCollection *tqparent = 0, const char *name = 0L ); /** * Give an advice/hint. * @since 3.2 */ static KAction *hint(const TQObject *recvr = 0, const char *slot = 0, - KActionCollection *parent = 0, const char *name = 0L ); + KActionCollection *tqparent = 0, const char *name = 0L ); /** * Show a demo. * @since 3.2 */ static KToggleAction *demo(const TQObject *recvr = 0, const char *slot = 0, - KActionCollection *parent = 0, const char *name = 0L ); + KActionCollection *tqparent = 0, const char *name = 0L ); /** * Solve the game. * @since 3.2 */ static KAction *solve(const TQObject *recvr = 0, const char *slot = 0, - KActionCollection *parent = 0, const char *name = 0L ); + KActionCollection *tqparent = 0, const char *name = 0L ); /** * Choose game type. * @since 3.2 */ static KSelectAction *chooseGameType(const TQObject *recvr = 0, const char *slot = 0, - KActionCollection *parent = 0, const char *name = 0L ); + KActionCollection *tqparent = 0, const char *name = 0L ); /** * Restart game. * @since 3.2 */ static KAction *restart(const TQObject *recvr = 0, const char *slot = 0, - KActionCollection *parent = 0, const char *name = 0L ); + KActionCollection *tqparent = 0, const char *name = 0L ); }; diff --git a/libksirtet/base/board.cpp b/libksirtet/base/board.cpp index 12193e31..0a6d37f1 100644 --- a/libksirtet/base/board.cpp +++ b/libksirtet/base/board.cpp @@ -12,11 +12,11 @@ using namespace KGrid2D; //----------------------------------------------------------------------------- -FixedCanvasView::FixedCanvasView(TQWidget *parent, const char *name) - : TQCanvasView(parent, name, WNoAutoErase) +FixedCanvasView::FixedCanvasView(TQWidget *tqparent, const char *name) + : TQCanvasView(tqparent, name, WNoAutoErase) {} -TQSize FixedCanvasView::sizeHint() const +TQSize FixedCanvasView::tqsizeHint() const { if ( canvas()==0 ) return TQSize(); return canvas()->size() + 2 * TQSize(frameWidth(), frameWidth()); @@ -24,7 +24,7 @@ TQSize FixedCanvasView::sizeHint() const void FixedCanvasView::adjustSize() { - setFixedSize(sizeHint()); + setFixedSize(tqsizeHint()); } //----------------------------------------------------------------------------- @@ -35,8 +35,8 @@ const BaseBoard::DirectionData BaseBoard::DIRECTION_DATA[Nb_Direction] = { { SquareBase::Up, Down } }; -BaseBoard::BaseBoard(bool graphic, TQWidget *parent) -: FixedCanvasView(parent, "board"), +BaseBoard::BaseBoard(bool graphic, TQWidget *tqparent) +: FixedCanvasView(tqparent, "board"), GenericTetris(bfactory->bbi.width, bfactory->bbi.height, bfactory->bbi.withPieces, graphic), state(GameOver), timer(this), sequences(0), main(0), _next(0), diff --git a/libksirtet/base/board.h b/libksirtet/base/board.h index 7be2a4ec..e65206f8 100644 --- a/libksirtet/base/board.h +++ b/libksirtet/base/board.h @@ -12,13 +12,14 @@ class SequenceArray; class BlockInfo; //----------------------------------------------------------------------------- -class KDE_EXPORT FixedCanvasView : public QCanvasView +class KDE_EXPORT FixedCanvasView : public TQCanvasView { Q_OBJECT + TQ_OBJECT public: - FixedCanvasView(TQWidget *parent = 0, const char *name = 0); + FixedCanvasView(TQWidget *tqparent = 0, const char *name = 0); - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; public slots: virtual void adjustSize(); @@ -28,6 +29,7 @@ public slots: class KDE_EXPORT BaseBoard : public FixedCanvasView, public GenericTetris { Q_OBJECT + TQ_OBJECT public: enum Direction { Left = 1, Right = 2, Up = 4, Down = 8, Nb_Direction = 4 }; private: @@ -38,7 +40,7 @@ class KDE_EXPORT BaseBoard : public FixedCanvasView, public GenericTetris static const DirectionData DIRECTION_DATA[Nb_Direction]; public: - BaseBoard(bool graphic, TQWidget *parent); + BaseBoard(bool graphic, TQWidget *tqparent); virtual ~BaseBoard(); void copy(const GenericTetris &); diff --git a/libksirtet/base/factory.h b/libksirtet/base/factory.h index b772adb7..7df5574d 100644 --- a/libksirtet/base/factory.h +++ b/libksirtet/base/factory.h @@ -43,8 +43,8 @@ class KDE_EXPORT BaseFactory const MainData &mainData; const BaseBoardInfo &bbi; - virtual BaseBoard *createBoard(bool graphic, TQWidget *parent) = 0; - virtual BaseInterface *createInterface(TQWidget *parent) = 0; + virtual BaseBoard *createBoard(bool graphic, TQWidget *tqparent) = 0; + virtual BaseInterface *createInterface(TQWidget *tqparent) = 0; virtual TQWidget *createAppearanceConfig(); virtual TQWidget *createColorConfig(); diff --git a/libksirtet/base/field.cpp b/libksirtet/base/field.cpp index fae20266..6e35faf5 100644 --- a/libksirtet/base/field.cpp +++ b/libksirtet/base/field.cpp @@ -41,9 +41,9 @@ void BaseField::init(bool AI, bool multiplayer, bool server, bool first, _flags.multiplayer = multiplayer; _flags.server = server; _flags.first = first; - TQString text = (AI ? i18n("%1\n(AI player)").arg(name) - : (multiplayer ? i18n("%1\n(Human player)").arg(name) - : TQString::null)); + TQString text = (AI ? i18n("%1\n(AI player)").tqarg(name) + : (multiplayer ? i18n("%1\n(Human player)").tqarg(name) + : TQString())); if ( first && !server ) text += i18n("\nWaiting for server"); setMessage(text, (first && server ? StartButton : NoButton)); showScore->resetColor(); @@ -79,11 +79,11 @@ void BaseField::setMessage(const TQString &label, ButtonType type) _boardLayout->addStretch(3); if ( !label.isEmpty() ) { TQString str = (isArcade() ? i18n("Arcade game") + '\n' - : TQString::null) + label; + : TQString()) + label; _label = new TQLabel(str, board); - _label->setAlignment(Qt::AlignCenter); + _label->tqsetAlignment(TQt::AlignCenter); _label->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); - _boardLayout->addWidget(_label, 0, Qt::AlignCenter); + _boardLayout->addWidget(_label, 0, TQt::AlignCenter); _label->show(); } _boardLayout->addStretch(1); @@ -93,8 +93,8 @@ void BaseField::setMessage(const TQString &label, ButtonType type) 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); + _widget->tqparent(), slot); + _boardLayout->addWidget(_button, 0, TQt::AlignCenter); _button->show(); } _boardLayout->addStretch(3); @@ -123,22 +123,22 @@ void BaseField::stop(bool gameover) { board->stop(); ButtonType button = StartButton; - TQString msg = (gameover ? i18n("Game over") : TQString::null); + TQString msg = (gameover ? i18n("Game over") : TQString()); if ( board->isArcade() && board->arcadeStageDone() ) { if ( board->arcadeStage()==bfactory->bbi.nbArcadeStages ) msg = i18n("The End"); else { - msg = i18n("Stage #%1 done").arg(board->arcadeStage()); + msg = i18n("Stage #%1 done").tqarg(board->arcadeStage()); button = ProceedButton; } } setMessage(msg, button); } -void BaseField::gameOver(const KExtHighscore::Score &score, TQWidget *parent) +void BaseField::gameOver(const KExtHighscore::Score &score, TQWidget *tqparent) { - KNotifyClient::event(parent->winId(), "game over", i18n("Game Over")); - KExtHighscore::submitScore(score, parent); + KNotifyClient::event(tqparent->winId(), "game over", i18n("Game Over")); + KExtHighscore::submitScore(score, tqparent); } void BaseField::scoreUpdated() @@ -147,8 +147,8 @@ void BaseField::scoreUpdated() if (_flags.multiplayer) return; TQColor color; - if ( _firstScoresetColor(color); } diff --git a/libksirtet/base/field.h b/libksirtet/base/field.h index e9366f4c..a60173bb 100644 --- a/libksirtet/base/field.h +++ b/libksirtet/base/field.h @@ -22,7 +22,7 @@ class KDE_EXPORT BaseField virtual ~BaseField() {} virtual KExtHighscore::Score currentScore() const = 0; - static void gameOver(const KExtHighscore::Score &, TQWidget *parent); + static void gameOver(const KExtHighscore::Score &, TQWidget *tqparent); virtual void setArcade(); bool isArcade() const; @@ -60,7 +60,7 @@ class KDE_EXPORT BaseField bool hasButton() const { return _flags.server && _flags.first; } void setMessage(const TQString &label, ButtonType); - void hideMessage() { setMessage(TQString::null, NB_BUTTON_TYPE); } + void hideMessage() { setMessage(TQString(), NB_BUTTON_TYPE); } }; #endif diff --git a/libksirtet/base/gtetris.h b/libksirtet/base/gtetris.h index b0f990b9..1546741d 100644 --- a/libksirtet/base/gtetris.h +++ b/libksirtet/base/gtetris.h @@ -81,7 +81,7 @@ ** ** Do whatever you want with this code (i.e. the files gtetris.h, ** gtetris.cpp, tpiece.h and tpiece.cpp). It is basically a weekend hack -** and it would bring joy to my heart if anyone in any way would find +** and it would bring joy to my heart if anyone in any way would tqfind ** it useful. ** ** Nostalgia, comments and/or praise can be sent to: Eirik.Eng@troll.no diff --git a/libksirtet/base/inter.cpp b/libksirtet/base/inter.cpp index 658e7c47..c573ef78 100644 --- a/libksirtet/base/inter.cpp +++ b/libksirtet/base/inter.cpp @@ -3,13 +3,13 @@ #include -void BaseInterface::showHighscores(TQWidget *parent) +void BaseInterface::showHighscores(TQWidget *tqparent) { if ( !_isPaused() ) _pause(); - _showHighscores(parent); + _showHighscores(tqparent); } -void BaseInterface::_showHighscores(TQWidget *parent) +void BaseInterface::_showHighscores(TQWidget *tqparent) { - KExtHighscore::show(parent); + KExtHighscore::show(tqparent); } diff --git a/libksirtet/base/inter.h b/libksirtet/base/inter.h index 3bf394db..21c81db0 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(TQWidget *parent); + void showHighscores(TQWidget *tqparent); protected: - virtual void _showHighscores(TQWidget *parent); + virtual void _showHighscores(TQWidget *tqparent); }; #endif diff --git a/libksirtet/base/kzoommainwindow.cpp b/libksirtet/base/kzoommainwindow.cpp index 4e1b85a5..1d0f5319 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, TQT_SLOT(zoomIn()), actionCollection()); + _zoomInAction = KStdAction::zoomIn(TQT_TQOBJECT(this), TQT_SLOT(zoomIn()), actionCollection()); _zoomOutAction = - KStdAction::zoomOut(this, TQT_SLOT(zoomOut()), actionCollection()); + KStdAction::zoomOut(TQT_TQOBJECT(this), TQT_SLOT(zoomOut()), actionCollection()); _menu = - KStdAction::showMenubar(this, TQT_SLOT(toggleMenubar()), actionCollection()); + KStdAction::showMenubar(TQT_TQOBJECT(this), TQT_SLOT(toggleMenubar()), actionCollection()); } void KZoomMainWindow::init(const char *popupName) @@ -58,7 +58,7 @@ void KZoomMainWindow::init(const char *popupName) void KZoomMainWindow::addWidget(TQWidget *widget) { widget->adjustSize(); - TQWidget *tlw = widget->topLevelWidget(); + TQWidget *tlw = widget->tqtopLevelWidget(); KZoomMainWindow *zm = static_cast(tlw->qt_cast("KZoomMainWindow")); Q_ASSERT(zm); @@ -74,7 +74,7 @@ void KZoomMainWindow::widgetDestroyed() bool KZoomMainWindow::eventFilter(TQObject *o, TQEvent *e) { if ( e->type()==TQEvent::LayoutHint ) - setFixedSize(minimumSize()); // because K/QMainWindow + setFixedSize(tqminimumSize()); // because K/TQMainWindow // does not manage fixed central widget // with hidden menubar... return KMainWindow::eventFilter(o, e); diff --git a/libksirtet/base/kzoommainwindow.h b/libksirtet/base/kzoommainwindow.h index fd213fd7..18e85ddb 100644 --- a/libksirtet/base/kzoommainwindow.h +++ b/libksirtet/base/kzoommainwindow.h @@ -44,6 +44,7 @@ class KToggleAction; class KDE_EXPORT KZoomMainWindow : public KMainWindow { Q_OBJECT + TQ_OBJECT public: /** Constructor. */ KZoomMainWindow(uint minZoom, uint maxZoom, uint zoomStep, @@ -51,7 +52,7 @@ public: /** Add a widget to be managed i.e. the adjustSize() method of the * widget is called whenever the zoom is changed. - * This function assumes that the topLevelWidget() is the KZoomMainWindow. + * This function assumes that the tqtopLevelWidget() is the KZoomMainWindow. */ static void addWidget(TQWidget *widget); diff --git a/libksirtet/base/main.cpp b/libksirtet/base/main.cpp index e09a9c50..cbfc433a 100644 --- a/libksirtet/base/main.cpp +++ b/libksirtet/base/main.cpp @@ -24,20 +24,20 @@ BaseMainWindow::BaseMainWindow() KNotifyClient::startDaemon(); // File & Popup - KStdGameAction::gameNew(this, TQT_SLOT(start()), actionCollection()); - _pause = KStdGameAction::pause(this, TQT_SLOT(pause()), actionCollection()); + KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(start()), actionCollection()); + _pause = KStdGameAction::pause(TQT_TQOBJECT(this), TQT_SLOT(pause()), actionCollection()); _pause->setEnabled(false); - KStdGameAction::highscores(this, TQT_SLOT(showHighscores()), + KStdGameAction::highscores(TQT_TQOBJECT(this), TQT_SLOT(showHighscores()), actionCollection()); - KStdGameAction::quit(qApp, TQT_SLOT(quit()), actionCollection()); + KStdGameAction::quit(TQT_TQOBJECT(tqApp), TQT_SLOT(quit()), actionCollection()); // Settings - KStdAction::preferences(this, TQT_SLOT(configureSettings()), + KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(configureSettings()), actionCollection()); - KStdAction::keyBindings(this, TQT_SLOT(configureKeys()), actionCollection()); - KStdAction::configureNotifications(this, TQT_SLOT(configureNotifications()), + KStdAction::keyBindings(TQT_TQOBJECT(this), TQT_SLOT(configureKeys()), actionCollection()); + KStdAction::configureNotifications(TQT_TQOBJECT(this), TQT_SLOT(configureNotifications()), actionCollection()); - KStdGameAction::configureHighscores(this, TQT_SLOT(configureHighscores()), + KStdGameAction::configureHighscores(TQT_TQOBJECT(this), TQT_SLOT(configureHighscores()), actionCollection()); _inter = bfactory->createInterface(this); diff --git a/libksirtet/base/main.h b/libksirtet/base/main.h index cd165963..153f38ce 100644 --- a/libksirtet/base/main.h +++ b/libksirtet/base/main.h @@ -13,6 +13,7 @@ class KConfigDialog; class KDE_EXPORT BaseMainWindow : public KZoomMainWindow { Q_OBJECT + TQ_OBJECT public: BaseMainWindow(); virtual ~BaseMainWindow(); diff --git a/libksirtet/base/piece.h b/libksirtet/base/piece.h index 6cdd667c..accbf1ee 100644 --- a/libksirtet/base/piece.h +++ b/libksirtet/base/piece.h @@ -69,7 +69,7 @@ class SequenceArray : public TQMemArray }; //----------------------------------------------------------------------------- -class BlockInfo : public QCanvas +class BlockInfo : public TQCanvas { public: BlockInfo(const SequenceArray &); diff --git a/libksirtet/base/settings.h b/libksirtet/base/settings.h index d32415c6..75f89404 100644 --- a/libksirtet/base/settings.h +++ b/libksirtet/base/settings.h @@ -8,9 +8,10 @@ class TQGridLayout; //----------------------------------------------------------------------------- -class BaseAppearanceConfig : public QWidget +class BaseAppearanceConfig : public TQWidget { Q_OBJECT + TQ_OBJECT public: BaseAppearanceConfig(); @@ -20,9 +21,10 @@ protected: }; //----------------------------------------------------------------------------- -class ColorConfig : public QWidget +class ColorConfig : public TQWidget { Q_OBJECT + TQ_OBJECT public: ColorConfig(); diff --git a/libksirtet/common/ai.cpp b/libksirtet/common/ai.cpp index 78f9d5af..3960291e 100644 --- a/libksirtet/common/ai.cpp +++ b/libksirtet/common/ai.cpp @@ -222,7 +222,7 @@ double AI::points() const for (uint i=0; i<_elements.size(); i++) { if ( _elements[i].coefficient==0.0 ) continue; double v = _elements[i].data->function(*main, *board); - if ( _elements[i].data->triggered && qRound(v)<_elements[i].trigger ) + if ( _elements[i].data->triggered && tqRound(v)<_elements[i].trigger ) continue; pts += _elements[i].coefficient * v; } @@ -343,14 +343,14 @@ TQCString AIConfig::coefficientKey(const char *name) double AIConfig::coefficient(const AI::Data &data) { - KConfigSkeletonItem *item = CommonPrefs::self()->findItem( TQString("Coefficient_%1").arg(data.name) ); + KConfigSkeletonItem *item = CommonPrefs::self()->findItem( TQString("Coefficient_%1").tqarg(data.name) ); assert(item); return item->property().toDouble(); } int AIConfig::trigger(const AI::Data &data) { - KConfigSkeletonItem *item = CommonPrefs::self()->findItem( TQString("Trigger_%1").arg(data.name) ); + KConfigSkeletonItem *item = CommonPrefs::self()->findItem( TQString("Trigger_%1").tqarg(data.name) ); assert(item); return item->property().toInt(); } diff --git a/libksirtet/common/ai.h b/libksirtet/common/ai.h index b25a1d90..2211cd3d 100644 --- a/libksirtet/common/ai.h +++ b/libksirtet/common/ai.h @@ -38,9 +38,10 @@ class LIBKSIRTET_EXPORT AIPiece }; //----------------------------------------------------------------------------- -class LIBKSIRTET_EXPORT AI : public QObject +class LIBKSIRTET_EXPORT AI : public TQObject { Q_OBJECT + TQ_OBJECT public: struct Data { const char *name, *label, *whatsthis; @@ -103,9 +104,10 @@ class LIBKSIRTET_EXPORT AI : public QObject }; //----------------------------------------------------------------------------- -class LIBKSIRTET_EXPORT AIConfig : public QWidget +class LIBKSIRTET_EXPORT AIConfig : public TQWidget { Q_OBJECT + TQ_OBJECT public: AIConfig(const TQValueVector &elements); diff --git a/libksirtet/common/board.cpp b/libksirtet/common/board.cpp index 7a0802ad..93851b87 100644 --- a/libksirtet/common/board.cpp +++ b/libksirtet/common/board.cpp @@ -11,8 +11,8 @@ #include "commonprefs.h" -Board::Board(bool graphic, GiftPool *gp, TQWidget *parent) - : BaseBoard(graphic, parent), +Board::Board(bool graphic, GiftPool *gp, TQWidget *tqparent) + : BaseBoard(graphic, tqparent), _giftPool(gp), aiEngine(0) {} diff --git a/libksirtet/common/board.h b/libksirtet/common/board.h index 7b9f0b3a..5f38df9e 100644 --- a/libksirtet/common/board.h +++ b/libksirtet/common/board.h @@ -11,8 +11,9 @@ class AI; class LIBKSIRTET_EXPORT Board : public BaseBoard { Q_OBJECT + TQ_OBJECT public: - Board(bool graphic, GiftPool *, TQWidget *parent); + Board(bool graphic, GiftPool *, TQWidget *tqparent); virtual ~Board(); void setType(bool computer); diff --git a/libksirtet/common/factory.h b/libksirtet/common/factory.h index 2d02dcb2..5cd0cdbf 100644 --- a/libksirtet/common/factory.h +++ b/libksirtet/common/factory.h @@ -25,7 +25,7 @@ class LIBKSIRTET_EXPORT CommonFactory : public BaseFactory const CommonBoardInfo &cbi; - virtual BaseField *createField(TQWidget *parent) = 0; + virtual BaseField *createField(TQWidget *tqparent) = 0; virtual AI *createAI() = 0; TQWidget *createAIConfig(); diff --git a/libksirtet/common/field.cpp b/libksirtet/common/field.cpp index 4c00ba4e..ea6a3ffc 100644 --- a/libksirtet/common/field.cpp +++ b/libksirtet/common/field.cpp @@ -19,8 +19,8 @@ #include "commonprefs.h" -Field::Field(TQWidget *parent) -: MPSimpleBoard(parent), BaseField(this) +Field::Field(TQWidget *tqparent) +: MPSimpleBoard(tqparent), BaseField(this) { // column 1 // score LCD @@ -39,7 +39,7 @@ Field::Field(TQWidget *parent) // level progress levelLabel = new TQLabel(this); - levelLabel->setAlignment(AlignCenter); + levelLabel->tqsetAlignment(AlignCenter); lcds->addWidget(levelLabel, 5, 0); toLevel = new KProgress(this); toLevel->setTextEnabled(true); @@ -77,7 +77,7 @@ Field::Field(TQWidget *parent) vbl->addStretch(1); labShowNext = new TQLabel(i18n("Next Tile"), this); - labShowNext->setAlignment(AlignCenter); + labShowNext->tqsetAlignment(AlignCenter); vbl->addWidget(labShowNext, 0); showNext = new ShowNextPiece(board, this); _snRootPixmap = new KCanvasRootPixmap(showNext); diff --git a/libksirtet/common/field.h b/libksirtet/common/field.h index ce0168e6..69d11bfb 100644 --- a/libksirtet/common/field.h +++ b/libksirtet/common/field.h @@ -18,8 +18,9 @@ class KGameLCDClock; class LIBKSIRTET_EXPORT Field : public MPSimpleBoard, public BaseField { Q_OBJECT + TQ_OBJECT public: - Field(TQWidget *parent); + Field(TQWidget *tqparent); public slots: void moveLeft(); diff --git a/libksirtet/common/highscores.cpp b/libksirtet/common/highscores.cpp index 459b35af..fb1642c0 100644 --- a/libksirtet/common/highscores.cpp +++ b/libksirtet/common/highscores.cpp @@ -11,10 +11,10 @@ using namespace KExtHighscore; CommonHighscores::CommonHighscores() { - Item *item = new Item((uint)1, i18n("Level"), Qt::AlignRight); + Item *item = new Item((uint)1, i18n("Level"), TQt::AlignRight); addScoreItem("level", item); item = new Item((uint)0, i18n(bfactory->mainData.removedLabel), - Qt::AlignRight); + TQt::AlignRight); addScoreItem("removed", item); } @@ -23,13 +23,13 @@ void CommonHighscores::convertLegacy(uint) KConfigGroupSaver cg(kapp->config(), "High Scores"); for (uint i=0; i<10; i++) { TQString name - = cg.config()->readEntry(TQString("name%1").arg(i), TQString::null); + = cg.config()->readEntry(TQString("name%1").tqarg(i), TQString()); if ( name.isNull() ) break; if ( name.isEmpty() ) name = i18n("anonymous"); uint score - = cg.config()->readUnsignedNumEntry(TQString("score%1").arg(i), 0); + = cg.config()->readUnsignedNumEntry(TQString("score%1").tqarg(i), 0); uint level - = cg.config()->readUnsignedNumEntry(TQString("level%1").arg(i), 1); + = cg.config()->readUnsignedNumEntry(TQString("level%1").tqarg(i), 1); Score s(Won); s.setScore(score); s.setData("name", name); diff --git a/libksirtet/common/inter.cpp b/libksirtet/common/inter.cpp index c5630108..e81f7347 100644 --- a/libksirtet/common/inter.cpp +++ b/libksirtet/common/inter.cpp @@ -33,8 +33,8 @@ const int Interface::KEYCODE_TWO[Nb_Actions] = { Key_F, Key_G, Key_D, Key_Space, Key_E, Key_C, SHIFT+Key_F, SHIFT+Key_G }; -Interface::Interface(const MPGameInfo &gi, TQWidget *parent) - : MPSimpleInterface(gi, Nb_Actions, ACTION_DATA, parent) +Interface::Interface(const MPGameInfo &gi, TQWidget *tqparent) + : MPSimpleInterface(gi, Nb_Actions, ACTION_DATA, tqparent) { setDefaultKeycodes(1, 0, KEYCODE_ONE); setDefaultKeycodes(2, 0, KEYCODE_TWO); @@ -91,10 +91,10 @@ void Interface::_sendPlayData() } } -void Interface::_showHighscores(TQWidget *parent) +void Interface::_showHighscores(TQWidget *tqparent) { - if ( !server() || nbPlayers()!=1 ) _scores.show(parent); - else BaseInterface::_showHighscores(parent); + if ( !server() || nbPlayers()!=1 ) _scores.show(tqparent); + else BaseInterface::_showHighscores(tqparent); } void Interface::_showGameOverData() diff --git a/libksirtet/common/inter.h b/libksirtet/common/inter.h index 02041afa..fb8a8349 100644 --- a/libksirtet/common/inter.h +++ b/libksirtet/common/inter.h @@ -15,8 +15,9 @@ class Field; class LIBKSIRTET_EXPORT Interface : public MPSimpleInterface, public BaseInterface { Q_OBJECT + TQ_OBJECT public: - Interface(const MPGameInfo &, TQWidget *parent); + Interface(const MPGameInfo &, TQWidget *tqparent); signals: void settingsChanged(); @@ -27,7 +28,7 @@ public slots: void settingsChangedSlot() { emit settingsChanged(); } protected: - void _showHighscores(TQWidget *parent); + void _showHighscores(TQWidget *tqparent); private: TQMemArray _data; diff --git a/libksirtet/common/main.cpp b/libksirtet/common/main.cpp index e7674846..8856a726 100644 --- a/libksirtet/common/main.cpp +++ b/libksirtet/common/main.cpp @@ -20,22 +20,22 @@ void MainWindow::init() { Interface *inter = static_cast(_inter); inter->normalGame(); - setFocusPolicy(StrongFocus); + setFocusPolicy(TQ_StrongFocus); // Modes bool ama = ( bfactory->bbi.nbArcadeStages!=0 ); TQString s = (ama ? i18n("&Single Human (Normal)") : i18n("&Single Human")); - (void)new KAction(s, 0, inter, TQT_SLOT(normalGame()), + (void)new KAction(s, 0, TQT_TQOBJECT(inter), TQT_SLOT(normalGame()), actionCollection(), "mp_single_human"); if (ama) (void)new KAction(i18n("&Single Human (Arcade)"), 0, - inter, TQT_SLOT(arcadeGame()), + TQT_TQOBJECT(inter), TQT_SLOT(arcadeGame()), actionCollection(), "mp_arcade"); - (void)new KAction(i18n("Human vs &Human"), 0, inter, TQT_SLOT(humanVsHuman()), + (void)new KAction(i18n("Human vs &Human"), 0, TQT_TQOBJECT(inter), TQT_SLOT(humanVsHuman()), actionCollection(), "mp_human_vs_human"); (void)new KAction(i18n("Human vs &Computer"), 0, - inter, TQT_SLOT(humanVsComputer()), + TQT_TQOBJECT(inter), TQT_SLOT(humanVsComputer()), actionCollection(), "mp_human_vs_computer"); - (void)new KAction(i18n("&More..."), 0, inter, TQT_SLOT(dialog()), + (void)new KAction(i18n("&More..."), 0, TQT_TQOBJECT(inter), TQT_SLOT(dialog()), actionCollection(), "mp_more"); buildGUI(inter); diff --git a/libksirtet/common/main.h b/libksirtet/common/main.h index a98fc6f1..a1534a95 100644 --- a/libksirtet/common/main.h +++ b/libksirtet/common/main.h @@ -8,6 +8,7 @@ class LIBKSIRTET_EXPORT MainWindow : public BaseMainWindow { Q_OBJECT + TQ_OBJECT public: MainWindow() {} diff --git a/libksirtet/common/misc_ui.cpp b/libksirtet/common/misc_ui.cpp index cf802e25..6e9cffec 100644 --- a/libksirtet/common/misc_ui.cpp +++ b/libksirtet/common/misc_ui.cpp @@ -24,8 +24,8 @@ const uint LED_HEIGHT = 15; const uint LED_SPACING = 5; /*****************************************************************************/ -ShowNextPiece::ShowNextPiece(BaseBoard *board, TQWidget *parent) - : FixedCanvasView(parent, "show_next_piece") +ShowNextPiece::ShowNextPiece(BaseBoard *board, TQWidget *tqparent) + : FixedCanvasView(tqparent, "show_next_piece") { setCanvas(board->next()); setFrameStyle(TQFrame::Panel | TQFrame::Sunken); @@ -33,15 +33,15 @@ ShowNextPiece::ShowNextPiece(BaseBoard *board, TQWidget *parent) } /*****************************************************************************/ -Shadow::Shadow(BaseBoard *board, TQWidget *parent) - : TQWidget(parent, "shadow"), _xOffset(board->frameWidth()), +Shadow::Shadow(BaseBoard *board, TQWidget *tqparent) + : TQWidget(tqparent, "shadow"), _xOffset(board->frameWidth()), _board(board), _show(false) { KZoomMainWindow::addWidget(this); connect(board, TQT_SIGNAL(updatePieceConfigSignal()), TQT_SLOT(update())); } -TQSize Shadow::sizeHint() const +TQSize Shadow::tqsizeHint() const { return TQSize(_xOffset + _board->matrix().width() * BasePrefs::blockSize(), SHADOW_HEIGHT); @@ -78,19 +78,19 @@ void Shadow::paintEvent(TQPaintEvent *) /*****************************************************************************/ -class Led : public QWidget +class Led : public TQWidget { public: - Led(const TQColor &c, TQWidget *parent) - : TQWidget(parent), col(c), _on(FALSE) {} + Led(const TQColor &c, TQWidget *tqparent) + : TQWidget(tqparent), col(c), _on(FALSE) {} TQSizePolicy sizePolicy() const { return TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed); } - TQSize sizeHint() const { return TQSize(LED_WIDTH, LED_HEIGHT); } + TQSize tqsizeHint() const { return TQSize(LED_WIDTH, LED_HEIGHT); } - void on() { if (!_on) { _on = TRUE; repaint(); } } - void off() { if (_on) {_on = FALSE; repaint(); } } - void setColor(const TQColor &c) { if (c!=col) { col = c; repaint(); } } + void on() { if (!_on) { _on = TRUE; tqrepaint(); } } + void off() { if (_on) {_on = FALSE; tqrepaint(); } } + void setColor(const TQColor &c) { if (c!=col) { col = c; tqrepaint(); } } protected: void paintEvent(TQPaintEvent *) { @@ -105,8 +105,8 @@ class Led : public QWidget bool _on; }; -GiftPool::GiftPool(TQWidget *parent) - : TQHBox(parent, "gift_pool"), nb(0), ready(false) +GiftPool::GiftPool(TQWidget *tqparent) + : TQHBox(tqparent, "gift_pool"), nb(0), ready(false) { setSpacing(LED_SPACING); leds.resize(cfactory->cbi.nbGiftLeds); @@ -114,9 +114,9 @@ GiftPool::GiftPool(TQWidget *parent) leds.insert(i, new Led(yellow, this)); } -TQSize GiftPool::sizeHint() const +TQSize GiftPool::tqsizeHint() const { - TQSize s = (leds.size() ? leds[0]->sizeHint() : TQSize()); + TQSize s = (leds.size() ? leds[0]->tqsizeHint() : TQSize()); return TQSize((s.width()+LED_SPACING)*leds.size()-LED_SPACING, s.height()); } @@ -131,9 +131,9 @@ void GiftPool::put(uint n) if ( nb==0 && !ready ) TQTimer::singleShot(cfactory->cbi.giftPoolTimeout, this, TQT_SLOT(timeout())); - uint e = QMIN(nb+n, leds.size()); + uint e = TQMIN(nb+n, leds.size()); for (uint i=nb; ion(); - uint f = QMIN(nb+n-e, leds.size()); + uint f = TQMIN(nb+n-e, leds.size()); for (uint i=0; isetColor(red); nb += n; } @@ -161,7 +161,7 @@ uint GiftPool::take() void GiftPool::reset() { - killTimers(); + TQT_TQOBJECT(this)->killTimers(); ready = false; nb = 0; for (uint i=0; imatrix().height(), 0, KGameProgress::Vertical, - parent, name), _board(board) + : KGameProgress(0, board->matrix().height(), 0, Qt::Vertical, + tqparent, name), _board(board) { setBackgroundColor(lightGray); setTextEnabled(false); @@ -182,7 +182,7 @@ PlayerProgress::PlayerProgress(BaseBoard *board, TQWidget *parent, KZoomMainWindow::addWidget(this); } -TQSize PlayerProgress::sizeHint() const +TQSize PlayerProgress::tqsizeHint() const { return TQSize(10, _board->matrix().height() * BasePrefs::blockSize()) + 2 * TQSize(frameWidth(), frameWidth()); diff --git a/libksirtet/common/misc_ui.h b/libksirtet/common/misc_ui.h index 38544a02..61b87b96 100644 --- a/libksirtet/common/misc_ui.h +++ b/libksirtet/common/misc_ui.h @@ -14,18 +14,20 @@ class LIBKSIRTET_EXPORT ShowNextPiece : public FixedCanvasView { Q_OBJECT + TQ_OBJECT public: - ShowNextPiece(BaseBoard *, TQWidget *parent); + ShowNextPiece(BaseBoard *, TQWidget *tqparent); }; /*****************************************************************************/ -class LIBKSIRTET_EXPORT Shadow : public QWidget +class LIBKSIRTET_EXPORT Shadow : public TQWidget { Q_OBJECT + TQ_OBJECT public: - Shadow(BaseBoard *, TQWidget *parent); + Shadow(BaseBoard *, TQWidget *tqparent); - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; virtual TQSizePolicy sizePolicy() const; void setDisplay(bool show); @@ -40,13 +42,14 @@ class LIBKSIRTET_EXPORT Shadow : public QWidget /*****************************************************************************/ class Led; -class LIBKSIRTET_EXPORT GiftPool : public QHBox +class LIBKSIRTET_EXPORT GiftPool : public TQHBox { Q_OBJECT + TQ_OBJECT public: - GiftPool(TQWidget *parent); + GiftPool(TQWidget *tqparent); - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; virtual TQSizePolicy sizePolicy() const; void reset(); @@ -68,10 +71,11 @@ class LIBKSIRTET_EXPORT GiftPool : public QHBox class LIBKSIRTET_EXPORT PlayerProgress : public KGameProgress { Q_OBJECT + TQ_OBJECT public: - PlayerProgress(BaseBoard *board, TQWidget *parent = 0, const char *name = 0); + PlayerProgress(BaseBoard *board, TQWidget *tqparent = 0, const char *name = 0); - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; virtual TQSizePolicy sizePolicy() const; private: diff --git a/libksirtet/common/settings.h b/libksirtet/common/settings.h index 2a554e8d..a33c2b12 100644 --- a/libksirtet/common/settings.h +++ b/libksirtet/common/settings.h @@ -10,14 +10,16 @@ class LIBKSIRTET_EXPORT AppearanceConfig : public BaseAppearanceConfig { Q_OBJECT + TQ_OBJECT public: AppearanceConfig(); }; //----------------------------------------------------------------------------- -class LIBKSIRTET_EXPORT GameConfig : public QWidget +class LIBKSIRTET_EXPORT GameConfig : public TQWidget { Q_OBJECT + TQ_OBJECT public: GameConfig(); diff --git a/libksirtet/common/types.h b/libksirtet/common/types.h index 5b85f302..702f8a70 100644 --- a/libksirtet/common/types.h +++ b/libksirtet/common/types.h @@ -6,11 +6,11 @@ #include "lib/libksirtet_export.h" -struct ClientPlayData { Q_UINT8 height, gift, end; }; +struct ClientPlayData { TQ_UINT8 height, gift, end; }; LIBKSIRTET_EXPORT TQDataStream &operator <<(TQDataStream &s, const ClientPlayData &d); LIBKSIRTET_EXPORT TQDataStream &operator >>(TQDataStream &s, ClientPlayData &d); -struct ServerPlayData { Q_UINT8 prevHeight, nextHeight, gift; }; +struct ServerPlayData { TQ_UINT8 prevHeight, nextHeight, gift; }; LIBKSIRTET_EXPORT TQDataStream &operator <<(TQDataStream &s, const ServerPlayData &d); LIBKSIRTET_EXPORT TQDataStream &operator >>(TQDataStream &s, ServerPlayData &d); @@ -18,7 +18,7 @@ class ServerInitData { public: TQString prevName, nextName, name; - Q_UINT32 initLevel, seed; + TQ_UINT32 initLevel, seed; }; LIBKSIRTET_EXPORT TQDataStream &operator <<(TQDataStream &s, const ServerInitData &d); LIBKSIRTET_EXPORT TQDataStream &operator >>(TQDataStream &s, ServerInitData &d); diff --git a/libksirtet/lib/defines.cpp b/libksirtet/lib/defines.cpp index baf91083..3b3ec229 100644 --- a/libksirtet/lib/defines.cpp +++ b/libksirtet/lib/defines.cpp @@ -2,12 +2,12 @@ #include -void errorBox(const TQString &msg1, const TQString &msg2, TQWidget *parent) +void errorBox(const TQString &msg1, const TQString &msg2, TQWidget *tqparent) { TQString str; if ( msg2.isNull() ) str = msg1; - else str = i18n("%1:\n%2").arg(msg1).arg(msg2); - KMessageBox::error(parent, str); + else str = i18n("%1:\n%2").tqarg(msg1).tqarg(msg2); + KMessageBox::error(tqparent, str); } TQString socketError(const KExtendedSocket *socket) @@ -16,9 +16,9 @@ TQString socketError(const KExtendedSocket *socket) } bool checkSocket(int res, const KExtendedSocket *socket, - const TQString &msg, TQWidget *parent) + const TQString &msg, TQWidget *tqparent) { if ( res==0 ) return false; - errorBox(msg, socketError(socket), parent); + errorBox(msg, socketError(socket), tqparent); return true; } diff --git a/libksirtet/lib/defines.h b/libksirtet/lib/defines.h index a6728a38..db936b10 100644 --- a/libksirtet/lib/defines.h +++ b/libksirtet/lib/defines.h @@ -16,10 +16,10 @@ #define MP_SERVER_ADDRESS "Server address" #define MP_PORT "Port" -void errorBox(const TQString &msg1, const TQString &msg2, TQWidget *parent); +void errorBox(const TQString &msg1, const TQString &msg2, TQWidget *tqparent); TQString socketError(const KExtendedSocket *socket); bool checkSocket(int res, const KExtendedSocket *, - const TQString &msg, TQWidget *parent); + const TQString &msg, TQWidget *tqparent); #define R_ERROR_BOX(msg1, msg2) { \ errorBox(msg1, msg2, this); \ diff --git a/libksirtet/lib/internal.cpp b/libksirtet/lib/internal.cpp index f8b34085..1622a2fa 100644 --- a/libksirtet/lib/internal.cpp +++ b/libksirtet/lib/internal.cpp @@ -111,7 +111,7 @@ TQString Network::playerName(uint i) const if ( i<(l+ll) ) return remotes[k].names[i-l]; l += ll; } - return TQString::null; // dummy + return TQString(); // dummy } IOBuffer *Network::ioBuffer(uint i) const diff --git a/libksirtet/lib/internal.h b/libksirtet/lib/internal.h index cc74fbc4..038656eb 100644 --- a/libksirtet/lib/internal.h +++ b/libksirtet/lib/internal.h @@ -59,6 +59,7 @@ class Server class Network : public TQObject, public Local { Q_OBJECT + TQ_OBJECT public: Network(MPInterface *_interface, TQValueList &_boards, @@ -93,6 +94,7 @@ class Network : public TQObject, public Local class LocalServer : public TQObject, public Local, public Server { Q_OBJECT + TQ_OBJECT public: LocalServer(MPInterface *_interface, @@ -112,6 +114,7 @@ class LocalServer : public TQObject, public Local, public Server class NetworkServer : public Network, public Server { Q_OBJECT + TQ_OBJECT public: NetworkServer(MPInterface *_interface, @@ -137,6 +140,7 @@ class NetworkServer : public Network, public Server class Client : public Network { Q_OBJECT + TQ_OBJECT public: Client(MPInterface *_interface, TQValueList &_boards, diff --git a/libksirtet/lib/keys.cpp b/libksirtet/lib/keys.cpp index 8433503f..fadb8e5f 100644 --- a/libksirtet/lib/keys.cpp +++ b/libksirtet/lib/keys.cpp @@ -7,8 +7,8 @@ KeyData::KeyData(uint maxNb, uint nbActions, const ActionData *data, - TQObject *parent) - : TQObject(parent), _maxNb(maxNb) + TQObject *tqparent) + : TQObject(tqparent), _maxNb(maxNb) { _data.duplicate(data, nbActions); @@ -46,10 +46,10 @@ void KeyData::createActionCollection(uint index, TQWidget *receiver) _cols[index] = new KActionCollection(receiver, this); for (uint k=0; k<_data.size(); k++) { TQString label = i18n(_data[k].label); - TQString name = TQString("%2 %3").arg(index+1).arg(_data[k].name); + TQString name = TQString("%2 %3").tqarg(index+1).tqarg(_data[k].name); const char *slot = (_data[k].slotRelease ? 0 : _data[k].slot); KAction *a = new KAction(label, _keycodes[_cols.size()-1][index][k], - receiver, slot, _cols[index], name.utf8()); + TQT_TQOBJECT(receiver), slot, _cols[index], name.utf8()); a->setEnabled(false); if ( slot==0 ) { SpecialData data; @@ -68,7 +68,7 @@ void KeyData::setEnabled(uint index, bool enabled) { for (uint k=0; k<_cols[index]->count(); k++) { TQMap::Iterator it = - _specActions.find(_cols[index]->action(k)); + _specActions.tqfind(_cols[index]->action(k)); if ( it==_specActions.end() ) _cols[index]->action(k)->setEnabled(enabled); else (*it).enabled = enabled; @@ -78,8 +78,8 @@ void KeyData::setEnabled(uint index, bool enabled) void KeyData::addKeys(KKeyDialog &d) { for (uint i=0; i<_cols.size(); i++) - d.insert(_cols[i], i18n("Shortcuts for player #%1/%2").arg(i+1) - .arg(_cols.size())); + d.insert(_cols[i], i18n("Shortcuts for player #%1/%2").tqarg(i+1) + .tqarg(_cols.size())); } void KeyData::save() diff --git a/libksirtet/lib/keys.h b/libksirtet/lib/keys.h index 62bb818c..16e25118 100644 --- a/libksirtet/lib/keys.h +++ b/libksirtet/lib/keys.h @@ -7,12 +7,13 @@ #include "mp_interface.h" -class KeyData : public QObject +class KeyData : public TQObject { Q_OBJECT + TQ_OBJECT public: KeyData(uint maxNb, uint nbActions, const ActionData *, - TQObject *parent); + TQObject *tqparent); void setKeycodes(uint nb, uint i, const int *keycodes); void setCurrentNb(uint nb); @@ -36,7 +37,7 @@ class KeyData : public QObject TQMap _specActions; TQString group() const - { return TQString("Keys (%1 humans)").arg(_cols.size()); } + { return TQString("Keys (%1 humans)").tqarg(_cols.size()); } }; #endif // KEYS_H diff --git a/libksirtet/lib/meeting.cpp b/libksirtet/lib/meeting.cpp index 71df0e4d..8730fb96 100644 --- a/libksirtet/lib/meeting.cpp +++ b/libksirtet/lib/meeting.cpp @@ -14,16 +14,16 @@ NetMeeting::NetMeeting(const cId &_id, Socket *socket, MPOptionWidget *option, - bool _server, TQWidget *parent, const char * name) + bool _server, TQWidget *tqparent, const char * name) : KDialogBase(Plain, i18n("Network Meeting"), (_server ? Ok|Cancel|Help : Cancel|Help), - (_server ? Ok : Cancel), parent, name), + (_server ? Ok : Cancel), tqparent, name), server(_server), ow(option), id(_id), socketRemoved(FALSE) { sm.append(socket, SocketManager::ReadWrite); sm[0]->notifier()->setEnabled(TRUE); -/* top layout */ +/* top tqlayout */ TQVBoxLayout *top = new TQVBoxLayout(plainPage(), spacingHint()); top->setResizeMode(TQLayout::Fixed); @@ -37,7 +37,7 @@ NetMeeting::NetMeeting(const cId &_id, Socket *socket, top->addWidget(wl); labWait = new TQLabel(i18n("Waiting for clients"), plainPage()); - labWait->setAlignment(AlignCenter); + labWait->tqsetAlignment(AlignCenter); top->addWidget(labWait); // options widget @@ -68,7 +68,7 @@ void NetMeeting::appendLine(const MeetingLineData &pld, bool server) if (pld.own) connect(pl, TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(textChanged(const TQString &))); else message(i18n("A new client has just arrived (#%1)") - .arg(wl->size()+1)); + .tqarg(wl->size()+1)); pl->setData(pld.ed); connect(pl, TQT_SIGNAL(typeChanged(MeetingCheckBox::Type)), TQT_SLOT(typeChanged(MeetingCheckBox::Type))); @@ -136,7 +136,7 @@ void NetMeeting::cleanReject(const TQString &str) // Read incoming data void NetMeeting::readNotifier(int fd) { - int i = sm.find(fd); + int i = sm.tqfind(fd); Q_ASSERT( i!=-1 ); switch ( sm[i]->read() ) { case -1: readError(i); break; @@ -213,8 +213,8 @@ void NetMeeting::message(const TQString &str) /** ServerNetMeeting *********************************************************/ ServerNetMeeting::ServerNetMeeting(const cId &id, const RemoteHostData &r, MPOptionWidget *option, - TQPtrList &arhd, TQWidget *parent, const char * name) -: NetMeeting(id, r.socket, option, TRUE, parent, name), rhd(arhd) + TQPtrList &arhd, TQWidget *tqparent, const char * name) +: NetMeeting(id, r.socket, option, TRUE, tqparent, name), rhd(arhd) { connect(sm[0]->notifier(), TQT_SIGNAL(activated(int)), TQT_SLOT(newHost(int))); players.append(Accepted); // server @@ -241,7 +241,7 @@ void ServerNetMeeting::writeToAll(uint i) void ServerNetMeeting::netError(uint i, const TQString &type) { Q_ASSERT( i!=0 ); - disconnectHost(i, i18n("%1 client #%2: disconnect it").arg(type).arg(i)); + disconnectHost(i, i18n("%1 client #%2: disconnect it").tqarg(type).tqarg(i)); } void ServerNetMeeting::disconnectHost(uint i, const TQString &str) @@ -265,7 +265,7 @@ void ServerNetMeeting::newHost(int) int res = sm[0]->accept(s); if ( res!=0 ) { message(i18n("Failed to accept incoming client:\n%1") - .arg(socketError(s))); + .tqarg(socketError(s))); return; } players.append(NewPlayer); @@ -301,7 +301,7 @@ void ServerNetMeeting::idFlag(uint i) void ServerNetMeeting::endFlag(uint i) { - disconnectHost(i, i18n("Client #%1 has left").arg(i)); + disconnectHost(i, i18n("Client #%1 has left").tqarg(i)); } void ServerNetMeeting::newFlag(uint i) @@ -421,7 +421,7 @@ void ServerNetMeeting::accept() // send play message to client (Play flag // + bool [accepted/rejected]) - sm[0]->writingStream() << PlayFlag << (Q_UINT8)willPlay; + sm[0]->writingStream() << PlayFlag << (TQ_UINT8)willPlay; // if write failed and the client is not playing : silently // put it aside ... if ( !sm[0]->write() && willPlay ) { @@ -448,8 +448,8 @@ void ServerNetMeeting::optionsChanged() /** ClientNetMeeting *********************************************************/ ClientNetMeeting::ClientNetMeeting(const cId &id, const RemoteHostData &rhd, MPOptionWidget *option, - TQWidget *parent, const char * name) -: NetMeeting(id, rhd.socket, option, FALSE, parent, name), bds(rhd.bds) + TQWidget *tqparent, const char * name) +: NetMeeting(id, rhd.socket, option, FALSE, tqparent, name), bds(rhd.bds) { connect(sm[0]->notifier(), TQT_SIGNAL(activated(int)), TQT_SLOT(readNotifier(int))); @@ -462,7 +462,7 @@ ClientNetMeeting::ClientNetMeeting(const cId &id, void ClientNetMeeting::netError(uint, const TQString &str) { - cleanReject(i18n("%1 server: aborting connection.").arg(str)); + cleanReject(i18n("%1 server: aborting connection.").tqarg(str)); } void ClientNetMeeting::writeToAll(uint) @@ -529,7 +529,7 @@ void ClientNetMeeting::delFlag(uint) sm[0]->readingStream() >> k; CHECK_READ(0); removeLine(k-1); - message(i18n("Client %1 has left").arg(k)); + message(i18n("Client %1 has left").tqarg(k)); } void ClientNetMeeting::textChanged(const TQString &text) @@ -549,7 +549,7 @@ void ClientNetMeeting::typeChanged(MeetingCheckBox::Type type) void ClientNetMeeting::playFlag(uint) { // receive accept or reject (bool) - Q_UINT8 i; + TQ_UINT8 i; sm[0]->readingStream() >> i; CHECK_READ(0); sm[0]->notifier()->setEnabled(false); diff --git a/libksirtet/lib/meeting.h b/libksirtet/lib/meeting.h index 1e9ba267..cc8356fc 100644 --- a/libksirtet/lib/meeting.h +++ b/libksirtet/lib/meeting.h @@ -13,12 +13,13 @@ class MPOptionWidget; class NetMeeting : public KDialogBase { Q_OBJECT + TQ_OBJECT public: // "gameName" and "gameId" are TQByteArray because they are // used for ID comparing between games. NetMeeting(const cId &id, Socket *, MPOptionWidget *option, bool server, - TQWidget *parent = 0, const char * name = 0); + TQWidget *tqparent = 0, const char * name = 0); virtual ~NetMeeting(); protected slots: @@ -44,7 +45,7 @@ class NetMeeting : public KDialogBase void setType(const TypeInfo &ti); void setText(const TextInfo &ti); - void cleanReject(const TQString &str = TQString::null); + void cleanReject(const TQString &str = TQString()); bool checkState(uint i, PlayerState s); bool checkAndSetState(uint i, PlayerState os, PlayerState ns); bool ready() const; @@ -77,12 +78,13 @@ class NetMeeting : public KDialogBase class ServerNetMeeting : public NetMeeting { Q_OBJECT + TQ_OBJECT public: ServerNetMeeting(const cId &id, const RemoteHostData &rhd, MPOptionWidget *options, TQPtrList &arhd, - TQWidget *parent = 0, const char * name = 0); + TQWidget *tqparent = 0, const char * name = 0); private slots: void newHost(int); @@ -108,11 +110,12 @@ class ServerNetMeeting : public NetMeeting class ClientNetMeeting : public NetMeeting { Q_OBJECT + TQ_OBJECT public: ClientNetMeeting(const cId &id, const RemoteHostData &rhd, MPOptionWidget *options, - TQWidget *parent = 0, const char * name = 0); + TQWidget *tqparent = 0, const char * name = 0); private slots: void textChanged(const TQString &text); diff --git a/libksirtet/lib/miscui.cpp b/libksirtet/lib/miscui.cpp index dde70adb..7bc8e48b 100644 --- a/libksirtet/lib/miscui.cpp +++ b/libksirtet/lib/miscui.cpp @@ -8,8 +8,8 @@ //----------------------------------------------------------------------------- MeetingCheckBox::MeetingCheckBox(Type type, bool owner, bool server, - TQWidget *parent) - : TQWidget(parent, "meeting_check_box") + TQWidget *tqparent) + : TQWidget(tqparent, "meeting_check_box") { TQVBoxLayout *vbox = new TQVBoxLayout(this); @@ -46,8 +46,8 @@ void MeetingCheckBox::changedSlot() //----------------------------------------------------------------------------- PlayerComboBox::PlayerComboBox(Type type, bool canBeEmpty, bool acceptAI, - TQWidget *parent) - : TQComboBox(parent, "player_combo_box") + TQWidget *tqparent) + : TQComboBox(tqparent, "player_combo_box") { insertItem(i18n("Human")); if (acceptAI) insertItem(i18n("AI")); diff --git a/libksirtet/lib/miscui.h b/libksirtet/lib/miscui.h index fb40e0ec..3bc7fd32 100644 --- a/libksirtet/lib/miscui.h +++ b/libksirtet/lib/miscui.h @@ -6,12 +6,13 @@ //----------------------------------------------------------------------------- -class MeetingCheckBox : public QWidget +class MeetingCheckBox : public TQWidget { Q_OBJECT + TQ_OBJECT public: enum Type { Ready, NotReady, Excluded }; - MeetingCheckBox(Type, bool owner, bool server, TQWidget *parent); + MeetingCheckBox(Type, bool owner, bool server, TQWidget *tqparent); void setType(Type); Type type() const; @@ -27,12 +28,13 @@ class MeetingCheckBox : public QWidget }; //----------------------------------------------------------------------------- -class PlayerComboBox : public QComboBox +class PlayerComboBox : public TQComboBox { Q_OBJECT + TQ_OBJECT public: enum Type { Human = 0, AI, None }; - PlayerComboBox(Type, bool canBeNone, bool acceptAI, TQWidget *parent); + PlayerComboBox(Type, bool canBeNone, bool acceptAI, TQWidget *tqparent); Type type() const { return (Type)currentItem(); } diff --git a/libksirtet/lib/mp_board.h b/libksirtet/lib/mp_board.h index 5e84825c..2578e927 100644 --- a/libksirtet/lib/mp_board.h +++ b/libksirtet/lib/mp_board.h @@ -7,13 +7,14 @@ * The MP_Board class is the base widget from which each individual * board should inheritate ; you must implement its virtual methods. */ -class MPBoard : public QWidget +class MPBoard : public TQWidget { Q_OBJECT + TQ_OBJECT public: - MPBoard(TQWidget *parent, const char *name=0) - : TQWidget(parent, name) {} + MPBoard(TQWidget *tqparent, const char *name=0) + : TQWidget(tqparent, name) {} virtual ~MPBoard() {} /** diff --git a/libksirtet/lib/mp_interface.cpp b/libksirtet/lib/mp_interface.cpp index cfe06cd0..6683ba00 100644 --- a/libksirtet/lib/mp_interface.cpp +++ b/libksirtet/lib/mp_interface.cpp @@ -21,15 +21,15 @@ /*****************************************************************************/ MPInterface::MPInterface(const MPGameInfo &_gameInfo, uint nbActions, const ActionData *data, - TQWidget *parent, const char *name) -: TQWidget(parent, name), internal(0), gameInfo(_gameInfo), nbLocalHumans(0) + TQWidget *tqparent, const char *name) +: TQWidget(tqparent, name), internal(0), gameInfo(_gameInfo), nbLocalHumans(0) { Q_ASSERT( gameInfo.maxNbLocalPlayers>=1 ); hbl = new TQHBoxLayout(this, 0, 5); hbl->setResizeMode( TQLayout::Fixed ); - _keyData = new KeyData(gameInfo.maxNbLocalPlayers, nbActions, data, this); + _keyData = new KeyData(gameInfo.maxNbLocalPlayers, nbActions, data, TQT_TQOBJECT(this)); } MPInterface::~MPInterface() @@ -98,16 +98,16 @@ void MPInterface::specialLocalGame(uint nbHumans, uint nbAIs) KConfigGroupSaver cg(kapp->config(), MP_GROUP); for (uint i=0; i<(nbHumans+nbAIs); i++) { bd.type = (ireadNumEntry(TQString(MP_PLAYER_TYPE).arg(i), + cg.config()->readNumEntry(TQString(MP_PLAYER_TYPE).tqarg(i), PlayerComboBox::None); if ( bd.type==t ) - bd.name = cg.config()->readEntry(TQString(MP_PLAYER_NAME).arg(i), - TQString::null); + bd.name = cg.config()->readEntry(TQString(MP_PLAYER_NAME).tqarg(i), + TQString()); if ( bd.name.isNull() ) - bd.name = (iaction("game_pause")) + ((KToggleAction *)((KMainWindow *)tqtopLevelWidget())->action("game_pause")) MPSimpleInterface::MPSimpleInterface(const MPGameInfo &gi, uint nbActions, const ActionData *data, - TQWidget *parent, const char *name) -: MPInterface(gi, nbActions, data, parent, name), state(SS_Standby) + TQWidget *tqparent, const char *name) +: MPInterface(gi, nbActions, data, tqparent, name), state(SS_Standby) {} void MPSimpleInterface::init() diff --git a/libksirtet/lib/mp_simple_interface.h b/libksirtet/lib/mp_simple_interface.h index d366dafd..04cb014c 100644 --- a/libksirtet/lib/mp_simple_interface.h +++ b/libksirtet/lib/mp_simple_interface.h @@ -7,11 +7,12 @@ class MPSimpleInterface : public MPInterface { Q_OBJECT + TQ_OBJECT public: MPSimpleInterface(const MPGameInfo &gi, uint nbActions, const ActionData *data, - TQWidget *parent = 0, const char *name = 0); + TQWidget *tqparent = 0, const char *name = 0); bool isPaused() const { return state==SS_Pause; } diff --git a/libksirtet/lib/mp_simple_types.cpp b/libksirtet/lib/mp_simple_types.cpp index c2a9dc27..142c1d15 100644 --- a/libksirtet/lib/mp_simple_types.cpp +++ b/libksirtet/lib/mp_simple_types.cpp @@ -1,6 +1,6 @@ #include "mp_simple_types.h" TQDataStream &operator <<(TQDataStream &s, const EnumClass &ec) - { s << (Q_UINT8)ec.f; return s; } + { s << (TQ_UINT8)ec.f; return s; } TQDataStream &operator >>(TQDataStream &s, EnumClass &ec) - { Q_UINT8 t; s >> t; ec.f = (int)t; return s; } + { TQ_UINT8 t; s >> t; ec.f = (int)t; return s; } diff --git a/libksirtet/lib/pline.cpp b/libksirtet/lib/pline.cpp index 86fde398..94e9c50e 100644 --- a/libksirtet/lib/pline.cpp +++ b/libksirtet/lib/pline.cpp @@ -9,12 +9,12 @@ #define THIN_BORDER 4 MeetingLine::MeetingLine(bool isOwner, bool serverIsReader, bool serverLine, - TQWidget *parent, const char *name) -: TQFrame(parent, name) + TQWidget *tqparent, const char *name) +: TQFrame(tqparent, name) { setFrameStyle(Panel | (serverLine ? Raised : Plain)); - // Top layout + // Top tqlayout hbl = new TQHBoxLayout(this, THIN_BORDER + frameWidth()); /* TriCheckBox */ @@ -26,7 +26,7 @@ MeetingLine::MeetingLine(bool isOwner, bool serverIsReader, bool serverLine, /* Name */ lname = new TQLabel(" ", this); - lname->setAlignment(AlignCenter); + lname->tqsetAlignment(AlignCenter); lname->setFrameStyle(TQFrame::Panel | TQFrame::Sunken); lname->setLineWidth(2); lname->setMidLineWidth(3); @@ -34,7 +34,7 @@ MeetingLine::MeetingLine(bool isOwner, bool serverIsReader, bool serverLine, f.setBold(TRUE); lname->setFont(f); lname->setFixedSize(lname->fontMetrics().maxWidth()*NAME_MAX_LENGTH, - lname->sizeHint().height()); + lname->tqsizeHint().height()); hbl->addWidget(lname); hbl->addStretch(1); @@ -51,7 +51,7 @@ MeetingLine::MeetingLine(bool isOwner, bool serverIsReader, bool serverLine, qle->setMaxLength(TALKER_MAX_LENGTH); qle->setFont( TQFont("fixed", 12, TQFont::Bold) ); qle->setFixedSize(qle->fontMetrics().maxWidth()*TALKER_MAX_LENGTH, - qle->sizeHint().height()); + qle->tqsizeHint().height()); connect(qle, TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(_textChanged(const TQString &))); qle->setEnabled(isOwner); @@ -66,8 +66,8 @@ void MeetingLine::setData(const ExtData &ed) if ( bds[i].type==PlayerComboBox::Human ) nbh++; else if ( bds[i].type==PlayerComboBox::AI ) nba++; } - labH->setText(i18n("Hu=%1").arg(nbh)); - labAI->setText(i18n("AI=%1").arg(nba)); + labH->setText(i18n("Hu=%1").tqarg(nbh)); + labAI->setText(i18n("AI=%1").tqarg(nba)); lname->setText(bds[0].name); setType(ed.type); setText(ed.text); @@ -84,12 +84,12 @@ void MeetingLine::data(ExtData &ed) const PlayerLine::PlayerLine(PlayerComboBox::Type type, const TQString &txt, bool humanSetting, bool AISetting, bool canBeEmpty, bool acceptAI, - TQWidget *parent, const char *name) -: TQFrame(parent, name), hs(humanSetting), as(AISetting) + TQWidget *tqparent, const char *name) +: TQFrame(tqparent, name), hs(humanSetting), as(AISetting) { setFrameStyle(Panel | Raised); - // Top layout + // Top tqlayout TQHBoxLayout *hbl; hbl = new TQHBoxLayout(this, THIN_BORDER + frameWidth()); @@ -102,7 +102,7 @@ PlayerLine::PlayerLine(PlayerComboBox::Type type, const TQString &txt, edit = new TQLineEdit(txt, this); edit->setMaxLength(NAME_MAX_LENGTH); edit->setFixedSize(edit->fontMetrics().maxWidth()*(NAME_MAX_LENGTH+2), - edit->sizeHint().height()); + edit->tqsizeHint().height()); hbl->addWidget(edit); /* settings button */ @@ -128,8 +128,8 @@ void PlayerLine::setSlot() } /*****************************************************************************/ -GWidgetList::GWidgetList(uint interval, TQWidget *parent, const char * name) - : TQWidget(parent, name), vbl(this, interval) +GWidgetList::GWidgetList(uint interval, TQWidget *tqparent, const char * name) + : TQWidget(tqparent, name), vbl(this, interval) { widgets.setAutoDelete(TRUE); } diff --git a/libksirtet/lib/pline.h b/libksirtet/lib/pline.h index d9969264..9cef8d29 100644 --- a/libksirtet/lib/pline.h +++ b/libksirtet/lib/pline.h @@ -13,13 +13,14 @@ class TQPushButton; /** Internal class : display a "player line" in netmeeting. */ -class MeetingLine : public QFrame +class MeetingLine : public TQFrame { Q_OBJECT + TQ_OBJECT public: MeetingLine(bool isOwner, bool readerIsServer, bool serverLine, - TQWidget *parent, const char *name = 0); + TQWidget *tqparent, const char *name = 0); MeetingCheckBox::Type type() const { return tcb->type(); } void setType(MeetingCheckBox::Type type) { tcb->setType(type); } @@ -48,15 +49,16 @@ class MeetingLine : public QFrame TQLineEdit *qle; }; -class PlayerLine : public QFrame +class PlayerLine : public TQFrame { Q_OBJECT + TQ_OBJECT public: PlayerLine(PlayerComboBox::Type type, const TQString &txt, bool humanSetting, bool AISetting, bool canBeEmpty, bool acceptAI, - TQWidget *parent = 0, const char *name = 0); + TQWidget *tqparent = 0, const char *name = 0); PlayerComboBox::Type type() const { return pcb->type(); } TQString name() const { return edit->text(); } @@ -78,18 +80,19 @@ class PlayerLine : public QFrame }; /** Internal class : scrolable list of widgets. */ -class GWidgetList : public QWidget +class GWidgetList : public TQWidget { Q_OBJECT + TQ_OBJECT public: - GWidgetList(uint interval, TQWidget *parent = 0, const char * name = 0); + GWidgetList(uint interval, TQWidget *tqparent = 0, const char * name = 0); void remove(uint i); uint size() const { return widgets.count(); } protected: - /** The widget must be created with this widget as parent. */ + /** The widget must be created with this widget as tqparent. */ void append(TQWidget *); TQWidget *widget(uint i) { return widgets.at(i); } @@ -102,8 +105,8 @@ template class WidgetList : public GWidgetList { public: - WidgetList(uint interval, TQWidget *parent=0, const char *name=0) - : GWidgetList(interval, parent, name) {} + WidgetList(uint interval, TQWidget *tqparent=0, const char *name=0) + : GWidgetList(interval, tqparent, name) {} void append(Type *w) { GWidgetList::append(w); } Type *widget(uint i) { return (Type *)GWidgetList::widget(i); } diff --git a/libksirtet/lib/smanager.cpp b/libksirtet/lib/smanager.cpp index f6588546..ba2afd89 100644 --- a/libksirtet/lib/smanager.cpp +++ b/libksirtet/lib/smanager.cpp @@ -31,7 +31,7 @@ void SocketManager::clean() sockets.resize(0); } -int SocketManager::find(int fd) +int SocketManager::tqfind(int fd) { for(uint i=0; ifd()==fd ) return i; @@ -44,7 +44,7 @@ uint SocketManager::append(Socket *socket, SocketProperty sp) sockets.resize(s+1); sockets[s] = socket; - max_fd = QMAX(max_fd, socket->fd()); + max_fd = TQMAX(max_fd, socket->fd()); if ( sp==ReadWrite || sp==ReadOnly ) FD_SET(socket->fd(), &read_set); if ( sp==ReadWrite || sp==WriteOnly ) { @@ -65,7 +65,7 @@ void SocketManager::remove(uint i, bool del) max_fd = 0; for(uint j=0; jfd()); + max_fd = TQMAX(max_fd, sockets[j]->fd()); int fd = so->fd(); if ( FD_ISSET(fd, &read_set) ) FD_CLR(fd, &read_set); diff --git a/libksirtet/lib/smanager.h b/libksirtet/lib/smanager.h index 59dd0edb..8541934e 100644 --- a/libksirtet/lib/smanager.h +++ b/libksirtet/lib/smanager.h @@ -40,7 +40,7 @@ class SocketManager Socket *operator [](uint i) { return sockets[i]; } /** @return the index of the socket (-1 if not present). */ - int find(int fd); + int tqfind(int fd); /** * Append a socket at the end of the array of sockets. diff --git a/libksirtet/lib/socket.cpp b/libksirtet/lib/socket.cpp index 6defc94b..7dd74f74 100644 --- a/libksirtet/lib/socket.cpp +++ b/libksirtet/lib/socket.cpp @@ -21,13 +21,13 @@ #endif Socket::Socket(KExtendedSocket *s, bool createNotifier, - TQObject *parent, const char *name) + TQObject *tqparent, const char *name) : _socket(s), _notifier(0) { Q_ASSERT(s); if (createNotifier) { _notifier = new TQSocketNotifier(s->fd(), TQSocketNotifier::Read, - parent, name); + tqparent, name); _notifier->setEnabled(FALSE); } } diff --git a/libksirtet/lib/socket.h b/libksirtet/lib/socket.h index 01dac726..75538670 100644 --- a/libksirtet/lib/socket.h +++ b/libksirtet/lib/socket.h @@ -12,7 +12,7 @@ class Socket { public: Socket(KExtendedSocket *, bool createNotifier = FALSE, - TQObject *parent = 0, const char *name = 0); + TQObject *tqparent = 0, const char *name = 0); /** close the socket */ ~Socket(); diff --git a/libksirtet/lib/types.cpp b/libksirtet/lib/types.cpp index ad3dbc9b..86f7bfba 100644 --- a/libksirtet/lib/types.cpp +++ b/libksirtet/lib/types.cpp @@ -20,30 +20,30 @@ TQString cId::errorMessage(const cId &id) const TQString str = i18n("\nServer: \"%1\"\nClient: \"%2\""); switch (state) { - case Accepted: return TQString::null; + case Accepted: return TQString(); case LibIdClash: return i18n("The MultiPlayer library of the server is incompatible") - + str.arg(libId).arg(id.libId); + + str.tqarg(libId).tqarg(id.libId); case GameNameClash: return i18n("Trying to connect a server for another game type") - + str.arg(gameName).arg(id.gameName); + + str.tqarg(gameName).tqarg(id.gameName); case GameIdClash: return i18n("The server game version is incompatible") - + str.arg(gameId).arg(id.gameId); + + str.tqarg(gameId).tqarg(id.gameId); } Q_ASSERT(0); - return TQString::null; + return TQString(); } TQDataStream &operator << (TQDataStream &s, const cId &id) { - s << id.libId << id.gameName << id.gameId << (Q_UINT8)id.state; + s << id.libId << id.gameName << id.gameId << (TQ_UINT8)id.state; return s; } TQDataStream &operator >> (TQDataStream &s, cId &id) { - Q_UINT8 state; + TQ_UINT8 state; s >> id.libId >> id.gameName >> id.gameId >> state; id.state = (cId::State)state; return s; @@ -52,13 +52,13 @@ TQDataStream &operator >> (TQDataStream &s, cId &id) //----------------------------------------------------------------------------- TQDataStream &operator << (TQDataStream &s, const MeetingMsgFlag &f) { - s << (Q_UINT8)f; + s << (TQ_UINT8)f; return s; } TQDataStream &operator >> (TQDataStream &s, MeetingMsgFlag &f) { - Q_UINT8 i; + TQ_UINT8 i; s >> i; f = (MeetingMsgFlag)i; return s; } @@ -66,13 +66,13 @@ TQDataStream &operator >> (TQDataStream &s, MeetingMsgFlag &f) //----------------------------------------------------------------------------- TQDataStream &operator << (TQDataStream &s, const TextInfo &ti) { - s << (Q_UINT32)ti.i << ti.text; + s << (TQ_UINT32)ti.i << ti.text; return s; } TQDataStream &operator >> (TQDataStream &s, TextInfo &ti) { - Q_UINT32 i; + TQ_UINT32 i; s >> i >> ti.text; ti.i = i; return s; } @@ -80,13 +80,13 @@ TQDataStream &operator >> (TQDataStream &s, TextInfo &ti) //----------------------------------------------------------------------------- TQDataStream &operator << (TQDataStream &s, const MeetingCheckBox::Type &t) { - s << (Q_UINT8)t; + s << (TQ_UINT8)t; return s; } TQDataStream &operator >> (TQDataStream &s, MeetingCheckBox::Type &t) { - Q_UINT8 i; + TQ_UINT8 i; s >> i; t = (MeetingCheckBox::Type)i; return s; } @@ -94,13 +94,13 @@ TQDataStream &operator >> (TQDataStream &s, MeetingCheckBox::Type &t) //----------------------------------------------------------------------------- TQDataStream &operator << (TQDataStream &s, const TypeInfo &ti) { - s << (Q_UINT32)ti.i << ti.type; + s << (TQ_UINT32)ti.i << ti.type; return s; } TQDataStream &operator >> (TQDataStream &s, TypeInfo &ti) { - Q_UINT32 i; + TQ_UINT32 i; s >> i >> ti.type; ti.i = i; return s; } @@ -108,13 +108,13 @@ TQDataStream &operator >> (TQDataStream &s, TypeInfo &ti) //----------------------------------------------------------------------------- TQDataStream &operator << (TQDataStream &s, const BoardData &bd) { - s << (Q_UINT8)bd.type << bd.name; + s << (TQ_UINT8)bd.type << bd.name; return s; } TQDataStream &operator >> (TQDataStream &s, BoardData &bd) { - Q_UINT8 i; + TQ_UINT8 i; s >> i >> bd.name; bd.type = (PlayerComboBox::Type)i; return s; @@ -136,13 +136,14 @@ TQDataStream &operator >> (TQDataStream &s, ExtData &ed) //----------------------------------------------------------------------------- TQDataStream &operator << (TQDataStream &s, const MeetingLineData &pld) { - s << pld.ed << (Q_UINT8)pld.own; + s << pld.ed; + s << (TQ_UINT8)pld.own; return s; } TQDataStream &operator >> (TQDataStream &s, MeetingLineData &pld) { - Q_UINT8 b; + TQ_UINT8 b; s >> pld.ed >> b; pld.own = b; return s; } @@ -150,13 +151,13 @@ TQDataStream &operator >> (TQDataStream &s, MeetingLineData &pld) //----------------------------------------------------------------------------- TQDataStream &operator << (TQDataStream &s, const MetaFlag &f) { - s << (Q_UINT8)f; + s << (TQ_UINT8)f; return s; } TQDataStream &operator >> (TQDataStream &s, MetaFlag &f) { - Q_UINT8 i; + TQ_UINT8 i; s >> i; f = (MetaFlag)i; return s; } @@ -168,25 +169,25 @@ Stream::Stream(int _mode) { setDevice(&buf); Q_ASSERT( _mode==IO_ReadOnly || _mode==IO_WriteOnly ); - buf.open(_mode); + buf.open((TQIODevice_OpenModeFlag)_mode); } void Stream::clear() { buf.close(); - buf.open(mode | IO_Truncate); + buf.open((TQIODevice_OpenModeFlag)(mode | IO_Truncate)); } void Stream::setArray(TQByteArray a) { buf.close(); buf.setBuffer(a); - buf.open(mode); + buf.open((TQIODevice_OpenModeFlag)mode); } bool ReadingStream::readOk() { - return ( buf.status()==IO_Ok ); + return ( TQT_TQIODEVICE(&buf)->status()==IO_Ok ); } void ReadingStream::clearRead() diff --git a/libksirtet/lib/types.h b/libksirtet/lib/types.h index ee5867fa..3e294073 100644 --- a/libksirtet/lib/types.h +++ b/libksirtet/lib/types.h @@ -126,7 +126,7 @@ TQDataStream &operator << (TQDataStream &s, const MetaFlag &f); TQDataStream &operator >> (TQDataStream &s, MetaFlag &f); /** Internal class : encapsulate read/write TQBuffer. */ -class Stream : public QDataStream +class Stream : public TQDataStream { public: Stream(int mode); @@ -134,8 +134,8 @@ class Stream : public QDataStream void clear(); void setArray(TQByteArray a); - TQByteArray buffer() const { return buf.buffer(); } - uint size() const { return buf.buffer().size(); } + TQByteArray buffer() /*const*/ { return buf.buffer(); } + uint size() /*const*/ { return buf.buffer().size(); } protected: TQBuffer buf; diff --git a/libksirtet/lib/wizard.cpp b/libksirtet/lib/wizard.cpp index 19d9de34..a059cfa2 100644 --- a/libksirtet/lib/wizard.cpp +++ b/libksirtet/lib/wizard.cpp @@ -32,8 +32,8 @@ #define MAX_USER_PORT 65535 MPWizard::MPWizard(const MPGameInfo &gi, ConnectionData &_cd, - TQWidget *parent, const char *name) -: KWizard(parent, name, TRUE), cd(_cd) + TQWidget *tqparent, const char *name) +: KWizard(tqparent, name, TRUE), cd(_cd) { // setupTypePage(); // #### REMOVE NETWORK GAMES UNTIL FIXED type = Local; @@ -81,10 +81,10 @@ void MPWizard::setupLocalPage(const MPGameInfo &gi) localPage->setMargin(KDialogBase::marginHint()); wl = new WidgetList(5, localPage); - TQSignalMapper *husm = new TQSignalMapper(this); + TQSignalMapper *husm = new TQSignalMapper(TQT_TQOBJECT(this)); if (gi.humanSettingSlot) connect(husm, TQT_SIGNAL(mapped(int)), gi.humanSettingSlot); - TQSignalMapper *aism = new TQSignalMapper(this); + TQSignalMapper *aism = new TQSignalMapper(TQT_TQOBJECT(this)); if (gi.AISettingSlot) connect(aism, TQT_SIGNAL(mapped(int)), gi.AISettingSlot); KConfigGroupSaver cg(kapp->config(), MP_GROUP); @@ -94,17 +94,17 @@ void MPWizard::setupLocalPage(const MPGameInfo &gi) Q_ASSERT( gi.maxNbLocalPlayers>0 ); for (uint i=0; ireadNumEntry(TQString(MP_PLAYER_TYPE).arg(i), + cg.config()->readNumEntry(TQString(MP_PLAYER_TYPE).tqarg(i), (i==0 ? PlayerComboBox::Human : PlayerComboBox::None)); - n = cg.config()->readEntry(TQString(MP_PLAYER_NAME).arg(i), - i18n("Player #%1").arg(i)); + n = cg.config()->readEntry(TQString(MP_PLAYER_NAME).tqarg(i), + i18n("Player #%1").tqarg(i)); pl = new PlayerLine(type, n, gi.humanSettingSlot, gi.AISettingSlot, i!=0, gi.AIAllowed, wl); connect(pl, TQT_SIGNAL(typeChanged(int)), TQT_SLOT(lineTypeChanged(int))); - husm->setMapping(pl, i); + husm->setMapping(TQT_TQOBJECT(pl), i); connect(pl, TQT_SIGNAL(setHuman()), husm, TQT_SLOT(map())); - aism->setMapping(pl, i); + aism->setMapping(TQT_TQOBJECT(pl), i); connect(pl, TQT_SIGNAL(setAI()), aism, TQT_SLOT(map())); wl->append(pl); } @@ -122,7 +122,7 @@ void MPWizard::setupLocalPage(const MPGameInfo &gi) TQString MPWizard::name(uint i) const { TQString s = wl->widget(i)->name(); - if ( s.length()==0 ) s = i18n("Player #%1").arg(i); + if ( s.length()==0 ) s = i18n("Player #%1").tqarg(i); return s; } @@ -177,7 +177,7 @@ void MPWizard::accept() // do lookup int res = socket->lookup(); if ( checkSocket(res, socket, i18n("Error looking up for \"%1\"") - .arg(host), this) ) { + .tqarg(host), this) ) { delete socket; return; } @@ -206,9 +206,9 @@ void MPWizard::accept() cg.config()->writeEntry(MP_GAMETYPE, (int)type); for (uint i=0; isize(); i++) { - cg.config()->writeEntry(TQString(MP_PLAYER_TYPE).arg(i), + cg.config()->writeEntry(TQString(MP_PLAYER_TYPE).tqarg(i), (int)wl->widget(i)->type()); - cg.config()->writeEntry(TQString(MP_PLAYER_NAME).arg(i), name(i)); + cg.config()->writeEntry(TQString(MP_PLAYER_NAME).tqarg(i), name(i)); } KWizard::accept(); diff --git a/libksirtet/lib/wizard.h b/libksirtet/lib/wizard.h index fd90a3b8..42623ec7 100644 --- a/libksirtet/lib/wizard.h +++ b/libksirtet/lib/wizard.h @@ -19,10 +19,11 @@ class ConnectionData; class MPWizard : public KWizard { Q_OBJECT + TQ_OBJECT public: MPWizard(const MPGameInfo &gi, ConnectionData &cd, - TQWidget *parent = 0, const char *name = 0); + TQWidget *tqparent = 0, const char *name = 0); void showPage(TQWidget *page); diff --git a/lskat/lskat/KChildConnect.cpp b/lskat/lskat/KChildConnect.cpp index 35ac9408..f74fd10b 100644 --- a/lskat/lskat/KChildConnect.cpp +++ b/lskat/lskat/KChildConnect.cpp @@ -30,7 +30,7 @@ KChildConnect::~KChildConnect() { } -KR_STATUS KChildConnect::QueryStatus() +KR_STATUS KChildConnect::QuerytqStatus() { return KR_OK; } @@ -57,7 +57,7 @@ bool KChildConnect::SendMsg(KEMessage *msg) return Send(sendstring); } -// Send string to parent +// Send string to tqparent bool KChildConnect::Send(TQString str) { if (!str || str.length()<1) return true; // no need to send crap @@ -75,7 +75,7 @@ void KChildConnect::Receive(TQString input) // Call us recursive until there are no CR left len=KEMESSAGE_CR.length(); - pos=input.find(KEMESSAGE_CR); + pos=input.tqfind(KEMESSAGE_CR); if (pos>0) { tmp=input.left(pos); diff --git a/lskat/lskat/KChildConnect.h b/lskat/lskat/KChildConnect.h index b8e48fcd..99ab31b0 100644 --- a/lskat/lskat/KChildConnect.h +++ b/lskat/lskat/KChildConnect.h @@ -22,9 +22,10 @@ #include "KEMessage.h" -class KChildConnect: public QObject +class KChildConnect: public TQObject { Q_OBJECT + TQ_OBJECT protected: TQStrList inputcache; @@ -41,7 +42,7 @@ class KChildConnect: public QObject virtual bool SendMsg(KEMessage *msg); virtual bool Send(TQString str); - virtual KR_STATUS QueryStatus(); + virtual KR_STATUS QuerytqStatus(); public slots: diff --git a/lskat/lskat/KConnectEntry.cpp b/lskat/lskat/KConnectEntry.cpp index 870b8cd2..ed926d6d 100644 --- a/lskat/lskat/KConnectEntry.cpp +++ b/lskat/lskat/KConnectEntry.cpp @@ -55,18 +55,18 @@ KInteractiveConnect *KConnectEntry::QueryInteractiveConnect() return connect.i; } -KR_STATUS KConnectEntry::QueryStatus() +KR_STATUS KConnectEntry::QuerytqStatus() { switch(type) { case KG_INPUTTYPE_INTERACTIVE: - return connect.i->QueryStatus(); + return connect.i->QuerytqStatus(); break; case KG_INPUTTYPE_REMOTE: - return connect.r->QueryStatus(); + return connect.r->QuerytqStatus(); break; case KG_INPUTTYPE_PROCESS: - return connect.p->QueryStatus(); + return connect.p->QuerytqStatus(); break; default: return KR_INVALID; diff --git a/lskat/lskat/KConnectEntry.h b/lskat/lskat/KConnectEntry.h index 73619eac..16df7924 100644 --- a/lskat/lskat/KConnectEntry.h +++ b/lskat/lskat/KConnectEntry.h @@ -50,7 +50,7 @@ class KConnectEntry KConnectEntry &operator=(KConnectEntry &entry); bool Exit(); bool Init(KG_INPUTTYPE stype,int id=0,KEMessage *msg=0); - KR_STATUS QueryStatus(); + KR_STATUS QuerytqStatus(); bool SendMsg(KEMessage *msg); }; #endif diff --git a/lskat/lskat/KEInput.cpp b/lskat/lskat/KEInput.cpp index 091bf4e1..ea2def79 100644 --- a/lskat/lskat/KEInput.cpp +++ b/lskat/lskat/KEInput.cpp @@ -22,8 +22,8 @@ #include "KEInput.moc" -KEInput::KEInput(TQObject * parent) - : TQObject(parent,0) +KEInput::KEInput(TQObject * tqparent) + : TQObject(tqparent,0) { number_of_inputs=0; locked=FALSE; @@ -85,14 +85,14 @@ KG_INPUTTYPE KEInput::QueryType(int no) return playerArray[no].QueryType(); } -KR_STATUS KEInput::QueryStatus(int no) +KR_STATUS KEInput::QuerytqStatus(int no) { if (no==-1) no=QueryNext(); if (no>=number_of_inputs || no<0) { return KR_INVALID; } - return playerArray[no].QueryStatus(); + return playerArray[no].QuerytqStatus(); } bool KEInput::SendMsg(KEMessage *msg,int no) { @@ -122,7 +122,7 @@ bool KEInput::SetInputDevice(int no, KG_INPUTTYPE type,KEMessage *msg) result=playerArray[no].Init(type,no,msg); // if (result) // Connect even if remote connection is not yet build - if (result || playerArray[no].QueryStatus()==KR_WAIT_FOR_CLIENT) + if (result || playerArray[no].QuerytqStatus()==KR_WAIT_FOR_CLIENT) { switch(QueryType(no)) { diff --git a/lskat/lskat/KEInput.h b/lskat/lskat/KEInput.h index 4e83f36a..0a599e9a 100644 --- a/lskat/lskat/KEInput.h +++ b/lskat/lskat/KEInput.h @@ -29,9 +29,10 @@ #include "KConnectTypes.h" -class KEInput : public QObject +class KEInput : public TQObject { Q_OBJECT + TQ_OBJECT private: int number_of_inputs; @@ -46,7 +47,7 @@ class KEInput : public QObject TQMemArray playerArray; public: - KEInput(TQObject * parent=0); + KEInput(TQObject * tqparent=0); ~KEInput(); int QueryNumberOfInputs(); int QueryNext(); @@ -55,7 +56,7 @@ class KEInput : public QObject bool IsRemote(int no=-1); int QueryPrevious(); KG_INPUTTYPE QueryType(int no=-1); - KR_STATUS QueryStatus(int no=-1); + KR_STATUS QuerytqStatus(int no=-1); bool IsInput(int no); bool SetInputDevice(int no, KG_INPUTTYPE type, KEMessage *msg=0); bool RemoveInput(int no); diff --git a/lskat/lskat/KEMessage.cpp b/lskat/lskat/KEMessage.cpp index 38cd2e8d..43ae9312 100644 --- a/lskat/lskat/KEMessage.cpp +++ b/lskat/lskat/KEMessage.cpp @@ -61,7 +61,7 @@ void KEMessage::AddData(TQString key, const char *data,int size) KGM_TYPE KEMessage::QueryType(TQString key) { KMessageEntry *entry; - entry=dict.find(key); + entry=dict.tqfind(key); if (!entry) return (KGM_TYPE)0; return entry->QueryType(); } @@ -69,7 +69,7 @@ KGM_TYPE KEMessage::QueryType(TQString key) bool KEMessage::HasKey(TQString key) { KMessageEntry *entry; - entry=dict.find(key); + entry=dict.tqfind(key); if (!entry) return false; return true; } @@ -78,7 +78,7 @@ bool KEMessage::GetData(TQString key,short &s) { short *result; KMessageEntry *entry; - entry=dict.find(key); + entry=dict.tqfind(key); if (!entry) return false; if (entry->QueryType()!=KGM_TYPE_SHORT) return false; // printf("GetShortData: %p for %s\n",entry->QueryData(),(char *)key); @@ -91,7 +91,7 @@ bool KEMessage::GetData(TQString key,long &l) { long *result; KMessageEntry *entry; - entry=dict.find(key); + entry=dict.tqfind(key); if (!entry) return false; if (entry->QueryType()!=KGM_TYPE_LONG) return false; result=(long *)entry->QueryData(); @@ -103,7 +103,7 @@ bool KEMessage::GetData(TQString key,float &f) { float *result; KMessageEntry *entry; - entry=dict.find(key); + entry=dict.tqfind(key); if (!entry) return false; if (entry->QueryType()!=KGM_TYPE_FLOAT) return false; // printf("GetFloatData: %p for %s\n",entry->QueryData(),(char *)key); @@ -115,7 +115,7 @@ bool KEMessage::GetData(TQString key,float &f) bool KEMessage::GetData(TQString key,char * &c,int &size) { KMessageEntry *entry; - entry=dict.find(key); + entry=dict.tqfind(key); if (!entry) return false; if (entry->QueryType()!=KGM_TYPE_DATA) return false; c=entry->QueryData(); @@ -179,19 +179,19 @@ TQString KEMessage::StringToEntry(TQString str,KMessageEntry *entry) len=KEMESSAGE_SEP.length(); if (!entry) return TQString(); - pos=str.find(KEMESSAGE_SEP,0); + pos=str.tqfind(KEMESSAGE_SEP,0); if (pos<0) return TQString(); // wrong format key=str.left(pos); oldpos=pos; - pos=str.find(KEMESSAGE_SEP,oldpos+len); + pos=str.tqfind(KEMESSAGE_SEP,oldpos+len); if (pos<0) return TQString(); // wrong format size=str.mid(oldpos+len,pos-oldpos-len); oldpos=pos; - pos=str.find(KEMESSAGE_SEP,oldpos+len); + pos=str.tqfind(KEMESSAGE_SEP,oldpos+len); if (pos<0) return TQString(); // wrong format type=str.mid(oldpos+len,pos-oldpos-len); @@ -202,7 +202,7 @@ TQString KEMessage::StringToEntry(TQString str,KMessageEntry *entry) cnt=size.toInt(); entry->SetType((KGM_TYPE)type.toInt()); - // I hope this works with unicode strings as well + // I hope this works with tqunicode strings as well p=data.latin1(); q=(char *)calloc(data.length()/2,sizeof(char)); if (!q) return TQString(); @@ -226,7 +226,7 @@ TQString KEMessage::ToString() s=KEMESSAGE_HEAD+KEMESSAGE_CR; for (it=keys.first();it!=0;it=keys.next()) { - entry=dict.find(TQCString(it)); + entry=dict.tqfind(TQCString(it)); s+=EntryToString(it,entry); } s+=KEMESSAGE_TAIL+KEMESSAGE_CR; @@ -251,14 +251,14 @@ bool KEMessage::AddStringMsg(TQString str) len=KEMESSAGE_CR.length(); - pos=str.find(KEMESSAGE_CR); + pos=str.tqfind(KEMESSAGE_CR); if (pos<0) return false; // wrong format if (str.left(pos)!=(KEMESSAGE_HEAD)) return false; // wrong message do { oldpos=pos; - pos=str.find(KEMESSAGE_CR,oldpos+len); + pos=str.tqfind(KEMESSAGE_CR,oldpos+len); if (pos<0) return false; // wrong format data=str.mid(oldpos+len,pos-oldpos-len); if (data!=(KEMESSAGE_TAIL)) @@ -315,7 +315,7 @@ KEMessage &KEMessage::operator=(KEMessage &msg) // printf("Assigning = KEMessage from %p to %p\n",&msg,this); for (it=msg.keys.first();it!=0;it=msg.keys.next()) { - entry=msg.dict.find(TQCString(it)); + entry=msg.dict.tqfind(TQCString(it)); newentry=new KMessageEntry; *newentry=*entry; AddEntry(TQCString(it),newentry); diff --git a/lskat/lskat/KInputChildProcess.cpp b/lskat/lskat/KInputChildProcess.cpp index bd78235c..5ba87e96 100644 --- a/lskat/lskat/KInputChildProcess.cpp +++ b/lskat/lskat/KInputChildProcess.cpp @@ -55,7 +55,7 @@ bool KInputChildProcess::exec() s=inputbuffer+s; // printf("ChildABC '%s'\n",(const char *)s); // fflush(stdout); - pos=s.findRev(KEMESSAGE_CR); + pos=s.tqfindRev(KEMESSAGE_CR); if (pos<0) { inputbuffer=s; diff --git a/lskat/lskat/KInputChildProcess.h b/lskat/lskat/KInputChildProcess.h index 2f964e71..14201922 100644 --- a/lskat/lskat/KInputChildProcess.h +++ b/lskat/lskat/KInputChildProcess.h @@ -22,9 +22,10 @@ #include "KChildConnect.h" -class KInputChildProcess : public QObject +class KInputChildProcess : public TQObject { Q_OBJECT + TQ_OBJECT private: char *buffer; diff --git a/lskat/lskat/KInteractiveConnect.h b/lskat/lskat/KInteractiveConnect.h index 1585f60f..5c01d6bd 100644 --- a/lskat/lskat/KInteractiveConnect.h +++ b/lskat/lskat/KInteractiveConnect.h @@ -23,6 +23,7 @@ class KInteractiveConnect:public KChildConnect { Q_OBJECT + TQ_OBJECT public: KInteractiveConnect(); diff --git a/lskat/lskat/KProcessConnect.cpp b/lskat/lskat/KProcessConnect.cpp index 97cd9221..b3117c18 100644 --- a/lskat/lskat/KProcessConnect.cpp +++ b/lskat/lskat/KProcessConnect.cpp @@ -115,7 +115,7 @@ void KProcessConnect::slotReceivedStdout(KProcess *, char *buffer, int buflen) } // Append old unresolved input s=inputbuffer+s; - pos=s.findRev(KEMESSAGE_CR); + pos=s.tqfindRev(KEMESSAGE_CR); // printf("String '%s' pos=%d len=%d\n",(const char *)s,pos,s.length()); if (pos<0) { diff --git a/lskat/lskat/KProcessConnect.h b/lskat/lskat/KProcessConnect.h index 0e7b491a..38a68fa9 100644 --- a/lskat/lskat/KProcessConnect.h +++ b/lskat/lskat/KProcessConnect.h @@ -27,6 +27,7 @@ class KProcessConnect: public KChildConnect { Q_OBJECT + TQ_OBJECT private: KProcess *process; diff --git a/lskat/lskat/KRSocket.h b/lskat/lskat/KRSocket.h index faf1c975..c139a1b1 100644 --- a/lskat/lskat/KRSocket.h +++ b/lskat/lskat/KRSocket.h @@ -70,9 +70,10 @@ class KRServerSocketPrivate; * @version $Id$ * @short Monitor a port for incoming TCP/IP connections. */ -class KRServerSocket : public QObject +class KRServerSocket : public TQObject { Q_OBJECT + TQ_OBJECT public: /** * Constructor. diff --git a/lskat/lskat/KRemoteConnect.cpp b/lskat/lskat/KRemoteConnect.cpp index 315d2a96..a84ab9dc 100644 --- a/lskat/lskat/KRemoteConnect.cpp +++ b/lskat/lskat/KRemoteConnect.cpp @@ -63,7 +63,7 @@ KRemoteConnect::~KRemoteConnect() printf("DESTGRUCTING KRemoteConenct\n"); } -KR_STATUS KRemoteConnect::QueryStatus() +KR_STATUS KRemoteConnect::QuerytqStatus() { return socketStatus; } @@ -267,7 +267,7 @@ void KRemoteConnect::socketRead(KSocket *sock) // Append old unresolved input s=inputbuffer+s; - pos=s.findRev(KEMESSAGE_CR); + pos=s.tqfindRev(KEMESSAGE_CR); // printf("String '%s' pos=%d len=%d\n",(const char *)s,pos,s.length()); if (pos<0) { diff --git a/lskat/lskat/KRemoteConnect.h b/lskat/lskat/KRemoteConnect.h index 99f9280d..5669b330 100644 --- a/lskat/lskat/KRemoteConnect.h +++ b/lskat/lskat/KRemoteConnect.h @@ -29,6 +29,7 @@ class KRemoteConnect: public KChildConnect { Q_OBJECT + TQ_OBJECT protected: KRServerSocket *kServerSocket; @@ -53,7 +54,7 @@ class KRemoteConnect: public KChildConnect // bool SendMsg(KEMessage *msg); virtual bool Send(TQString str); // void Receive(TQString input); - virtual KR_STATUS QueryStatus(); + virtual KR_STATUS QuerytqStatus(); protected: bool OfferServerSocket(); diff --git a/lskat/lskat/lskat.cpp b/lskat/lskat/lskat.cpp index 41309afd..c6f21ff1 100644 --- a/lskat/lskat/lskat.cpp +++ b/lskat/lskat/lskat.cpp @@ -50,7 +50,7 @@ LSkatApp::LSkatApp() : KMainWindow(0) config=kapp->config(); // localise data file - TQString file=TQString::fromLatin1("lskat/grafix/t1.png"); + TQString file=TQString::tqfromLatin1("lskat/grafix/t1.png"); mGrafix=kapp->dirs()->findResourceDir("data", file); if (mGrafix.isNull()) mGrafix = TQCString("grafix/"); else mGrafix+=TQCString("lskat/grafix/"); @@ -63,7 +63,7 @@ LSkatApp::LSkatApp() : KMainWindow(0) initStatusBar(); setupGUI(KMainWindow::StatusBar | Save); - createGUI(TQString::null, false); + createGUI(TQString(), false); initDocument(); initView(); @@ -73,7 +73,7 @@ LSkatApp::LSkatApp() : KMainWindow(0) // Needs to be after readOptions as we read in default paths doc->LoadGrafix(mGrafix); - mInput=new KEInput(this); + mInput=new KEInput(TQT_TQOBJECT(this)); doc->SetInputHandler(mInput); connect(mInput,TQT_SIGNAL(signalPrepareProcessMove(KEMessage *)), this,TQT_SLOT(slotPrepareProcessMove(KEMessage *))); @@ -158,26 +158,26 @@ void LSkatApp::initGUI() { TQStringList list; - (void)KStdAction::openNew(this, TQT_SLOT(slotFileNew()), actionCollection(), "new_game"); + (void)KStdAction::openNew(TQT_TQOBJECT(this), TQT_SLOT(slotFileNew()), actionCollection(), "new_game"); ACTION("new_game")->setStatusText(i18n("Starting a new game...")); ACTION("new_game")->setWhatsThis(i18n("Starting a new game...")); - (void)new KAction(i18n("&End Game"),"stop", 0, this, TQT_SLOT(slotFileEnd()), + (void)new KAction(i18n("&End Game"),"stop", 0, TQT_TQOBJECT(this), TQT_SLOT(slotFileEnd()), actionCollection(), "end_game"); ACTION("end_game")->setStatusText(i18n("Ending the current game...")); ACTION("end_game")->setWhatsThis(i18n("Aborts a currently played game. No winner will be declared.")); - (void)new KAction(i18n("&Clear Statistics"),"flag", 0, this, TQT_SLOT(slotFileStatistics()), + (void)new KAction(i18n("&Clear Statistics"),"flag", 0, TQT_TQOBJECT(this), TQT_SLOT(slotFileStatistics()), actionCollection(), "clear_statistics"); ACTION("clear_statistics")->setStatusText(i18n("Delete all time statistics...")); ACTION("clear_statistics")->setWhatsThis(i18n("Clears the all time statistics which is kept in all sessions.")); - (void)new KAction(i18n("Send &Message..."), CTRL+Key_M, this, TQT_SLOT(slotFileMessage()), + (void)new KAction(i18n("Send &Message..."), CTRL+Key_M, TQT_TQOBJECT(this), TQT_SLOT(slotFileMessage()), actionCollection(), "send_message"); ACTION("send_message")->setStatusText(i18n("Sending message to remote player...")); ACTION("send_message")->setWhatsThis(i18n("Allows you to talk with a remote player.")); - (void)KStdAction::quit(this, TQT_SLOT(slotFileQuit()), actionCollection(), "game_exit"); + (void)KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT(slotFileQuit()), actionCollection(), "game_exit"); ACTION("game_exit")->setStatusText(i18n("Exiting...")); ACTION("game_exit")->setWhatsThis(i18n("Quits the program.")); - (void)new KSelectAction(i18n("Starting Player"),0,this,TQT_SLOT(slotStartplayer()), + (void)new KSelectAction(i18n("Starting Player"),0,TQT_TQOBJECT(this),TQT_SLOT(slotStartplayer()), actionCollection(), "startplayer"); ACTION("startplayer")->setStatusText(i18n("Changing starting player...")); ACTION("startplayer")->setWhatsThis(i18n("Chooses which player begins the next game.")); @@ -186,7 +186,7 @@ void LSkatApp::initGUI() list.append(i18n("Player &2")); ((KSelectAction *)ACTION("startplayer"))->setItems(list); - (void)new KSelectAction(i18n("Player &1 Played By"),0,this,TQT_SLOT(slotPlayer1By()), + (void)new KSelectAction(i18n("Player &1 Played By"),0,TQT_TQOBJECT(this),TQT_SLOT(slotPlayer1By()), actionCollection(), "player1"); ACTION("player1")->setStatusText(i18n("Changing who plays player 1...")); ACTION("player1")->setWhatsThis(i18n("Changing who plays player 1...")); @@ -195,13 +195,13 @@ void LSkatApp::initGUI() list.append(i18n("&Computer")); list.append(i18n("&Remote")); ((KSelectAction *)ACTION("player1"))->setItems(list); - (void)new KSelectAction(i18n("Player &2 Played By"),0,this,TQT_SLOT(slotPlayer2By()), + (void)new KSelectAction(i18n("Player &2 Played By"),0,TQT_TQOBJECT(this),TQT_SLOT(slotPlayer2By()), actionCollection(), "player2"); ACTION("player1")->setStatusText(i18n("Changing who plays player 2...")); ACTION("player1")->setWhatsThis(i18n("Changing who plays player 2...")); ((KSelectAction *)ACTION("player2"))->setItems(list); - (void)new KSelectAction(i18n("&Level"),0,this,TQT_SLOT(slotLevel()), + (void)new KSelectAction(i18n("&Level"),0,TQT_TQOBJECT(this),TQT_SLOT(slotLevel()), actionCollection(), "choose_level"); ACTION("choose_level")->setStatusText(i18n("Change level...")); ACTION("choose_level")->setWhatsThis(i18n("Change the strength of the computer player.")); @@ -211,12 +211,12 @@ void LSkatApp::initGUI() list.append(i18n("&Hard")); ((KSelectAction *)ACTION("choose_level"))->setItems(list); - (void)new KAction(i18n("Select &Card Deck..."), 0, this, TQT_SLOT(slotOptionsCardDeck()), + (void)new KAction(i18n("Select &Card Deck..."), 0, TQT_TQOBJECT(this), TQT_SLOT(slotOptionsCardDeck()), actionCollection(), "select_carddeck"); ACTION("select_carddeck")->setStatusText(i18n("Configure card decks...")); ACTION("select_carddeck")->setWhatsThis(i18n("Choose how the cards should look.")); - (void)new KAction(i18n("Change &Names..."), 0, this, TQT_SLOT(slotOptionsNames()), + (void)new KAction(i18n("Change &Names..."), 0, TQT_TQOBJECT(this), TQT_SLOT(slotOptionsNames()), actionCollection(), "change_names"); ACTION("change_names")->setStatusText(i18n("Configure player names...")); ACTION("change_names")->setWhatsThis(i18n("Configure player names...")); @@ -243,7 +243,7 @@ void LSkatApp::initStatusBar() // computer move timer procTimer=new TQTimer(this); - connect(procTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(slotProcTimer())); + connect(procTimer,TQT_SIGNAL(timeout()),TQT_TQOBJECT(this),TQT_SLOT(slotProcTimer())); } void LSkatApp::initDocument() @@ -358,7 +358,7 @@ void LSkatApp::slotFileStatistics() message=i18n("Do you really want to clear the all time " "statistical data?"); - if (KMessageBox::Yes==KMessageBox::questionYesNo(this,message,TQString::null,KStdGuiItem::clear())) + if (KMessageBox::Yes==KMessageBox::questionYesNo(this,message,TQString(),KStdGuiItem::clear())) { doc->ClearStats(); doc->slotUpdateAllViews(0); @@ -587,7 +587,7 @@ void LSkatApp::slotStatusNames(){ if (!doc->IsRunning()) msg=i18n("No game running"); else { - msg=i18n("%1 to move...").arg(doc->GetName(doc->GetCurrentPlayer())); + msg=i18n("%1 to move...").tqarg(doc->GetName(doc->GetCurrentPlayer())); } slotStatusMover(msg); } @@ -625,14 +625,14 @@ void LSkatApp::NewGame() } // Connected 0 and we are server else if (mInput->QueryType(0)==KG_INPUTTYPE_REMOTE && - mInput->QueryStatus()>0 && doc->IsServer()) + mInput->QuerytqStatus()>0 && doc->IsServer()) { mInput->Unlock(); mInput->Next(doc->GetStartPlayer()); } // Connected 1 and we are server else if (mInput->QueryType(1)==KG_INPUTTYPE_REMOTE && - mInput->QueryStatus()>1 && doc->IsServer()) + mInput->QuerytqStatus()>1 && doc->IsServer()) { mInput->Unlock(); mInput->Next(doc->GetStartPlayer()); @@ -659,7 +659,7 @@ bool LSkatApp::MakeInputDevice(int no) msg=new KEMessage; PrepareGame(msg); // Build new connection - if ( mInput->QueryType(no)!=type || mInput->QueryStatus(no)<=0) + if ( mInput->QueryType(no)!=type || mInput->QuerytqStatus(no)<=0) { OptionsNetwork(); port=doc->QueryPort(); @@ -677,11 +677,11 @@ bool LSkatApp::MakeInputDevice(int no) tim=10000; if (!host.isEmpty()) { - s=i18n("Remote connection to %1:%2...").arg(host).arg(port); + s=i18n("Remote connection to %1:%2...").tqarg(host).tqarg(port); } else { - s=i18n("Offering remote connection on port %1...").arg(port); + s=i18n("Offering remote connection on port %1...").tqarg(port); } progress=new TQProgressDialog(s, i18n("Abort"), tim, this,0,true ); progress->setCaption(i18n("Lieutenant Skat")); @@ -689,7 +689,7 @@ bool LSkatApp::MakeInputDevice(int no) { progress->setProgress( j ); if ( progress->wasCancelled() ) break; - if (mInput->QueryStatus(no)>0) break; + if (mInput->QuerytqStatus(no)>0) break; usleep(100); } // progress.setProgress(tim); @@ -717,7 +717,7 @@ bool LSkatApp::MakeInputDevice(int no) } } delete msg; - if (mInput->QueryStatus(no)>0) + if (mInput->QuerytqStatus(no)>0) { res=true; } diff --git a/lskat/lskat/lskat.h b/lskat/lskat/lskat.h index e44f7e1b..cd20b841 100644 --- a/lskat/lskat/lskat.h +++ b/lskat/lskat/lskat.h @@ -23,7 +23,7 @@ #include #endif -// include files for Qt +// include files for TQt #include // include files for KDE @@ -69,6 +69,7 @@ class LSkatView; class LSkatApp : public KMainWindow { Q_OBJECT + TQ_OBJECT friend class LSkatView; diff --git a/lskat/lskat/lskatdoc.cpp b/lskat/lskat/lskatdoc.cpp index fd95f0c8..f8b955e5 100644 --- a/lskat/lskat/lskatdoc.cpp +++ b/lskat/lskat/lskatdoc.cpp @@ -15,7 +15,7 @@ * * ***************************************************************************/ -// include files for Qt +// include files for TQt #include #include #include @@ -36,7 +36,7 @@ TQPtrList *LSkatDoc::pViewList = 0L; -LSkatDoc::LSkatDoc(TQWidget *parent, const char *name) : TQObject(parent, name) +LSkatDoc::LSkatDoc(TQWidget *tqparent, const char *name) : TQObject(tqparent, name) { int i; if(!pViewList) @@ -135,7 +135,7 @@ void LSkatDoc::slotUpdateAllViews(LSkatView *sender) for(w=pViewList->first(); w!=0; w=pViewList->next()) { if(w!=sender) - w->repaint(); + w->tqrepaint(); } } } @@ -147,7 +147,7 @@ void LSkatDoc::UpdateViews(int mode) { for(w=pViewList->first(); w!=0; w=pViewList->next()) { - if (mode & UPDATE_STATUS) w->updateStatus(); + if (mode & UPDATE_STATUS) w->updatetqStatus(); } } } @@ -528,8 +528,8 @@ int LSkatDoc::WonMove(int c1,int c2) } -int LSkatDoc::GetMoveStatus() {return movestatus;} -void LSkatDoc::SetMoveStatus(int i) { movestatus=i; } +int LSkatDoc::GetMovetqStatus() {return movestatus;} +void LSkatDoc::SetMovetqStatus(int i) { movestatus=i; } int LSkatDoc::GetCurrentPlayer() {return currentplayer;} void LSkatDoc::SetCurrentPlayer(int i) {currentplayer=i;} int LSkatDoc::GetStartPlayer() {return startplayer;} diff --git a/lskat/lskat/lskatdoc.h b/lskat/lskat/lskatdoc.h index 8e62a27f..b9304baa 100644 --- a/lskat/lskat/lskatdoc.h +++ b/lskat/lskat/lskatdoc.h @@ -44,12 +44,13 @@ class LSkatView; * @author Source Framework Automatically Generated by KDevelop, (c) The KDevelop Team. * @version KDevelop version 0.4 code generation */ -class LSkatDoc : public QObject +class LSkatDoc : public TQObject { Q_OBJECT + TQ_OBJECT public: /** Constructor for the fileclass of the application */ - LSkatDoc(TQWidget *parent, const char *name=0); + LSkatDoc(TQWidget *tqparent, const char *name=0); /** Destructor for the fileclass of the application */ ~LSkatDoc(); @@ -96,8 +97,8 @@ class LSkatDoc : public QObject bool IsRunning(); CCOLOUR GetTrump(); void SetTrump(CCOLOUR i); - int GetMoveStatus(); - void SetMoveStatus(int i); + int GetMovetqStatus(); + void SetMovetqStatus(int i); int GetCurrentPlayer(); void SetCurrentPlayer(int i); int GetStartPlayer(); @@ -215,8 +216,8 @@ public: int cardvalues[14]; public slots: - /** calls repaint() on all views connected to the document object and is called by the view by which the document has been changed. - * As this view normally repaints itself, it is excluded from the paintEvent. + /** calls tqrepaint() on all views connected to the document object and is called by the view by which the document has been changed. + * As this view normally tqrepaints itself, it is excluded from the paintEvent. */ void slotUpdateAllViews(LSkatView *sender); diff --git a/lskat/lskat/lskatview.cpp b/lskat/lskat/lskatview.cpp index a338bc00..8603a662 100644 --- a/lskat/lskat/lskatview.cpp +++ b/lskat/lskat/lskatview.cpp @@ -15,7 +15,7 @@ * * ***************************************************************************/ -// include files for Qt +// include files for TQt #include #include #include @@ -104,7 +104,7 @@ #define MOVECOUNTER 20 // so many moves when playing card #define MOVE_TIMER_DELAY 7 // timer in milllisec default 7 -LSkatView::LSkatView(TQWidget *parent, const char *name) : TQWidget(parent, name) +LSkatView::LSkatView(TQWidget *tqparent, const char *name) : TQWidget(tqparent, name) { setBackgroundMode(PaletteBase); // setBackgroundMode(NoBackground); @@ -136,7 +136,7 @@ LSkatView::LSkatView(TQWidget *parent, const char *name) : TQWidget(parent, name // Access the document with the game data LSkatDoc *LSkatView::getDocument() const { - LSkatApp *theApp=(LSkatApp *) parentWidget(); + LSkatApp *theApp=(LSkatApp *) tqparentWidget(); return theApp->getDocument(); } @@ -206,7 +206,7 @@ void LSkatView::drawMove(TQPainter *p) int card; TQPoint point; - card=getDocument()->GetMoveStatus(); + card=getDocument()->GetMovetqStatus(); if (card>=0) { @@ -403,12 +403,12 @@ void LSkatView::drawFinal(TQPainter *p) TQRect brect1_3,brect2_3,brect3_3,brect4_3; TQRect brect1_4,brect2_4,brect3_4,brect4_4; - // Calculate geometry + // Calculate tqgeometry line1=i18n("Game over"); rect=p->window(); //rect1.moveBy(0,FINAL_Y0-24); p->setFont(font24); - brect1=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line1); + brect1=p->boundingRect(rect,TQt::AlignHCenter|TQt::SingleLine|TQt::AlignTop,line1); //TQRect wrect=p->window(); sumrect=brect1; @@ -418,7 +418,7 @@ void LSkatView::drawFinal(TQPainter *p) int hp=getDocument()->mPixTrump[trump].height()+5; rect=TQRect(0,hp>sumrect.height()?hp:sumrect.height(),p->window().width(),p->window().height()); p->setFont(font14); - brect2=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line2); + brect2=p->boundingRect(rect,TQt::AlignHCenter|TQt::SingleLine|TQt::AlignTop,line2); sumrect|=brect2; } else @@ -429,53 +429,53 @@ void LSkatView::drawFinal(TQPainter *p) } else if (sc0>sc1) { - line2=i18n("Player 1 - %1 won ").arg(getDocument()->GetName(0)); + line2=i18n("Player 1 - %1 won ").tqarg(getDocument()->GetName(0)); } else { - line2=i18n("Player 2 - %1 won ").arg(getDocument()->GetName(1)); + line2=i18n("Player 2 - %1 won ").tqarg(getDocument()->GetName(1)); } int hp=getDocument()->mPixTrump[trump].height()+5; rect=TQRect(0,hp>sumrect.height()?hp:sumrect.height(),p->window().width(),p->window().height()); p->setFont(font14); - brect2=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line2); + brect2=p->boundingRect(rect,TQt::AlignHCenter|TQt::SingleLine|TQt::AlignTop,line2); sumrect|=brect2; p->setFont(font14); col1_3=i18n("Score:"); col1_4=TQString(" "); rect=TQRect(0,0,p->window().width(),p->window().height()); - brect1_3=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col1_3); + brect1_3=p->boundingRect(rect,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop,col1_3); ts[0]=brect1_3.width()+10; col2_3=getDocument()->GetName(0); rect=TQRect(0,0,p->window().width(),p->window().height()); - brect2_3=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col2_3); + brect2_3=p->boundingRect(rect,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop,col2_3); col2_4=getDocument()->GetName(1); rect=TQRect(0,0,p->window().width(),p->window().height()); - brect2_4=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col2_4); + brect2_4=p->boundingRect(rect,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop,col2_4); rect=brect2_3|brect2_4; ts[1]=ts[0]+rect.width()+10; col3_3.sprintf("%d",sc0); rect=TQRect(0,0,p->window().width(),p->window().height()); - brect3_3=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col3_3); + brect3_3=p->boundingRect(rect,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop,col3_3); col3_4.sprintf("%d",sc1); rect=TQRect(0,0,p->window().width(),p->window().height()); - brect3_4=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col3_4); + brect3_4=p->boundingRect(rect,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop,col3_4); rect=brect3_3|brect3_4; ts[2]=ts[1]+rect.width()+30; - col4_3=i18n("%1 points").arg(pt0); + col4_3=i18n("%1 points").tqarg(pt0); rect=TQRect(0,0,p->window().width(),p->window().height()); - brect4_3=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col4_3); + brect4_3=p->boundingRect(rect,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop,col4_3); - col4_4=i18n("%1 points").arg(pt1); + col4_4=i18n("%1 points").tqarg(pt1); rect=TQRect(0,0,p->window().width(),p->window().height()); - brect4_4=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col4_4); + brect4_4=p->boundingRect(rect,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop,col4_4); rect=brect4_3|brect4_4; ts[3]=ts[2]+rect.width()+10; @@ -492,36 +492,36 @@ void LSkatView::drawFinal(TQPainter *p) p->setFont(font14); if (sc0>=120) { - line5=i18n("%1 won to nil. Congratulations!").arg(getDocument()->GetName(0)); + line5=i18n("%1 won to nil. Congratulations!").tqarg(getDocument()->GetName(0)); rect=TQRect(0,sumrect.height()+10,p->window().width(),p->window().height()); - brect5=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line5); + brect5=p->boundingRect(rect,TQt::AlignHCenter|TQt::SingleLine|TQt::AlignTop,line5); sumrect|=brect5; } else if (sc0>=90) { if (sc0==90) - line5=i18n("%1 won with 90 points. Super!").arg(getDocument()->GetName(0)); + line5=i18n("%1 won with 90 points. Super!").tqarg(getDocument()->GetName(0)); else - line5=i18n("%1 won over 90 points. Super!").arg(getDocument()->GetName(0)); + line5=i18n("%1 won over 90 points. Super!").tqarg(getDocument()->GetName(0)); rect=TQRect(0,sumrect.height()+10,p->window().width(),p->window().height()); - brect5=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line5); + brect5=p->boundingRect(rect,TQt::AlignHCenter|TQt::SingleLine|TQt::AlignTop,line5); sumrect|=brect5; } if (sc1>=120) { - line5=i18n("%1 won to nil. Congratulations!").arg(getDocument()->GetName(1)); + line5=i18n("%1 won to nil. Congratulations!").tqarg(getDocument()->GetName(1)); rect=TQRect(0,sumrect.height()+10,p->window().width(),p->window().height()); - brect5=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line5); + brect5=p->boundingRect(rect,TQt::AlignHCenter|TQt::SingleLine|TQt::AlignTop,line5); sumrect|=brect5; } else if (sc1>=90) { if (sc1==90) - line5=i18n("%1 won with 90 points. Super!").arg(getDocument()->GetName(1)); + line5=i18n("%1 won with 90 points. Super!").tqarg(getDocument()->GetName(1)); else - line5=i18n("%1 won over 90 points. Super!").arg(getDocument()->GetName(1)); + line5=i18n("%1 won over 90 points. Super!").tqarg(getDocument()->GetName(1)); rect=TQRect(0,sumrect.height()+10,p->window().width(),p->window().height()); - brect5=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line5); + brect5=p->boundingRect(rect,TQt::AlignHCenter|TQt::SingleLine|TQt::AlignTop,line5); sumrect|=brect5; } } @@ -542,14 +542,14 @@ void LSkatView::drawFinal(TQPainter *p) rect=sumrect; rect.setTop(brect1.top()+offset.y()); //brect1.moveBy(offset.x(),offset.y()); - p->drawText(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line1); + p->drawText(rect,TQt::AlignHCenter|TQt::SingleLine|TQt::AlignTop,line1); p->setFont(font14); p->setPen(COL_PLAYER); rect=sumrect; rect.setTop(brect2.top()+offset.y()); //brect2.moveBy(offset.x(),offset.y()); - p->drawText(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line2); + p->drawText(rect,TQt::AlignHCenter|TQt::SingleLine|TQt::AlignTop,line2); p->drawPixmap(sumrect.topLeft()+TQPoint(-5,-5), getDocument()->mPixTrump[trump]); p->drawPixmap(sumrect.topLeft()+TQPoint(5,-5)+TQPoint(sumrect.width()-getDocument()->mPixTrump[trump].width(),0), @@ -560,40 +560,40 @@ void LSkatView::drawFinal(TQPainter *p) { p->setTabArray(ts); p->setFont(font14); - p->setPen(Qt::black); + p->setPen(TQt::black); rect=sumrect; rect.setTop(brect3.top()+offset.y()); // Workaround for the next line where the ExpandTab crashes!!! drawTabText(p,rect,line3,ts); - // p->drawText(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop|Qt::ExpandTabs,line3); + // p->drawText(rect,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop|TQt::ExpandTabs,line3); rect=sumrect; rect.setTop(brect4.top()+offset.y()); // Workaround for the next line where the ExpandTab crashes!!! drawTabText(p,rect,line4,ts); - // p->drawText(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop|Qt::ExpandTabs,line4); + // p->drawText(rect,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop|TQt::ExpandTabs,line4); } if (!line5.isNull()) { p->setFont(font14); - p->setPen(Qt::black); + p->setPen(TQt::black); rect=sumrect; rect.setTop(brect5.top()+offset.y()); - p->drawText(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line5); + p->drawText(rect,TQt::AlignHCenter|TQt::SingleLine|TQt::AlignTop,line5); } } // This function is just a workaround for the QT function drawText -// with Qt::EXpandTAbs eanbled. For some strange reasons this crashes... +// with TQt::EXpandTAbs eanbled. For some strange reasons this crashes... void LSkatView::drawTabText(TQPainter *p,TQRect rect,TQString s,int *ts) { int lcnt=0; - // p->setPen(Qt::black); + // p->setPen(TQt::black); // p->drawRect(rect); while(s.length()>0 && (lcnt==0 || ts[lcnt-1]) ) { - int lpos=s.find("\t"); + int lpos=s.tqfind("\t"); int rpos=s.length()-lpos-1; if (lpos<0) { @@ -605,13 +605,13 @@ void LSkatView::drawTabText(TQPainter *p,TQRect rect,TQString s,int *ts) TQRect rect2=rect; if (lcnt>0) rect2.setLeft(rect.left()+ts[lcnt-1]); - p->drawText(rect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,tmp); + p->drawText(rect2,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop,tmp); lcnt++; } } // Draw the status field at the right side -void LSkatView::drawStatus(TQPainter *p) +void LSkatView::drawtqStatus(TQPainter *p) { TQPoint p1,p2; int trump; @@ -651,7 +651,7 @@ void LSkatView::drawStatus(TQPainter *p) // Player pl ------------------- // line1=TQString(i18n("Player 1"))+TQString(TQCString(" - "))+getDocument()->GetName(0); line1=getDocument()->GetName(pl); - brect1=p->boundingRect(drawrect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line1); + brect1=p->boundingRect(drawrect,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop,line1); sumrect=brect1; if (getDocument()->IsRunning()) @@ -659,11 +659,11 @@ void LSkatView::drawStatus(TQPainter *p) // Geometry and strings line2=i18n("Score:"); rect=TQRect(drawrect.left(),sumrect.bottom()+16,drawrect.width(),drawrect.height()-sumrect.height()); - brect2=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2); + brect2=p->boundingRect(rect,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop,line2); sumrect|=brect2; line3=i18n("Move:"); rect=TQRect(drawrect.left(),sumrect.bottom()+10,drawrect.width(),drawrect.height()-sumrect.height()); - brect3=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line3); + brect3=p->boundingRect(rect,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop,line3); sumrect|=brect3; rect=brect2|brect3; @@ -674,14 +674,14 @@ void LSkatView::drawStatus(TQPainter *p) // paint if (getDocument()->GetStartPlayer()==pl) p->setPen(COL_PLAYER); else p->setPen(black); - p->drawText(brect1,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line1); + p->drawText(brect1,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop,line1); p->setPen(black); - p->drawText(brect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2); - p->drawText(brect3,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line3); + p->drawText(brect2,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop,line2); + p->drawText(brect3,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop,line3); rect2=TQRect(brect2.left()+rect.width(),brect2.top(),drawrect.width()-brect2.width()-rect.width(),brect2.height()); - p->drawText(rect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2a); + p->drawText(rect2,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop,line2a); rect2=TQRect(brect3.left()+rect.width(),brect3.top(),drawrect.width()-brect3.width()-rect.width(),brect3.height()); - p->drawText(rect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2b); + p->drawText(rect2,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop,line2b); pa=TQPoint(drawrect.width()-getDocument()->mPixTrump[trump].width(),drawrect.height()-getDocument()->mPixTrump[trump].height()); if (getDocument()->GetStartPlayer()==pl) @@ -695,17 +695,17 @@ void LSkatView::drawStatus(TQPainter *p) // Geometry and strings line2=i18n("Points:"); rect=TQRect(drawrect.left(),sumrect.bottom()+6,drawrect.width(),drawrect.height()-sumrect.height()); - brect2=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2); + brect2=p->boundingRect(rect,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop,line2); sumrect|=brect2; line3=i18n("Won:"); rect=TQRect(drawrect.left(),sumrect.bottom()+6,drawrect.width(),drawrect.height()-sumrect.height()); - brect3=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line3); + brect3=p->boundingRect(rect,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop,line3); sumrect|=brect3; line4=i18n("Games:"); rect=TQRect(drawrect.left(),sumrect.bottom()+6,drawrect.width(),drawrect.height()-sumrect.height()); - brect4=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line4); + brect4=p->boundingRect(rect,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop,line4); sumrect|=brect4; rect=brect2|brect3|brect4; @@ -716,17 +716,17 @@ void LSkatView::drawStatus(TQPainter *p) // paint p->setPen(COL_PLAYER); - p->drawText(brect1,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line1); + p->drawText(brect1,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop,line1); p->setPen(black); - p->drawText(brect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2); - p->drawText(brect3,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line3); - p->drawText(brect4,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line4); + p->drawText(brect2,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop,line2); + p->drawText(brect3,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop,line3); + p->drawText(brect4,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop,line4); rect2=TQRect(brect2.left()+rect.width(),brect2.top(),drawrect.width()-brect2.width()-rect.width()+5,brect2.height()); - p->drawText(rect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2a); + p->drawText(rect2,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop,line2a); rect2=TQRect(brect3.left()+rect.width(),brect3.top(),drawrect.width()-brect3.width()-rect.width()+5,brect3.height()); - p->drawText(rect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2b); + p->drawText(rect2,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop,line2b); rect2=TQRect(brect4.left()+rect.width(),brect4.top(),drawrect.width()-brect4.width()-rect.width()+5,brect4.height()); - p->drawText(rect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2c); + p->drawText(rect2,TQt::AlignLeft|TQt::SingleLine|TQt::AlignTop,line2c); pa=TQPoint(drawrect.width()-getDocument()->mPixType[getDocument()->GetPlayedBy(pl)-1].width(),0); p->drawPixmap(p1+pa+TQPoint(3,-3), getDocument()->mPixType[getDocument()->GetPlayedBy(pl)-1]); @@ -740,7 +740,7 @@ void LSkatView::drawStatus(TQPainter *p) void LSkatView::Paint(TQPainter *p) { // If game is running - drawStatus(p); + drawtqStatus(p); drawDeck(p); if (getDocument()->IsRunning()) { @@ -760,7 +760,7 @@ void LSkatView::paintEvent( TQPaintEvent * e) TQPixmap pm(this->rect().size()); TQPainter p; TQBrush brush; - p.begin(&pm,this); + p.tqbegin(TQT_TQPAINTDEVICE(&pm),this); brush.setPixmap( getDocument()->mPixBackground ); p.fillRect(0,0,this->rect().width(),this->rect().height(),brush); drawIntro(&p); @@ -790,10 +790,10 @@ TQPoint LSkatView::calcCardPos(int x,int y) // mouse click event void LSkatView::mousePressEvent( TQMouseEvent *mouse ) { - if (mouse->button()!=LeftButton) return ; + if (mouse->button()!=Qt::LeftButton) return ; if (!getDocument()->IsRunning()) return ; - if (getDocument()->GetMoveStatus()!=-1) return ; + if (getDocument()->GetMovetqStatus()!=-1) return ; TQPoint point; int mx,my,player; @@ -890,7 +890,7 @@ void LSkatView::introTimerReady() } else if (introcnt=MOVECOUNTER) { - LSkatApp *m=(LSkatApp *) parentWidget(); + LSkatApp *m=(LSkatApp *) tqparentWidget(); moveTimer->stop(); cardmovecnt=0; update(TQRect(cardend,getDocument()->cardsize)); @@ -925,7 +925,7 @@ void LSkatView::moveTimerReady() } } -void LSkatView::updateStatus() +void LSkatView::updatetqStatus() { update(status_rect1); update(status_rect2); diff --git a/lskat/lskat/lskatview.h b/lskat/lskat/lskatview.h index 19146cc5..8fd86025 100644 --- a/lskat/lskat/lskatview.h +++ b/lskat/lskat/lskatview.h @@ -36,14 +36,15 @@ class LSkatDoc; * @author Source Framework Automatically Generated by KDevelop, (c) The KDevelop Team. * @version KDevelop version 0.4 code generation */ -class LSkatView : public QWidget +class LSkatView : public TQWidget { Q_OBJECT + TQ_OBJECT public: /** Constructor for the main view */ - LSkatView(TQWidget *parent = 0, const char *name=0); + LSkatView(TQWidget *tqparent = 0, const char *name=0); - /** returns a pointer to the document connected to the view instance. Mind that this method requires a LSkatApp instance as a parent + /** returns a pointer to the document connected to the view instance. Mind that this method requires a LSkatApp instance as a tqparent * widget to get to the window document pointer by calling the LSkatApp::getDocument() method. * * @see LSkatApp#getDocument @@ -53,13 +54,13 @@ class LSkatView : public QWidget void paintEvent( TQPaintEvent * p); void Paint(TQPainter *p); void InitMove(int player,int x,int y); - void updateStatus(); + void updatetqStatus(); protected: void drawDeck(TQPainter *p); void drawIntro(TQPainter *p); void drawMove(TQPainter *p); - void drawStatus(TQPainter *p); + void drawtqStatus(TQPainter *p); void drawFinal(TQPainter *p); void drawBorder(TQPainter *p,TQRect rect,int offset,int width,int mode); TQPoint calcCardPos(int x,int y); diff --git a/lskat/lskat/msgdlg.cpp b/lskat/lskat/msgdlg.cpp index cb3e6334..e1a6923a 100644 --- a/lskat/lskat/msgdlg.cpp +++ b/lskat/lskat/msgdlg.cpp @@ -37,8 +37,8 @@ // Create the dialog for changing the player names -MsgDlg::MsgDlg( TQWidget *parent, const char *name,const char * /*sufi */ ) - : TQDialog( parent, name,TRUE ) +MsgDlg::MsgDlg( TQWidget *tqparent, const char *name,const char * /*sufi */ ) + : TQDialog( tqparent, name,TRUE ) { setCaption(i18n("Send Message to Remote Player")); setMinimumSize(400,160); diff --git a/lskat/lskat/msgdlg.h b/lskat/lskat/msgdlg.h index 6612597d..b2b0bfe0 100644 --- a/lskat/lskat/msgdlg.h +++ b/lskat/lskat/msgdlg.h @@ -20,12 +20,13 @@ #include #include -class MsgDlg : public QDialog +class MsgDlg : public TQDialog { Q_OBJECT + TQ_OBJECT public: - MsgDlg (TQWidget* parent = NULL,const char* name = NULL,const char *sufi=NULL); + MsgDlg (TQWidget* tqparent = NULL,const char* name = NULL,const char *sufi=NULL); TQString GetMsg(); protected slots: diff --git a/lskat/lskat/namedlg.cpp b/lskat/lskat/namedlg.cpp index 4bbffad7..66296195 100644 --- a/lskat/lskat/namedlg.cpp +++ b/lskat/lskat/namedlg.cpp @@ -19,15 +19,15 @@ #define NAME_MAX_LEN 12 /* - * Constructs a NameDlg which is a child of 'parent', with the + * Constructs a NameDlg which is a child of 'tqparent', with the * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ -NameDlg::NameDlg( TQWidget *parent, const char *name,bool /* modal */, WFlags /* fl */ ) +NameDlg::NameDlg( TQWidget *tqparent, const char *name,bool /* modal */, WFlags /* fl */ ) : KDialogBase( Plain, i18n("Configure Names"), Ok|Cancel, Ok, - parent, name, true,true ) + tqparent, name, true,true ) { TQWidget *page = plainPage(); @@ -45,10 +45,10 @@ NameDlg::NameDlg( TQWidget *parent, const char *name,bool /* modal */, WFlags /* player_names = new TQGroupBox( page, "player_names" ); player_names->setTitle(i18n("Player Names") ); player_names->setColumnLayout(0, Qt::Vertical ); - player_names->layout()->setSpacing( 0 ); - player_names->layout()->setMargin( 0 ); - vbox_2 = new TQVBoxLayout( player_names->layout() ); - vbox_2->setAlignment( Qt::AlignTop ); + player_names->tqlayout()->setSpacing( 0 ); + player_names->tqlayout()->setMargin( 0 ); + vbox_2 = new TQVBoxLayout( player_names->tqlayout() ); + vbox_2->tqsetAlignment( TQt::AlignTop ); vbox_2->setSpacing( 6 ); vbox_2->setMargin( 11 ); @@ -109,7 +109,7 @@ NameDlg::NameDlg( TQWidget *parent, const char *name,bool /* modal */, WFlags /* */ NameDlg::~NameDlg() { - // no need to delete child widgets, Qt does it all for us + // no need to delete child widgets, TQt does it all for us } // In and output the name strings diff --git a/lskat/lskat/namedlg.h b/lskat/lskat/namedlg.h index df236595..f8f26881 100644 --- a/lskat/lskat/namedlg.h +++ b/lskat/lskat/namedlg.h @@ -21,9 +21,10 @@ class TQPushButton; class NameDlg : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - NameDlg( TQWidget* parent = 0, const char* name = 0, bool modal = TRUE, WFlags fl = 0 ); + NameDlg( TQWidget* tqparent = 0, const char* name = 0, bool modal = TRUE, WFlags fl = 0 ); ~NameDlg(); void SetNames(TQString n1,TQString n2); void GetNames(TQString &n1,TQString &n2); diff --git a/lskat/lskat/networkdlg.cpp b/lskat/lskat/networkdlg.cpp index 16e1716a..1bf3f18f 100644 --- a/lskat/lskat/networkdlg.cpp +++ b/lskat/lskat/networkdlg.cpp @@ -25,10 +25,10 @@ extern const char* LSKAT_SERVICE; // Create the dialog -NetworkDlg::NetworkDlg( TQWidget *parent, const char *name ) - : NetworkDlgBase( parent, name, TRUE ) +NetworkDlg::NetworkDlg( TQWidget *tqparent, const char *name ) + : NetworkDlgBase( tqparent, name, TRUE ) { - browser = new DNSSD::ServiceBrowser(TQString::fromLatin1(LSKAT_SERVICE)); + browser = new DNSSD::ServiceBrowser(TQString::tqfromLatin1(LSKAT_SERVICE)); connect(browser,TQT_SIGNAL(finished()),TQT_SLOT(gamesFound())); browser->startBrowse(); } @@ -97,7 +97,7 @@ void NetworkDlg::toggleServerClient() hostname->setEnabled(true); } else { - hostname->setText(TQString::null); + hostname->setText(TQString()); hostname->setEnabled(false); } } diff --git a/lskat/lskat/networkdlg.h b/lskat/lskat/networkdlg.h index 6efccd2f..9657280d 100644 --- a/lskat/lskat/networkdlg.h +++ b/lskat/lskat/networkdlg.h @@ -25,9 +25,10 @@ class NetworkDlg : public NetworkDlgBase { Q_OBJECT + TQ_OBJECT public: - NetworkDlg(TQWidget* parent=NULL, const char* name=NULL); + NetworkDlg(TQWidget* tqparent=NULL, const char* name=NULL); ~NetworkDlg(); void SetName(const TQString& name); void SetHost(const TQString& host); diff --git a/lskat/lskat/networkdlgbase.ui b/lskat/lskat/networkdlgbase.ui index 861c77f3..e840bc72 100644 --- a/lskat/lskat/networkdlgbase.ui +++ b/lskat/lskat/networkdlgbase.ui @@ -1,10 +1,10 @@ NetworkDlgBase - + NetworkDlgBase - + 0 0 @@ -19,7 +19,7 @@ unnamed - + group @@ -38,7 +38,7 @@ unnamed - + serverBtn @@ -49,7 +49,7 @@ true - + clientBtn @@ -59,11 +59,11 @@ - + stack - + serverPage @@ -80,7 +80,7 @@ 0 - + serverLabel @@ -91,7 +91,7 @@ serverName - + serverName @@ -106,7 +106,7 @@ - + clientPage @@ -123,7 +123,7 @@ 0 - + clientLabel @@ -134,7 +134,7 @@ clientName - + clientName @@ -142,15 +142,15 @@ - + - layout9 + tqlayout9 unnamed - + hostLabel @@ -165,13 +165,13 @@ Host: - + AlignVCenter|AlignLeft - + hostname @@ -179,7 +179,7 @@ false - + portLabel @@ -194,7 +194,7 @@ Port: - + AlignVCenter|AlignLeft @@ -202,7 +202,7 @@ - + port @@ -218,9 +218,9 @@ - + - layout11 + tqlayout11 @@ -236,14 +236,14 @@ Expanding - + 51 20 - + pushButton1 @@ -261,7 +261,7 @@ Expanding - + 61 20 @@ -298,9 +298,9 @@ toggleServerClient() - + toggleServerClient() gameSelected(int nr) - - + + diff --git a/lskat/lskatproc/KChildConnect.cpp b/lskat/lskatproc/KChildConnect.cpp index 6ea4b973..a504018d 100644 --- a/lskat/lskatproc/KChildConnect.cpp +++ b/lskat/lskatproc/KChildConnect.cpp @@ -30,7 +30,7 @@ KChildConnect::~KChildConnect() { } -KR_STATUS KChildConnect::QueryStatus() +KR_STATUS KChildConnect::QuerytqStatus() { return KR_OK; } @@ -57,7 +57,7 @@ bool KChildConnect::SendMsg(KEMessage *msg) return Send(sendstring); } -// Send string to parent +// Send string to tqparent bool KChildConnect::Send(TQString str) { if (!str || str.length()<1) return true; // no need to send crap @@ -75,7 +75,7 @@ void KChildConnect::Receive(TQString input) // Call us recursive until there are no CR left len=KEMESSAGE_CR.length(); - pos=input.find(KEMESSAGE_CR); + pos=input.tqfind(KEMESSAGE_CR); if (pos>0) { tmp=input.left(pos); diff --git a/lskat/lskatproc/KChildConnect.h b/lskat/lskatproc/KChildConnect.h index 37339218..36e9e9a5 100644 --- a/lskat/lskatproc/KChildConnect.h +++ b/lskat/lskatproc/KChildConnect.h @@ -14,9 +14,10 @@ #include "KEMessage.h" -class KChildConnect: public QObject +class KChildConnect: public TQObject { Q_OBJECT + TQ_OBJECT protected: TQStrList inputcache; @@ -33,7 +34,7 @@ class KChildConnect: public QObject virtual bool SendMsg(KEMessage *msg); virtual bool Send(TQString str); - virtual KR_STATUS QueryStatus(); + virtual KR_STATUS QuerytqStatus(); public slots: diff --git a/lskat/lskatproc/KEMessage.cpp b/lskat/lskatproc/KEMessage.cpp index ce8985f3..96c33797 100644 --- a/lskat/lskatproc/KEMessage.cpp +++ b/lskat/lskatproc/KEMessage.cpp @@ -61,7 +61,7 @@ void KEMessage::AddData(TQString key,const char *data,int size) KGM_TYPE KEMessage::QueryType(TQString key) { KMessageEntry *entry; - entry=dict.find(key); + entry=dict.tqfind(key); if (!entry) return (KGM_TYPE)0; return entry->QueryType(); } @@ -69,7 +69,7 @@ KGM_TYPE KEMessage::QueryType(TQString key) bool KEMessage::HasKey(TQString key) { KMessageEntry *entry; - entry=dict.find(key); + entry=dict.tqfind(key); if (!entry) return false; return true; } @@ -78,7 +78,7 @@ bool KEMessage::GetData(TQString key,short &s) { short *result; KMessageEntry *entry; - entry=dict.find(key); + entry=dict.tqfind(key); if (!entry) return false; if (entry->QueryType()!=KGM_TYPE_SHORT) return false; // printf("GetShortData: %p for %s\n",entry->QueryData(),(char *)key); @@ -91,7 +91,7 @@ bool KEMessage::GetData(TQString key,long &l) { long *result; KMessageEntry *entry; - entry=dict.find(key); + entry=dict.tqfind(key); if (!entry) return false; if (entry->QueryType()!=KGM_TYPE_LONG) return false; result=(long *)entry->QueryData(); @@ -103,7 +103,7 @@ bool KEMessage::GetData(TQString key,float &f) { float *result; KMessageEntry *entry; - entry=dict.find(key); + entry=dict.tqfind(key); if (!entry) return false; if (entry->QueryType()!=KGM_TYPE_FLOAT) return false; // printf("GetFloatData: %p for %s\n",entry->QueryData(),(char *)key); @@ -115,7 +115,7 @@ bool KEMessage::GetData(TQString key,float &f) bool KEMessage::GetData(TQString key,char * &c,int &size) { KMessageEntry *entry; - entry=dict.find(key); + entry=dict.tqfind(key); if (!entry) return false; if (entry->QueryType()!=KGM_TYPE_DATA) return false; c=entry->QueryData(); @@ -179,19 +179,19 @@ TQString KEMessage::StringToEntry(TQString str,KMessageEntry *entry) len=KEMESSAGE_SEP.length(); if (!entry) return TQString(); - pos=str.find(KEMESSAGE_SEP,0); + pos=str.tqfind(KEMESSAGE_SEP,0); if (pos<0) return TQString(); // wrong format key=str.left(pos); oldpos=pos; - pos=str.find(KEMESSAGE_SEP,oldpos+len); + pos=str.tqfind(KEMESSAGE_SEP,oldpos+len); if (pos<0) return TQString(); // wrong format size=str.mid(oldpos+len,pos-oldpos-len); oldpos=pos; - pos=str.find(KEMESSAGE_SEP,oldpos+len); + pos=str.tqfind(KEMESSAGE_SEP,oldpos+len); if (pos<0) return TQString(); // wrong format type=str.mid(oldpos+len,pos-oldpos-len); @@ -202,7 +202,7 @@ TQString KEMessage::StringToEntry(TQString str,KMessageEntry *entry) cnt=size.toInt(); entry->SetType((KGM_TYPE)type.toInt()); - // I hope this works with unicode strings as well + // I hope this works with tqunicode strings as well p=data.latin1(); q=(char *)calloc(data.length()/2,sizeof(char)); if (!q) return TQString(); @@ -226,7 +226,7 @@ TQString KEMessage::ToString() s=KEMESSAGE_HEAD+KEMESSAGE_CR; for (it=keys.first();it!=0;it=keys.next()) { - entry=dict.find(TQCString(it)); + entry=dict.tqfind(TQCString(it)); s+=EntryToString(it,entry); } s+=KEMESSAGE_TAIL+KEMESSAGE_CR; @@ -251,14 +251,14 @@ bool KEMessage::AddStringMsg(TQString str) len=KEMESSAGE_CR.length(); - pos=str.find(KEMESSAGE_CR); + pos=str.tqfind(KEMESSAGE_CR); if (pos<0) return false; // wrong format if (str.left(pos)!=(KEMESSAGE_HEAD)) return false; // wrong message do { oldpos=pos; - pos=str.find(KEMESSAGE_CR,oldpos+len); + pos=str.tqfind(KEMESSAGE_CR,oldpos+len); if (pos<0) return false; // wrong format data=str.mid(oldpos+len,pos-oldpos-len); if (data!=(KEMESSAGE_TAIL)) @@ -315,7 +315,7 @@ KEMessage &KEMessage::operator=(KEMessage &msg) // printf("Assigning = KEMessage from %p to %p\n",&msg,this); for (it=msg.keys.first();it!=0;it=msg.keys.next()) { - entry=msg.dict.find(TQCString(it)); + entry=msg.dict.tqfind(TQCString(it)); newentry=new KMessageEntry; *newentry=*entry; AddEntry(TQCString(it),newentry); diff --git a/lskat/lskatproc/KInputChildProcess.cpp b/lskat/lskatproc/KInputChildProcess.cpp index 13e00b93..c06f42e5 100644 --- a/lskat/lskatproc/KInputChildProcess.cpp +++ b/lskat/lskatproc/KInputChildProcess.cpp @@ -55,7 +55,7 @@ bool KInputChildProcess::exec() s=inputbuffer+s; // printf("ChildABC '%s'\n",(const char *)s); // fflush(stdout); - pos=s.findRev(KEMESSAGE_CR); + pos=s.tqfindRev(KEMESSAGE_CR); if (pos<0) { inputbuffer=s; diff --git a/lskat/lskatproc/KInputChildProcess.h b/lskat/lskatproc/KInputChildProcess.h index 2f964e71..14201922 100644 --- a/lskat/lskatproc/KInputChildProcess.h +++ b/lskat/lskatproc/KInputChildProcess.h @@ -22,9 +22,10 @@ #include "KChildConnect.h" -class KInputChildProcess : public QObject +class KInputChildProcess : public TQObject { Q_OBJECT + TQ_OBJECT private: char *buffer;