cleanup: make static fields local to ComboBoxDelegate

All combobox-delegates shared a number of static status fields.
In a quest to make the code more reentrant, move that to the
actual object. The fields have to be defined as mutable, since
they are set in const member functions.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-03-27 22:33:17 +01:00
parent be7365755e
commit f9e246fed2
2 changed files with 8 additions and 9 deletions

View file

@ -48,8 +48,16 @@ slots:
virtual void editorClosed(QWidget *widget, QAbstractItemDelegate::EndEditHint hint) = 0;
private:
bool editable;
mutable bool keyboardFinished;
protected:
QAbstractItemModel *model;
mutable struct CurrSelected {
QComboBox *comboEditor;
int currRow;
QString activeText;
QAbstractItemModel *model;
bool ignoreSelection;
} currCombo;
};
class TankInfoDelegate : public ComboBoxDelegate {