From 838baf3f99ec5ab81b063eb5449a3381d860f377 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 11 Jun 2011 04:58:26 +0000 Subject: 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 --- kbackgammon/kbg.cpp | 58 ++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'kbackgammon/kbg.cpp') 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); -- cgit v1.2.3