fixed card hover event in sideboard screen
This commit is contained in:
parent
596e7be8b1
commit
dcf54ae2de
3 changed files with 8 additions and 1 deletions
|
@ -17,7 +17,6 @@ AbstractCardItem::AbstractCardItem(const QString &_name, Player *_owner, QGraphi
|
|||
{
|
||||
setCursor(Qt::OpenHandCursor);
|
||||
setFlag(ItemIsSelectable);
|
||||
setAcceptsHoverEvents(true);
|
||||
setCacheMode(DeviceCoordinateCache);
|
||||
|
||||
connect(info, SIGNAL(pixmapUpdated()), this, SLOT(pixmapUpdated()));
|
||||
|
|
|
@ -64,6 +64,7 @@ void DeckViewCardDragItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||
DeckViewCard::DeckViewCard(const QString &_name, const QString &_originZone, QGraphicsItem *parent)
|
||||
: AbstractCardItem(_name, 0, parent), originZone(_originZone), dragItem(0)
|
||||
{
|
||||
setAcceptsHoverEvents(true);
|
||||
}
|
||||
|
||||
DeckViewCard::~DeckViewCard()
|
||||
|
@ -116,6 +117,12 @@ void DeckViewCard::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
|||
setCursor(Qt::OpenHandCursor);
|
||||
}
|
||||
|
||||
void DeckViewCard::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
event->accept();
|
||||
processHoverEvent();
|
||||
}
|
||||
|
||||
DeckViewCardContainer::DeckViewCardContainer(const QString &_name)
|
||||
: QGraphicsItem(), name(_name), width(0), height(0), maxWidth(0)
|
||||
{
|
||||
|
|
|
@ -26,6 +26,7 @@ public:
|
|||
const QString &getOriginZone() const { return originZone; }
|
||||
protected:
|
||||
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
|
||||
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
|
||||
};
|
||||
|
||||
class DeckViewCardDragItem : public AbstractCardDragItem {
|
||||
|
|
Loading…
Reference in a new issue