improved last commit
This commit is contained in:
parent
44c64322d3
commit
a3f6adddc9
3 changed files with 4 additions and 10 deletions
|
@ -34,7 +34,6 @@ public:
|
||||||
|
|
||||||
class CardInfo {
|
class CardInfo {
|
||||||
private:
|
private:
|
||||||
class SetCompareFunctor;
|
|
||||||
CardDatabase *db;
|
CardDatabase *db;
|
||||||
|
|
||||||
QString name;
|
QString name;
|
||||||
|
|
|
@ -189,12 +189,13 @@ void CardItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
|
||||||
if (!zone->getPlayer()->getLocal())
|
if (!zone->getPlayer()->getLocal())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (zone->getName() == "hand") {
|
if (zone->getName() == "table")
|
||||||
|
((TableZone *) zone)->toggleTapped();
|
||||||
|
else {
|
||||||
TableZone *table = (TableZone *) zone->getPlayer()->getZones()->findZone("table");
|
TableZone *table = (TableZone *) zone->getPlayer()->getZones()->findZone("table");
|
||||||
QPoint gridPoint = table->getFreeGridPoint(info->getTableRow());
|
QPoint gridPoint = table->getFreeGridPoint(info->getTableRow());
|
||||||
table->handleDropEvent(id, zone, table->mapFromGrid(gridPoint).toPoint(), false);
|
table->handleDropEvent(id, zone, table->mapFromGrid(gridPoint).toPoint(), false);
|
||||||
} else if (zone->getName() == "table")
|
}
|
||||||
((TableZone *) zone)->toggleTapped();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CardItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
void CardItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
||||||
|
@ -203,11 +204,6 @@ void CardItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
||||||
QGraphicsItem::hoverEnterEvent(event);
|
QGraphicsItem::hoverEnterEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CardItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
|
||||||
{
|
|
||||||
QGraphicsItem::hoverLeaveEvent(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
QVariant CardItem::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
|
QVariant CardItem::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
|
||||||
{
|
{
|
||||||
if (change == ItemSelectedChange) {
|
if (change == ItemSelectedChange) {
|
||||||
|
|
|
@ -69,7 +69,6 @@ protected:
|
||||||
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
||||||
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
|
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
|
||||||
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
|
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
|
||||||
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
|
|
||||||
QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value);
|
QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue