Cockatrice 2026-09-01-Development-3.1.0-beta.10
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
deck_editor_deck_dock_widget.h
Go to the documentation of this file.
1
7
8#ifndef DECK_EDITOR_DECK_DOCK_WIDGET_H
9#define DECK_EDITOR_DECK_DOCK_WIDGET_H
10
12#include "../../key_signals.h"
17
18#include <QCheckBox>
19#include <QComboBox>
20#include <QDockWidget>
21#include <QLabel>
22#include <QPushButton>
23#include <QTextEdit>
24#include <QTreeView>
27
29class DeckListModel;
31class DeckEditorDeckDockWidget : public QDockWidget
32{
33 Q_OBJECT
34public:
36
38 QTreeView *deckView;
40 QLabel *playmatLabel;
42 void createDeckDock();
44 void retranslateUi();
45
46 QComboBox *getGroupByComboBox()
47 {
49 }
50
51 [[nodiscard]] QItemSelectionModel *getSelectionModel() const
52 {
53 return deckView->selectionModel();
54 }
55
56public slots:
57 void selectPrevCard();
58 void selectNextCard();
61 void actAddCard(const ExactCard &card, const QString &zoneName);
63 void actDecrementCard(const ExactCard &card, QString zoneName);
65 void actSwapCard(const ExactCard &card, const QString &zoneName);
66 void actSwapSelection();
67 void actRemoveCard();
68 void initializeFormats();
69
70signals:
71 void selectedCardChanged(const ExactCard &card);
72
73private:
76
79 QLabel *nameLabel;
86 QTextEdit *commentsEdit;
90 QLabel *hashLabel1;
94 QLabel *formatLabel;
95 QComboBox *formatComboBox;
96
98
100
101 DeckListModel *getModel() const;
102 [[nodiscard]] QModelIndexList getSelectedCardNodeSourceIndices() const;
103 void offsetCountAtIndex(const QModelIndex &idx, bool isIncrement);
104
105private slots:
106 void decklistCustomMenu(QPoint point);
107 void updateCard(QModelIndex, const QModelIndex &current);
108 void writeName();
109 void writeComments();
110 void writeBannerCard(int);
111 void openPlaymatSettings();
112 void updatePlaymatLabel();
114 void setSelectedIndex(const QModelIndex &newCardIndex, bool preserveWidgetFocus);
115 void updateHash();
116 void refreshShortcuts();
117 void updateShowBannerCardComboBox(bool visible);
118 void updateShowTagsWidget(bool visible);
120 void changeSelectedCard(int changeBy);
121 void recursiveExpand(const QModelIndex &parent);
122 void expandAll();
123};
124
125#endif // DECK_EDITOR_DECK_DOCK_WIDGET_H
Defines the AbstractTabDeckEditor class, which provides a base for deck editor tabs in the applicatio...
AbstractTabDeckEditor is the base class for all deck editor tabs.
Definition abstract_tab_deck_editor.h:94
Definition commander_bracket_widget.h:15
void updateHash()
Definition deck_editor_deck_dock_widget.cpp:387
void updateShowBannerCardComboBox(bool visible)
Definition deck_editor_deck_dock_widget.cpp:490
void initializeFormats()
Definition deck_editor_deck_dock_widget.cpp:303
void actRemoveCard()
Definition deck_editor_deck_dock_widget.cpp:738
void syncDisplayWidgetsToModel()
Definition deck_editor_deck_dock_widget.cpp:526
QItemSelectionModel * getSelectionModel() const
Definition deck_editor_deck_dock_widget.h:51
SettingsButtonWidget * quickSettingsWidget
Definition deck_editor_deck_dock_widget.h:82
void actAddCard(const ExactCard &card, const QString &zoneName)
Definition deck_editor_deck_dock_widget.cpp:659
QLabel * hashLabel1
Definition deck_editor_deck_dock_widget.h:90
QCheckBox * showBannerCardCheckBox
Definition deck_editor_deck_dock_widget.h:83
void writeName()
Writes the contents of the name textBox to the DeckStateManager.
Definition deck_editor_deck_dock_widget.cpp:372
void retranslateUi()
Definition deck_editor_deck_dock_widget.cpp:791
void updateBannerCardComboBox()
Definition deck_editor_deck_dock_widget.cpp:392
QTimer * commentsDebounceTimer
Definition deck_editor_deck_dock_widget.h:87
void selectPrevCard()
Definition deck_editor_deck_dock_widget.cpp:562
void decklistCustomMenu(QPoint point)
Definition deck_editor_deck_dock_widget.cpp:773
void writeBannerCard(int)
Writes the selected bannerCard to the DeckStateManager.
Definition deck_editor_deck_dock_widget.cpp:447
QTextEdit * commentsEdit
Definition deck_editor_deck_dock_widget.h:86
DeckListStyleProxy * proxy
Definition deck_editor_deck_dock_widget.h:37
QLabel * nameLabel
Definition deck_editor_deck_dock_widget.h:79
void actSwapSelection()
Definition deck_editor_deck_dock_widget.cpp:690
CommanderBracketWidget * commanderBracketWidget
Definition deck_editor_deck_dock_widget.h:99
DeckStateManager * deckStateManager
Definition deck_editor_deck_dock_widget.h:75
QComboBox * getGroupByComboBox()
Definition deck_editor_deck_dock_widget.h:46
void openPlaymatSettings()
Definition deck_editor_deck_dock_widget.cpp:454
void updateShowTagsWidget(bool visible)
Definition deck_editor_deck_dock_widget.cpp:496
QLabel * playmatLabel
Definition deck_editor_deck_dock_widget.h:40
DeckEditorDeckDockWidget(AbstractTabDeckEditor *parent)
Definition deck_editor_deck_dock_widget.cpp:48
DeckListModel * getModel() const
Convenience method to get the underlying model instance from the DeckStateManager.
Definition deck_editor_deck_dock_widget.cpp:557
QPushButton * playmatSettingsButton
Definition deck_editor_deck_dock_widget.h:41
ExactCard getCurrentCard()
Definition deck_editor_deck_dock_widget.cpp:338
QComboBox * bannerCardComboBox
Definition deck_editor_deck_dock_widget.h:39
QComboBox * activeGroupCriteriaComboBox
Definition deck_editor_deck_dock_widget.h:93
QAction * aDecrement
Definition deck_editor_deck_dock_widget.h:97
void refreshShortcuts()
Definition deck_editor_deck_dock_widget.cpp:783
QAction * aRemoveCard
Definition deck_editor_deck_dock_widget.h:97
QCheckBox * showTagsWidgetCheckBox
Definition deck_editor_deck_dock_widget.h:84
void selectNextCard()
Definition deck_editor_deck_dock_widget.cpp:567
QLabel * commentsLabel
Definition deck_editor_deck_dock_widget.h:85
void recursiveExpand(const QModelIndex &parent)
Expands all parents of the given index.
Definition deck_editor_deck_dock_widget.cpp:621
void selectedCardChanged(const ExactCard &card)
DeckPreviewDeckTagsDisplayWidget * deckTagsDisplayWidget
Definition deck_editor_deck_dock_widget.h:89
void setSelectedIndex(const QModelIndex &newCardIndex, bool preserveWidgetFocus)
Definition deck_editor_deck_dock_widget.cpp:515
void writeComments()
Writes the contents of the comments textBox to the DeckStateManager.
Definition deck_editor_deck_dock_widget.cpp:381
void updateCard(QModelIndex, const QModelIndex &current)
Definition deck_editor_deck_dock_widget.cpp:362
QLabel * bannerCardLabel
Definition deck_editor_deck_dock_widget.h:88
void syncBannerCardComboBoxSelectionWithDeck()
Definition deck_editor_deck_dock_widget.cpp:501
DeckListHistoryManagerWidget * historyManagerWidget
Definition deck_editor_deck_dock_widget.h:77
QTimer * nameDebounceTimer
Definition deck_editor_deck_dock_widget.h:81
LineEditUnfocusable * nameEdit
Definition deck_editor_deck_dock_widget.h:80
QComboBox * formatComboBox
Definition deck_editor_deck_dock_widget.h:95
void actDecrementSelection()
Definition deck_editor_deck_dock_widget.cpp:721
void actDecrementCard(const ExactCard &card, QString zoneName)
Definition deck_editor_deck_dock_widget.cpp:709
QTreeView * deckView
Definition deck_editor_deck_dock_widget.h:38
LineEditUnfocusable * hashLabel
Definition deck_editor_deck_dock_widget.h:91
void applyActiveGroupCriteria()
Definition deck_editor_deck_dock_widget.cpp:483
void actSwapCard(const ExactCard &card, const QString &zoneName)
Definition deck_editor_deck_dock_widget.cpp:677
void actIncrementSelection()
Definition deck_editor_deck_dock_widget.cpp:668
QModelIndexList getSelectedCardNodeSourceIndices() const
Definition deck_editor_deck_dock_widget.cpp:645
QAction * aIncrement
Definition deck_editor_deck_dock_widget.h:97
QAction * aSwapCard
Definition deck_editor_deck_dock_widget.h:97
void offsetCountAtIndex(const QModelIndex &idx, bool isIncrement)
Increments or decrements the amount of the card node at the index by 1.
Definition deck_editor_deck_dock_widget.cpp:760
KeySignals deckViewKeySignals
Definition deck_editor_deck_dock_widget.h:78
QLabel * formatLabel
Definition deck_editor_deck_dock_widget.h:94
void changeSelectedCard(int changeBy)
Selects a card based on the change direction.
Definition deck_editor_deck_dock_widget.cpp:577
void createDeckDock()
Definition deck_editor_deck_dock_widget.cpp:60
AbstractTabDeckEditor * deckEditor
Definition deck_editor_deck_dock_widget.h:74
void expandAll()
Fully expands all levels of the deck view.
Definition deck_editor_deck_dock_widget.cpp:634
void updatePlaymatLabel()
Definition deck_editor_deck_dock_widget.cpp:473
QLabel * activeGroupCriteriaLabel
Definition deck_editor_deck_dock_widget.h:92
Definition deck_list_history_manager_widget.h:20
Qt model representing a decklist for use in views (tree/table).
Definition deck_list_model.h:217
Definition deck_list_style_proxy.h:7
Definition deck_preview_deck_tags_display_widget.h:16
This class centralizes the management of the state of the deck in the deck editor tab....
Definition deck_state_manager.h:22
Represents a specific card instance, defined by its CardInfo and a particular printing.
Definition exact_card.h:19
Definition key_signals.h:15
Definition custom_line_edit.h:20
Definition settings_button_widget.h:17
Defines the DeckList class, which manages a full deck structure including cards, zones,...