mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 08:14:47 -07:00
fixed crash that occurs when reloading the card database while deck editor or game is running
This commit is contained in:
parent
b0656ffcea
commit
7a7b686e67
8 changed files with 31 additions and 3 deletions
|
|
@ -13,14 +13,15 @@
|
|||
#include <QTimer>
|
||||
|
||||
AbstractCardItem::AbstractCardItem(const QString &_name, Player *_owner, QGraphicsItem *parent)
|
||||
: ArrowTarget(_owner, parent), info(db->getCard(_name)), infoWidget(0), name(_name), tapped(false), tapAngle(0), isHovered(false), realZValue(0)
|
||||
: ArrowTarget(_owner, parent), infoWidget(0), name(_name), tapped(false), tapAngle(0), isHovered(false), realZValue(0)
|
||||
{
|
||||
setCursor(Qt::OpenHandCursor);
|
||||
setFlag(ItemIsSelectable);
|
||||
setCacheMode(DeviceCoordinateCache);
|
||||
|
||||
connect(info, SIGNAL(pixmapUpdated()), this, SLOT(pixmapUpdated()));
|
||||
|
||||
connect(db, SIGNAL(cardListChanged()), this, SLOT(cardInfoUpdated()));
|
||||
connect(settingsCache, SIGNAL(displayCardNamesChanged()), this, SLOT(callUpdate()));
|
||||
cardInfoUpdated();
|
||||
|
||||
animationTimer = new QTimer(this);
|
||||
animationTimer->setSingleShot(false);
|
||||
|
|
@ -42,6 +43,12 @@ void AbstractCardItem::pixmapUpdated()
|
|||
update();
|
||||
}
|
||||
|
||||
void AbstractCardItem::cardInfoUpdated()
|
||||
{
|
||||
info = db->getCard(name);
|
||||
connect(info, SIGNAL(pixmapUpdated()), this, SLOT(pixmapUpdated()));
|
||||
}
|
||||
|
||||
void AbstractCardItem::setRealZValue(qreal _zValue)
|
||||
{
|
||||
realZValue = _zValue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue