#include <printing_selector_card_overlay_widget.h>
|
| void | resizeEvent (QResizeEvent *event) override |
| | Resizes the overlay widget to match the card's size.
|
| void | enterEvent (QEnterEvent *event) override |
| | Handles the mouse enter event when the cursor enters the overlay widget area.
|
| void | leaveEvent (QEvent *event) override |
| | Handles the mouse leave event when the cursor leaves the overlay widget area.
|
| void | mousePressEvent (QMouseEvent *event) override |
| | Handles the mouse press event for right-clicks to show the context menu.
|
| void | customMenu (QPoint point) |
| | Creates and shows a custom context menu when the right mouse button is clicked.
|
|
| void | initializePinBadge () |
| | Initializes the pin badge overlay and loads its icon with DPI-aware rasterization.
|
◆ PrintingSelectorCardOverlayWidget()
| PrintingSelectorCardOverlayWidget::PrintingSelectorCardOverlayWidget |
( |
QWidget * | parent, |
|
|
AbstractTabDeckEditor * | _deckEditor, |
|
|
DeckListModel * | _deckModel, |
|
|
QTreeView * | _deckView, |
|
|
QSlider * | _cardSizeSlider, |
|
|
const ExactCard & | _rootCard ) |
|
explicit |
Constructs a PrintingSelectorCardOverlayWidget for displaying a card overlay.
This widget is responsible for showing the card's image and providing interactive features such as a context menu and the ability to adjust the card's scale. It includes the card's image as well as a widget that displays the card amounts in different zones (mainboard, sideboard, etc.).
- Parameters
-
| parent | The parent widget for this overlay. |
| _deckEditor | The TabDeckEditor instance for deck management. |
| _deckModel | The DeckListModel instance providing deck data. |
| _deckView | The QTreeView instance displaying the deck. |
| _cardSizeSlider | The slider controlling the size of the card. |
| _rootCard | The root card object that contains information about the card. |
◆ cardPreferenceChanged
| void PrintingSelectorCardOverlayWidget::cardPreferenceChanged |
( |
| ) |
|
|
signal |
◆ customMenu()
| void PrintingSelectorCardOverlayWidget::customMenu |
( |
QPoint | point | ) |
|
|
protected |
Creates and shows a custom context menu when the right mouse button is clicked.
The context menu includes an option to show related cards, which displays a submenu with actions for each related card. When an action is triggered, the card information is updated, and the printing selector is shown.
- Parameters
-
| point | The position of the mouse when the right-click occurred. |
◆ enterEvent()
| void PrintingSelectorCardOverlayWidget::enterEvent |
( |
QEnterEvent * | event | ) |
|
|
overrideprotected |
Handles the mouse enter event when the cursor enters the overlay widget area.
When the cursor enters the widget, the card information is updated, and the card amount widget is displayed if the amounts are zero for both the mainboard and sideboard.
- Parameters
-
| event | The event triggered when the mouse enters the widget. |
◆ initializePinBadge()
| void PrintingSelectorCardOverlayWidget::initializePinBadge |
( |
| ) |
|
|
private |
Initializes the pin badge overlay and loads its icon with DPI-aware rasterization.
The icon is rasterized once using the label's device pixel ratio so it stays crisp on HiDPI displays. The resulting pixmap is cached on the QLabel and simply shown/hidden when needed. If the SVG cannot be read, a textual fallback badge is created instead.
◆ leaveEvent()
| void PrintingSelectorCardOverlayWidget::leaveEvent |
( |
QEvent * | event | ) |
|
|
overrideprotected |
Handles the mouse leave event when the cursor leaves the overlay widget area.
When the cursor leaves the widget, the card amount widget is hidden if both the mainboard and sideboard amounts are zero.
- Parameters
-
| event | The event triggered when the mouse leaves the widget. |
◆ mousePressEvent()
| void PrintingSelectorCardOverlayWidget::mousePressEvent |
( |
QMouseEvent * | event | ) |
|
|
overrideprotected |
Handles the mouse press event for right-clicks to show the context menu.
If the right mouse button is pressed, a custom context menu will appear. For other mouse buttons, the event is passed to the base class for default handling.
- Parameters
-
| event | The mouse event triggered by the user. |
◆ resizeEvent()
| void PrintingSelectorCardOverlayWidget::resizeEvent |
( |
QResizeEvent * | event | ) |
|
|
overrideprotected |
Resizes the overlay widget to match the card's size.
This method ensures that the amount widget matches the card's size when the overlay widget is resized. It also resizes the card info picture widget to match the new size.
- Parameters
-
| event | The resize event triggered when the widget is resized. |
◆ updatePinBadgeVisibility
| void PrintingSelectorCardOverlayWidget::updatePinBadgeVisibility |
( |
| ) |
|
|
privateslot |
Updates the pin badge visibility and position based on the card's pinned state.
This method checks whether the current card printing is pinned and updates the pin badge accordingly. If the card is pinned, the badge is made visible and positioned in the top-right corner of the card image with appropriate margins. If the card is not pinned, the badge is hidden.
The method is called whenever the card preference changes or the card size is adjusted via the slider to ensure the badge remains properly positioned.
◆ allZonesCardAmountWidget
◆ cardInfoPicture
◆ cardSizeSlider
| QSlider* PrintingSelectorCardOverlayWidget::cardSizeSlider |
|
private |
◆ deckEditor
◆ deckModel
◆ deckView
| QTreeView* PrintingSelectorCardOverlayWidget::deckView |
|
private |
◆ pinBadge
| QLabel* PrintingSelectorCardOverlayWidget::pinBadge = nullptr |
|
private |
◆ rootCard
| ExactCard PrintingSelectorCardOverlayWidget::rootCard |
|
private |
The documentation for this class was generated from the following files: