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

#include <card_info_picture_enlarged_widget.h>

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

Public Member Functions

 CardInfoPictureEnlargedWidget (QWidget *parent=nullptr)
 Constructs a CardPictureEnlargedWidget.
void setCardPixmap (const ExactCard &_card, QSize size)
 Sets the pixmap for the widget based on a provided card.

Protected Member Functions

void paintEvent (QPaintEvent *event) override
 Custom paint event that draws the enlarged card image with rounded corners.

Private Member Functions

void loadPixmap (const QSize &size)
 Loads the pixmap based on the given size and card information.

Private Attributes

QPixmap enlargedPixmap
bool pixmapDirty
ExactCard card

Constructor & Destructor Documentation

◆ CardInfoPictureEnlargedWidget()

CardInfoPictureEnlargedWidget::CardInfoPictureEnlargedWidget ( QWidget * parent = nullptr)
explicit

Constructs a CardPictureEnlargedWidget.

Parameters
parentThe parent widget.

Sets the widget's window flags to keep it displayed as a tooltip overlay.

Here is the call graph for this function:

Member Function Documentation

◆ loadPixmap()

void CardInfoPictureEnlargedWidget::loadPixmap ( const QSize & size)
private

Loads the pixmap based on the given size and card information.

Parameters
sizeThe desired size for the loaded pixmap.

If card information is available, it loads the card's specific pixmap. Otherwise, it loads a default card back pixmap.

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

◆ paintEvent()

void CardInfoPictureEnlargedWidget::paintEvent ( QPaintEvent * event)
overrideprotected

Custom paint event that draws the enlarged card image with rounded corners.

Parameters
eventThe paint event (unused).

Checks if the pixmap is valid. Then, calculates the size and position for centering the scaled pixmap within the widget, applies rounded corners, and draws the pixmap.

Here is the call graph for this function:

◆ setCardPixmap()

void CardInfoPictureEnlargedWidget::setCardPixmap ( const ExactCard & _card,
QSize size )

Sets the pixmap for the widget based on a provided card.

Parameters
_cardThe card information to load.
sizeThe desired size for the pixmap.

Sets the widget's pixmap to the card image and resizes the widget to match the specified size. Triggers a repaint.

Here is the call graph for this function:

Member Data Documentation

◆ card

ExactCard CardInfoPictureEnlargedWidget::card
private

◆ enlargedPixmap

QPixmap CardInfoPictureEnlargedWidget::enlargedPixmap
private

◆ pixmapDirty

bool CardInfoPictureEnlargedWidget::pixmapDirty
private

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