mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
desktop: unglobalize ComboBox-models
The combo-boxes (cylinder type, weightsystem, etc.) were controlled by global models. Keeping these models up-to-date was very combersome and buggy. Create a new model everytime a combobox is opened. Ultimately it might even be better to create a copy of the strings and switch to simple QStringListModel. Set data in the core directly and don't do this via the models. The result is much simpler and easier to handle. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
de313bd01a
commit
0d011231e6
16 changed files with 130 additions and 215 deletions
|
|
@ -24,15 +24,15 @@ struct dive;
|
|||
class GasSelectionModel : public QStringListModel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
GasSelectionModel(const dive &d, QObject *parent);
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||
QVariant data(const QModelIndex &index, int role) const override;
|
||||
void repopulate(const dive *d);
|
||||
};
|
||||
|
||||
class DiveTypeSelectionModel : public QStringListModel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
DiveTypeSelectionModel();
|
||||
DiveTypeSelectionModel(QObject *parent);
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||
QVariant data(const QModelIndex &index, int role) const override;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue