Make "create token" dialog's card name a filter

* There is a circular update loop I had to cut off where the name field
  updates the filter and then the currentRowChanged signal is firing without a row.

* I chose to make a private method to show intent instead of relying on
  other QLineEdit methods (textEdited) that don't fire signals.

* Some other shenanigans may be at hand that are causing this
  workaround, but my familiarity with Qt is pretty low.
This commit is contained in:
Mark McDonald 2016-05-11 21:30:14 -04:00
parent 7bc14b594d
commit 8dd8b434b2
2 changed files with 16 additions and 1 deletions

View file

@ -25,6 +25,7 @@ public:
bool getDestroy() const;
private slots:
void tokenSelectionChanged(const QModelIndex &current, const QModelIndex &previous);
void updateSearch(const QString &search);
void actChooseTokenFromAll(bool checked);
void actChooseTokenFromDeck(bool checked);
void actOk();
@ -37,6 +38,8 @@ private:
QLineEdit *nameEdit, *ptEdit, *annotationEdit;
QCheckBox *destroyCheckBox;
QRadioButton *chooseTokenFromAllRadioButton, *chooseTokenFromDeckRadioButton;
void updateSearchFieldWithoutUpdatingFilter(const QString &newValue) const;
};
#endif