mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 14:32:15 -07:00
Signal view removal, addition.
Took 5 minutes
This commit is contained in:
parent
aaf3c1e3b2
commit
d4a5bb3a79
4 changed files with 19 additions and 5 deletions
|
|
@ -149,11 +149,11 @@ void ZoneViewZoneLogic::removeCard(int position, bool toNewZone)
|
|||
|
||||
void ZoneViewZoneLogic::setWriteableRevealZone(bool _writeableRevealZone)
|
||||
{
|
||||
// TODO: Deal with this
|
||||
/*if (writeableRevealZone && !_writeableRevealZone) {
|
||||
origZone->getViews().append(this);
|
||||
|
||||
if (writeableRevealZone && !_writeableRevealZone) {
|
||||
emit addToViews();
|
||||
} else if (!writeableRevealZone && _writeableRevealZone) {
|
||||
origZone->getViews().removeOne(this);
|
||||
}*/
|
||||
emit removeFromViews();
|
||||
}
|
||||
writeableRevealZone = _writeableRevealZone;
|
||||
}
|
||||
|
|
@ -6,6 +6,8 @@ class ZoneViewZoneLogic : public CardZoneLogic
|
|||
{
|
||||
Q_OBJECT
|
||||
signals:
|
||||
void addToViews();
|
||||
void removeFromViews();
|
||||
void closeView();
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -34,6 +34,16 @@ ZoneViewZone::ZoneViewZone(ZoneViewZoneLogic *_logic, QGraphicsItem *parent)
|
|||
connect(_logic, &ZoneViewZoneLogic::closeView, this, &ZoneViewZone::close);
|
||||
}
|
||||
|
||||
void ZoneViewZone::addToViews()
|
||||
{
|
||||
qobject_cast<ZoneViewZoneLogic *>(getLogic())->getOriginalZone()->getViews().append(this);
|
||||
}
|
||||
|
||||
void ZoneViewZone::removeFromViews()
|
||||
{
|
||||
qobject_cast<ZoneViewZoneLogic *>(getLogic())->getOriginalZone()->getViews().removeOne(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes this ZoneView and removes it from the origZone's views.
|
||||
* You should normally call this method instead of deleteLater()
|
||||
|
|
|
|||
|
|
@ -62,6 +62,8 @@ public:
|
|||
return optimumRect;
|
||||
}
|
||||
public slots:
|
||||
void addToViews();
|
||||
void removeFromViews();
|
||||
void close();
|
||||
void setFilterString(const QString &_filterString);
|
||||
void setGroupBy(CardList::SortOption _groupBy);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue