![]() |
Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
|
#include <deck_preview_card_picture_widget.h>
Signals | |
| void | imageClicked (QMouseEvent *event, DeckPreviewCardPictureWidget *instance) |
| void | imageSingleClicked () |
| void | imageDoubleClicked (QMouseEvent *event, DeckPreviewCardPictureWidget *instance) |
| Signals inherited from CardInfoPictureWidget | |
| void | hoveredOnCard (const ExactCard &hoveredCard) |
| void | cardScaleFactorChanged (int _scale) |
| void | cardChanged (const ExactCard &card) |
| void | cardClicked (QMouseEvent *event, const ExactCard &card) |
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, bool _emitClickImmediately=false) | |
| Constructs a DeckPreviewCardPictureWidget. | |
| 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 () |
| Displays the enlarged version of the card's pixmap near the cursor. | |
| void | destroyEnlargedPixmapWidget () |
Private Attributes | |
| QTimer * | singleClickTimer |
| QMouseEvent * | lastMouseEvent = nullptr |
| bool | emitClickImmediately |
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. | |
|
explicit |
Constructs a DeckPreviewCardPictureWidget.
Constructs a CardPictureWithTextOverlay widget.
| parent | The parent widget. |
| hoverToZoomEnabled | If this widget will spawn a larger widget when hovered over. |
| raiseOnEnter | If the widget raises its border when the mouse enters. |
| textColor | The color of the overlay text. |
| outlineColor | The color of the outline around the text. |
| fontSize | The font size of the overlay text. |
| alignment | The alignment of the text within the overlay. |
| emitClickImmediately | If true, a left click is reported immediately on click instead of after the double-click interval. Use this for selection surfaces where reacting to a double-click (select-and-open) would needlessly delay the single-click feedback. The double-click signal is still emitted. |
| parent | The parent widget. |
| hoverToZoomEnabled | If this widget will spawn a larger widget when hovered over. |
| textColor | The color of the overlay text. |
| outlineColor | The color of the outline around the text. |
| fontSize | The font size of the overlay text. |
| alignment | The alignment of the text within the overlay. |
Sets the widget's size policy and default border style.
|
signal |
|
signal |
|
signal |
|
overrideprotected |
|
overrideprotected |
|
private |
|
private |
|
private |