fixed compiler warnings

This commit is contained in:
Max-Wilhelm Bruker 2009-09-09 17:23:41 +02:00
parent 33e47c2653
commit 117a77655b
2 changed files with 7 additions and 7 deletions

View file

@ -39,7 +39,7 @@ Player::Player(const QString &_name, int _id, bool _local, CardDatabase *_db, Cl
table = new TableZone(this, this);
connect(table, SIGNAL(sizeChanged()), this, SLOT(updateBoundingRect()));
hand = new HandZone(this, table->boundingRect().height(), this);
hand = new HandZone(this, (int) table->boundingRect().height(), this);
base = QPointF(deck->boundingRect().width() + 60, 0);
hand->setPos(base);

View file

@ -13,7 +13,7 @@ TableZone::TableZone(Player *_p, QGraphicsItem *parent)
economicGrid = settings.value("table/economic", 1).toInt();
if (economicGrid)
height = 14.0 / 3 * CARD_HEIGHT + 3 * paddingY;
height = (int) (14.0 / 3 * CARD_HEIGHT + 3 * paddingY);
else
height = 4 * CARD_HEIGHT + 3 * paddingY;
width = minWidth + 2 * marginX;
@ -103,7 +103,7 @@ void TableZone::resizeToContents()
int xMax = 0;
for (int i = 0; i < cards.size(); ++i)
if (cards[i]->pos().x() > xMax)
xMax = cards[i]->pos().x();
xMax = (int) cards[i]->pos().x();
xMax += 2 * CARD_WIDTH;
if (xMax < minWidth)
xMax = minWidth;
@ -156,19 +156,19 @@ QPoint TableZone::mapToGrid(const QPointF &mapPoint) const
y = height - CARD_HEIGHT;
QPoint result = QPoint(
x * 2 / CARD_WIDTH,
y / (CARD_HEIGHT + paddingY)
(int) (x * 2 / CARD_WIDTH),
(int) (y / (CARD_HEIGHT + paddingY))
);
if (result.y() == 3) {
if (economicGrid)
return QPoint(
x * 2 / CARD_WIDTH - floor(x / (2 * CARD_WIDTH)),
(int) (x * 2 / CARD_WIDTH - floor(x / (2 * CARD_WIDTH))),
3
);
else
return QPoint(
x / (1.5 * CARD_WIDTH),
(int) (x / (1.5 * CARD_WIDTH)),
3
);
} else