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

A selectable preview tile for a deck that has no local file. More...

#include <shared_deck_preview_widget.h>

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

Signals

void selectionToggled (bool selected)
void activated ()

Public Member Functions

 SharedDeckPreviewWidget (QWidget *parent, const CardDatabaseQuerier *querier, const QString &deckName, const QString &bannerCardName, const QString &colorIdentity, const QString &gameFormat=QString(), const QString &deckToolTip=QString())
bool isSelected () const
void setSelected (bool selected)
void setBaseAccessibleName (const QString &name)

Protected Member Functions

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

Private Slots

void toggleSelection ()
void activate ()

Private Member Functions

void updateSelectionVisual (bool selected)
void updateSelectionFrameGeometry ()

Private Attributes

DeckPreviewCardPictureWidget * bannerCardDisplayWidget
ColorIdentityWidget * colorIdentityWidget
QLabel * gameFormatLabel
QCheckBox * selectionCheckBox
QFrame * selectionFrame
QString baseAccessibleName

Detailed Description

A selectable preview tile for a deck that has no local file.

Renders a banner card picture (looked up by name in the card database), the deck name, color identity and game format. Used to preview decks shared via a cockatrice:// link (metadata from Command_DeckShareList) and the deck currently open in the deck editor.

Selection follows the deck-preview covenant: the tile reports its click immediately (no double-click interval delay), a palette(highlight) frame marks the selected tile, and Space/Enter toggles selection from the keyboard. A double click selects the tile and emits activated() so the caller can open just that deck.

Constructor & Destructor Documentation

◆ SharedDeckPreviewWidget()

SharedDeckPreviewWidget::SharedDeckPreviewWidget ( QWidget * parent,
const CardDatabaseQuerier * querier,
const QString & deckName,
const QString & bannerCardName,
const QString & colorIdentity,
const QString & gameFormat = QString(),
const QString & deckToolTip = QString() )
explicit
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ activate

void SharedDeckPreviewWidget::activate ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ activated

void SharedDeckPreviewWidget::activated ( )
signal
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isSelected()

bool SharedDeckPreviewWidget::isSelected ( ) const
nodiscard
Here is the caller graph for this function:

◆ keyPressEvent()

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

◆ resizeEvent()

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

◆ selectionToggled

void SharedDeckPreviewWidget::selectionToggled ( bool selected)
signal
Here is the caller graph for this function:

◆ setBaseAccessibleName()

void SharedDeckPreviewWidget::setBaseAccessibleName ( const QString & name)
Here is the caller graph for this function:

◆ setSelected()

void SharedDeckPreviewWidget::setSelected ( bool selected)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ toggleSelection

void SharedDeckPreviewWidget::toggleSelection ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateSelectionFrameGeometry()

void SharedDeckPreviewWidget::updateSelectionFrameGeometry ( )
private
Here is the caller graph for this function:

◆ updateSelectionVisual()

void SharedDeckPreviewWidget::updateSelectionVisual ( bool selected)
private
Here is the caller graph for this function:

Member Data Documentation

◆ bannerCardDisplayWidget

DeckPreviewCardPictureWidget* SharedDeckPreviewWidget::bannerCardDisplayWidget
private

◆ baseAccessibleName

QString SharedDeckPreviewWidget::baseAccessibleName
private

◆ colorIdentityWidget

ColorIdentityWidget* SharedDeckPreviewWidget::colorIdentityWidget
private

◆ gameFormatLabel

QLabel* SharedDeckPreviewWidget::gameFormatLabel
private

◆ selectionCheckBox

QCheckBox* SharedDeckPreviewWidget::selectionCheckBox
private

◆ selectionFrame

QFrame* SharedDeckPreviewWidget::selectionFrame
private

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