Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
AllZonesCardAmountWidget Class Reference

#include <all_zones_card_amount_widget.h>

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

Public Slots

void adjustFontSize (int scalePercentage)
 Adjusts the font size of the zone labels based on the slider value.

Public Member Functions

 AllZonesCardAmountWidget (QWidget *parent, AbstractTabDeckEditor *deckEditor, DeckListModel *deckModel, QTreeView *deckView, QSlider *cardSizeSlider, const ExactCard &rootCard)
 Constructor for the AllZonesCardAmountWidget class.
int getMainboardAmount ()
 Gets the card count in the mainboard zone.
int getSideboardAmount ()
 Gets the card count in the sideboard zone.
void enterEvent (QEnterEvent *event) override
 Handles the event when the mouse enters the widget.

Private Attributes

QVBoxLayout * layout
AbstractTabDeckEditordeckEditor
DeckListModeldeckModel
QTreeView * deckView
QSlider * cardSizeSlider
ExactCard rootCard
QLabel * zoneLabelMainboard
CardAmountWidgetbuttonBoxMainboard
QLabel * zoneLabelSideboard
CardAmountWidgetbuttonBoxSideboard

Constructor & Destructor Documentation

◆ AllZonesCardAmountWidget()

AllZonesCardAmountWidget::AllZonesCardAmountWidget ( QWidget * parent,
AbstractTabDeckEditor * deckEditor,
DeckListModel * deckModel,
QTreeView * deckView,
QSlider * cardSizeSlider,
const ExactCard & rootCard )
explicit

Constructor for the AllZonesCardAmountWidget class.

Initializes the widget with its layout and sets up the connections and necessary UI elements for managing card counts in both the mainboard and sideboard zones.

Parameters
parentThe parent widget.
deckEditorPointer to the TabDeckEditor.
deckModelPointer to the DeckListModel.
deckViewPointer to the QTreeView for the deck display.
cardSizeSliderPointer to the QSlider used for dynamic font resizing.
rootCardThe root card for the widget.
Here is the call graph for this function:

Member Function Documentation

◆ adjustFontSize

void AllZonesCardAmountWidget::adjustFontSize ( int scalePercentage)
slot

Adjusts the font size of the zone labels based on the slider value.

This method calculates the new font size as a percentage of the original font size based on the slider value and applies it to the zone label text.

Parameters
scalePercentageThe scale percentage from the slider.
Here is the caller graph for this function:

◆ enterEvent()

void AllZonesCardAmountWidget::enterEvent ( QEnterEvent * event)
override

Handles the event when the mouse enters the widget.

This method is triggered when the mouse enters the widget's area, allowing for updates or interactions such as UI feedback or layout changes.

Parameters
eventThe event information for the mouse entry.

◆ getMainboardAmount()

int AllZonesCardAmountWidget::getMainboardAmount ( )

Gets the card count in the mainboard zone.

Returns
The number of cards in the mainboard.

◆ getSideboardAmount()

int AllZonesCardAmountWidget::getSideboardAmount ( )

Gets the card count in the sideboard zone.

Returns
The number of cards in the sideboard.

Member Data Documentation

◆ buttonBoxMainboard

CardAmountWidget* AllZonesCardAmountWidget::buttonBoxMainboard
private

◆ buttonBoxSideboard

CardAmountWidget* AllZonesCardAmountWidget::buttonBoxSideboard
private

◆ cardSizeSlider

QSlider* AllZonesCardAmountWidget::cardSizeSlider
private

◆ deckEditor

AbstractTabDeckEditor* AllZonesCardAmountWidget::deckEditor
private

◆ deckModel

DeckListModel* AllZonesCardAmountWidget::deckModel
private

◆ deckView

QTreeView* AllZonesCardAmountWidget::deckView
private

◆ layout

QVBoxLayout* AllZonesCardAmountWidget::layout
private

◆ rootCard

ExactCard AllZonesCardAmountWidget::rootCard
private

◆ zoneLabelMainboard

QLabel* AllZonesCardAmountWidget::zoneLabelMainboard
private

◆ zoneLabelSideboard

QLabel* AllZonesCardAmountWidget::zoneLabelSideboard
private

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