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

#include <deck_view.h>

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

Public Types

enum  { Type = typeDeckViewCardContainer }

Public Member Functions

int type () const override
 DeckViewCardContainer (const QString &_name)
QRectF boundingRect () const override
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
void addCard (DeckViewCard *card)
void removeCard (DeckViewCard *card)
const QList< DeckViewCard * > & getCards () const
const QString & getName () const
void setWidth (qreal _width)
QList< QPair< int, int > > getRowsAndCols () const
QSizeF calculateBoundingRect (const QList< QPair< int, int > > &rowsAndCols) const
void rearrangeItems (const QList< QPair< int, int > > &rowsAndCols)

Private Member Functions

int getCardTypeTextWidth () const

Static Private Member Functions

static bool sortCardsByName (DeckViewCard *c1, DeckViewCard *c2)

Private Attributes

QString name
QList< DeckViewCard * > cards
QMultiMap< QString, DeckViewCard * > cardsByType
QList< QPair< int, int > > currentRowsAndCols
qreal width
qreal height

Static Private Attributes

static const int separatorY = 20
static const int paddingY = 10

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Type 

Constructor & Destructor Documentation

◆ DeckViewCardContainer()

DeckViewCardContainer::DeckViewCardContainer ( const QString & _name)
explicit

Member Function Documentation

◆ addCard()

void DeckViewCardContainer::addCard ( DeckViewCard * card)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ boundingRect()

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

◆ calculateBoundingRect()

QSizeF DeckViewCardContainer::calculateBoundingRect ( const QList< QPair< int, int > > & rowsAndCols) const
nodiscard
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCards()

const QList< DeckViewCard * > & DeckViewCardContainer::getCards ( ) const
inlinenodiscard
Here is the caller graph for this function:

◆ getCardTypeTextWidth()

int DeckViewCardContainer::getCardTypeTextWidth ( ) const
nodiscardprivate
Here is the caller graph for this function:

◆ getName()

const QString & DeckViewCardContainer::getName ( ) const
inlinenodiscard
Here is the caller graph for this function:

◆ getRowsAndCols()

QList< QPair< int, int > > DeckViewCardContainer::getRowsAndCols ( ) const
nodiscard

◆ paint()

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

◆ rearrangeItems()

void DeckViewCardContainer::rearrangeItems ( const QList< QPair< int, int > > & rowsAndCols)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeCard()

void DeckViewCardContainer::removeCard ( DeckViewCard * card)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setWidth()

void DeckViewCardContainer::setWidth ( qreal _width)

◆ sortCardsByName()

bool DeckViewCardContainer::sortCardsByName ( DeckViewCard * c1,
DeckViewCard * c2 )
staticprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ type()

int DeckViewCardContainer::type ( ) const
inlinenodiscardoverride

Member Data Documentation

◆ cards

QList<DeckViewCard *> DeckViewCardContainer::cards
private

◆ cardsByType

QMultiMap<QString, DeckViewCard *> DeckViewCardContainer::cardsByType
private

◆ currentRowsAndCols

QList<QPair<int, int> > DeckViewCardContainer::currentRowsAndCols
private

◆ height

qreal DeckViewCardContainer::height
private

◆ name

QString DeckViewCardContainer::name
private

◆ paddingY

const int DeckViewCardContainer::paddingY = 10
staticprivate

◆ separatorY

const int DeckViewCardContainer::separatorY = 20
staticprivate

◆ width

qreal DeckViewCardContainer::width
private

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