summaryrefslogtreecommitdiffstats
path: root/kpat/dealer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kpat/dealer.cpp')
-rw-r--r--kpat/dealer.cpp218
1 files changed, 109 insertions, 109 deletions
diff --git a/kpat/dealer.cpp b/kpat/dealer.cpp
index 2100ae2e..365e7411 100644
--- a/kpat/dealer.cpp
+++ b/kpat/dealer.cpp
@@ -6,7 +6,7 @@
#include "kmainwindow.h"
#include <kapplication.h>
#include <kpixmapeffect.h>
-#include <qtimer.h>
+#include <tqtimer.h>
#include <kaction.h>
#include <klocale.h>
#include "cardmaps.h"
@@ -56,7 +56,7 @@ Dealer *Dealer::s_instance = 0;
Dealer::Dealer( KMainWindow* _parent , const char* _name )
- : QCanvasView( 0, _parent, _name ),
+ : TQCanvasView( 0, _parent, _name ),
towait(0),
myActions(0),
ademo(0),
@@ -69,7 +69,7 @@ Dealer::Dealer( KMainWindow* _parent , const char* _name )
_autodrop(true),
_gameRecorded(false)
{
- setResizePolicy(QScrollView::Manual);
+ setResizePolicy(TQScrollView::Manual);
setVScrollBarMode(AlwaysOff);
setHScrollBarMode(AlwaysOff);
@@ -81,9 +81,9 @@ Dealer::Dealer( KMainWindow* _parent , const char* _name )
undoList.setAutoDelete(true);
- demotimer = new QTimer(this);
+ demotimer = new TQTimer(this);
- connect(demotimer, SIGNAL(timeout()), SLOT(demo()));
+ connect(demotimer, TQT_SIGNAL(timeout()), TQT_SLOT(demo()));
assert(!s_instance);
s_instance = this;
@@ -96,7 +96,7 @@ const Dealer *Dealer::instance()
}
-void Dealer::setBackgroundPixmap(const QPixmap &background, const QColor &midcolor)
+void Dealer::setBackgroundPixmap(const TQPixmap &background, const TQColor &midcolor)
{
_midcolor = midcolor;
canvas()->setBackgroundPixmap(background);
@@ -108,36 +108,36 @@ void Dealer::setBackgroundPixmap(const QPixmap &background, const QColor &midcol
void Dealer::setupActions() {
- QPtrList<KAction> actionlist;
+ TQPtrList<KAction> actionlist;
kdDebug(11111) << "setupActions " << actions() << endl;
if (actions() & Dealer::Hint) {
- ahint = new KAction( i18n("&Hint"), QString::fromLatin1("wizard"), Key_H, this,
- SLOT(hint()),
+ ahint = new KAction( i18n("&Hint"), TQString::fromLatin1("wizard"), Key_H, this,
+ TQT_SLOT(hint()),
parent()->actionCollection(), "game_hint");
actionlist.append(ahint);
} else
ahint = 0;
if (actions() & Dealer::Demo) {
- ademo = new KToggleAction( i18n("&Demo"), QString::fromLatin1("1rightarrow"), CTRL+Key_D, this,
- SLOT(toggleDemo()),
+ ademo = new KToggleAction( i18n("&Demo"), TQString::fromLatin1("1rightarrow"), CTRL+Key_D, this,
+ TQT_SLOT(toggleDemo()),
parent()->actionCollection(), "game_demo");
actionlist.append(ademo);
} else
ademo = 0;
if (actions() & Dealer::Redeal) {
- aredeal = new KAction (i18n("&Redeal"), QString::fromLatin1("queue"), 0, this,
- SLOT(redeal()),
+ aredeal = new KAction (i18n("&Redeal"), TQString::fromLatin1("queue"), 0, this,
+ TQT_SLOT(redeal()),
parent()->actionCollection(), "game_redeal");
actionlist.append(aredeal);
} else
aredeal = 0;
- parent()->guiFactory()->plugActionList( parent(), QString::fromLatin1("game_actions"), actionlist);
+ parent()->guiFactory()->plugActionList( parent(), TQString::fromLatin1("game_actions"), actionlist);
}
Dealer::~Dealer()
@@ -145,7 +145,7 @@ Dealer::~Dealer()
if (!_won)
countLoss();
clearHints();
- parent()->guiFactory()->unplugActionList( parent(), QString::fromLatin1("game_actions"));
+ parent()->guiFactory()->unplugActionList( parent(), TQString::fromLatin1("game_actions"));
while (!piles.isEmpty())
delete piles.first(); // removes itself
@@ -156,7 +156,7 @@ Dealer::~Dealer()
KMainWindow *Dealer::parent() const
{
- return dynamic_cast<KMainWindow*>(QCanvasView::parent());
+ return dynamic_cast<KMainWindow*>(TQCanvasView::parent());
}
@@ -252,7 +252,7 @@ bool Dealer::isMoving(Card *c) const
return movingCards.find(c) != movingCards.end();
}
-void Dealer::contentsMouseMoveEvent(QMouseEvent* e)
+void Dealer::contentsMouseMoveEvent(TQMouseEvent* e)
{
if (movingCards.isEmpty())
return;
@@ -266,9 +266,9 @@ void Dealer::contentsMouseMoveEvent(QMouseEvent* e)
}
PileList sources;
- QCanvasItemList list = canvas()->collisions(movingCards.first()->rect());
+ TQCanvasItemList list = canvas()->collisions(movingCards.first()->rect());
- for (QCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it)
+ for (TQCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it)
{
if ((*it)->rtti() == Card::RTTI) {
Card *c = dynamic_cast<Card*>(*it);
@@ -320,21 +320,21 @@ void Dealer::mark(Card *c)
void Dealer::unmarkAll()
{
- for (QCanvasItemList::Iterator it = marked.begin(); it != marked.end(); ++it)
+ for (TQCanvasItemList::Iterator it = marked.begin(); it != marked.end(); ++it)
{
(*it)->setSelected(false);
}
marked.clear();
}
-void Dealer::contentsMousePressEvent(QMouseEvent* e)
+void Dealer::contentsMousePressEvent(TQMouseEvent* e)
{
unmarkAll();
stopDemo();
if (waiting())
return;
- QCanvasItemList list = canvas()->collisions(e->pos());
+ TQCanvasItemList list = canvas()->collisions(e->pos());
kdDebug(11111) << "mouse pressed " << list.count() << " " << canvas()->allItems().count() << endl;
moved = false;
@@ -373,22 +373,22 @@ void Dealer::contentsMousePressEvent(QMouseEvent* e)
class Hit {
public:
Pile *source;
- QRect intersect;
+ TQRect intersect;
bool top;
};
-typedef QValueList<Hit> HitList;
+typedef TQValueList<Hit> HitList;
-void Dealer::contentsMouseReleaseEvent( QMouseEvent *e)
+void Dealer::contentsMouseReleaseEvent( TQMouseEvent *e)
{
if (!moved) {
if (!movingCards.isEmpty()) {
movingCards.first()->source()->moveCardsBack(movingCards);
movingCards.clear();
}
- QCanvasItemList list = canvas()->collisions(e->pos());
+ TQCanvasItemList list = canvas()->collisions(e->pos());
if (list.isEmpty())
return;
- QCanvasItemList::Iterator it = list.begin();
+ TQCanvasItemList::Iterator it = list.begin();
if ((*it)->rtti() == Card::RTTI) {
Card *c = dynamic_cast<Card*>(*it);
assert(c);
@@ -418,10 +418,10 @@ void Dealer::contentsMouseReleaseEvent( QMouseEvent *e)
unmarkAll();
- QCanvasItemList list = canvas()->collisions(movingCards.first()->rect());
+ TQCanvasItemList list = canvas()->collisions(movingCards.first()->rect());
HitList sources;
- for (QCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it)
+ for (TQCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it)
{
if ((*it)->rtti() == Card::RTTI) {
Card *c = dynamic_cast<Card*>(*it);
@@ -499,7 +499,7 @@ void Dealer::contentsMouseReleaseEvent( QMouseEvent *e)
canvas()->update();
}
-void Dealer::contentsMouseDoubleClickEvent( QMouseEvent*e )
+void Dealer::contentsMouseDoubleClickEvent( TQMouseEvent*e )
{
stopDemo();
unmarkAll();
@@ -510,10 +510,10 @@ void Dealer::contentsMouseDoubleClickEvent( QMouseEvent*e )
movingCards.first()->source()->moveCardsBack(movingCards);
movingCards.clear();
}
- QCanvasItemList list = canvas()->collisions(e->pos());
+ TQCanvasItemList list = canvas()->collisions(e->pos());
if (list.isEmpty())
return;
- QCanvasItemList::Iterator it = list.begin();
+ TQCanvasItemList::Iterator it = list.begin();
if ((*it)->rtti() != Card::RTTI)
return;
Card *c = dynamic_cast<Card*>(*it);
@@ -526,12 +526,12 @@ void Dealer::contentsMouseDoubleClickEvent( QMouseEvent*e )
}
}
-QSize Dealer::minimumCardSize() const
+TQSize Dealer::minimumCardSize() const
{
return minsize;
}
-void Dealer::resizeEvent(QResizeEvent *e)
+void Dealer::resizeEvent(TQResizeEvent *e)
{
int x = width();
int y = height();
@@ -570,7 +570,7 @@ void Dealer::resizeEvent(QResizeEvent *e)
if (!e)
updateScrollBars();
else
- QCanvasView::resizeEvent(e);
+ TQCanvasView::resizeEvent(e);
}
bool Dealer::cardClicked(Card *c) {
@@ -613,7 +613,7 @@ void Dealer::startNew()
if ( aredeal )
aredeal->setEnabled( true );
toldAboutLostGame = false;
- minsize = QSize(0,0);
+ minsize = TQSize(0,0);
_won = false;
_waiting = 0;
_gameRecorded=false;
@@ -622,8 +622,8 @@ void Dealer::startNew()
kdDebug(11111) << "startNew unmarkAll\n";
unmarkAll();
kdDebug(11111) << "startNew setAnimated(false)\n";
- QCanvasItemList list = canvas()->allItems();
- for (QCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) {
+ TQCanvasItemList list = canvas()->allItems();
+ for (TQCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) {
if ((*it)->rtti() == Card::RTTI)
static_cast<Card*>(*it)->disconnect();
@@ -638,7 +638,7 @@ void Dealer::startNew()
restart();
takeState();
Card *towait = 0;
- for (QCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) {
+ for (TQCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) {
if ((*it)->rtti() == Card::RTTI) {
towait = static_cast<Card*>(*it);
if (towait->animated())
@@ -650,7 +650,7 @@ void Dealer::startNew()
if (!towait)
takeState();
else
- connect(towait, SIGNAL(stoped(Card*)), SLOT(slotTakeState(Card *)));
+ connect(towait, TQT_SIGNAL(stoped(Card*)), TQT_SLOT(slotTakeState(Card *)));
resizeEvent(0);
}
@@ -660,7 +660,7 @@ void Dealer::slotTakeState(Card *c) {
takeState();
}
-void Dealer::enlargeCanvas(QCanvasRectangle *c)
+void Dealer::enlargeCanvas(TQCanvasRectangle *c)
{
if (!c->isVisible() || c->animated())
return;
@@ -702,7 +702,7 @@ public:
y == rhs.y && z == rhs.z && faceup == rhs.faceup
&& source_index == rhs.source_index && tookdown == rhs.tookdown);
}
- void fillNode(QDomElement &e) const {
+ void fillNode(TQDomElement &e) const {
e.setAttribute("value", it->rank());
e.setAttribute("suit", it->suit());
e.setAttribute("source", source->index());
@@ -715,7 +715,7 @@ public:
}
};
-typedef class QValueList<CardState> CardStateList;
+typedef class TQValueList<CardState> CardStateList;
bool operator==( const State & st1, const State & st2) {
return st1.cards == st2.cards && st1.gameData == st2.gameData;
@@ -723,10 +723,10 @@ bool operator==( const State & st1, const State & st2) {
State *Dealer::getState()
{
- QCanvasItemList list = canvas()->allItems();
+ TQCanvasItemList list = canvas()->allItems();
State * st = new State;
- for (QCanvasItemList::ConstIterator it = list.begin(); it != list.end(); ++it)
+ for (TQCanvasItemList::ConstIterator it = list.begin(); it != list.end(); ++it)
{
if ((*it)->rtti() == Card::RTTI) {
Card *c = dynamic_cast<Card*>(*it);
@@ -758,9 +758,9 @@ State *Dealer::getState()
void Dealer::setState(State *st)
{
CardStateList * n = &st->cards;
- QCanvasItemList list = canvas()->allItems();
+ TQCanvasItemList list = canvas()->allItems();
- for (QCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it)
+ for (TQCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it)
{
if ((*it)->rtti() == Pile::RTTI) {
Pile *p = dynamic_cast<Pile*>(*it);
@@ -827,32 +827,32 @@ void Dealer::takeState()
ademo->setEnabled( false );
if ( aredeal )
aredeal->setEnabled( false );
- QTimer::singleShot(400, this, SIGNAL(gameLost()));
+ TQTimer::singleShot(400, this, TQT_SIGNAL(gameLost()));
toldAboutLostGame = true;
return;
}
}
if (!demoActive() && !waiting())
- QTimer::singleShot(TIME_BETWEEN_MOVES, this, SLOT(startAutoDrop()));
+ TQTimer::singleShot(TIME_BETWEEN_MOVES, this, TQT_SLOT(startAutoDrop()));
emit undoPossible(undoList.count() > 1 && !waiting());
}
-void Dealer::saveGame(QDomDocument &doc) {
- QDomElement dealer = doc.createElement("dealer");
+void Dealer::saveGame(TQDomDocument &doc) {
+ TQDomElement dealer = doc.createElement("dealer");
doc.appendChild(dealer);
dealer.setAttribute("id", _id);
- dealer.setAttribute("number", QString::number(gameNumber()));
- QString data = getGameState();
+ dealer.setAttribute("number", TQString::number(gameNumber()));
+ TQString data = getGameState();
if (!data.isEmpty())
dealer.setAttribute("data", data);
- dealer.setAttribute("moves", QString::number(getMoves()));
+ dealer.setAttribute("moves", TQString::number(getMoves()));
bool taken[1000];
memset(taken, 0, sizeof(taken));
- QCanvasItemList list = canvas()->allItems();
- for (QCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it)
+ TQCanvasItemList list = canvas()->allItems();
+ for (TQCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it)
{
if ((*it)->rtti() == Pile::RTTI) {
Pile *p = dynamic_cast<Pile*>(*it);
@@ -863,7 +863,7 @@ void Dealer::saveGame(QDomDocument &doc) {
}
taken[p->index()] = true;
- QDomElement pile = doc.createElement("pile");
+ TQDomElement pile = doc.createElement("pile");
pile.setAttribute("index", p->index());
CardList cards = p->cards();
@@ -871,7 +871,7 @@ void Dealer::saveGame(QDomDocument &doc) {
it != cards.end();
++it)
{
- QDomElement card = doc.createElement("card");
+ TQDomElement card = doc.createElement("card");
card.setAttribute("suit", (*it)->suit());
card.setAttribute("value", (*it)->rank());
card.setAttribute("faceup", (*it)->isFaceUp());
@@ -886,20 +886,20 @@ void Dealer::saveGame(QDomDocument &doc) {
}
/*
- QDomElement eList = doc.createElement("undo");
+ TQDomElement eList = doc.createElement("undo");
- QPtrListIterator<State> it(undoList);
+ TQPtrListIterator<State> it(undoList);
for (; it.current(); ++it)
{
State *n = it.current();
- QDomElement state = doc.createElement("state");
+ TQDomElement state = doc.createElement("state");
if (!n->gameData.isEmpty())
state.setAttribute("data", n->gameData);
- QDomElement cards = doc.createElement("cards");
- for (QValueList<CardState>::ConstIterator it2 = n->cards.begin();
+ TQDomElement cards = doc.createElement("cards");
+ for (TQValueList<CardState>::ConstIterator it2 = n->cards.begin();
it2 != n->cards.end(); ++it2)
{
- QDomElement item = doc.createElement("item");
+ TQDomElement item = doc.createElement("item");
(*it2).fillNode(item);
cards.appendChild(item);
}
@@ -911,26 +911,26 @@ void Dealer::saveGame(QDomDocument &doc) {
// kdDebug(11111) << doc.toString() << endl;
}
-void Dealer::openGame(QDomDocument &doc)
+void Dealer::openGame(TQDomDocument &doc)
{
unmarkAll();
- QDomElement dealer = doc.documentElement();
+ TQDomElement dealer = doc.documentElement();
setGameNumber(dealer.attribute("number").toULong());
undoList.clear();
- QDomNodeList piles = dealer.elementsByTagName("pile");
+ TQDomNodeList piles = dealer.elementsByTagName("pile");
- QCanvasItemList list = canvas()->allItems();
+ TQCanvasItemList list = canvas()->allItems();
CardList cards;
- for (QCanvasItemList::ConstIterator it = list.begin(); it != list.end(); ++it)
+ for (TQCanvasItemList::ConstIterator it = list.begin(); it != list.end(); ++it)
if ((*it)->rtti() == Card::RTTI)
cards.append(static_cast<Card*>(*it));
Deck::deck()->collectAndShuffle();
- for (QCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it)
+ for (TQCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it)
{
if ((*it)->rtti() == Pile::RTTI)
{
@@ -939,13 +939,13 @@ void Dealer::openGame(QDomDocument &doc)
for (uint i = 0; i < piles.count(); ++i)
{
- QDomElement pile = piles.item(i).toElement();
+ TQDomElement pile = piles.item(i).toElement();
if (pile.attribute("index").toInt() == p->index())
{
- QDomNodeList pcards = pile.elementsByTagName("card");
+ TQDomNodeList pcards = pile.elementsByTagName("card");
for (uint j = 0; j < pcards.count(); ++j)
{
- QDomElement card = pcards.item(j).toElement();
+ TQDomElement card = pcards.item(j).toElement();
Card::Suit s = static_cast<Card::Suit>(card.attribute("suit").toInt());
Card::Rank v = static_cast<Card::Rank>(card.attribute("value").toInt());
@@ -953,7 +953,7 @@ void Dealer::openGame(QDomDocument &doc)
it2 != cards.end(); ++it2)
{
if ((*it2)->suit() == s && (*it2)->rank() == v) {
- if (QString((*it2)->name()) == "Diamonds Eight") {
+ if (TQString((*it2)->name()) == "Diamonds Eight") {
kdDebug(11111) << i << " " << j << endl;
}
p->add(*it2);
@@ -1034,7 +1034,7 @@ void Dealer::setWaiting(bool w)
void Dealer::setAutoDropEnabled(bool a)
{
_autodrop = a;
- QTimer::singleShot(TIME_BETWEEN_MOVES, this, SLOT(startAutoDrop()));
+ TQTimer::singleShot(TIME_BETWEEN_MOVES, this, TQT_SLOT(startAutoDrop()));
}
bool Dealer::startAutoDrop()
@@ -1042,11 +1042,11 @@ bool Dealer::startAutoDrop()
if (!autoDrop())
return false;
- QCanvasItemList list = canvas()->allItems();
+ TQCanvasItemList list = canvas()->allItems();
- for (QCanvasItemList::ConstIterator it = list.begin(); it != list.end(); ++it)
+ for (TQCanvasItemList::ConstIterator it = list.begin(); it != list.end(); ++it)
if ((*it)->animated()) {
- QTimer::singleShot(TIME_BETWEEN_MOVES, this, SLOT(startAutoDrop()));
+ TQTimer::singleShot(TIME_BETWEEN_MOVES, this, TQT_SLOT(startAutoDrop()));
return true;
}
@@ -1070,7 +1070,7 @@ bool Dealer::startAutoDrop()
t->move(x, y);
kdDebug(11111) << "autodrop " << t->name() << endl;
t->moveTo(int(t->source()->x()), int(t->source()->y()), int(t->z()), STEPS_AUTODROP);
- connect(t, SIGNAL(stoped(Card*)), SLOT(waitForAutoDrop(Card*)));
+ connect(t, TQT_SIGNAL(stoped(Card*)), TQT_SLOT(waitForAutoDrop(Card*)));
return true;
}
}
@@ -1160,20 +1160,20 @@ 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(QString("won%1").arg(_id),0) + 1;
- config->writeEntry(QString("won%1").arg(_id),n);
- n = config->readUnsignedNumEntry(QString("winstreak%1").arg(_id),0) + 1;
- config->writeEntry(QString("winstreak%1").arg(_id),n);
- unsigned int m = config->readUnsignedNumEntry(QString("maxwinstreak%1").arg(_id),0);
+ 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);
if (n>m)
- config->writeEntry(QString("maxwinstreak%1").arg(_id),n);
- config->writeEntry(QString("loosestreak%1").arg(_id),0);
+ config->writeEntry(TQString("maxwinstreak%1").arg(_id),n);
+ config->writeEntry(TQString("loosestreak%1").arg(_id),0);
}
// sort cards by increasing z
- QCanvasItemList list = canvas()->allItems();
- QValueList<CardPtr> cards;
- for (QCanvasItemList::ConstIterator it=list.begin(); it!=list.end(); ++it)
+ TQCanvasItemList list = canvas()->allItems();
+ TQValueList<CardPtr> cards;
+ for (TQCanvasItemList::ConstIterator it=list.begin(); it!=list.end(); ++it)
if ((*it)->rtti() == Card::RTTI) {
CardPtr p;
p.ptr = dynamic_cast<Card*>(*it);
@@ -1183,16 +1183,16 @@ void Dealer::won()
qHeapSort(cards);
// disperse the cards everywhere
- QRect can(0, 0, canvas()->width(), canvas()->height());
- QValueList<CardPtr>::ConstIterator it = cards.begin();
+ TQRect can(0, 0, canvas()->width(), canvas()->height());
+ TQValueList<CardPtr>::ConstIterator it = cards.begin();
for (; it != cards.end(); ++it) {
(*it).ptr->turn(true);
- QRect p(0, 0, (*it).ptr->width(), (*it).ptr->height());
+ TQRect p(0, 0, (*it).ptr->width(), (*it).ptr->height());
int x, y;
do {
x = 3*canvas()->width()/2 - kapp->random() % (canvas()->width() * 2);
y = 3*canvas()->height()/2 - (kapp->random() % (canvas()->height() * 2));
- p.moveTopLeft(QPoint(x, y));
+ p.moveTopLeft(TQPoint(x, y));
} while (can.intersects(p));
(*it).ptr->moveTo( x, y, 0, STEPS_WON);
@@ -1305,7 +1305,7 @@ Card *Dealer::demoNewCards()
void Dealer::newDemoMove(Card *m)
{
towait = m;
- connect(m, SIGNAL(stoped(Card*)), SLOT(waitForDemo(Card*)));
+ connect(m, TQT_SIGNAL(stoped(Card*)), TQT_SLOT(waitForDemo(Card*)));
}
void Dealer::waitForDemo(Card *t)
@@ -1344,8 +1344,8 @@ bool Dealer::checkAdd( int, const Pile *, const CardList&) const {
void Dealer::drawPile(KPixmap &pixmap, Pile *pile, bool selected)
{
- QPixmap bg = myCanvas.backgroundPixmap();
- QRect bounding(int(pile->x()), int(pile->y()), cardMap::CARDX(), cardMap::CARDY());
+ TQPixmap bg = myCanvas.backgroundPixmap();
+ TQRect bounding(int(pile->x()), int(pile->y()), cardMap::CARDX(), cardMap::CARDY());
pixmap.resize(bounding.width(), bounding.height());
pixmap.fill(Qt::white);
@@ -1401,24 +1401,24 @@ int Dealer::freeCells() const
return n;
}
-void Dealer::setAnchorName(const QString &name)
+void Dealer::setAnchorName(const TQString &name)
{
kdDebug(11111) << "setAnchorname " << name << endl;
ac = name;
}
-QString Dealer::anchorName() const { return ac; }
+TQString Dealer::anchorName() const { return ac; }
-void Dealer::wheelEvent( QWheelEvent *e )
+void Dealer::wheelEvent( TQWheelEvent *e )
{
- QWheelEvent ce( viewport()->mapFromGlobal( e->globalPos() ),
+ TQWheelEvent ce( viewport()->mapFromGlobal( e->globalPos() ),
e->globalPos(), e->delta(), e->state());
viewportWheelEvent(&ce);
if ( !ce.isAccepted() ) {
if ( e->orientation() == Horizontal && hScrollBarMode () == AlwaysOn )
- QApplication::sendEvent( horizontalScrollBar(), e);
+ TQApplication::sendEvent( horizontalScrollBar(), e);
else if (e->orientation() == Vertical && vScrollBarMode () == AlwaysOn )
- QApplication::sendEvent( verticalScrollBar(), e);
+ 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(QString("total%1").arg(_id),0);
+ unsigned int Total = config->readUnsignedNumEntry(TQString("total%1").arg(_id),0);
++Total;
- config->writeEntry(QString("total%1").arg(_id),Total);
+ config->writeEntry(TQString("total%1").arg(_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(QString("loosestreak%1").arg(_id),0) + 1;
- config->writeEntry(QString("loosestreak%1").arg(_id),n);
- unsigned int m = config->readUnsignedNumEntry(QString("maxloosestreak%1").arg(_id),0);
+ 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);
if (n>m)
- config->writeEntry(QString("maxloosestreak%1").arg(_id),n);
- config->writeEntry(QString("winstreak%1").arg(_id),0);
+ config->writeEntry(TQString("maxloosestreak%1").arg(_id),n);
+ config->writeEntry(TQString("winstreak%1").arg(_id),0);
}
}