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

A widget that controls how deck cards are displayed in the visual deck editor. More...

#include <visual_deck_display_options_widget.h>

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

Public Slots

void retranslateUi ()
 Updates all UI text for retranslation/localization.

Signals

void displayTypeChanged (const DisplayType &displayType)
 Emitted when the display type (flat or overlapping layout) changes.
void groupCriteriaChanged (const QString &activeGroupCriteria)
 Emitted when a new grouping criterion is selected.
void sortCriteriaChanged (const QStringList &activeSortCriteria)
 Emitted when the order of sort criteria changes.

Public Member Functions

 VisualDeckDisplayOptionsWidget (QWidget *parent)
 Constructs a new VisualDeckDisplayOptionsWidget.
DisplayType getDisplayType () const
 Gets the current display type (Overlap or Flat).
QString getActiveGroupCriteria () const
 Gets the currently active group-by criterion.
QStringList getActiveSortCriteria () const
 Gets the currently active ordered sort criteria.

Private Slots

void onSortCriteriaChange ()
 Slot triggered whenever the sort list is reordered.
void updateDisplayType ()
 Toggles the display layout between flat and overlapping modes.

Private Attributes

QHBoxLayout * groupAndSortLayout
 Layout for grouping and sorting UI elements.
DisplayType currentDisplayType = DisplayType::Overlap
 Current deck display type.
QPushButton * displayTypeButton
 Button used to toggle the display layout.
QLabel * groupByLabel
 Label for the group-by selector.
QComboBox * groupByComboBox
 Combo box listing group-by criteria.
QString activeGroupCriteria = "maintype"
 Currently active group-by criterion.
SettingsButtonWidgetsortCriteriaButton
 Encapsulates the sort settings widgets (label + list).
QLabel * sortByLabel
 Label for “Sort by”.
QLabel * sortLabel
 Descriptive label inside the sort criteria button.
QListWidget * sortByListWidget
 Draggable list of sort criteria.
QStringList activeSortCriteria = {"name", "cmc", "colors", "maintype"}
 Ordered list of current sort criteria.

Detailed Description

A widget that controls how deck cards are displayed in the visual deck editor.

This widget provides:

  • A group-by selector (QComboBox)
  • A sort-by multi-criteria, draggable list (QListWidget within a SettingsButtonWidget)
  • A display-type toggler (flat vs. overlap layout)

Depending on whether the parent is a VisualDeckEditorWidget, this widget can mirror the original group by checkbox from the main deck editor UI to maintain synchronization.

It emits signals whenever the grouping criterion, sorting criteria, or display mode changes.

Constructor & Destructor Documentation

◆ VisualDeckDisplayOptionsWidget()

VisualDeckDisplayOptionsWidget::VisualDeckDisplayOptionsWidget ( QWidget * parent)
explicit

Constructs a new VisualDeckDisplayOptionsWidget.

Parameters
parentThe parent QWidget—may trigger cloning of models if the parent is a visual deck editor.
Here is the call graph for this function:

Member Function Documentation

◆ displayTypeChanged

void VisualDeckDisplayOptionsWidget::displayTypeChanged ( const DisplayType & displayType)
signal

Emitted when the display type (flat or overlapping layout) changes.

Parameters
displayTypeThe newly selected display layout.
Here is the caller graph for this function:

◆ getActiveGroupCriteria()

QString VisualDeckDisplayOptionsWidget::getActiveGroupCriteria ( ) const
inline

Gets the currently active group-by criterion.

◆ getActiveSortCriteria()

QStringList VisualDeckDisplayOptionsWidget::getActiveSortCriteria ( ) const
inline

Gets the currently active ordered sort criteria.

◆ getDisplayType()

DisplayType VisualDeckDisplayOptionsWidget::getDisplayType ( ) const
inline

Gets the current display type (Overlap or Flat).

◆ groupCriteriaChanged

void VisualDeckDisplayOptionsWidget::groupCriteriaChanged ( const QString & activeGroupCriteria)
signal

Emitted when a new grouping criterion is selected.

Parameters
activeGroupCriteriaName of the selected group-by criterion.
Here is the caller graph for this function:

◆ onSortCriteriaChange

void VisualDeckDisplayOptionsWidget::onSortCriteriaChange ( )
privateslot

Slot triggered whenever the sort list is reordered.

Reads the QListWidget’s order and emits sortCriteriaChanged().

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

◆ retranslateUi

void VisualDeckDisplayOptionsWidget::retranslateUi ( )
slot

Updates all UI text for retranslation/localization.

Called when the application language changes.

Here is the caller graph for this function:

◆ sortCriteriaChanged

void VisualDeckDisplayOptionsWidget::sortCriteriaChanged ( const QStringList & activeSortCriteria)
signal

Emitted when the order of sort criteria changes.

Parameters
activeSortCriteriaOrdered list of sorting keys.
Here is the caller graph for this function:

◆ updateDisplayType

void VisualDeckDisplayOptionsWidget::updateDisplayType ( )
privateslot

Toggles the display layout between flat and overlapping modes.

Emits displayTypeChanged().

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

Member Data Documentation

◆ activeGroupCriteria

QString VisualDeckDisplayOptionsWidget::activeGroupCriteria = "maintype"
private

Currently active group-by criterion.

◆ activeSortCriteria

QStringList VisualDeckDisplayOptionsWidget::activeSortCriteria = {"name", "cmc", "colors", "maintype"}
private

Ordered list of current sort criteria.

◆ currentDisplayType

DisplayType VisualDeckDisplayOptionsWidget::currentDisplayType = DisplayType::Overlap
private

Current deck display type.

◆ displayTypeButton

QPushButton* VisualDeckDisplayOptionsWidget::displayTypeButton
private

Button used to toggle the display layout.

◆ groupAndSortLayout

QHBoxLayout* VisualDeckDisplayOptionsWidget::groupAndSortLayout
private

Layout for grouping and sorting UI elements.

◆ groupByComboBox

QComboBox* VisualDeckDisplayOptionsWidget::groupByComboBox
private

Combo box listing group-by criteria.

◆ groupByLabel

QLabel* VisualDeckDisplayOptionsWidget::groupByLabel
private

Label for the group-by selector.

◆ sortByLabel

QLabel* VisualDeckDisplayOptionsWidget::sortByLabel
private

Label for “Sort by”.

◆ sortByListWidget

QListWidget* VisualDeckDisplayOptionsWidget::sortByListWidget
private

Draggable list of sort criteria.

◆ sortCriteriaButton

SettingsButtonWidget* VisualDeckDisplayOptionsWidget::sortCriteriaButton
private

Encapsulates the sort settings widgets (label + list).

◆ sortLabel

QLabel* VisualDeckDisplayOptionsWidget::sortLabel
private

Descriptive label inside the sort criteria button.


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