Cockatrice 2026-03-05-Development-2.11.0-beta.54
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
DeckPreviewWidget Class Referencefinal

#include <deck_preview_widget.h>

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

Public Slots

void setFilePath (const QString &filePath)
void refreshBannerCardText ()
void refreshBannerCardToolTip ()
void updateBannerCardComboBox (const QString &currentText)
void setBannerCard (int)
void imageClickedEvent (QMouseEvent *event, DeckPreviewCardPictureWidget *instance)
void imageDoubleClickedEvent (QMouseEvent *event, DeckPreviewCardPictureWidget *instance)
void initializeUi (bool deckLoadSuccess)
void resyncWidgets ()
 Syncs the contents of the child widgets with the current deck.
void reloadIfModified ()
 Reloads the deck if the file's last modified time has increased since we last checked.
void updateVisibility ()
void updateColorIdentityVisibility (bool visible)
void updateBannerCardComboBoxVisibility (bool visible)
void updateTagsVisibility (bool visible)
void resizeEvent (QResizeEvent *event) override

Signals

void deckLoadRequested (const QString &filePath)
void openDeckEditor (const LoadedDeck &deck)

Public Member Functions

 DeckPreviewWidget (QWidget *_parent, VisualDeckStorageWidget *_visualDeckStorageWidget, const QString &_filePath)
void retranslateUi ()
QString getColorIdentity ()
QString getDisplayName () const
bool checkVisibility () const

Public Attributes

VisualDeckStorageWidgetvisualDeckStorageWidget
QVBoxLayout * layout
QString filePath
QDateTime lastModifiedTime
DeckLoaderdeckLoader
DeckPreviewCardPictureWidgetbannerCardDisplayWidget = nullptr
ColorIdentityWidgetcolorIdentityWidget = nullptr
DeckPreviewDeckTagsDisplayWidgetdeckTagsDisplayWidget = nullptr
QLabel * bannerCardLabel = nullptr
QComboBox * bannerCardComboBox = nullptr
bool filteredBySearch = false
bool filteredByColor = false
bool filteredByTags = false

Protected Member Functions

void enterEvent (QEnterEvent *event) override

Private Slots

void setTags (const QStringList &tags)
void actRenameDeck ()
void actRenameFile ()
void actDeleteFile ()

Private Member Functions

void updateLastModifiedTime ()
 Sets the lastModifiedTime to the value given by the file.
void writeDeckToFile ()
 Writes the current contents of the deck to file. Updates the lastModifiedTime afterward.
QMenu * createRightClickMenu ()
void addSetBannerCardMenu (QMenu *menu)

Constructor & Destructor Documentation

◆ DeckPreviewWidget()

DeckPreviewWidget::DeckPreviewWidget ( QWidget * _parent,
VisualDeckStorageWidget * _visualDeckStorageWidget,
const QString & _filePath )
explicit
Here is the call graph for this function:

Member Function Documentation

◆ actDeleteFile

void DeckPreviewWidget::actDeleteFile ( )
privateslot
Here is the caller graph for this function:

◆ actRenameDeck

void DeckPreviewWidget::actRenameDeck ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actRenameFile

void DeckPreviewWidget::actRenameFile ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addSetBannerCardMenu()

void DeckPreviewWidget::addSetBannerCardMenu ( QMenu * menu)
private

Adds the "Set Banner Card" submenu to the given menu. Does nothing if bannerCardComboBox is null.

Parameters
menuThe menu to add the submenu to
Here is the caller graph for this function:

◆ checkVisibility()

bool DeckPreviewWidget::checkVisibility ( ) const
nodiscard
Here is the caller graph for this function:

◆ createRightClickMenu()

QMenu * DeckPreviewWidget::createRightClickMenu ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ deckLoadRequested

void DeckPreviewWidget::deckLoadRequested ( const QString & filePath)
signal
Here is the caller graph for this function:

◆ enterEvent()

void DeckPreviewWidget::enterEvent ( QEnterEvent * event)
overrideprotected
Here is the call graph for this function:

◆ getColorIdentity()

QString DeckPreviewWidget::getColorIdentity ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDisplayName()

QString DeckPreviewWidget::getDisplayName ( ) const
nodiscard

