mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -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
|
|
@ -115,6 +115,7 @@ void CardInfoWidget::setCard(CardInfo *card)
|
|||
disconnect(info, 0, this, 0);
|
||||
info = card;
|
||||
connect(info, SIGNAL(pixmapUpdated()), this, SLOT(updatePixmap()));
|
||||
connect(info, SIGNAL(destroyed()), this, SLOT(clear()));
|
||||
|
||||
updatePixmap();
|
||||
nameLabel2->setText(card->getName());
|
||||
|
|
@ -134,6 +135,11 @@ void CardInfoWidget::setCard(AbstractCardItem *card)
|
|||
setCard(card->getInfo());
|
||||
}
|
||||
|
||||
void CardInfoWidget::clear()
|
||||
{
|
||||
setCard(db->getCard());
|
||||
}
|
||||
|
||||
void CardInfoWidget::updatePixmap()
|
||||
{
|
||||
QPixmap *resizedPixmap = info->getPixmap(QSize(pixmapWidth, pixmapWidth * aspectRatio));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue