mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 08:34:52 -07:00
event handling
This commit is contained in:
parent
e796af2b89
commit
77015c9ebf
34 changed files with 891 additions and 855 deletions
|
|
@ -1,12 +1,13 @@
|
|||
#include "cardinfowidget.h"
|
||||
#include "carditem.h"
|
||||
#include <QGridLayout>
|
||||
#include <QLabel>
|
||||
#include <QTextEdit>
|
||||
#include <QMessageBox>
|
||||
#include "cardinfowidget.h"
|
||||
#include "carditem.h"
|
||||
#include "carddatabase.h"
|
||||
#include "main.h"
|
||||
|
||||
CardInfoWidget::CardInfoWidget(CardDatabase *_db, QWidget *parent)
|
||||
: QFrame(parent), db(_db), pixmapHeight(pixmapWidth), info(0)
|
||||
CardInfoWidget::CardInfoWidget(QWidget *parent)
|
||||
: QFrame(parent), pixmapHeight(pixmapWidth), info(0)
|
||||
{
|
||||
cardPicture = new QLabel;
|
||||
cardPicture->setAlignment(Qt::AlignCenter);
|
||||
|
|
@ -62,15 +63,12 @@ CardInfoWidget::CardInfoWidget(CardDatabase *_db, QWidget *parent)
|
|||
|
||||
retranslateUi();
|
||||
setFrameStyle(QFrame::Panel | QFrame::Raised);
|
||||
textLabel->setFixedHeight(130);
|
||||
textLabel->setFixedHeight(100);
|
||||
setFixedSize(sizeHint());
|
||||
}
|
||||
|
||||
void CardInfoWidget::setCard(CardInfo *card)
|
||||
{
|
||||
if (!card)
|
||||
return;
|
||||
|
||||
if (info)
|
||||
disconnect(info, 0, this, 0);
|
||||
info = card;
|
||||
|
|
@ -89,6 +87,11 @@ void CardInfoWidget::setCard(const QString &cardName)
|
|||
setCard(db->getCard(cardName));
|
||||
}
|
||||
|
||||
void CardInfoWidget::setCard(CardItem *card)
|
||||
{
|
||||
setCard(card->getInfo());
|
||||
}
|
||||
|
||||
void CardInfoWidget::updatePixmap()
|
||||
{
|
||||
QPixmap *resizedPixmap = info->getPixmap(QSize(pixmapWidth, pixmapHeight));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue