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

#include <deck_preview_card_picture_widget.h>

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

Signals

void imageClicked (QMouseEvent *event, DeckPreviewCardPictureWidget *instance)
void imageDoubleClicked (QMouseEvent *event, DeckPreviewCardPictureWidget *instance)
Signals inherited from CardInfoPictureWithTextOverlayWidget
void imageClicked (QMouseEvent *event, CardInfoPictureWithTextOverlayWidget *instance)
Signals inherited from CardInfoPictureWidget
void hoveredOnCard (const ExactCard &hoveredCard)
void cardScaleFactorChanged (int _scale)
void cardChanged (const ExactCard &card)
void cardClicked ()

Public Member Functions

 DeckPreviewCardPictureWidget (QWidget *parent, bool hoverToZoomEnabled=false, bool raiseOnEnter=false, const QColor &textColor=Qt::white, const QColor &outlineColor=Qt::black, int fontSize=12, Qt::Alignment alignment=Qt::AlignCenter)
 Constructs a CardPictureWithTextOverlay widget.
Public Member Functions inherited from CardInfoPictureWithTextOverlayWidget
 CardInfoPictureWithTextOverlayWidget (QWidget *parent=nullptr, bool hoverToZoomEnabled=false, bool raiseOnEnter=false, const QColor &textColor=Qt::white, const QColor &outlineColor=Qt::black, int fontSize=12, Qt::Alignment alignment=Qt::AlignCenter)
 Constructs a CardPictureWithTextOverlay widget.
void setOverlayText (const QString &text)
 Sets the overlay text to be displayed on the card.
void setTextColor (const QColor &color)
 Sets the color of the overlay text.
void setOutlineColor (const QColor &color)
 Sets the outline color around the overlay text.
void setFontSize (int size)
 Sets the font size for the overlay text.
void setTextAlignment (Qt::Alignment alignment)
 Sets the alignment of the overlay text within the widget.
void setHighlighted (bool _highlighted)
QSize sizeHint () const override
 Provides the recommended size for this widget.
Public Member Functions inherited from CardInfoPictureWidget
 CardInfoPictureWidget (QWidget *parent=nullptr, bool hoverToZoomEnabled=false, bool raiseOnEnter=false)
 Constructs a CardInfoPictureWidget.
ExactCard getCard ()
QSize sizeHint () const override
 Provides the recommended size for the widget based on the scale factor.

Protected Member Functions

void mousePressEvent (QMouseEvent *event) override
void mouseDoubleClickEvent (QMouseEvent *event) override
Protected Member Functions inherited from CardInfoPictureWithTextOverlayWidget
void paintEvent (QPaintEvent *event) override
 Paints the widget, including both the card image and the text overlay.
void mousePressEvent (QMouseEvent *event) override
QSize minimumSizeHint () const override
 Provides the minimum recommended size for this widget.
Protected Member Functions inherited from CardInfoPictureWidget
void resizeEvent (QResizeEvent *event) override
 Handles widget resizing by updating the pixmap size.
void paintEvent (QPaintEvent *) override
 Custom paint event that draws the card image with rounded corners.
void enterEvent (QEnterEvent *event) override
 Starts the hover timer to show the enlarged pixmap on hover.
void leaveEvent (QEvent *event) override
 Stops the hover timer and hides the enlarged pixmap when the mouse leaves.
void moveEvent (QMoveEvent *event) override
void mouseMoveEvent (QMouseEvent *event) override
 Moves the enlarged pixmap widget to follow the mouse cursor.
void mousePressEvent (QMouseEvent *event) override
void hideEvent (QHideEvent *event) override
void loadPixmap ()
 Loads the appropriate pixmap based on the current card info.
const QPixmap & getResizedPixmap () const
void showEnlargedPixmap () const
 Displays the enlarged version of the card's pixmap near the cursor.

Private Attributes

QTimer * singleClickTimer
QMouseEvent * lastMouseEvent = nullptr

Additional Inherited Members

Public Slots inherited from CardInfoPictureWidget
void setCard (const ExactCard &card)
 Sets the card to be displayed and updates the pixmap.
void setScaleFactor (int scale)
 Sets the scale factor for the widget.
void setHoverToZoomEnabled (bool enabled)
 Sets the hover to zoom feature.
void setRaiseOnEnterEnabled (bool enabled)
void updatePixmap ()
 Marks the pixmap as dirty and triggers a widget repaint.

Constructor & Destructor Documentation

◆ DeckPreviewCardPictureWidget()

DeckPreviewCardPictureWidget::DeckPreviewCardPictureWidget ( QWidget * parent,
bool hoverToZoomEnabled = false,
bool raiseOnEnter = false,
const QColor & textColor = Qt::white,
const QColor & outlineColor = Qt::black,
int fontSize = 12,
Qt::Alignment alignment = Qt::AlignCenter )
explicit

Constructs a CardPictureWithTextOverlay widget.

Parameters
parentThe parent widget.
hoverToZoomEnabledIf this widget will spawn a larger widget when hovered over.
textColorThe color of the overlay text.
outlineColorThe color of the outline around the text.
fontSizeThe font size of the overlay text.
alignmentThe alignment of the text within the overlay.
_deckLoaderThe Deck Loader holding the Deck associated with this preview.

Sets the widget's size policy and default border style.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ imageClicked

void DeckPreviewCardPictureWidget::imageClicked ( QMouseEvent * event,
DeckPreviewCardPictureWidget * instance )
signal
Here is the call graph for this function:
Here is the caller graph for this function:

◆ imageDoubleClicked

void DeckPreviewCardPictureWidget::imageDoubleClicked ( QMouseEvent * event,
DeckPreviewCardPictureWidget * instance )
signal
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mouseDoubleClickEvent()

void DeckPreviewCardPictureWidget::mouseDoubleClickEvent ( QMouseEvent * event)
overrideprotected
Here is the call graph for this function:

◆ mousePressEvent()

void DeckPreviewCardPictureWidget::mousePressEvent ( QMouseEvent * event)
overrideprotected
Here is the call graph for this function:

Member Data Documentation

◆ lastMouseEvent

QMouseEvent* DeckPreviewCardPictureWidget::lastMouseEvent = nullptr
private

◆ singleClickTimer

QTimer* DeckPreviewCardPictureWidget::singleClickTimer
private

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