![]() |
Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
|
#include <card_amount_widget.h>
Public Slots | |
| void | setAmount (int _amount) |
| void | updateCardCount () |
| Updates the card count display in the widget. | |
| void | addPrinting (const QString &zone) |
| Adds a printing of the card to the specified zone (Mainboard, Sideboard, or Tokensboard). | |
Signals | |
| void | deckModified (const QString &modificationReason) |
Public Member Functions | |
| CardAmountWidget (QWidget *parent, DeckStateManager *deckStateManager, QSlider *cardSizeSlider, const ExactCard &rootCard, const QString &zoneName) | |
| Constructs a widget for displaying and controlling the card count in a specific zone. | |
| int | getAmount () |
Protected Member Functions | |
| void | paintEvent (QPaintEvent *event) override |
| Handles the painting of the widget, drawing a semi-transparent background. | |
| void | showEvent (QShowEvent *event) override |
Private Slots | |
| void | addPrintingMainboard () |
| Adds a printing to the mainboard zone. | |
| void | addPrintingSideboard () |
| Adds a printing to the sideboard zone. | |
| void | addPrintingTokensboard () |
| Adds a printing to the tokens zone. | |
| void | removePrintingMainboard () |
| Removes a printing from the mainboard zone. | |
| void | removePrintingSideboard () |
| Removes a printing from the sideboard zone. | |
| void | removePrintingTokensboard () |
| Removes a printing from the tokens zone. | |
| void | adjustFontSize (int scalePercentage) |
| Adjusts the font size of the card count label based on the slider value. | |
Private Member Functions | |
| void | decrementCardHelper (const QString &zoneName) |
| Helper function to decrement the card count for a given zone. | |
Private Attributes | |
| DeckStateManager * | deckStateManager |
| QSlider * | cardSizeSlider |
| ExactCard | rootCard |
| QString | zoneName |
| QHBoxLayout * | layout |
| DynamicFontSizePushButton * | incrementButton |
| DynamicFontSizePushButton * | decrementButton |
| QLabel * | cardCountInZone |
| bool | hovered |
| int | amount = 0 |
|
explicit |
Constructs a widget for displaying and controlling the card count in a specific zone.
| parent | The parent widget. |
| cardSizeSlider | Pointer to the QSlider for adjusting font size. |
| rootCard | The root card to manage within the widget. |
| zoneName | The zone name (e.g., DECK_ZONE_MAIN , DECK_ZONE_SIDE, or DECK_ZONE_TOKENS). |
|
slot |
Adds a printing of the card to the specified zone (Mainboard, Sideboard, or Tokensboard).
| zone | The zone to add the card to (DECK_ZONE_MAIN, DECK_ZONE_SIDE, or DECK_ZONE_TOKENS). |
|
privateslot |
Adds a printing to the mainboard zone.
|
privateslot |
Adds a printing to the sideboard zone.
|
privateslot |
Adds a printing to the tokens zone.
|
privateslot |
Adjusts the font size of the card count label based on the slider value.
| scalePercentage | The percentage value from the slider for scaling the font size. |
< Minimum font size
< Maximum font size
< Scale at 100%
|
signal |
|
private |
Helper function to decrement the card count for a given zone.
| zone | The zone from which to remove the card (DECK_ZONE_MAIN, DECK_ZONE_SIDE, or DECK_ZONE_TOKENS). |
| int CardAmountWidget::getAmount | ( | ) |
|
overrideprotected |
Handles the painting of the widget, drawing a semi-transparent background.
| event | The paint event. |
|
privateslot |
Removes a printing from the mainboard zone.
|
privateslot |
Removes a printing from the sideboard zone.
|
privateslot |
Removes a printing from the tokens zone.
|
slot |
|
overrideprotected |
|
slot |
Updates the card count display in the widget.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |