Cockatrice 2026-01-14-Development-2.11.0-beta.46
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.
void setAmounts (int mainboardAmount, int sideboardAmount)

Public Member Functions

 AllZonesCardAmountWidget (QWidget *parent, DeckStateManager *deckStateManager, 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.
bool isNonZero ()
 Checks if the amount is at least one in either the mainboard or sideboard.
void enterEvent (QEnterEvent *event) override
 Handles the event when the mouse enters the widget.

Private Attributes

QVBoxLayout * layout
QSlider * cardSizeSlider
QLabel * zoneLabelMainboard
CardAmountWidgetbuttonBoxMainboard
QLabel * zoneLabelSideboard
CardAmountWidgetbuttonBoxSideboard

Constructor & Destructor Documentation

◆ AllZonesCardAmountWidget()

AllZonesCardAmountWidget::AllZonesCardAmountWidget ( QWidget * parent,
DeckStateManager * deckStateManager,
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.
deckStateManagerPointer to the DeckStateManager
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.
Here is the caller graph for this function:

◆ getSideboardAmount()

int AllZonesCardAmountWidget::getSideboardAmount ( )

Gets the card count in the sideboard zone.

Returns
The number of cards in the sideboard.
Here is the caller graph for this function:

◆ isNonZero()

bool AllZonesCardAmountWidget::isNonZero ( )

Checks if the amount is at least one in either the mainboard or sideboard.

Here is the call graph for this function:

◆ setAmounts

void AllZonesCardAmountWidget::setAmounts ( int mainboardAmount,
int sideboardAmount )
slot

Member Data Documentation

◆ buttonBoxMainboard

CardAmountWidget* AllZonesCardAmountWidget::buttonBoxMainboard
private

◆ buttonBoxSideboard

CardAmountWidget* AllZonesCardAmountWidget::buttonBoxSideboard
private

◆ cardSizeSlider

QSlider* AllZonesCardAmountWidget::cardSizeSlider
private

◆ layout

QVBoxLayout* AllZonesCardAmountWidget::layout
private

◆ zoneLabelMainboard

QLabel* AllZonesCardAmountWidget::zoneLabelMainboard
private

◆ zoneLabelSideboard

QLabel* AllZonesCardAmountWidget::zoneLabelSideboard
private

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