Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
dlg_create_token.h
Go to the documentation of this file.
1
6
7#ifndef DLG_CREATETOKEN_H
8#define DLG_CREATETOKEN_H
9
10#include <QDialog>
11#include <QList>
12#include <QString>
13#include <QStringList>
14#include <qtmetamacros.h>
15
16class QLabel;
17class QLineEdit;
18class QComboBox;
19class QCheckBox;
20class QRadioButton;
21class QTreeView;
25class QModelIndex;
26class QWidget;
27
29{
30 QString name;
31 QString color;
32 QString pt;
33 QString annotation;
34 bool destroy = true;
35 bool faceDown = false;
36 QString providerId;
37};
38
39class DlgCreateToken : public QDialog
40{
41 Q_OBJECT
42public:
43 explicit DlgCreateToken(const QStringList &_predefinedTokens, QWidget *parent = nullptr);
44 [[nodiscard]] TokenInfo getTokenInfo() const;
45
46protected:
47 void closeEvent(QCloseEvent *event) override;
48private slots:
49 void faceDownCheckBoxToggled(bool checked);
50 void tokenSelectionChanged(const QModelIndex &current, const QModelIndex &previous);
51 void updateSearch(const QString &search);
52 void actChooseTokenFromAll(bool checked);
53 void actChooseTokenFromDeck(bool checked);
54 void actOk();
55 void actReject();
56
57private:
60 QStringList predefinedTokens;
62 QComboBox *colorEdit;
64 QCheckBox *destroyCheckBox;
65 QCheckBox *faceDownCheckBox;
68 QTreeView *chooseTokenView;
69
70 void updateSearchFieldWithoutUpdatingFilter(const QString &newValue) const;
71};
72
73#endif
Definition card_database_model.h:23
Widget that displays an enlarged image of a card, loading the image based on the card's info or showi...
Definition card_info_picture_widget.h:27
void actReject()
Definition dlg_create_token.cpp:261
QCheckBox * destroyCheckBox
Definition dlg_create_token.h:64
QTreeView * chooseTokenView
Definition dlg_create_token.h:68
void actOk()
Definition dlg_create_token.cpp:255
QLineEdit * annotationEdit
Definition dlg_create_token.h:63
QLineEdit * nameEdit
Definition dlg_create_token.h:63
CardDatabaseModel * cardDatabaseModel
Definition dlg_create_token.h:58
QLabel * colorLabel
Definition dlg_create_token.h:61
QRadioButton * chooseTokenFromAllRadioButton
Definition dlg_create_token.h:66
QLineEdit * ptEdit
Definition dlg_create_token.h:63
void faceDownCheckBoxToggled(bool checked)
Definition dlg_create_token.cpp:186
void actChooseTokenFromDeck(bool checked)
Definition dlg_create_token.cpp:248
void actChooseTokenFromAll(bool checked)
Definition dlg_create_token.cpp:241
QComboBox * colorEdit
Definition dlg_create_token.h:62
void tokenSelectionChanged(const QModelIndex &current, const QModelIndex &previous)
Definition dlg_create_token.cpp:201
QStringList predefinedTokens
Definition dlg_create_token.h:60
QRadioButton * chooseTokenFromDeckRadioButton
Definition dlg_create_token.h:66
void updateSearch(const QString &search)
Definition dlg_create_token.cpp:236
DlgCreateToken(const QStringList &_predefinedTokens, QWidget *parent=nullptr)
Definition dlg_create_token.cpp:41
QLabel * ptLabel
Definition dlg_create_token.h:61
QLabel * annotationLabel
Definition dlg_create_token.h:61
TokenInfo getTokenInfo() const
Definition dlg_create_token.cpp:267
void updateSearchFieldWithoutUpdatingFilter(const QString &newValue) const
Definition dlg_create_token.cpp:229
QLabel * nameLabel
Definition dlg_create_token.h:61
CardInfoPictureWidget * pic
Definition dlg_create_token.h:67
void closeEvent(QCloseEvent *event) override
Definition dlg_create_token.cpp:180
TokenDisplayModel * cardDatabaseDisplayModel
Definition dlg_create_token.h:59
QCheckBox * faceDownCheckBox
Definition dlg_create_token.h:65
Definition token_display_model.h:18
Definition dlg_create_token.h:29
QString annotation
Definition dlg_create_token.h:33
QString name
Definition dlg_create_token.h:30
bool destroy
Definition dlg_create_token.h:34
QString color
Definition dlg_create_token.h:31
QString providerId
Definition dlg_create_token.h:36
bool faceDown
Definition dlg_create_token.h:35
QString pt
Definition dlg_create_token.h:32