#include <printing_selector_card_sorting_widget.h>
◆ PrintingSelectorCardSortingWidget()
| PrintingSelectorCardSortingWidget::PrintingSelectorCardSortingWidget |
( |
PrintingSelector * | parent | ) |
|
|
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.
◆ filterSets()
| 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.
- Parameters
-
| printings | The list of printings to be filtered. |
| searchText | The search text used to filter the card sets. |
- Returns
- A filtered list of card sets.
◆ prependPinnedPrintings()
| QList< PrintingInfo > PrintingSelectorCardSortingWidget::prependPinnedPrintings |
( |
const QList< PrintingInfo > & | printings, |
|
|
const QString & | cardName ) |
◆ prependPrintingsInDeck()
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.
- Parameters
-
| printings | The original list of printings. |
| selectedCard | The currently selected card. |
| deckModel | The model representing the deck. |
- Returns
- A list of printings with the printings contained in the deck prepended.
◆ sortSets()
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:
- Alphabetical
- Preference
- Release Date
- Contained in Deck
- Potential Cards in Deck
- Parameters
-
| setMap | The list of card sets to be sorted. |
- Returns
- A sorted list of printings.
◆ updateSortOrder
| void PrintingSelectorCardSortingWidget::updateSortOrder |
( |
| ) |
|
|
slot |
Updates the sorting order (ascending or descending).
This function toggles the sort order between ascending and descending and updates the display.
◆ updateSortSetting
| void PrintingSelectorCardSortingWidget::updateSortSetting |
( |
| ) |
|
|
slot |
Updates the sorting setting in the application settings.
This function saves the selected sorting option (from the combobox) to the application settings.
◆ descendingSort
| bool PrintingSelectorCardSortingWidget::descendingSort |
|
private |
◆ parent
◆ SORT_OPTIONS
| const QStringList PrintingSelectorCardSortingWidget::SORT_OPTIONS |
|
staticprivate |
◆ SORT_OPTIONS_ALPHABETICAL
| const QString PrintingSelectorCardSortingWidget::SORT_OPTIONS_ALPHABETICAL = tr("Alphabetical") |
|
staticprivate |
◆ SORT_OPTIONS_CONTAINED_IN_DECK
| const QString PrintingSelectorCardSortingWidget::SORT_OPTIONS_CONTAINED_IN_DECK |
|
staticprivate |
◆ SORT_OPTIONS_POTENTIAL_CARDS
| const QString PrintingSelectorCardSortingWidget::SORT_OPTIONS_POTENTIAL_CARDS |
|
staticprivate |
◆ SORT_OPTIONS_PREFERENCE
| const QString PrintingSelectorCardSortingWidget::SORT_OPTIONS_PREFERENCE = tr("Preference") |
|
staticprivate |
◆ SORT_OPTIONS_RELEASE_DATE
| const QString PrintingSelectorCardSortingWidget::SORT_OPTIONS_RELEASE_DATE = tr("Release Date") |
|
staticprivate |
◆ sortOptionsSelector
| QComboBox* PrintingSelectorCardSortingWidget::sortOptionsSelector |
|
private |
◆ sortToolBar
| QHBoxLayout* PrintingSelectorCardSortingWidget::sortToolBar |
|
private |
◆ toggleSortOrder
| QPushButton* PrintingSelectorCardSortingWidget::toggleSortOrder |
|
private |
The documentation for this class was generated from the following files: