Cockatrice 2026-10-19-Development-3.1.2-beta.2
A 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
12
13#include <QList>
14#include <QString>
15#include <QStringList>
16#include <QWidget>
17#include <qtmetamacros.h>
18
19class DeckListModel;
21class QComboBox;
22class QHBoxLayout;
23class QPushButton;
24
26{
27 Q_OBJECT
28public:
31 QList<PrintingInfo> filterSets(const QList<PrintingInfo> &printings, const QString &searchText);
32 QList<PrintingInfo> prependPinnedPrintings(const QList<PrintingInfo> &printings, const QString &cardName);
34 const CardInfoPtr &selectedCard,
35 const DeckListModel *deckModel);
36
37public slots:
38 void updateSortOrder();
39 void updateSortSetting();
40
41private:
43 QHBoxLayout *sortToolBar;
44 static const QString SORT_OPTIONS_ALPHABETICAL;
45 static const QString SORT_OPTIONS_PREFERENCE;
46 static const QString SORT_OPTIONS_RELEASE_DATE;
47 static const QString SORT_OPTIONS_CONTAINED_IN_DECK;
48 static const QString SORT_OPTIONS_POTENTIAL_CARDS;
49 static const QStringList SORT_OPTIONS;
52 QPushButton *toggleSortOrder;
53};
54
55#endif // PRINTING_SELECTOR_CARD_SORTING_WIDGET_H
QSharedPointer< CardInfo > CardInfoPtr
Definition card_info.cpp:15
QMap< QString, QList< PrintingInfo > > SetToPrintingsMap
Definition card_info.h:32
Qt model representing a decklist for use in views (tree/table).
Definition deck_list_model.h:228
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.
Definition printing_selector_card_sorting_widget.cpp:203
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:153
QList< PrintingInfo > prependPinnedPrintings(const QList< PrintingInfo > &printings, const QString &cardName)
Definition printing_selector_card_sorting_widget.cpp:174
QHBoxLayout * sortToolBar
Definition printing_selector_card_sorting_widget.h:43
PrintingSelector * parent
Definition printing_selector_card_sorting_widget.h:42
static const QString SORT_OPTIONS_ALPHABETICAL
Definition printing_selector_card_sorting_widget.h:44
PrintingSelectorCardSortingWidget(PrintingSelector *parent)
A widget for sorting and filtering card sets in the Printing Selector.
Definition printing_selector_card_sorting_widget.cpp:38
void updateSortOrder()
Updates the sorting order (ascending or descending).
Definition printing_selector_card_sorting_widget.cpp:65
static const QString SORT_OPTIONS_RELEASE_DATE
Definition printing_selector_card_sorting_widget.h:46
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:99
static const QString SORT_OPTIONS_PREFERENCE
Definition printing_selector_card_sorting_widget.h:45
void updateSortSetting()
Updates the sorting setting in the application settings.
Definition printing_selector_card_sorting_widget.cpp:81
static const QString SORT_OPTIONS_CONTAINED_IN_DECK
Definition printing_selector_card_sorting_widget.h:47
bool descendingSort
Definition printing_selector_card_sorting_widget.h:51
QComboBox * sortOptionsSelector
Definition printing_selector_card_sorting_widget.h:50
QPushButton * toggleSortOrder
Definition printing_selector_card_sorting_widget.h:52
static const QStringList SORT_OPTIONS
Definition printing_selector_card_sorting_widget.h:29
static const QString SORT_OPTIONS_POTENTIAL_CARDS
Definition printing_selector_card_sorting_widget.h:48
Definition printing_selector.h:41
Definition remote_connection_controller.h:20