Cockatrice 2026-06-27-Development-3.1.0-beta.3
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
TabDeckEditorVisualTabWidget Class Reference

Tab container for the visual deck editor. More...

#include <tab_deck_editor_visual_tab_widget.h>

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

Public Slots

void onCardChanged (const ExactCard &activeCard)
 Emitted when the active card changes in the deck view.
void onCardChangedDatabaseDisplay (const ExactCard &activeCard)
 Emitted when the active card changes in the database display.
void onCardClickedDeckEditor (QMouseEvent *event, const ExactCard &card, const QString &zoneName)
 Emitted when a card is clicked in the deck view.
void onCardClickedDatabaseDisplay (QMouseEvent *event, const ExactCard &card)
 Emitted when a card is clicked in the database display.

Signals

void cardChanged (const ExactCard &activeCard)
void cardChangedDatabaseDisplay (const ExactCard &activeCard)
void cardClicked (QMouseEvent *event, const ExactCard &card, const QString &zoneName)
void cardClickedDatabaseDisplay (QMouseEvent *event, const ExactCard &card)
void cardAdded (const ExactCard &card, const QString &zoneName)
void cardDecremented (const ExactCard &card, const QString &zoneName)
void edhrecRequested (const CardInfoPtr &cardInfo, bool isCommander)
void printingSelectorRequested ()
void cardInfoRequested (const ExactCard &cardName)

Public Member Functions

 TabDeckEditorVisualTabWidget (QWidget *parent, AbstractTabDeckEditor *_deckEditor, DeckListModel *_deckModel, CardDatabaseModel *_cardDatabaseModel)
 Construct the tab widget with required models.
void addNewTab (QWidget *widget, const QString &title)
 Add a new tab with a widget and title.
void removeCurrentTab ()
 Remove the currently active tab.
void setTabTitle (int index, const QString &title)
 Set the title of a specific tab.
QWidget * getCurrentTab () const
 Get the currently active tab widget.
int getTabCount () const
 Get the total number of tabs.

Public Attributes

VisualDeckEditorWidgetvisualDeckView
 Visual deck editor widget.
DeckListStatisticsAnalyzerstatsAnalyzer
DeckAnalyticsWidgetdeckAnalytics
 Deck analytics widget.
VisualDatabaseDisplayWidgetvisualDatabaseDisplay
 Database display widget.
PrintingSelectorprintingSelector
 Printing selector widget.
VisualDeckEditorSampleHandWidgetsampleHandWidget
 Sample hand simulation widget.

Private Slots

void handleTabClose (int index)
 Handle closing of a tab at a given index.
void actAddCard (const ExactCard &card)
 Adds card to maindeck or side depending on whether ctrl is held.

Private Attributes

QVBoxLayout * layout
 Layout for tabs and controls.
AbstractTabDeckEditordeckEditor
 Reference to the deck editor.
DeckListModeldeckModel
 Deck list model.
CardDatabaseModelcardDatabaseModel
 Card database model.

Detailed Description

Tab container for the visual deck editor.

Description: TabDeckEditorVisualTabWidget is a QTabWidget container for visual deck editing sub-tabs. It organizes the visual deck, database display, deck analytics, and sample hand preview into separate tabs.

Purpose:

  • Provides a tabbed interface for multiple visual components of the deck editor.
  • Handles forwarding of card events (hover, click, selection) to TabDeckEditorVisual.
  • Manages dynamic tab addition, removal, and title updates.

Contained Sub-Tabs and Widgets:

Key Methods:

Constructor & Destructor Documentation

◆ TabDeckEditorVisualTabWidget()

TabDeckEditorVisualTabWidget::TabDeckEditorVisualTabWidget ( QWidget * parent,
AbstractTabDeckEditor * _deckEditor,
DeckListModel * _deckModel,
CardDatabaseModel * _cardDatabaseModel )
explicit

Construct the tab widget with required models.

Constructs the TabDeckEditorVisualTabWidget.

Parameters
parentParent widget.
_deckEditorPointer to the deck editor instance.
_deckModelDeck list model.
_cardDatabaseModelCard database model.
parentThe parent QWidget.
_deckEditorPointer to the associated deck editor.
_deckModelPointer to the deck list model.
_cardDatabaseModelPointer to the card database model.

Initializes all sub-widgets (visual deck view, database display, deck analytics, sample hand) and sets up the tab layout and signal connections.

Here is the call graph for this function:

Member Function Documentation

◆ actAddCard

void TabDeckEditorVisualTabWidget::actAddCard ( const ExactCard & card)
privateslot

Adds card to maindeck or side depending on whether ctrl is held.

Parameters
card
Here is the caller graph for this function:

◆ addNewTab()

void TabDeckEditorVisualTabWidget::addNewTab ( QWidget * widget,
const QString & title )

Add a new tab with a widget and title.

Adds a new tab with the given widget and title.

Parameters
widgetThe widget to add.
titleThe title of the tab.
Here is the caller graph for this function:

◆ cardAdded

void TabDeckEditorVisualTabWidget::cardAdded ( const ExactCard & card,
const QString & zoneName )
signal
Here is the caller graph for this function:

◆ cardChanged

void TabDeckEditorVisualTabWidget::cardChanged ( const ExactCard & activeCard)
signal
Here is the caller graph for this function:

◆ cardChangedDatabaseDisplay

