Cockatrice 2026-01-14-Development-2.11.0-beta.46
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
ZoneViewWidget Class Reference

#include <view_zone_widget.h>

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

Signals

void closePressed (ZoneViewWidget *zv)

Public Member Functions

 ZoneViewWidget (Player *_player, CardZoneLogic *_origZone, int numberCards=0, bool _revealZone=false, bool _writeableRevealZone=false, const QList< const ServerInfo_Card * > &cardList=QList< const ServerInfo_Card * >(), bool _isReversed=false)
ZoneViewZonegetZone () const
PlayergetPlayer () const
void retranslateUi ()

Protected Member Functions

void closeEvent (QCloseEvent *event) override
void initStyleOption (QStyleOption *option) const override
bool windowFrameEvent (QEvent *event) override
QVariant itemChange (GraphicsItemChange change, const QVariant &value) override
void mouseMoveEvent (QGraphicsSceneMouseEvent *event) override
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override
void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) override

Private Slots

void processGroupBy (int value)
void processSortBy (int value)
void processSetPileView (QT_STATE_CHANGED_T value)
void resizeToZoneContents (bool forceInitialHeight=false)
void handleScrollBarChange (int value)
void zoneDeleted ()
void resizeEvent (QGraphicsSceneResizeEvent *) override
void expandWindow ()

Private Member Functions

void stopWindowDrag ()
void startWindowDrag (QGraphicsSceneMouseEvent *event)
QRectF closeButtonRect (QWidget *styleWidget) const
QGraphicsView * findDragView (QWidget *eventWidget) const
 Resolves the QGraphicsView to use for drag coordinate mapping.
QPointF calcDraggedWindowPos (const QPoint &screenPos, const QPointF &scenePos, const QPointF &buttonDownScenePos) const
 Calculates the desired widget position while dragging.
void resizeScrollbar (qreal newZoneHeight)

Private Attributes

ZoneViewZonezone
QGraphicsWidget * zoneContainer
QScrollBar * scrollBar
ScrollableGraphicsProxyWidgetscrollBarProxy
QLineEdit searchEdit
QComboBox groupBySelector
QComboBox sortBySelector
QCheckBox shuffleCheckBox
QCheckBox pileViewCheckBox
bool canBeShuffled
int extraHeight
Playerplayer
bool draggingWindow = false
QPoint dragStartScreenPos
QPointF dragStartItemPos
QPointer< QGraphicsView > dragView

Detailed Description

A QGraphicsWidget that holds a ZoneViewZone.

Some zone views allow sorting. This widget will display the sort options when relevant, and forward the values of the options to the ZoneViewZone.

Constructor & Destructor Documentation

◆ ZoneViewWidget()

ZoneViewWidget::ZoneViewWidget ( Player * _player,
CardZoneLogic * _origZone,
int numberCards = 0,
bool _revealZone = false,
bool _writeableRevealZone = false,
const QList< const ServerInfo_Card * > & cardList = QList<const ServerInfo_Card *>(),
bool _isReversed = false )
Parameters
_playerthe player the cards were revealed to.
_origZonethe zone the cards were revealed from.
numberCardsnum of cards to reveal from the zone. Ex: scry the top 3 cards. Pass in a negative number to reveal the entire zone. -1 specifically will give the option to shuffle the zone upon closing the window.
_revealZoneif false, the cards will be face down.
_writeableRevealZonewhether the player can interact with the revealed cards.
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ calcDraggedWindowPos()

QPointF ZoneViewWidget::calcDraggedWindowPos ( const QPoint & screenPos,
const QPointF & scenePos,
const QPointF & buttonDownScenePos ) const
private

Calculates the desired widget position while dragging.

Parameters
screenPosGlobal screen coordinates of the current mouse position
scenePosScene coordinates of the current mouse position
buttonDownScenePosScene coordinates of the initial mouse press position
Returns
The new widget position in scene coordinates
Here is the caller graph for this function:

◆ closeButtonRect()

QRectF ZoneViewWidget::closeButtonRect ( QWidget * styleWidget) const
private
Here is the caller graph for this function:

◆ closeEvent()

void ZoneViewWidget::closeEvent ( QCloseEvent * event)
overrideprotected
Here is the call graph for this function:

◆ closePressed

void ZoneViewWidget::closePressed ( ZoneViewWidget * zv)
signal
Here is the call graph for this function:
Here is the caller graph for this function:

◆ expandWindow

void ZoneViewWidget::expandWindow ( )
privateslot

Expands/shrinks the window, depending on the current height as well as the configured initial and expanded max heights.

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

◆ findDragView()

QGraphicsView * ZoneViewWidget::findDragView ( QWidget * eventWidget) const
private

Resolves the QGraphicsView to use for drag coordinate mapping.

Parameters
eventWidgetQWidget that originated the mouse event
Returns
The resolved QGraphicsView
Here is the caller graph for this function:

◆ getPlayer()

Player * ZoneViewWidget::getPlayer ( ) const
inline

◆ getZone()

ZoneViewZone * ZoneViewWidget::getZone ( ) const
inline

◆ handleScrollBarChange

void ZoneViewWidget::handleScrollBarChange ( int value)
privateslot
Here is the caller graph for this function:

◆ initStyleOption()

void ZoneViewWidget::initStyleOption ( QStyleOption * option) const
overrideprotected

◆ itemChange()

QVariant ZoneViewWidget::itemChange ( GraphicsItemChange change,
const QVariant & value )
overrideprotected

◆ mouseDoubleClickEvent()

void ZoneViewWidget::mouseDoubleClickEvent ( QGraphicsSceneMouseEvent * event)
overrideprotected
Here is the call graph for this function:

◆ mouseMoveEvent()

void ZoneViewWidget::mouseMoveEvent ( QGraphicsSceneMouseEvent * event)
overrideprotected
Here is the call graph for this function:

◆ mouseReleaseEvent()

void ZoneViewWidget::mouseReleaseEvent ( QGraphicsSceneMouseEvent * event)
overrideprotected
Here is the call graph for this function:

◆ processGroupBy

void ZoneViewWidget::processGroupBy ( int value)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processSetPileView

void ZoneViewWidget::processSetPileView ( QT_STATE_CHANGED_T value)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processSortBy

void ZoneViewWidget::processSortBy ( int value)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resizeEvent

void ZoneViewWidget::resizeEvent ( QGraphicsSceneResizeEvent * event)
overrideprivateslot
Here is the call graph for this function:

◆ resizeScrollbar()

void ZoneViewWidget::resizeScrollbar ( qreal newZoneHeight)
private
Here is the caller graph for this function:

◆ resizeToZoneContents

void ZoneViewWidget::resizeToZoneContents ( bool forceInitialHeight = false)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ retranslateUi()

void ZoneViewWidget::retranslateUi ( )
Here is the caller graph for this function:

◆ startWindowDrag()

void ZoneViewWidget::startWindowDrag ( QGraphicsSceneMouseEvent * event)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ stopWindowDrag()

void ZoneViewWidget::stopWindowDrag ( )
private
Here is the caller graph for this function:

◆ windowFrameEvent()

bool ZoneViewWidget::windowFrameEvent ( QEvent * event)
overrideprotected
Here is the call graph for this function:

◆ zoneDeleted

void ZoneViewWidget::zoneDeleted ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ canBeShuffled

bool ZoneViewWidget::canBeShuffled
private

◆ draggingWindow

bool ZoneViewWidget::draggingWindow = false
private

◆ dragStartItemPos

QPointF ZoneViewWidget::dragStartItemPos
private

◆ dragStartScreenPos

QPoint ZoneViewWidget::dragStartScreenPos
private

◆ dragView

QPointer<QGraphicsView> ZoneViewWidget::dragView
private

◆ extraHeight

int ZoneViewWidget::extraHeight
private

◆ groupBySelector

QComboBox ZoneViewWidget::groupBySelector
private

◆ pileViewCheckBox

QCheckBox ZoneViewWidget::pileViewCheckBox
private

◆ player

Player* ZoneViewWidget::player
private

◆ scrollBar

QScrollBar* ZoneViewWidget::scrollBar
private

◆ scrollBarProxy

ScrollableGraphicsProxyWidget* ZoneViewWidget::scrollBarProxy
private

◆ searchEdit

QLineEdit ZoneViewWidget::searchEdit
private

◆ shuffleCheckBox

QCheckBox ZoneViewWidget::shuffleCheckBox
private

◆ sortBySelector

QComboBox ZoneViewWidget::sortBySelector
private

◆ zone

ZoneViewZone* ZoneViewWidget::zone
private

◆ zoneContainer

QGraphicsWidget* ZoneViewWidget::zoneContainer
private

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