mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
This closes feature request 0000020. Attention, this breaks protocol compatibility.
This commit is contained in:
parent
cfd715cce9
commit
41c4603fe9
12 changed files with 87 additions and 13 deletions
|
|
@ -64,6 +64,11 @@ DeckViewCard::DeckViewCard(const QString &_name, const QString &_originZone, QGr
|
|||
{
|
||||
}
|
||||
|
||||
DeckViewCard::~DeckViewCard()
|
||||
{
|
||||
delete dragItem;
|
||||
}
|
||||
|
||||
void DeckViewCard::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||
{
|
||||
AbstractCardItem::paint(painter, option, widget);
|
||||
|
|
@ -85,6 +90,9 @@ void DeckViewCard::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
|||
if ((event->screenPos() - event->buttonDownScreenPos(Qt::LeftButton)).manhattanLength() < 2 * QApplication::startDragDistance())
|
||||
return;
|
||||
|
||||
if (static_cast<DeckViewScene *>(scene())->getLocked())
|
||||
return;
|
||||
|
||||
delete dragItem;
|
||||
dragItem = new DeckViewCardDragItem(this, event->pos());
|
||||
scene()->addItem(dragItem);
|
||||
|
|
@ -185,7 +193,7 @@ void DeckViewCardContainer::setWidth(qreal _width)
|
|||
}
|
||||
|
||||
DeckViewScene::DeckViewScene(QObject *parent)
|
||||
: QGraphicsScene(parent), deck(0)
|
||||
: QGraphicsScene(parent), locked(false), deck(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue