Refactor: move last token info into struct (#5808)

* add override

* refactor token info into struct

* correct default destroy value
This commit is contained in:
RickyRister 2025-04-09 08:26:14 -07:00 committed by GitHub
parent 0bd53d6dc7
commit 56bbd8a172
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 45 additions and 56 deletions

View file

@ -17,19 +17,24 @@ class CardDatabaseModel;
class TokenDisplayModel;
class CardInfoPictureWidget;
struct TokenInfo
{
QString name;
QString color;
QString pt;
QString annotation;
bool destroy = true;
};
class DlgCreateToken : public QDialog
{
Q_OBJECT
public:
explicit DlgCreateToken(const QStringList &_predefinedTokens, QWidget *parent = nullptr);
QString getName() const;
QString getColor() const;
QString getPT() const;
QString getAnnotation() const;
bool getDestroy() const;
TokenInfo getTokenInfo() const;
protected:
void closeEvent(QCloseEvent *event);
void closeEvent(QCloseEvent *event) override;
private slots:
void tokenSelectionChanged(const QModelIndex &current, const QModelIndex &previous);
void updateSearch(const QString &search);