fixed compiler warnings
This commit is contained in:
parent
33e47c2653
commit
117a77655b
2 changed files with 7 additions and 7 deletions
|
@ -39,7 +39,7 @@ Player::Player(const QString &_name, int _id, bool _local, CardDatabase *_db, Cl
|
||||||
|
|
||||||
table = new TableZone(this, this);
|
table = new TableZone(this, this);
|
||||||
connect(table, SIGNAL(sizeChanged()), this, SLOT(updateBoundingRect()));
|
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);
|
base = QPointF(deck->boundingRect().width() + 60, 0);
|
||||||
hand->setPos(base);
|
hand->setPos(base);
|
||||||
|
|
|
@ -13,7 +13,7 @@ TableZone::TableZone(Player *_p, QGraphicsItem *parent)
|
||||||
|
|
||||||
economicGrid = settings.value("table/economic", 1).toInt();
|
economicGrid = settings.value("table/economic", 1).toInt();
|
||||||
if (economicGrid)
|
if (economicGrid)
|
||||||
height = 14.0 / 3 * CARD_HEIGHT + 3 * paddingY;
|
height = (int) (14.0 / 3 * CARD_HEIGHT + 3 * paddingY);
|
||||||
else
|
else
|
||||||
height = 4 * CARD_HEIGHT + 3 * paddingY;
|
height = 4 * CARD_HEIGHT + 3 * paddingY;
|
||||||
width = minWidth + 2 * marginX;
|
width = minWidth + 2 * marginX;
|
||||||
|
@ -103,7 +103,7 @@ void TableZone::resizeToContents()
|
||||||
int xMax = 0;
|
int xMax = 0;
|
||||||
for (int i = 0; i < cards.size(); ++i)
|
for (int i = 0; i < cards.size(); ++i)
|
||||||
if (cards[i]->pos().x() > xMax)
|
if (cards[i]->pos().x() > xMax)
|
||||||
xMax = cards[i]->pos().x();
|
xMax = (int) cards[i]->pos().x();
|
||||||
xMax += 2 * CARD_WIDTH;
|
xMax += 2 * CARD_WIDTH;
|
||||||
if (xMax < minWidth)
|
if (xMax < minWidth)
|
||||||
xMax = minWidth;
|
xMax = minWidth;
|
||||||
|
@ -156,19 +156,19 @@ QPoint TableZone::mapToGrid(const QPointF &mapPoint) const
|
||||||
y = height - CARD_HEIGHT;
|
y = height - CARD_HEIGHT;
|
||||||
|
|
||||||
QPoint result = QPoint(
|
QPoint result = QPoint(
|
||||||
x * 2 / CARD_WIDTH,
|
(int) (x * 2 / CARD_WIDTH),
|
||||||
y / (CARD_HEIGHT + paddingY)
|
(int) (y / (CARD_HEIGHT + paddingY))
|
||||||
);
|
);
|
||||||
|
|
||||||
if (result.y() == 3) {
|
if (result.y() == 3) {
|
||||||
if (economicGrid)
|
if (economicGrid)
|
||||||
return QPoint(
|
return QPoint(
|
||||||
x * 2 / CARD_WIDTH - floor(x / (2 * CARD_WIDTH)),
|
(int) (x * 2 / CARD_WIDTH - floor(x / (2 * CARD_WIDTH))),
|
||||||
3
|
3
|
||||||
);
|
);
|
||||||
else
|
else
|
||||||
return QPoint(
|
return QPoint(
|
||||||
x / (1.5 * CARD_WIDTH),
|
(int) (x / (1.5 * CARD_WIDTH)),
|
||||||
3
|
3
|
||||||
);
|
);
|
||||||
} else
|
} else
|
||||||
|
|
Loading…
Reference in a new issue