![]() |
Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
|
#include <printing_selector_card_sorting_widget.h>
Public Slots | |
| void | updateSortOrder () |
| Updates the sorting order (ascending or descending). | |
| void | updateSortSetting () |
| Updates the sorting setting in the application settings. | |
Public Member Functions | |
| PrintingSelectorCardSortingWidget (PrintingSelector *parent) | |
| A widget for sorting and filtering card sets in the Printing Selector. | |
| QList< PrintingInfo > | sortSets (const SetToPrintingsMap &setMap) |
| Sorts a list of card sets based on the selected sorting option. | |
| QList< PrintingInfo > | filterSets (const QList< PrintingInfo > &printings, const QString &searchText) |
| Filters a list of card sets based on the search text. | |
| QList< PrintingInfo > | prependPinnedPrintings (const QList< PrintingInfo > &printings, const QString &cardName) |
| QList< PrintingInfo > | prependPrintingsInDeck (const QList< PrintingInfo > &printings, const CardInfoPtr &selectedCard, const DeckListModel *deckModel) |
| Prepend card printings that are contained in the deck to the list of printings. | |
Private Attributes | |
| PrintingSelector * | parent |
| QHBoxLayout * | sortToolBar |
| QComboBox * | sortOptionsSelector |
| bool | descendingSort |
| QPushButton * | toggleSortOrder |
Static Private Attributes | |
| static const QString | SORT_OPTIONS_ALPHABETICAL = tr("Alphabetical") |
| static const QString | SORT_OPTIONS_PREFERENCE = tr("Preference") |
| static const QString | SORT_OPTIONS_RELEASE_DATE = tr("Release Date") |
| static const QString | SORT_OPTIONS_CONTAINED_IN_DECK |
| static const QString | SORT_OPTIONS_POTENTIAL_CARDS |
| static const QStringList | SORT_OPTIONS |
|
explicit |
A widget for sorting and filtering card sets in the Printing Selector.
This widget allows users to choose sorting options for the card sets, such as alphabetical order, release date, or user-defined preferences. It also allows users to toggle the sorting order between ascending and descending.
| QList< PrintingInfo > PrintingSelectorCardSortingWidget::filterSets | ( | const QList< PrintingInfo > & | printings, |
| const QString & | searchText ) |
Filters a list of card sets based on the search text.
This function filters the given list of card sets by comparing their long and short names with the provided search text. If the search text matches either the long or short name of a card set, that set is included in the filtered list.
| printings | The list of printings to be filtered. |
| searchText | The search text used to filter the card sets. |
| QList< PrintingInfo > PrintingSelectorCardSortingWidget::prependPinnedPrintings | ( | const QList< PrintingInfo > & | printings, |
| const QString & | cardName ) |
| QList< PrintingInfo > PrintingSelectorCardSortingWidget::prependPrintingsInDeck | ( | const QList< PrintingInfo > & | printings, |
| const CardInfoPtr & | selectedCard, | ||
| const DeckListModel * | deckModel ) |
Prepend card printings that are contained in the deck to the list of printings.
This function adjusts the list of printings by moving the printings that are already contained in the deck to the beginning of the list, sorted by the count of cards in the deck.
| printings | The original list of printings. |
| selectedCard | The currently selected card. |
| deckModel | The model representing the deck. |
| QList< PrintingInfo > PrintingSelectorCardSortingWidget::sortSets | ( | const SetToPrintingsMap & | setMap | ) |
Sorts a list of card sets based on the selected sorting option.
This function sorts the card sets according to the selected sorting option in the combobox. The options include:
| setMap | The list of card sets to be sorted. |
|
slot |
Updates the sorting order (ascending or descending).
This function toggles the sort order between ascending and descending and updates the display.
|
slot |
Updates the sorting setting in the application settings.
This function saves the selected sorting option (from the combobox) to the application settings.
|
private |
|
private |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
private |
|
private |
|
private |