Cockatrice 2026-09-01-Development-3.1.0-beta.10
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
CardArtPreviewWidget Class Reference

Interactive preview of the user list banner art. More...

#include <user_card_settings_dialog.h>

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

Signals

void paramsEdited (const CardArtParams &params)
 Emitted whenever direct manipulation (drag, wheel, keys) changes the parameters.

Public Member Functions

 CardArtPreviewWidget (QWidget *parent=nullptr)
void setPixmap (const QPixmap &pixmap)
void setParams (const CardArtParams &params)
void setAttribution (const QString &attribution)

Protected Member Functions

void paintEvent (QPaintEvent *event) override
void mousePressEvent (QMouseEvent *event) override
void mouseMoveEvent (QMouseEvent *event) override
void mouseReleaseEvent (QMouseEvent *event) override
void wheelEvent (QWheelEvent *event) override
void keyPressEvent (QKeyEvent *event) override
void focusInEvent (QFocusEvent *event) override

Private Member Functions

qreal bannerTravel () const
 vertical travel of the art behind the strip, in output pixels
void applyCropDelta (qreal dOffset, qreal zoomFactor)
bool sameCrop (const CardArtParams &a, const CardArtParams &b) const
void restoreSnapshot ()

Private Attributes

QPixmap sourcePixmap
CardArtParams params
CardArtParams paramsAtFocusIn
 crop as of the latest focus gain, restored by Esc or Backspace
QString attributionText
QPoint lastDragPos
 widget space position of the previous mouse move while panning
bool dragging {false}
 true between an accepted press and its release, guards stale drag positions

Detailed Description

Interactive preview of the user list banner art.

Renders the banner strip with the given CardArtParams through the same UserListPainter::drawCardArt() the live delegate uses, including the avatar placeholder and fade masks. Dragging pans the art vertically at output scale, the wheel zooms, arrow keys nudge, Backspace or Esc restores the parameters as of focus gain.

Constructor & Destructor Documentation

◆ CardArtPreviewWidget()

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

Member Function Documentation

◆ applyCropDelta()

void CardArtPreviewWidget::applyCropDelta ( qreal dOffset,
qreal zoomFactor )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ bannerTravel()

qreal CardArtPreviewWidget::bannerTravel ( ) const
private

vertical travel of the art behind the strip, in output pixels

Here is the caller graph for this function:

◆ focusInEvent()

void CardArtPreviewWidget::focusInEvent ( QFocusEvent * event)
overrideprotected

◆ keyPressEvent()

void CardArtPreviewWidget::keyPressEvent ( QKeyEvent * event)
overrideprotected
Here is the call graph for this function:

◆ mouseMoveEvent()

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

◆ mousePressEvent()

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

◆ mouseReleaseEvent()

void CardArtPreviewWidget::mouseReleaseEvent ( QMouseEvent * event)
overrideprotected

◆ paintEvent()

void CardArtPreviewWidget::paintEvent ( QPaintEvent * event)
overrideprotected
Here is the call graph for this function:

◆ paramsEdited

void CardArtPreviewWidget::paramsEdited ( const CardArtParams & params)
signal

Emitted whenever direct manipulation (drag, wheel, keys) changes the parameters.

Here is the caller graph for this function:

◆ restoreSnapshot()

void CardArtPreviewWidget::restoreSnapshot ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sameCrop()

bool CardArtPreviewWidget::sameCrop ( const CardArtParams & a,
const CardArtParams & b ) const
private
Here is the caller graph for this function:

◆ setAttribution()

void CardArtPreviewWidget::setAttribution ( const QString & attribution)

◆ setParams()

void CardArtPreviewWidget::setParams ( const CardArtParams & params)

◆ setPixmap()

void CardArtPreviewWidget::setPixmap ( const QPixmap & pixmap)

◆ wheelEvent()

void CardArtPreviewWidget::wheelEvent ( QWheelEvent * event)
overrideprotected
Here is the call graph for this function:

Member Data Documentation

◆ attributionText

QString CardArtPreviewWidget::attributionText
private

◆ dragging

bool CardArtPreviewWidget::dragging {false}
private

true between an accepted press and its release, guards stale drag positions

◆ lastDragPos

QPoint CardArtPreviewWidget::lastDragPos
private

widget space position of the previous mouse move while panning

◆ params

CardArtParams CardArtPreviewWidget::params
private

◆ paramsAtFocusIn

CardArtParams CardArtPreviewWidget::paramsAtFocusIn
private

crop as of the latest focus gain, restored by Esc or Backspace

◆ sourcePixmap

QPixmap CardArtPreviewWidget::sourcePixmap
private

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