Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform 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, CardInfoPictureWithTextOverlayWidget *instance, QString zoneName)
 Emitted when a card is clicked in the deck view.
void onCardClickedDatabaseDisplay (QMouseEvent *event, CardInfoPictureWithTextOverlayWidget *instance)
 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, CardInfoPictureWithTextOverlayWidget *instance, QString zoneName)
void cardClickedDatabaseDisplay (QMouseEvent *event, CardInfoPictureWithTextOverlayWidget *instance)

Public Member Functions

 TabDeckEditorVisualTabWidget (QWidget *parent, AbstractTabDeckEditor *_deckEditor, DeckListModel *_deckModel, CardDatabaseModel *_cardDatabaseModel, CardDatabaseDisplayModel *_cardDatabaseDisplayModel)
 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.
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.

Private Attributes

QVBoxLayout * layout
 Layout for tabs and controls.
AbstractTabDeckEditordeckEditor
 Reference to the deck editor.
DeckListModeldeckModel
 Deck list model.
CardDatabaseModelcardDatabaseModel
 Card database model.
CardDatabaseDisplayModelcardDatabaseDisplayModel
 Card database display 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,
CardDatabaseDisplayModel * _cardDatabaseDisplayModel )
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.
_cardDatabaseDisplayModelDatabase display model.
parentThe parent QWidget.
_deckEditorPointer to the associated deck editor.
_deckModelPointer to the deck list model.
_cardDatabaseModelPointer to the card database model.
_cardDatabaseDisplayModelPointer to the card database display 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

◆ 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:

◆ 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,
CardInfoPictureWithTextOverlayWidget * instance,
QString zoneName )
signal
Here is the caller graph for this function:

◆ cardClickedDatabaseDisplay

void TabDeckEditorVisualTabWidget::cardClickedDatabaseDisplay ( QMouseEvent * event,
CardInfoPictureWithTextOverlayWidget * instance )
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,
CardInfoPictureWithTextOverlayWidget * instance )
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.
instanceWidget representing the clicked card.
eventThe mouse event.
instanceThe widget instance of the clicked card.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onCardClickedDeckEditor

void TabDeckEditorVisualTabWidget::onCardClickedDeckEditor ( QMouseEvent * event,
CardInfoPictureWithTextOverlayWidget * instance,
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.
instanceWidget representing the clicked card.
zoneNameDeck zone of the card.
eventThe mouse event.
instanceThe widget instance of the 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:

◆ 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

◆ cardDatabaseDisplayModel

CardDatabaseDisplayModel* TabDeckEditorVisualTabWidget::cardDatabaseDisplayModel
private

Card database display model.

◆ 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.

◆ 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: