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

Displays a scrollable horizontal list of Archidekt deck listings with dynamic card sizing. More...

#include <archidekt_api_response_deck_listings_display_widget.h>

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

Signals

void requestNavigation (QString url)
 Emitted when a child deck entry requests that the UI navigate to a particular URL.

Public Member Functions

 ArchidektApiResponseDeckListingsDisplayWidget (QWidget *parent, ArchidektDeckListingApiResponse response, CardSizeWidget *cardSizeSlider)
 Constructs a widget that displays multiple deck listing previews.
void resizeEvent (QResizeEvent *event) override
 Ensures FlowWidget layout properly recomputes on resize.

Private Attributes

CardSizeWidgetcardSizeSlider
 Slider controlling the scale of card thumbnails in all deck entry widgets.
QHBoxLayout * layout
 Main horizontal layout containing the FlowWidget.
FlowWidgetflowWidget
 Container providing scrollable multi-row flow layout of deck entries.
QNetworkAccessManager * imageNetworkManager
 Shared network manager used to download card images for all child entry widgets.

Detailed Description

Displays a scrollable horizontal list of Archidekt deck listings with dynamic card sizing.

This widget serves as a container for multiple ArchidektApiResponseDeckEntryDisplayWidget instances, each representing one deck listing returned from an Archidekt API call.

Responsibilities

  • Creates a FlowWidget that arranges deck entries horizontally with wrapping.
  • Creates a shared QNetworkAccessManager for entry widgets to fetch card thumbnails.
  • Connects a CardSizeWidget slider to all deck entries to dynamically rescale their preview cards.
  • Propagates deck-navigation requests (requestNavigation) from children to the parent.

Layout

The widget uses a single QHBoxLayout containing the FlowWidget. The FlowWidget automatically manages child flow and scrollbar behavior (horizontal = off, vertical = auto), providing an efficient scrollable gallery of deck entries.

API Integration

The constructor consumes an ArchidektDeckListingApiResponse, iterates through its results, and instantiates a child entry widget for each deck.

Signals

Performance Notes

  • All entry widgets share a single QNetworkAccessManager instance to reuse connections and avoid redundant session creation.
  • resizeEvent() forces layout invalidation to ensure the flow layout responds properly to container resizing.

Constructor & Destructor Documentation

◆ ArchidektApiResponseDeckListingsDisplayWidget()

ArchidektApiResponseDeckListingsDisplayWidget::ArchidektApiResponseDeckListingsDisplayWidget ( QWidget * parent,
ArchidektDeckListingApiResponse response,
CardSizeWidget * cardSizeSlider )
explicit

Constructs a widget that displays multiple deck listing previews.

Parameters
parentParent widget.
responseThe Archidekt API response containing deck listings.
cardSizeSliderA slider widget used to dynamically resize card previews.

Each deck in response.results becomes its own ArchidektApiResponseDeckEntryDisplayWidget, added to the FlowWidget.

Here is the call graph for this function:

Member Function Documentation

◆ requestNavigation

void ArchidektApiResponseDeckListingsDisplayWidget::requestNavigation ( QString url)
signal

Emitted when a child deck entry requests that the UI navigate to a particular URL.

Parameters
urlThe destination URL (typically an Archidekt deck page).
Here is the caller graph for this function:

◆ resizeEvent()

void ArchidektApiResponseDeckListingsDisplayWidget::resizeEvent ( QResizeEvent * event)
override

Ensures FlowWidget layout properly recomputes on resize.

Forces the layout to invalidate and activate itself so that the FlowWidget recalculates wrapping and child placement.

Parameters
eventResize event.

Member Data Documentation

◆ cardSizeSlider

CardSizeWidget* ArchidektApiResponseDeckListingsDisplayWidget::cardSizeSlider
private

Slider controlling the scale of card thumbnails in all deck entry widgets.

◆ flowWidget

FlowWidget* ArchidektApiResponseDeckListingsDisplayWidget::flowWidget
private

Container providing scrollable multi-row flow layout of deck entries.

◆ imageNetworkManager

QNetworkAccessManager* ArchidektApiResponseDeckListingsDisplayWidget::imageNetworkManager
private

Shared network manager used to download card images for all child entry widgets.

◆ layout

QHBoxLayout* ArchidektApiResponseDeckListingsDisplayWidget::layout
private

Main horizontal layout containing the FlowWidget.


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