The display name is given by the deck name, or the filename if the deck name is not set.

Here is the caller graph for this function:

◆ imageClickedEvent

void DeckPreviewWidget::imageClickedEvent ( QMouseEvent * event,
DeckPreviewCardPictureWidget * instance )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ imageDoubleClickedEvent

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

◆ initializeUi

void DeckPreviewWidget::initializeUi ( bool deckLoadSuccess)
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ openDeckEditor

void DeckPreviewWidget::openDeckEditor ( const LoadedDeck & deck)
signal
Here is the caller graph for this function:

◆ refreshBannerCardText

void DeckPreviewWidget::refreshBannerCardText ( )
slot

Refreshes the banner card text. This also calls refreshBannerCardToolTip, since those two often need to be updated together.

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

◆ refreshBannerCardToolTip

void DeckPreviewWidget::refreshBannerCardToolTip ( )
slot
Here is the caller graph for this function:

◆ reloadIfModified

void DeckPreviewWidget::reloadIfModified ( )
slot

Reloads the deck if the file's last modified time has increased since we last checked.

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

◆ resizeEvent

void DeckPreviewWidget::resizeEvent ( QResizeEvent * event)
overrideslot

◆ resyncWidgets

void DeckPreviewWidget::resyncWidgets ( )
slot

Syncs the contents of the child widgets with the current deck.

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

◆ retranslateUi()

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

◆ setBannerCard

void DeckPreviewWidget::setBannerCard ( int )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFilePath

void DeckPreviewWidget::setFilePath ( const QString & filePath)
slot
Here is the caller graph for this function:

◆ setTags

void DeckPreviewWidget::setTags ( const QStringList & tags)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateBannerCardComboBox

void DeckPreviewWidget::updateBannerCardComboBox ( const QString & currentText)
slot
Here is the caller graph for this function:

◆ updateBannerCardComboBoxVisibility

void DeckPreviewWidget::updateBannerCardComboBoxVisibility ( bool visible)
slot
Here is the caller graph for this function:

◆ updateColorIdentityVisibility

void DeckPreviewWidget::updateColorIdentityVisibility ( bool visible)
slot
Here is the caller graph for this function:

◆ updateLastModifiedTime()

void DeckPreviewWidget::updateLastModifiedTime ( )
private

Sets the lastModifiedTime to the value given by the file.

Here is the caller graph for this function:

◆ updateTagsVisibility

void DeckPreviewWidget::updateTagsVisibility ( bool visible)
slot
Here is the caller graph for this function:

◆ updateVisibility

void DeckPreviewWidget::updateVisibility ( )
slot
Here is the call graph for this function:

◆ writeDeckToFile()

void DeckPreviewWidget::writeDeckToFile ( )
private

Writes the current contents of the deck to file. Updates the lastModifiedTime afterward.

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

Member Data Documentation

◆ bannerCardComboBox

QComboBox* DeckPreviewWidget::bannerCardComboBox = nullptr

◆ bannerCardDisplayWidget

DeckPreviewCardPictureWidget* DeckPreviewWidget::bannerCardDisplayWidget = nullptr

◆ bannerCardLabel

QLabel* DeckPreviewWidget::bannerCardLabel = nullptr

◆ colorIdentityWidget

ColorIdentityWidget* DeckPreviewWidget::colorIdentityWidget = nullptr

◆ deckLoader

DeckLoader* DeckPreviewWidget::deckLoader

◆ deckTagsDisplayWidget

DeckPreviewDeckTagsDisplayWidget* DeckPreviewWidget::deckTagsDisplayWidget = nullptr

◆ filePath

QString DeckPreviewWidget::filePath

◆ filteredByColor

bool DeckPreviewWidget::filteredByColor = false

◆ filteredBySearch

bool DeckPreviewWidget::filteredBySearch = false

◆ filteredByTags

bool DeckPreviewWidget::filteredByTags = false

◆ lastModifiedTime

QDateTime DeckPreviewWidget::lastModifiedTime

◆ layout

QVBoxLayout* DeckPreviewWidget::layout

◆ visualDeckStorageWidget

VisualDeckStorageWidget* DeckPreviewWidget::visualDeckStorageWidget

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