void TabDeckEditorVisualTabWidget::cardChangedDatabaseDisplay ( const ExactCard & activeCard)
signal
Here is the caller graph for this function:

◆ cardClicked

void TabDeckEditorVisualTabWidget::cardClicked ( QMouseEvent * event,
const ExactCard & card,
const QString & zoneName )
signal
Here is the caller graph for this function:

◆ cardClickedDatabaseDisplay

void TabDeckEditorVisualTabWidget::cardClickedDatabaseDisplay ( QMouseEvent * event,
const ExactCard & card )
signal
Here is the caller graph for this function:

◆ cardDecremented

void TabDeckEditorVisualTabWidget::cardDecremented ( const ExactCard & card,
const QString & zoneName )
signal
Here is the caller graph for this function:

◆ cardInfoRequested

void TabDeckEditorVisualTabWidget::cardInfoRequested ( const ExactCard & cardName)
signal
Here is the caller graph for this function:

◆ edhrecRequested

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

◆ getCurrentTab()

QWidget * TabDeckEditorVisualTabWidget::getCurrentTab ( ) const
nodiscard

Get the currently active tab widget.

Returns the currently selected tab widget.

Returns
Pointer to the current tab widget.

◆ getTabCount()

int TabDeckEditorVisualTabWidget::getTabCount ( ) const
nodiscard

Get the total number of tabs.

Returns the number of tabs in the tab widget.

Returns
Number of tabs.

◆ handleTabClose

void TabDeckEditorVisualTabWidget::handleTabClose ( int index)
privateslot

Handle closing of a tab at a given index.

Handles the closing of a tab.

Parameters
indexIndex of the tab to close.
indexThe index of the tab to close.

Removes the tab and deletes the widget to free memory.

Here is the caller graph for this function:

◆ onCardChanged

void TabDeckEditorVisualTabWidget::onCardChanged ( const ExactCard & activeCard)
slot

Emitted when the active card changes in the deck view.

Emits the cardChanged signal when a card is activated in the visual deck view.

Parameters
activeCardNew active card.
activeCardThe card that was activated.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onCardChangedDatabaseDisplay

void TabDeckEditorVisualTabWidget::onCardChangedDatabaseDisplay ( const ExactCard & activeCard)
slot

Emitted when the active card changes in the database display.

Emits the cardChangedDatabaseDisplay signal when a card is hovered in the database display.

Parameters
activeCardNew active card.
activeCardThe card that was hovered.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onCardClickedDatabaseDisplay

void TabDeckEditorVisualTabWidget::onCardClickedDatabaseDisplay ( QMouseEvent * event,
const ExactCard & card )
slot

Emitted when a card is clicked in the database display.

Emits the cardClickedDatabaseDisplay signal when a card is clicked in the database display.

Parameters
eventMouse event.
cardThe clicked card.
eventThe mouse event.
cardThe clicked card.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onCardClickedDeckEditor

void TabDeckEditorVisualTabWidget::onCardClickedDeckEditor ( QMouseEvent * event,
const ExactCard & card,
const QString & zoneName )
slot

Emitted when a card is clicked in the deck view.

Emits the cardClicked signal when a card is clicked in the visual deck view.

Parameters
eventMouse event.
cardThe clicked card.
zoneNameDeck zone of the card.
eventThe mouse event.
cardThe clicked card.
zoneNameThe zone of the deck where the card is located.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ printingSelectorRequested

void TabDeckEditorVisualTabWidget::printingSelectorRequested ( )
signal
Here is the caller graph for this function:

◆ removeCurrentTab()

void TabDeckEditorVisualTabWidget::removeCurrentTab ( )

Remove the currently active tab.

Removes the currently selected tab.

◆ setTabTitle()

void TabDeckEditorVisualTabWidget::setTabTitle ( int index,
const QString & title )

Set the title of a specific tab.

Sets the title of a tab at a given index.

Parameters
indexThe index of the tab.
titleThe new title.

Member Data Documentation

◆ cardDatabaseModel

CardDatabaseModel* TabDeckEditorVisualTabWidget::cardDatabaseModel
private

Card database model.

◆ deckAnalytics

DeckAnalyticsWidget* TabDeckEditorVisualTabWidget::deckAnalytics

Deck analytics widget.

◆ deckEditor

AbstractTabDeckEditor* TabDeckEditorVisualTabWidget::deckEditor
private

Reference to the deck editor.

◆ deckModel

DeckListModel* TabDeckEditorVisualTabWidget::deckModel
private

Deck list model.

◆ layout

QVBoxLayout* TabDeckEditorVisualTabWidget::layout
private

Layout for tabs and controls.

◆ printingSelector

PrintingSelector* TabDeckEditorVisualTabWidget::printingSelector

Printing selector widget.

◆ sampleHandWidget

VisualDeckEditorSampleHandWidget* TabDeckEditorVisualTabWidget::sampleHandWidget

Sample hand simulation widget.

◆ statsAnalyzer

DeckListStatisticsAnalyzer* TabDeckEditorVisualTabWidget::statsAnalyzer

◆ visualDatabaseDisplay

VisualDatabaseDisplayWidget* TabDeckEditorVisualTabWidget::visualDatabaseDisplay

Database display widget.

◆ visualDeckView

VisualDeckEditorWidget* TabDeckEditorVisualTabWidget::visualDeckView

Visual deck editor widget.


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