Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
printing_selector_card_sorting_widget.h
Go to the documentation of this file.
1
6
7#ifndef PRINTING_SELECTOR_CARD_SORTING_WIDGET_H
8#define PRINTING_SELECTOR_CARD_SORTING_WIDGET_H
9
10#include "printing_selector.h"
12#include <QComboBox>
13#include <QPushButton>
14#include <QWidget>
15
17{
18 Q_OBJECT
19public:
21 QList<PrintingInfo> sortSets(const SetToPrintingsMap &setMap);
22 QList<PrintingInfo> filterSets(const QList<PrintingInfo> &printings, const QString &searchText);
23 QList<PrintingInfo> prependPinnedPrintings(const QList<PrintingInfo> &printings, const QString &cardName);
24 QList<PrintingInfo> prependPrintingsInDeck(const QList<PrintingInfo> &printings,
25 const CardInfoPtr &selectedCard,
26 DeckListModel *deckModel);
27
28public slots:
29 void updateSortOrder();
30 void updateSortSetting();
31
32private:
34 QHBoxLayout *sortToolBar;
35 static const QString SORT_OPTIONS_ALPHABETICAL;
36 static const QString SORT_OPTIONS_PREFERENCE;
37 static const QString SORT_OPTIONS_RELEASE_DATE;
38 static const QString SORT_OPTIONS_CONTAINED_IN_DECK;
39 static const QString SORT_OPTIONS_POTENTIAL_CARDS;
40 static const QStringList SORT_OPTIONS;
43 QPushButton *toggleSortOrder;
44};
45
46#endif // PRINTING_SELECTOR_CARD_SORTING_WIDGET_H
QSharedPointer< CardInfo > CardInfoPtr
Definition card_info.cpp:20
QMap< QString, QList< PrintingInfo > > SetToPrintingsMap
Definition card_info.h:25
Qt model representing a decklist for use in views (tree/table).
Definition deck_list_model.h:200
QList< PrintingInfo > filterSets(const QList< PrintingInfo > &printings, const QString &searchText)
Filters a list of card sets based on the search text.
Definition printing_selector_card_sorting_widget.cpp:134
QList< PrintingInfo > prependPinnedPrintings(const QList< PrintingInfo > &printings, const QString &cardName)
Definition printing_selector_card_sorting_widget.cpp:155
QHBoxLayout * sortToolBar
Definition printing_selector_card_sorting_widget.h:34
PrintingSelector * parent
Definition printing_selector_card_sorting_widget.h:33
static const QString SORT_OPTIONS_ALPHABETICAL
Definition printing_selector_card_sorting_widget.h:35
PrintingSelectorCardSortingWidget(PrintingSelector *parent)
A widget for sorting and filtering card sets in the Printing Selector.
Definition printing_selector_card_sorting_widget.cpp:20
void updateSortOrder()
Updates the sorting order (ascending or descending).
Definition printing_selector_card_sorting_widget.cpp:46
QList< PrintingInfo > prependPrintingsInDeck(const QList< PrintingInfo > &printings, const CardInfoPtr &selectedCard, DeckListModel *deckModel)
Prepend card printings that are contained in the deck to the list of printings.
Definition printing_selector_card_sorting_widget.cpp:184
static const QString SORT_OPTIONS_RELEASE_DATE
Definition printing_selector_card_sorting_widget.h:37
QList< PrintingInfo > sortSets(const SetToPrintingsMap &setMap)
Sorts a list of card sets based on the selected sorting option.
Definition printing_selector_card_sorting_widget.cpp:80
static const QString SORT_OPTIONS_PREFERENCE
Definition printing_selector_card_sorting_widget.h:36
void updateSortSetting()
Updates the sorting setting in the application settings.
Definition printing_selector_card_sorting_widget.cpp:62
static const QString SORT_OPTIONS_CONTAINED_IN_DECK
Definition printing_selector_card_sorting_widget.h:38
bool descendingSort
Definition printing_selector_card_sorting_widget.h:42
QComboBox * sortOptionsSelector
Definition printing_selector_card_sorting_widget.h:41
QPushButton * toggleSortOrder
Definition printing_selector_card_sorting_widget.h:43
static const QStringList SORT_OPTIONS
Definition printing_selector_card_sorting_widget.h:11
static const QString SORT_OPTIONS_POTENTIAL_CARDS
Definition printing_selector_card_sorting_widget.h:39
Definition printing_selector.h:30
TODO: Document this.