#include <card_amount_widget.h>
|
| 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 or Sideboard).
|
|
| void | paintEvent (QPaintEvent *event) override |
| | Handles the painting of the widget, drawing a semi-transparent background.
|
| void | showEvent (QShowEvent *event) override |
|
| void | offsetCountAtIndex (const QModelIndex &idx, int offset) |
| | Offsets the card count at the specified index by the given amount.
|
| void | decrementCardHelper (const QString &zoneName) |
| | Helper function to decrement the card count for a given zone.
|
| void | recursiveExpand (const QModelIndex &index) |
| | Recursively expands the card in the deck view starting from the given index.
|
◆ CardAmountWidget()
| CardAmountWidget::CardAmountWidget |
( |
QWidget * | parent, |
|
|
AbstractTabDeckEditor * | deckEditor, |
|
|
DeckListModel * | deckModel, |
|
|
QTreeView * | deckView, |
|
|
QSlider * | cardSizeSlider, |
|
|
const ExactCard & | rootCard, |
|
|
const QString & | zoneName ) |
|
explicit |
Constructs a widget for displaying and controlling the card count in a specific zone.
- Parameters
-
| parent | The parent widget. |
| deckEditor | Pointer to the TabDeckEditor instance. |
| deckModel | Pointer to the DeckListModel instance. |
| deckView | Pointer to the QTreeView displaying the deck. |
| 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 or DECK_ZONE_SIDE). |
◆ addPrinting
| void CardAmountWidget::addPrinting |
( |
const QString & | zone | ) |
|
|
slot |
Adds a printing of the card to the specified zone (Mainboard or Sideboard).
- Parameters
-
| zone | The zone to add the card to (DECK_ZONE_MAIN or DECK_ZONE_SIDE). |
◆ addPrintingMainboard
| void CardAmountWidget::addPrintingMainboard |
( |
| ) |
|
|
privateslot |
Adds a printing to the mainboard zone.
◆ addPrintingSideboard
| void CardAmountWidget::addPrintingSideboard |
( |
| ) |
|
|
privateslot |
Adds a printing to the sideboard zone.
◆ adjustFontSize
| void CardAmountWidget::adjustFontSize |
( |
int | scalePercentage | ) |
|
|
privateslot |
Adjusts the font size of the card count label based on the slider value.
- Parameters
-
| scalePercentage | The percentage value from the slider for scaling the font size. |
< Minimum font size
< Maximum font size
< Scale at 100%
◆ countCardsInZone()
| int CardAmountWidget::countCardsInZone |
( |
const QString & | deckZone | ) |
|
Counts the number of cards in a specific zone (mainboard or sideboard).
- Parameters
-
| deckZone | The name of the zone (e.g., DECK_ZONE_MAIN or DECK_ZONE_SIDE). |
- Returns
- The number of cards in the zone.
◆ deckModified
| void CardAmountWidget::deckModified |
( |
const QString & | modificationReason | ) |
|
|
signal |
◆ decrementCardHelper()
| void CardAmountWidget::decrementCardHelper |
( |
const QString & | zone | ) |
|
|
private |
Helper function to decrement the card count for a given zone.
- Parameters
-
| zone | The zone from which to remove the card (DECK_ZONE_MAIN or DECK_ZONE_SIDE). |
◆ offsetCountAtIndex()
| void CardAmountWidget::offsetCountAtIndex |
( |
const QModelIndex & | idx, |
|
|
int | offset ) |
|
private |
Offsets the card count at the specified index by the given amount.
- Parameters
-
| idx | The model index of the card. |
| offset | The amount to add or subtract from the card count. |
◆ paintEvent()
| void CardAmountWidget::paintEvent |
( |
QPaintEvent * | event | ) |
|
|
overrideprotected |
Handles the painting of the widget, drawing a semi-transparent background.
- Parameters
-
◆ recursiveExpand()
| void CardAmountWidget::recursiveExpand |
( |
const QModelIndex & | index | ) |
|
|
private |
Recursively expands the card in the deck view starting from the given index.
- Parameters
-
| index | The model index of the card to expand. |
◆ removePrintingMainboard
| void CardAmountWidget::removePrintingMainboard |
( |
| ) |
|
|
privateslot |
Removes a printing from the mainboard zone.
◆ removePrintingSideboard
| void CardAmountWidget::removePrintingSideboard |
( |
| ) |
|
|
privateslot |
Removes a printing from the sideboard zone.
◆ showEvent()
| void CardAmountWidget::showEvent |
( |
QShowEvent * | event | ) |
|
|
overrideprotected |
◆ updateCardCount
| void CardAmountWidget::updateCardCount |
( |
| ) |
|
|
slot |
Updates the card count display in the widget.
◆ cardCountInZone
| QLabel* CardAmountWidget::cardCountInZone |
|
private |
◆ cardSizeSlider
| QSlider* CardAmountWidget::cardSizeSlider |
|
private |
◆ deckEditor
◆ deckModel
◆ deckView
| QTreeView* CardAmountWidget::deckView |
|
private |
◆ decrementButton
◆ hovered
| bool CardAmountWidget::hovered |
|
private |
◆ incrementButton
◆ layout
| QHBoxLayout* CardAmountWidget::layout |
|
private |
◆ rootCard
◆ zoneName
| QString CardAmountWidget::zoneName |
|
private |
The documentation for this class was generated from the following files: