Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
ZoneViewZone Class Reference

#include <view_zone.h>

Inheritance diagram for ZoneViewZone:
[legend]
Collaboration diagram for ZoneViewZone:
[legend]

Classes

struct  GridSize

Public Slots

void addToViews ()
void removeFromViews ()
void close ()
void setFilterString (const QString &_filterString)
void setGroupBy (CardList::SortOption _groupBy)
void setSortBy (CardList::SortOption _sortBy)
void setPileView (int _pileView)
Public Slots inherited from CardZone
bool showContextMenu (const QPoint &screenPos)
void onCardAdded (CardItem *addedCard)

Signals

void closed ()
void optimumRectChanged ()
void wheelEventReceived (QGraphicsSceneWheelEvent *event)

Public Member Functions

 ZoneViewZone (ZoneViewZoneLogic *_logic, QGraphicsItem *parent)
QRectF boundingRect () const override
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
void reorganizeCards () override
void initializeCards (const QList< const ServerInfo_Card * > &cardList=QList< const ServerInfo_Card * >())
void setGeometry (const QRectF &rect) override
QRectF getOptimumRect () const
Public Member Functions inherited from SelectZone
 SelectZone (CardZoneLogic *logic, QGraphicsItem *parent=nullptr)
Public Member Functions inherited from CardZone
int type () const override
 CardZone (CardZoneLogic *logic, QGraphicsItem *parent=nullptr)
void retranslateUi ()
CardZoneLogicgetLogic () const
void setMenu (QMenu *_menu, QAction *_doubleClickAction=0)
Public Member Functions inherited from AbstractGraphicsItem
 AbstractGraphicsItem (QGraphicsItem *parent=nullptr)

Protected Member Functions

QSizeF sizeHint (Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const override
void wheelEvent (QGraphicsSceneWheelEvent *event) override
Protected Member Functions inherited from SelectZone
void mouseMoveEvent (QGraphicsSceneMouseEvent *event) override
void mousePressEvent (QGraphicsSceneMouseEvent *event) override
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override
Protected Member Functions inherited from CardZone
void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) override
void mousePressEvent (QGraphicsSceneMouseEvent *event) override
virtual QPointF closestGridPoint (const QPointF &point)
QMenu * getMenu () const
Protected Member Functions inherited from AbstractGraphicsItem
void paintNumberEllipse (int number, int radius, const QColor &color, int position, int count, QPainter *painter)

Private Slots

void zoneDumpReceived (const Response &r)

Private Member Functions

GridSize positionCardsForDisplay (CardList &cards, CardList::SortOption pileOption=CardList::NoSort)
 Sets the position of each card to the proper position for the view.
void handleDropEvent (const QList< CardDragItem * > &dragItems, CardZoneLogic *startZone, const QPoint &dropPoint) override

Private Attributes

QRectF bRect
QRectF optimumRect
int minRows
FilterString filterString = FilterString("")
CardList::SortOption groupBy
CardList::SortOption sortBy
bool pileView

Static Private Attributes

static constexpr int HORIZONTAL_PADDING = 12
static constexpr int VERTICAL_PADDING = 5

Additional Inherited Members

Public Types inherited from CardZone
enum  { Type = typeZone }
Protected Attributes inherited from CardZone
QMenu * menu
QAction * doubleClickAction

Detailed Description

A CardZone that is a view into another CardZone. If this zone is writable, then modifications to this zone will be reflected in the underlying zone.

Most interactions with StackZones are handled through a zone view. For example, viewing the deck/graveyard/exile is handled through a view.

Handles both limited reveals (eg. look at top X cards) and full zone reveals (eg. searching the deck).

Constructor & Destructor Documentation

◆ ZoneViewZone()

ZoneViewZone::ZoneViewZone ( ZoneViewZoneLogic * _logic,
QGraphicsItem * parent )
Parameters
parentthe parent QGraphicsWidget containing the reveal zone
Here is the call graph for this function:

Member Function Documentation

◆ addToViews

void ZoneViewZone::addToViews ( )
slot
Here is the call graph for this function:

◆ boundingRect()

QRectF ZoneViewZone::boundingRect ( ) const
nodiscardoverride
Here is the caller graph for this function:

◆ close

void ZoneViewZone::close ( )
slot

Deletes this ZoneView and removes it from the origZone's views. You should normally call this method instead of deleteLater()

Here is the call graph for this function:
Here is the caller graph for this function:

◆ closed

void ZoneViewZone::closed ( )
signal
Here is the caller graph for this function:

◆ getOptimumRect()

QRectF ZoneViewZone::getOptimumRect ( ) const
inlinenodiscard

◆ handleDropEvent()

void ZoneViewZone::handleDropEvent ( const QList< CardDragItem * > & dragItems,
CardZoneLogic * startZone,
const QPoint & dropPoint )
overrideprivatevirtual

Implements CardZone.

Here is the call graph for this function:

◆ initializeCards()

void ZoneViewZone::initializeCards ( const QList< const ServerInfo_Card * > & cardList = QList<const ServerInfo_Card *>())
Here is the call graph for this function:

◆ optimumRectChanged

void ZoneViewZone::optimumRectChanged ( )
signal
Here is the caller graph for this function:

◆ paint()

void ZoneViewZone::paint ( QPainter * painter,
const QStyleOptionGraphicsItem * option,
QWidget * widget )
override
Here is the call graph for this function:

◆ positionCardsForDisplay()

ZoneViewZone::GridSize ZoneViewZone::positionCardsForDisplay ( CardList & cards,
CardList::SortOption pileOption = CardList::NoSort )
private

Sets the position of each card to the proper position for the view.

Parameters
cardsThe cards to reposition. Will modify the cards in the list.
pileOptionProperty used to group cards for the piles. Expects cards to be sorted by that property. Pass in NoSort to not make piles.
Returns
The number of rows and columns to display
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeFromViews

void ZoneViewZone::removeFromViews ( )
slot
Here is the call graph for this function:

◆ reorganizeCards()

void ZoneViewZone::reorganizeCards ( )
overridevirtual

Implements CardZone.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFilterString

void ZoneViewZone::setFilterString ( const QString & _filterString)
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setGeometry()

void ZoneViewZone::setGeometry ( const QRectF & rect)
override

◆ setGroupBy

void ZoneViewZone::setGroupBy ( CardList::SortOption _groupBy)
slot
Here is the call graph for this function:

◆ setPileView

void ZoneViewZone::setPileView ( int _pileView)
slot
Here is the call graph for this function:

◆ setSortBy

void ZoneViewZone::setSortBy ( CardList::SortOption _sortBy)
slot
Here is the call graph for this function:

◆ sizeHint()

QSizeF ZoneViewZone::sizeHint ( Qt::SizeHint which,
const QSizeF & constraint = QSizeF() ) const
nodiscardoverrideprotected

◆ wheelEvent()

void ZoneViewZone::wheelEvent ( QGraphicsSceneWheelEvent * event)
overrideprotected
Here is the call graph for this function:

◆ wheelEventReceived

void ZoneViewZone::wheelEventReceived ( QGraphicsSceneWheelEvent * event)
signal
Here is the caller graph for this function:

◆ zoneDumpReceived

void ZoneViewZone::zoneDumpReceived ( const Response & r)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ bRect

QRectF ZoneViewZone::bRect
private

◆ filterString

FilterString ZoneViewZone::filterString = FilterString("")
private

◆ groupBy

CardList::SortOption ZoneViewZone::groupBy
private

◆ HORIZONTAL_PADDING

int ZoneViewZone::HORIZONTAL_PADDING = 12
staticconstexprprivate

◆ minRows

int ZoneViewZone::minRows
private

◆ optimumRect

QRectF ZoneViewZone::optimumRect
private

◆ pileView

bool ZoneViewZone::pileView
private

◆ sortBy

CardList::SortOption ZoneViewZone::sortBy
private

◆ VERTICAL_PADDING

int ZoneViewZone::VERTICAL_PADDING = 5
staticconstexprprivate

The documentation for this class was generated from the following files: