Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
PublicDeckPreviewWidget Class Referencefinal

A preview tile for a public deck published by another user. More...

#include <public_deck_preview_widget.h>

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

Signals

void openDeckRequested (int deckId)

Public Member Functions

 PublicDeckPreviewWidget (QWidget *parent, const RemotePublicDecksModel::DeckEntry &entry)
void setEntry (const RemotePublicDecksModel::DeckEntry &entry)
void setBaseAccessibleName (const QString &name)
 Sets the accessible name announced to assistive technologies.
void setScaleFactor (int scale)
 Scales the banner card picture, mirroring the Visual Deck Storage.

Protected Member Functions

void resizeEvent (QResizeEvent *event) override
void keyPressEvent (QKeyEvent *event) override

Private Slots

void imageClickedEvent (QMouseEvent *event, DeckPreviewCardPictureWidget *instance)
void imageDoubleClickedEvent (QMouseEvent *event, DeckPreviewCardPictureWidget *instance)
void updateColorIdentityVisibility ()
void updateTagsVisibility ()
void updateUploadTimeVisibility ()

Private Attributes

int deckId = 0
QString baseAccessibleName
bool hasColorIdentity = false
bool hasTags = false
bool hasUploadTime = false
int lastKnownBannerWidth = 0
QList< QWidget * > fixedWidthChildren
DeckPreviewCardPictureWidget * bannerCardDisplayWidget
ColorIdentityWidget * colorIdentityWidget
FlowWidget * tagsFlowWidget
QLabel * uploadTimeLabel

Detailed Description

A preview tile for a public deck published by another user.

Renders the banner card picture (looked up by name/provider in the card database) with the deck name overlaid, the color identity, the deck's tags (read-only) and its upload time, all from the metadata the server stores for the deck, so no deck list is downloaded until the user actually opens the deck. Double-clicking the banner requests opening it.

Constructor & Destructor Documentation

◆ PublicDeckPreviewWidget()

PublicDeckPreviewWidget::PublicDeckPreviewWidget ( QWidget * parent,
const RemotePublicDecksModel::DeckEntry & entry )
explicit
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ imageClickedEvent

void PublicDeckPreviewWidget::imageClickedEvent ( QMouseEvent * event,
DeckPreviewCardPictureWidget * instance )
privateslot
Here is the caller graph for this function:

◆ imageDoubleClickedEvent

void PublicDeckPreviewWidget::imageDoubleClickedEvent ( QMouseEvent * event,
DeckPreviewCardPictureWidget * instance )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ keyPressEvent()

void PublicDeckPreviewWidget::keyPressEvent ( QKeyEvent * event)
overrideprotected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ openDeckRequested

void PublicDeckPreviewWidget::openDeckRequested ( int deckId)
signal
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resizeEvent()

void PublicDeckPreviewWidget::resizeEvent ( QResizeEvent * event)
overrideprotected
Here is the caller graph for this function:

◆ setBaseAccessibleName()

void PublicDeckPreviewWidget::setBaseAccessibleName ( const QString & name)

Sets the accessible name announced to assistive technologies.

Here is the caller graph for this function:

◆ setEntry()

void PublicDeckPreviewWidget::setEntry ( const RemotePublicDecksModel::DeckEntry & entry)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setScaleFactor()

void PublicDeckPreviewWidget::setScaleFactor ( int scale)

Scales the banner card picture, mirroring the Visual Deck Storage.

Here is the call graph for this function:

◆ updateColorIdentityVisibility

void PublicDeckPreviewWidget::updateColorIdentityVisibility ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateTagsVisibility

void PublicDeckPreviewWidget::updateTagsVisibility ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateUploadTimeVisibility

void PublicDeckPreviewWidget::updateUploadTimeVisibility ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ bannerCardDisplayWidget

DeckPreviewCardPictureWidget* PublicDeckPreviewWidget::bannerCardDisplayWidget
private

◆ baseAccessibleName

QString PublicDeckPreviewWidget::baseAccessibleName
private

◆ colorIdentityWidget

ColorIdentityWidget* PublicDeckPreviewWidget::colorIdentityWidget
private

◆ deckId

int PublicDeckPreviewWidget::deckId = 0
private

◆ fixedWidthChildren

QList<QWidget *> PublicDeckPreviewWidget::fixedWidthChildren
private

◆ hasColorIdentity

bool PublicDeckPreviewWidget::hasColorIdentity = false
private

◆ hasTags

bool PublicDeckPreviewWidget::hasTags = false
private

◆ hasUploadTime

bool PublicDeckPreviewWidget::hasUploadTime = false
private

◆ lastKnownBannerWidth

int PublicDeckPreviewWidget::lastKnownBannerWidth = 0
private

◆ tagsFlowWidget

FlowWidget* PublicDeckPreviewWidget::tagsFlowWidget
private

◆ uploadTimeLabel

QLabel* PublicDeckPreviewWidget::uploadTimeLabel
private

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