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

The card database table. More...

#include <card_database_view.h>

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

Signals

void cardChanged (const QString &cardName)
void cardAdded (const QString &cardName, const QString &zoneName)
void cardDecremented (const QString &cardName, const QString &zoneName)
void edhrecClicked (const CardInfoPtr &cardInfo, bool isCommander)
void selectPrintingClicked ()
void relatedCardClicked (const QString &relatedCard)

Public Member Functions

 CardDatabaseView (QWidget *parent, CardDatabaseDisplayModel *model)
QString currentCardName () const
KeySignals * getKeySignals ()
 Get the KeySignals that are connected to this view. You can install the KeySignals as an eventFilter to capture keyboard shortcuts for adding and decrementing cards.
void setZoneMenuProvider (const std::function< QList< QPair< QString, QStringList > >()> &provider, const std::function< QString()> &newZoneHandler)
 Sets the provider used to populate the "Add to zone" submenu of the context menu. If no provider is set, the submenu is not shown.

Private Slots

void actDoubleClick ()
void addCard (const QString &zoneName)
void decrementCard (const QString &zoneName)
void updateCard (const QModelIndex &current, const QModelIndex &)
void resetSelectionIfEmpty ()
void copyDatabaseCellContents () const
void saveDbHeaderState ()
void openCustomMenu (QPoint point)

Private Attributes

KeySignals searchKeySignals
CardDatabaseDisplayModel * databaseDisplayModel
std::function< QList< QPair< QString, QStringList > >()> zoneMenuProvider
std::function< QString()> newZoneHandler

Detailed Description

The card database table.

Constructor & Destructor Documentation

◆ CardDatabaseView()

CardDatabaseView::CardDatabaseView ( QWidget * parent,
CardDatabaseDisplayModel * model )
explicit
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ actDoubleClick

void CardDatabaseView::actDoubleClick ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addCard

void CardDatabaseView::addCard ( const QString & zoneName)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cardAdded

void CardDatabaseView::cardAdded ( const QString & cardName,
const QString & zoneName )
signal
Here is the caller graph for this function:

◆ cardChanged

void CardDatabaseView::cardChanged ( const QString & cardName)
signal
Here is the caller graph for this function:

◆ cardDecremented

void CardDatabaseView::cardDecremented ( const QString & cardName,
const QString & zoneName )
signal
Here is the caller graph for this function:

◆ copyDatabaseCellContents

void CardDatabaseView::copyDatabaseCellContents ( ) const
privateslot
Here is the caller graph for this function:

◆ currentCardName()

QString CardDatabaseView::currentCardName ( ) const
Here is the caller graph for this function:

◆ decrementCard

void CardDatabaseView::decrementCard ( const QString & zoneName)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ edhrecClicked

void CardDatabaseView::edhrecClicked ( const CardInfoPtr & cardInfo,
bool isCommander )
signal
Here is the caller graph for this function:

◆ getKeySignals()

KeySignals * CardDatabaseView::getKeySignals ( )
inline

Get the KeySignals that are connected to this view. You can install the KeySignals as an eventFilter to capture keyboard shortcuts for adding and decrementing cards.

Here is the caller graph for this function:

◆ openCustomMenu

void CardDatabaseView::openCustomMenu ( QPoint point)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ relatedCardClicked

void CardDatabaseView::relatedCardClicked ( const QString & relatedCard)
signal
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resetSelectionIfEmpty

void CardDatabaseView::resetSelectionIfEmpty ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveDbHeaderState

void CardDatabaseView::saveDbHeaderState ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ selectPrintingClicked

void CardDatabaseView::selectPrintingClicked ( )
signal
Here is the caller graph for this function:

◆ setZoneMenuProvider()

void CardDatabaseView::setZoneMenuProvider ( const std::function< QList< QPair< QString, QStringList > >()> & provider,
const std::function< QString()> & newZoneHandler )

Sets the provider used to populate the "Add to zone" submenu of the context menu. If no provider is set, the submenu is not shown.

Parameters
providerReturns the custom zones of the current deck, grouped by board zone
newZoneHandlerCreates a new custom zone and returns its name, or an empty string if creation was cancelled. The menu entry is hidden when not provided.
Here is the caller graph for this function:

◆ updateCard

void CardDatabaseView::updateCard ( const QModelIndex & current,
const QModelIndex &  )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ databaseDisplayModel

CardDatabaseDisplayModel* CardDatabaseView::databaseDisplayModel
private

◆ newZoneHandler

std::function<QString()> CardDatabaseView::newZoneHandler
private

Handler invoked when the user picks "New zone..." from the add-to-zone menu. Returns the name of the created zone, or an empty string if creation was cancelled.

◆ searchKeySignals

KeySignals CardDatabaseView::searchKeySignals
private

◆ zoneMenuProvider

std::function<QList<QPair<QString, QStringList> >()> CardDatabaseView::zoneMenuProvider
private

Provides the custom zones available in the current deck, grouped by board zone. The list contains (board zone name, custom zone names) pairs for every board.


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