Cockatrice 2026-01-14-Development-2.11.0-beta.46
A cross-platform 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 <QDockWidget>
19#include <QLabel>
20#include <QTextEdit>
21#include <QTreeView>
23
24class DeckListModel;
26class DeckEditorDeckDockWidget : public QDockWidget
27{
28 Q_OBJECT
29public:
31
33 QTreeView *deckView;
35 void createDeckDock();
37 void retranslateUi();
38
39 QComboBox *getGroupByComboBox()
40 {
42 }
43
44 [[nodiscard]] QItemSelectionModel *getSelectionModel() const
45 {
46 return deckView->selectionModel();
47 }
48
49public slots:
50 void selectPrevCard();
51 void selectNextCard();
54 void actAddCard(const ExactCard &card, const QString &zoneName);
56 void actDecrementCard(const ExactCard &card, QString zoneName);
58 void actSwapCard(const ExactCard &card, const QString &zoneName);
59 void actSwapSelection();
60 void actRemoveCard();
61 void initializeFormats();
62
63signals:
64 void selectedCardChanged(const ExactCard &card);
65
66private:
69
72 QLabel *nameLabel;
79 QTextEdit *commentsEdit;
83 QLabel *hashLabel1;
87 QLabel *formatLabel;
88 QComboBox *formatComboBox;
89
91
92 DeckListModel *getModel() const;
93 [[nodiscard]] QModelIndexList getSelectedCardNodeSourceIndices() const;
94 void offsetCountAtIndex(const QModelIndex &idx, bool isIncrement);
95
96private slots:
97 void decklistCustomMenu(QPoint point);
98 void updateCard(QModelIndex, const QModelIndex &current);
99 void writeName();
100 void writeComments();
101 void writeBannerCard(int);
103 void setSelectedIndex(const QModelIndex &newCardIndex, bool preserveWidgetFocus);
104 void updateHash();
105 void refreshShortcuts();
106 void updateShowBannerCardComboBox(bool visible);
107 void updateShowTagsWidget(bool visible);
109 void changeSelectedCard(int changeBy);
110 void recursiveExpand(const QModelIndex &parent);
111 void expandAll();
112};
113
114#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:93
void updateHash()
Definition deck_editor_deck_dock_widget.cpp:363
void updateShowBannerCardComboBox(bool visible)
Definition deck_editor_deck_dock_widget.cpp:437
void initializeFormats()
Definition deck_editor_deck_dock_widget.cpp:284
void actRemoveCard()
Definition deck_editor_deck_dock_widget.cpp:680
void syncDisplayWidgetsToModel()
Definition deck_editor_deck_dock_widget.cpp:473
QItemSelectionModel * getSelectionModel() const
Definition deck_editor_deck_dock_widget.h:44
SettingsButtonWidget * quickSettingsWidget
Definition deck_editor_deck_dock_widget.h:75
void actAddCard(const ExactCard &card, const QString &zoneName)
Definition deck_editor_deck_dock_widget.cpp:603
QLabel * hashLabel1
Definition deck_editor_deck_dock_widget.h:83
QCheckBox * showBannerCardCheckBox
Definition deck_editor_deck_dock_widget.h:76
void writeName()
Writes the contents of the name textBox to the DeckStateManager.
Definition deck_editor_deck_dock_widget.cpp:348
void retranslateUi()
Definition deck_editor_deck_dock_widget.cpp:735
void updateBannerCardComboBox()
Definition deck_editor_deck_dock_widget.cpp:368
QTimer * commentsDebounceTimer
Definition deck_editor_deck_dock_widget.h:80
void selectPrevCard()
Definition deck_editor_deck_dock_widget.cpp:506
void decklistCustomMenu(QPoint point)
Definition deck_editor_deck_dock_widget.cpp:715
void writeBannerCard(int)
Writes the selected bannerCard to the DeckStateManager.
Definition deck_editor_deck_dock_widget.cpp:423
QTextEdit * commentsEdit
Definition deck_editor_deck_dock_widget.h:79
DeckListStyleProxy * proxy
Definition deck_editor_deck_dock_widget.h:32
QLabel * nameLabel
Definition deck_editor_deck_dock_widget.h:72
void actSwapSelection()
Definition deck_editor_deck_dock_widget.cpp:634
DeckStateManager * deckStateManager
Definition deck_editor_deck_dock_widget.h:68
QComboBox * getGroupByComboBox()
Definition deck_editor_deck_dock_widget.h:39
void updateShowTagsWidget(bool visible)
Definition deck_editor_deck_dock_widget.cpp:443
DeckEditorDeckDockWidget(AbstractTabDeckEditor *parent)
Definition deck_editor_deck_dock_widget.cpp:40
DeckListModel * getModel() const
Convenience method to get the underlying model instance from the DeckStateManager.
Definition deck_editor_deck_dock_widget.cpp:501
ExactCard getCurrentCard()
Definition deck_editor_deck_dock_widget.cpp:315
QComboBox * bannerCardComboBox
Definition deck_editor_deck_dock_widget.h:34
QComboBox * activeGroupCriteriaComboBox
Definition deck_editor_deck_dock_widget.h:86
QAction * aDecrement
Definition deck_editor_deck_dock_widget.h:90
void refreshShortcuts()
Definition deck_editor_deck_dock_widget.cpp:727
QAction * aRemoveCard
Definition deck_editor_deck_dock_widget.h:90
QCheckBox * showTagsWidgetCheckBox
Definition deck_editor_deck_dock_widget.h:77
void selectNextCard()
Definition deck_editor_deck_dock_widget.cpp:511
QLabel * commentsLabel
Definition deck_editor_deck_dock_widget.h:78
void recursiveExpand(const QModelIndex &parent)
Expands all parents of the given index.
Definition deck_editor_deck_dock_widget.cpp:565
void selectedCardChanged(const ExactCard &card)
DeckPreviewDeckTagsDisplayWidget * deckTagsDisplayWidget
Definition deck_editor_deck_dock_widget.h:82
void setSelectedIndex(const QModelIndex &newCardIndex, bool preserveWidgetFocus)
Definition deck_editor_deck_dock_widget.cpp:462
void writeComments()
Writes the contents of the comments textBox to the DeckStateManager.
Definition deck_editor_deck_dock_widget.cpp:357
void updateCard(QModelIndex, const QModelIndex &current)
Definition deck_editor_deck_dock_widget.cpp:338
QLabel * bannerCardLabel
Definition deck_editor_deck_dock_widget.h:81
void syncBannerCardComboBoxSelectionWithDeck()
Definition deck_editor_deck_dock_widget.cpp:448
DeckListHistoryManagerWidget * historyManagerWidget
Definition deck_editor_deck_dock_widget.h:70
QTimer * nameDebounceTimer
Definition deck_editor_deck_dock_widget.h:74
LineEditUnfocusable * nameEdit
Definition deck_editor_deck_dock_widget.h:73
QComboBox * formatComboBox
Definition deck_editor_deck_dock_widget.h:88
void actDecrementSelection()
Definition deck_editor_deck_dock_widget.cpp:663
void actDecrementCard(const ExactCard &card, QString zoneName)
Definition deck_editor_deck_dock_widget.cpp:653
QTreeView * deckView
Definition deck_editor_deck_dock_widget.h:33
LineEditUnfocusable * hashLabel
Definition deck_editor_deck_dock_widget.h:84
void applyActiveGroupCriteria()
Definition deck_editor_deck_dock_widget.cpp:430
void actSwapCard(const ExactCard &card, const QString &zoneName)
Definition deck_editor_deck_dock_widget.cpp:621
void actIncrementSelection()
Definition deck_editor_deck_dock_widget.cpp:612
QModelIndexList getSelectedCardNodeSourceIndices() const
Definition deck_editor_deck_dock_widget.cpp:589
QAction * aIncrement
Definition deck_editor_deck_dock_widget.h:90
QAction * aSwapCard
Definition deck_editor_deck_dock_widget.h:90
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:702
KeySignals deckViewKeySignals
Definition deck_editor_deck_dock_widget.h:71
QLabel * formatLabel
Definition deck_editor_deck_dock_widget.h:87
void changeSelectedCard(int changeBy)
Selects a card based on the change direction.
Definition deck_editor_deck_dock_widget.cpp:521
void createDeckDock()
Definition deck_editor_deck_dock_widget.cpp:53
AbstractTabDeckEditor * deckEditor
Definition deck_editor_deck_dock_widget.h:67
void expandAll()
Fully expands all levels of the deck view.
Definition deck_editor_deck_dock_widget.cpp:578
QLabel * activeGroupCriteriaLabel
Definition deck_editor_deck_dock_widget.h:85
Definition deck_list_history_manager_widget.h:20
Qt model representing a decklist for use in views (tree/table).
Definition deck_list_model.h:214
Definition deck_list_style_proxy.h:7
Definition deck_preview_deck_tags_display_widget.h:17
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
TODO: Document this.
TODO: Document this.